From fbe48d4c4092697b98856fc61b5a63c62278b914 Mon Sep 17 00:00:00 2001 From: teomrd Date: Sat, 2 Nov 2024 12:26:58 +0000 Subject: [PATCH] deploy: 000b4ee95527bb211fc2adc1987ba49d3e066eb7 --- index.js | 4 ++-- index.js.map | 4 ++-- service-worker.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index add4351..f49883e 100644 --- a/index.js +++ b/index.js @@ -132,7 +132,7 @@ var Zr=Object.create;var ze=Object.defineProperty;var Xr=Object.getOwnPropertyDe

& Ctrl+P: to format a JSON doc

`,100),localStorage.setItem("miropad.user",new Date().toLocaleDateString())},jt=uo;var co={set:function(o,r){return localStorage.setItem(o,r),this},update:function(o,r){let e=JSON.parse(this.get(o));return localStorage.setItem(o,JSON.stringify({...e,...r})),this},remove:function(o){return localStorage.removeItem(o),this},get:function(o){return ue(o)?o.reduce((r,e)=>({...r,[e]:this.get(e)}),{}):localStorage.getItem(o)},parse:function(o){let r=this.get(o);return JSON.parse(r)},getDictionary:function(){let o=localStorage.getItem("__dictionary__");return o?JSON.parse(o):[]},removeFromDictionary:function(o){let e=this.getDictionary().filter(a=>a!==o);localStorage.setItem("__dictionary__",JSON.stringify(e))},saveToDictionary:async function(o){if(o.length)try{let r=o.toLowerCase().replace(/[^a-zA-Zά-ώΑ-Ω]/g," "),e=await this.getDictionary(),a=[...r.split(" ").filter(h=>h.length>3),...e],s=[...new Set(a)];localStorage.setItem("__dictionary__",JSON.stringify(s))}catch(r){M.error(`\u{1F631} Something went wrong while trying to save to local storage ${r}`)}else M.warning("\u{1F615} Nothing to save!");return this}},S=co;var te={github:{client_id:"70c1955dfe4914c52c10",request_state:"miro-pad"},auth_service:"https://vercel-api-phi.vercel.app/api/auth",mail_service:{api:"https://vercel-api-phi.vercel.app/api/mail",signature:`Theo Mironidis
Software Engineer
- https://teomrd.github.io`},file_service:{api:"https://vercel-api-phi.vercel.app/api/upload"}};var Me=(o,r=S.get("authToken"))=>fetch(`https://api.github.com/gists/${o}`,{headers:{Authorization:`token ${r}`}}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}),Nt=(o=S.get("authToken"))=>fetch("https://api.github.com/gists",{headers:{Authorization:`token ${o}`}}).then(r=>{if(!r.ok)throw Error(r.statusText);return r.json()}),Bt=async(o,r=S.get("gistId"),e=S.get("authToken"))=>{let a=await fetch(`https://api.github.com/gists/${r}`,{method:"PATCH",headers:{Authorization:`token ${e}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:{[o]:null},description:"MiroPad Gist",public:!1})});if(!a.ok)throw new Error(a.statusText);let s=await a.json();return M.info(`${o} deleted on Gist!`),s},It=(o=ee(),r=S.get("gistId"),e=S.get("authToken"))=>{if(r&&e){let a=o.reduce((s,{id:h,text:g,deleted:y})=>({...s,[h]:y?null:{content:g}}),{});return fetch(`https://api.github.com/gists/${r}`,{method:"PATCH",headers:{Authorization:`token ${e}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:a,description:"MiroPad Gist",public:!1})}).then(s=>{if(!s.ok)throw new Error(s.statusText);return s.json()}).then(s=>(o.map(({id:h,deleted:g})=>{g&&localStorage.removeItem(h)}),s))}},Ot=async(o=S.get("authToken"))=>{let e=ee().reduce((h,g)=>({...h,[g.id]:{content:g.text}}),{}),a=await fetch("https://api.github.com/gists",{method:"POST",headers:{Authorization:`token ${o}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:e,description:"MiroPad Gist",public:!1})});if(!a.ok)throw Error(a.statusText);return await a.json()},Ft=(o,r)=>fetch(`${te.auth_service}?state=${r}&code=${o}`,{headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).then(e=>e),$t=async({note:o,token:r=S.get("authToken")})=>{let e=await fetch("https://api.github.com/gists",{method:"POST",headers:{Authorization:`token ${r}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:{[o.id]:{content:o.text}},description:"MiroPad Gist",public:!0})});if(!e.ok)throw Error(e.statusText);return await e.json()};var Cd=new Uint8Array(0);function Gt(o,r){if(o===r)return!0;if(o.byteLength!==r.byteLength)return!1;for(let e=0;e=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),a=0;a>>0,d=new Uint8Array(t);q!==Z;){for(var n=L[q],i=0,l=t-1;(n!==0||i>>0,d[l]=n%y>>>0,n=n/y>>>0;if(n!==0)throw new Error("Non-zero carry");X=i,q++}for(var f=t-X;f!==t&&d[f]===0;)f++;for(var c=x.repeat(O);f>>0,t=new Uint8Array(Z);L[O];){var d=e[L.charCodeAt(O)];if(d===255)return;for(var n=0,i=Z-1;(d!==0||n>>0,t[i]=d%256>>>0,d=d/256>>>0;if(d!==0)throw new Error("Non-zero carry");q=n,O++}if(L[O]!==" "){for(var l=Z-q;l!==Z&&t[l]===0;)l++;for(var f=new Uint8Array(X+(Z-l)),c=X;l!==Z;)f[c++]=t[l++];return f}}}function H(L){var O=V(L);if(O)return O;throw new Error(`Non-${r} character`)}return{encode:F,decodeUnsafe:V,decode:H}}var fo=lo,ho=fo,Vt=ho;var Ke=class{constructor(r,e,a){B(this,"name");B(this,"prefix");B(this,"baseEncode");this.name=r,this.prefix=e,this.baseEncode=a}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},Ye=class{constructor(r,e,a){B(this,"name");B(this,"prefix");B(this,"baseDecode");B(this,"prefixCodePoint");this.name=r,this.prefix=e;let s=e.codePointAt(0);if(s===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s,this.baseDecode=a}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Ht(this,r)}},Ze=class{constructor(r){B(this,"decoders");this.decoders=r}or(r){return Ht(this,r)}decode(r){let e=r[0],a=this.decoders[e];if(a!=null)return a.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Ht(o,r){return new Ze({...o.decoders??{[o.prefix]:o},...r.decoders??{[r.prefix]:r}})}var Xe=class{constructor(r,e,a,s){B(this,"name");B(this,"prefix");B(this,"baseEncode");B(this,"baseDecode");B(this,"encoder");B(this,"decoder");this.name=r,this.prefix=e,this.baseEncode=a,this.baseDecode=s,this.encoder=new Ke(r,e,a),this.decoder=new Ye(r,e,s)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}};function Ut({name:o,prefix:r,encode:e,decode:a}){return new Xe(o,r,e,a)}function fe({name:o,prefix:r,alphabet:e}){let{encode:a,decode:s}=Vt(e,o);return Ut({prefix:r,name:o,encode:a,decode:h=>le(s(h))})}function po(o,r,e,a){let s={};for(let E=0;E=8&&(y-=8,g[P++]=255&x>>y)}if(y>=e||255&x<<8-y)throw new SyntaxError("Unexpected end of data");return g}function mo(o,r,e){let a=r[r.length-1]==="=",s=(1<e;)g-=e,h+=r[s&y>>g];if(g!==0&&(h+=r[s&y<=yo;)r[e++]=o&255|Rt,o/=128;for(;o&wo;)r[e++]=o&255|Rt,o>>>=7;return r[e]=o|0,qt.bytes=e-a+1,r}var vo=Qe,ko=128,Wt=127;function Qe(o,a){var e=0,a=a||0,s=0,h=a,g,y=o.length;do{if(h>=y)throw Qe.bytes=0,new RangeError("Could not decode varint");g=o[h++],e+=s<28?(g&Wt)<=ko);return Qe.bytes=h-a,e}var _o=Math.pow(2,7),xo=Math.pow(2,14),Co=Math.pow(2,21),So=Math.pow(2,28),zo=Math.pow(2,35),Mo=Math.pow(2,42),To=Math.pow(2,49),Po=Math.pow(2,56),Eo=Math.pow(2,63),Ao=function(o){return o<_o?1:o{let[F,V]=ve(r.subarray(e));return e+=V,F},s=a(),h=_e;if(s===18?(s=0,e=0):h=a(),s!==0&&s!==1)throw new RangeError(`Invalid CID version ${s}`);let g=e,y=a(),x=a(),P=e+x,E=P-g;return{version:s,codec:h,multihashCode:y,digestSize:x,multihashSize:E,size:P}}static parse(r,e){let[a,s]=jo(r,e),h=o.decode(s);if(h.version===0&&r[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return et(h).set(a,r),h}};function jo(o,r){switch(o[0]){case"Q":{let e=r??oe;return[oe.prefix,e.decode(`${oe.prefix}${o}`)]}case oe.prefix:{let e=r??oe;return[oe.prefix,e.decode(o)]}case we.prefix:{let e=r??we;return[we.prefix,e.decode(o)]}case Te.prefix:{let e=r??Te;return[Te.prefix,e.decode(o)]}default:{if(r==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],r.decode(o)]}}}function No(o,r,e){let{prefix:a}=e;if(a!==oe.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let s=r.get(a);if(s==null){let h=e.encode(o).slice(1);return r.set(a,h),h}else return s}function Bo(o,r,e){let{prefix:a}=e,s=r.get(a);if(s==null){let h=e.encode(o);return r.set(a,h),h}else return s}var _e=112,Io=18;function er(o,r,e){let a=pe(o),s=a+pe(r),h=new Uint8Array(s+e.byteLength);return he(o,h,0),he(r,h,a),h.set(e,s),h}var Oo=Symbol.for("@ipld/js-cid/CID");var Fo=new TextEncoder,na=new TextDecoder;var rr=512;function or(o){return Fo.encode(JSON.stringify(o))}function rt({name:o,code:r,encode:e}){return new tt(o,r,e)}var tt=class{constructor(r,e,a){B(this,"name");B(this,"code");B(this,"encode");this.name=r,this.code=e,this.encode=a}digest(r){if(r instanceof Uint8Array){let e=this.encode(r);return e instanceof Uint8Array?ke(this.code,e):e.then(a=>ke(this.code,a))}else throw Error("Unknown type, must be binary type")}};function nr(o){return async r=>new Uint8Array(await crypto.subtle.digest(o,r))}var dr=rt({name:"sha2-256",code:18,encode:nr("SHA-256")}),sa=rt({name:"sha2-512",code:19,encode:nr("SHA-512")});var Go=async o=>{let r=or(o),e=await dr.digest(r);return Pe.create(1,rr,e).toString()},Ee=Go;var Vo=o=>{try{JSON.parse(o)}catch{return!1}return!0},Ae=Vo;var ar=()=>document.title.split("|")[0],ot=o=>{let r=ar();document.title=r.trim()+" | "+o.trim(),m(".title h3").html(o.trim())},De=()=>{let o=ar();document.title=o,m("title").innerHTML("\u270D\uFE0F MiroPad vv3.1.2"),m(".title h3").innerHTML('\u270D\uFE0F MiroPad vv3.1.2')};var A={baseUrl:`${globalThis.location.origin}${globalThis.location.pathname}`,get:function(){return globalThis.location.href},getPageId:function(o=globalThis.location.href){return new URL(o).hash.slice(1).split("?")[0]||null},getSearchParams:function(o=globalThis.location.href){let a=new URL(o).href.split("?")[1]||"";return new URLSearchParams(a)},getParamsObject:function(o=globalThis.location.href){let r=this.getSearchParams(o),e={};for(let a of r.keys())e={...e,[a]:this.getSearchParam(a,o)};return e},getSearchParam(o,r=globalThis.location.href){return this.getSearchParams(r).get(o)},deleteParam:function(o){let r=this.getSearchParams();Array.isArray(o)?o.forEach(s=>{r.delete(s)}):r.delete(o);let{pathname:e}=globalThis.location,a=this.getPageId();return globalThis.location.assign(`${a?`#${a}`:e}${r.toString()?`?${r.toString()}`:""}`)},set:function(o=this.getPageId(),r=this.getParamsObject()){let e={...this.getParamsObject(),...r},a=new URLSearchParams(e);return globalThis.location.assign(`#${o}?${a.toString()}`)}};var se=(o=!0)=>{o?(m("#save").removeClass("unsaved"),m("#logo").removeClass("unsaved")):(m("#save").addClass("unsaved"),m("#logo").addClass("unsaved"))};var ir=o=>{let r=encodeURIComponent(o);if(r.length===0)throw new Error("You need to start with a valid title for your note!");return r},Le=o=>{let r=ur(o),e=G(r);if(e){let{dateCreated:a}=e;return a}throw new Error(`Note "${o}" cannot found!`)},Ho=o=>{let r=G(o);r&&localStorage.setItem(o,JSON.stringify({title:r.title,deleted:!0,revisions:r.revisions}))},G=(o=A.getPageId(),r)=>{let e;try{if(e=JSON.parse(S.get(o)),!e.revisions)throw new Error("This is not a note!")}catch{return null}let a=e?Object.values(e.revisions).reduce((h,g)=>g.dateCreated>h.dateCreated?g:h,{dateCreated:0}):{},s=r?e.revisions[r]:a;return o?{...e,id:o,...s||{},numberOfRevisions:e&&e.revisions?Object.keys(e.revisions).length:void 0,title:e.title}:null},sr=o=>{let r=G();r&&(S.update(r.id,{disableSync:o}),M.info(`"${r.title}" cloud sync ${o?"disabled \u{1F636}":"enabled \u26A1\uFE0F"}`))},je=(o=A.getPageId())=>{if(o){let r=A.getSearchParam("v")||void 0,e=G(void 0,r);e&&(m("#revisions").html(`${e.numberOfRevisions} revision${e.numberOfRevisions>1?"s":""}`),ot(e.title),m(".terminal").setValue(e.text)),e||M.error("404 Note not found \u{1F937}\u200D\u2642\uFE0F")}},Ne=()=>{location.hash="",De(),m("#revisions").html(""),m(".terminal").setValue("").focus(),se()},ge=(o="")=>o.split(` + https://teomrd.github.io`},file_service:{api:"https://vercel-api-phi.vercel.app/api/upload"}};var Me=(o,r=S.get("authToken"))=>fetch(`https://api.github.com/gists/${o}`,{headers:{Authorization:`token ${r}`}}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}),Nt=(o=S.get("authToken"))=>fetch("https://api.github.com/gists",{headers:{Authorization:`token ${o}`}}).then(r=>{if(!r.ok)throw Error(r.statusText);return r.json()}),Bt=async(o,r=S.get("gistId"),e=S.get("authToken"))=>{let a=await fetch(`https://api.github.com/gists/${r}`,{method:"PATCH",headers:{Authorization:`token ${e}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:{[o]:null},description:"MiroPad Gist",public:!1})});if(!a.ok)throw new Error(a.statusText);let s=await a.json();return M.info(`${o} deleted on Gist!`),s},It=(o=ee(),r=S.get("gistId"),e=S.get("authToken"))=>{if(r&&e){let a=o.reduce((s,{id:h,text:g,deleted:y})=>({...s,[h]:y?null:{content:g}}),{});return fetch(`https://api.github.com/gists/${r}`,{method:"PATCH",headers:{Authorization:`token ${e}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:a,description:"MiroPad Gist",public:!1})}).then(s=>{if(!s.ok)throw new Error(s.statusText);return s.json()}).then(s=>(o.map(({id:h,deleted:g})=>{g&&localStorage.removeItem(h)}),s))}},Ot=async(o=S.get("authToken"))=>{let e=ee().reduce((h,g)=>({...h,[g.id]:{content:g.text}}),{}),a=await fetch("https://api.github.com/gists",{method:"POST",headers:{Authorization:`token ${o}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:e,description:"MiroPad Gist",public:!1})});if(!a.ok)throw Error(a.statusText);return await a.json()},Ft=(o,r)=>fetch(`${te.auth_service}?state=${r}&code=${o}`,{headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).then(e=>e),$t=async({note:o,token:r=S.get("authToken")})=>{let e=await fetch("https://api.github.com/gists",{method:"POST",headers:{Authorization:`token ${r}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:{[o.id]:{content:o.text}},description:"MiroPad Gist",public:!0})});if(!e.ok)throw Error(e.statusText);return await e.json()};var Cd=new Uint8Array(0);function Gt(o,r){if(o===r)return!0;if(o.byteLength!==r.byteLength)return!1;for(let e=0;e=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),a=0;a>>0,d=new Uint8Array(t);q!==Z;){for(var n=L[q],i=0,l=t-1;(n!==0||i>>0,d[l]=n%y>>>0,n=n/y>>>0;if(n!==0)throw new Error("Non-zero carry");X=i,q++}for(var f=t-X;f!==t&&d[f]===0;)f++;for(var c=x.repeat(O);f>>0,t=new Uint8Array(Z);L[O];){var d=e[L.charCodeAt(O)];if(d===255)return;for(var n=0,i=Z-1;(d!==0||n>>0,t[i]=d%256>>>0,d=d/256>>>0;if(d!==0)throw new Error("Non-zero carry");q=n,O++}if(L[O]!==" "){for(var l=Z-q;l!==Z&&t[l]===0;)l++;for(var f=new Uint8Array(X+(Z-l)),c=X;l!==Z;)f[c++]=t[l++];return f}}}function H(L){var O=V(L);if(O)return O;throw new Error(`Non-${r} character`)}return{encode:F,decodeUnsafe:V,decode:H}}var fo=lo,ho=fo,Vt=ho;var Ke=class{constructor(r,e,a){B(this,"name");B(this,"prefix");B(this,"baseEncode");this.name=r,this.prefix=e,this.baseEncode=a}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},Ye=class{constructor(r,e,a){B(this,"name");B(this,"prefix");B(this,"baseDecode");B(this,"prefixCodePoint");this.name=r,this.prefix=e;let s=e.codePointAt(0);if(s===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s,this.baseDecode=a}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Ht(this,r)}},Ze=class{constructor(r){B(this,"decoders");this.decoders=r}or(r){return Ht(this,r)}decode(r){let e=r[0],a=this.decoders[e];if(a!=null)return a.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Ht(o,r){return new Ze({...o.decoders??{[o.prefix]:o},...r.decoders??{[r.prefix]:r}})}var Xe=class{constructor(r,e,a,s){B(this,"name");B(this,"prefix");B(this,"baseEncode");B(this,"baseDecode");B(this,"encoder");B(this,"decoder");this.name=r,this.prefix=e,this.baseEncode=a,this.baseDecode=s,this.encoder=new Ke(r,e,a),this.decoder=new Ye(r,e,s)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}};function Ut({name:o,prefix:r,encode:e,decode:a}){return new Xe(o,r,e,a)}function fe({name:o,prefix:r,alphabet:e}){let{encode:a,decode:s}=Vt(e,o);return Ut({prefix:r,name:o,encode:a,decode:h=>le(s(h))})}function po(o,r,e,a){let s={};for(let E=0;E=8&&(y-=8,g[P++]=255&x>>y)}if(y>=e||255&x<<8-y)throw new SyntaxError("Unexpected end of data");return g}function mo(o,r,e){let a=r[r.length-1]==="=",s=(1<e;)g-=e,h+=r[s&y>>g];if(g!==0&&(h+=r[s&y<=yo;)r[e++]=o&255|Rt,o/=128;for(;o&wo;)r[e++]=o&255|Rt,o>>>=7;return r[e]=o|0,qt.bytes=e-a+1,r}var vo=Qe,ko=128,Wt=127;function Qe(o,a){var e=0,a=a||0,s=0,h=a,g,y=o.length;do{if(h>=y)throw Qe.bytes=0,new RangeError("Could not decode varint");g=o[h++],e+=s<28?(g&Wt)<=ko);return Qe.bytes=h-a,e}var _o=Math.pow(2,7),xo=Math.pow(2,14),Co=Math.pow(2,21),So=Math.pow(2,28),zo=Math.pow(2,35),Mo=Math.pow(2,42),To=Math.pow(2,49),Po=Math.pow(2,56),Eo=Math.pow(2,63),Ao=function(o){return o<_o?1:o{let[F,V]=ve(r.subarray(e));return e+=V,F},s=a(),h=_e;if(s===18?(s=0,e=0):h=a(),s!==0&&s!==1)throw new RangeError(`Invalid CID version ${s}`);let g=e,y=a(),x=a(),P=e+x,E=P-g;return{version:s,codec:h,multihashCode:y,digestSize:x,multihashSize:E,size:P}}static parse(r,e){let[a,s]=jo(r,e),h=o.decode(s);if(h.version===0&&r[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return et(h).set(a,r),h}};function jo(o,r){switch(o[0]){case"Q":{let e=r??oe;return[oe.prefix,e.decode(`${oe.prefix}${o}`)]}case oe.prefix:{let e=r??oe;return[oe.prefix,e.decode(o)]}case we.prefix:{let e=r??we;return[we.prefix,e.decode(o)]}case Te.prefix:{let e=r??Te;return[Te.prefix,e.decode(o)]}default:{if(r==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],r.decode(o)]}}}function No(o,r,e){let{prefix:a}=e;if(a!==oe.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let s=r.get(a);if(s==null){let h=e.encode(o).slice(1);return r.set(a,h),h}else return s}function Bo(o,r,e){let{prefix:a}=e,s=r.get(a);if(s==null){let h=e.encode(o);return r.set(a,h),h}else return s}var _e=112,Io=18;function er(o,r,e){let a=pe(o),s=a+pe(r),h=new Uint8Array(s+e.byteLength);return he(o,h,0),he(r,h,a),h.set(e,s),h}var Oo=Symbol.for("@ipld/js-cid/CID");var Fo=new TextEncoder,na=new TextDecoder;var rr=512;function or(o){return Fo.encode(JSON.stringify(o))}function rt({name:o,code:r,encode:e}){return new tt(o,r,e)}var tt=class{constructor(r,e,a){B(this,"name");B(this,"code");B(this,"encode");this.name=r,this.code=e,this.encode=a}digest(r){if(r instanceof Uint8Array){let e=this.encode(r);return e instanceof Uint8Array?ke(this.code,e):e.then(a=>ke(this.code,a))}else throw Error("Unknown type, must be binary type")}};function nr(o){return async r=>new Uint8Array(await crypto.subtle.digest(o,r))}var dr=rt({name:"sha2-256",code:18,encode:nr("SHA-256")}),sa=rt({name:"sha2-512",code:19,encode:nr("SHA-512")});var Go=async o=>{let r=or(o),e=await dr.digest(r);return Pe.create(1,rr,e).toString()},Ee=Go;var Vo=o=>{try{JSON.parse(o)}catch{return!1}return!0},Ae=Vo;var ar=()=>document.title.split("|")[0],ot=o=>{let r=ar();document.title=r.trim()+" | "+o.trim(),m(".title h3").html(o.trim())},De=()=>{let o=ar();document.title=o,m("title").innerHTML("\u270D\uFE0F MiroPad v3.1.3"),m(".title h3").innerHTML('\u270D\uFE0F MiroPad v3.1.3')};var A={baseUrl:`${globalThis.location.origin}${globalThis.location.pathname}`,get:function(){return globalThis.location.href},getPageId:function(o=globalThis.location.href){return new URL(o).hash.slice(1).split("?")[0]||null},getSearchParams:function(o=globalThis.location.href){let a=new URL(o).href.split("?")[1]||"";return new URLSearchParams(a)},getParamsObject:function(o=globalThis.location.href){let r=this.getSearchParams(o),e={};for(let a of r.keys())e={...e,[a]:this.getSearchParam(a,o)};return e},getSearchParam(o,r=globalThis.location.href){return this.getSearchParams(r).get(o)},deleteParam:function(o){let r=this.getSearchParams();Array.isArray(o)?o.forEach(s=>{r.delete(s)}):r.delete(o);let{pathname:e}=globalThis.location,a=this.getPageId();return globalThis.location.assign(`${a?`#${a}`:e}${r.toString()?`?${r.toString()}`:""}`)},set:function(o=this.getPageId(),r=this.getParamsObject()){let e={...this.getParamsObject(),...r},a=new URLSearchParams(e);return globalThis.location.assign(`#${o}?${a.toString()}`)}};var se=(o=!0)=>{o?(m("#save").removeClass("unsaved"),m("#logo").removeClass("unsaved")):(m("#save").addClass("unsaved"),m("#logo").addClass("unsaved"))};var ir=o=>{let r=encodeURIComponent(o);if(r.length===0)throw new Error("You need to start with a valid title for your note!");return r},Le=o=>{let r=ur(o),e=G(r);if(e){let{dateCreated:a}=e;return a}throw new Error(`Note "${o}" cannot found!`)},Ho=o=>{let r=G(o);r&&localStorage.setItem(o,JSON.stringify({title:r.title,deleted:!0,revisions:r.revisions}))},G=(o=A.getPageId(),r)=>{let e;try{if(e=JSON.parse(S.get(o)),!e.revisions)throw new Error("This is not a note!")}catch{return null}let a=e?Object.values(e.revisions).reduce((h,g)=>g.dateCreated>h.dateCreated?g:h,{dateCreated:0}):{},s=r?e.revisions[r]:a;return o?{...e,id:o,...s||{},numberOfRevisions:e&&e.revisions?Object.keys(e.revisions).length:void 0,title:e.title}:null},sr=o=>{let r=G();r&&(S.update(r.id,{disableSync:o}),M.info(`"${r.title}" cloud sync ${o?"disabled \u{1F636}":"enabled \u26A1\uFE0F"}`))},je=(o=A.getPageId())=>{if(o){let r=A.getSearchParam("v")||void 0,e=G(void 0,r);e&&(m("#revisions").html(`${e.numberOfRevisions} revision${e.numberOfRevisions>1?"s":""}`),ot(e.title),m(".terminal").setValue(e.text)),e||M.error("404 Note not found \u{1F937}\u200D\u2642\uFE0F")}},Ne=()=>{location.hash="",De(),m("#revisions").html(""),m(".terminal").setValue("").focus(),se()},ge=(o="")=>o.split(` `)[0].trim().replace("#","").trim(),ur=o=>{let r=ge(o);return ir(r)},cr=async o=>{if(o.length){let r=ur(o),e=ge(o),a=G(r);if(a===null)return Be(o);let{text:s}=a,h=await Ee(o),g=await Ee(s);if(h===g)return;let y=S.get(r),x=JSON.parse(y);S.set(r,JSON.stringify({...x,title:e,revisions:{...x&&x.revisions||{},[h]:{dateCreated:Date.now(),text:o}}}))}},Be=async(o=m(".terminal").getValue())=>{if(await S.saveToDictionary(o),o.length){let r=await Ee(o);try{let e=o.split(` `)[0].trim().replace("#","").trim();ot(e);let a=ir(e),s=S.get(a),h=JSON.parse(s);S.set(a,JSON.stringify({...h,title:e,lines:o.split(` `),revisions:{...h&&h.revisions||{},[r]:{dateCreated:Date.now(),text:o}}})),A.set(a,{v:r}),S.set("lastLocalUpdate",new Date),M.success("\u{1F44C} Note saved!"),se()}catch(e){M.error(`\u{1F631} Something went wrong while trying to save to local storage ${e}`)}}else M.warning("\u{1F615} Nothing to save!")},ee=({includeDeleted:o=!1}={})=>Object.entries(localStorage).filter(([,r])=>typeof r=="string").filter(([r,e])=>!r.startsWith("__")&&Ae(e)).map(([r,e])=>[r,JSON.parse(e)]).filter(([,r])=>!!r.title).reduce((r,[e])=>[...r,G(e)],[]).filter(({deleted:r})=>o?!0:!r),lr=(o=null)=>o?ee().map(({id:e})=>G(e)).filter(e=>e!==null).filter(({text:e})=>e.toLowerCase().includes(o.toLowerCase()))[0]:void 0,Ie=()=>{if(confirm("Are you sure you want do that?")){let r=G();Ne(),r&&r.id&&(Bt(r.id),Ho(r.id))}j.hide()};var fr=()=>!!S.get("authToken");var de=({title:o,secondary:r,onclick:e,onSecondaryClick:a,icon:s},h=!1)=>{let g=document.createElement("LI");if(g.className=h?"selected":"",s){let P=s.cloneNode(!0);g.appendChild(P)}let y=ce(o)?o:document.createTextNode(o);y.onclick=e,g.appendChild(y);let x=document.createElement("span");if(r){x.className="secondary";let P=ce(r)?r:document.createTextNode(r);P.onclick=a,x.appendChild(P)}return g.appendChild(x),g};var hr=(o,r)=>{let e=o.toLowerCase().split(r),a=0;return e.reduce((s,h,g)=>[...s,...g===0?[h]:[r,h]],[]).filter(s=>s!=="").map(s=>{a=a+s.length;let h=a-s.length,g=h+s.length;return o.slice(h,g)})};var pr=o=>{let r=document.createElement("mark");return r.appendChild(document.createTextNode(o)),r},ne=({content:o="",highlight:r=""})=>{let e=document.createElement("div"),a=o.split(" "),s=r.toLowerCase().split(" ");return r.trim()===""?(e.appendChild(document.createTextNode(o)),e):(a.map(h=>{let g=s.map(y=>h.toLocaleLowerCase().includes(y)?y:void 0).filter(y=>y!==void 0);return{word:h,matches:g}}).forEach(({word:h,matches:g})=>{if(g.length>0){let y=g[0];if(h===y)e.appendChild(pr(` ${h}`));else{let P=hr(h,y).map(E=>E.toLowerCase()===y?pr(E):document.createTextNode(E));e.appendChild(document.createTextNode(" ")),P.forEach(E=>{e.appendChild(E)})}}else e.appendChild(document.createTextNode(` ${h} `))}),e)};var mr=()=>(M.info("You need to be authenticated!"),j.hide(),globalThis.location.replace(`https://github.com/login/oauth/authorize?client_id=${te.github.client_id}&scope=gist&state=${te.github.request_state}`)),gr=async o=>{M.info("Downloading my Gists!");let r=await Nt(o);j.setState({mode:j.getModes().gists}),M.info("Select Gist to sync with");let e=r.sort((s,h)=>new Date(h.updated_at).getTime()-new Date(s.updated_at).getTime()).map(({description:s,updated_at:h,id:g})=>({title:ne({content:`${s}(${g})`}),secondary:h,onclick:async()=>{await S.set("gistId",g),M.success(`${s}(${g}) selected for synchronization!`),xe(),j.hide()}})),a=de([{title:"Create a new Gist",onclick:async()=>{M.info("Syncing your MiroPads to a new Gist");try{let{id:s}=await Ot();S.set("gistId",s),M.success("MiroPads synced to a new Gist \u{1F389}")}catch(s){M.error(s.message)}j.hide()}},...e]);m("#commands").html(""),m("#commands").append(a)},xe=async(o=S.get("gistId"))=>{if(S.get("authToken")&&o){m("#logo").addClass("loading");let{files:e}=await Me(o);Object.values(e).forEach(({content:a})=>{cr(a)}),S.set("lastSync",new Date),M.success("\u2B07 MiroPad synced \u2705"),m("#logo").removeClass("loading")}},br=async()=>{let o=A.getSearchParam("code"),r=A.getSearchParam("state");if(o&&r){m("#logo").addClass("loading"),M.info("\u{1F510} Authenticating...");try{let{token:e}=await Ft(o,r);S.set("authToken",e),M.info("\u26F3 You have been authenticated!"),A.deleteParam(["code","state"])}catch(e){M.error(e.message)}m("#logo").removeClass("loading")}};var Uo=async(o="no-titled")=>{let r={suggestedName:`${o}`,types:[{description:"MiroPad text notes",accept:{"text/plain":[".miropad"]}}]};return await globalThis.showSaveFilePicker(r)},Ro=async(o,r)=>{let e=await o.createWritable();await e.write(r),await e.close()},wr=async(o,r)=>{try{let e=await Uo(r);await Ro(e,o)}catch{M.error("An error occurred trying to save the file.");return}},yr=(()=>{let o=document.createElement("a");return document.body.appendChild(o),o.setAttribute("style","display: none"),(r,e=`MiroPad-${new Date().toISOString()}.json`)=>{let a=JSON.stringify(r),s=new Blob([a],{type:"octet/stream"}),h=globalThis.URL.createObjectURL(s);o.href=h,o.download=e,o.click(),globalThis.URL.revokeObjectURL(h)}})();var _r=Lt(kr()),xr=new _r.default.Converter({tasklists:!0,underline:!0,emoji:!0,simplifiedAutoLink:!0,tables:!0,openLinksInNewWindow:!0});xr.setFlavor("github");var Fe=o=>xr.makeHtml(o);var nt=o=>{if(o.status.toString().slice(0,1)==="2")return o;throw new Error(o)},Wo=(o="")=>` @@ -169,7 +169,7 @@ var Zr=Object.create;var ze=Object.defineProperty;var Xr=Object.getOwnPropertyDe - `,qo=async(o,r,e="MiroPad note")=>{if(!o){M.error("\u{1F47B} No message to send, type something and try again! \u{1F913}");return}try{await fetch(`${te.mail_service.api}`,{method:"POST",headers:{"x-secret-token":S.get("MIROPAD_SECRET_TOKEN"),accept:"application/json","content-type":"application/json"},body:JSON.stringify({to:r,subject:e,html:Wo(o)})}).then(nt).then(a=>a.json()),M.success("Email sent \u{1F680}")}catch{M.error("Error not went through \u{1F4A5}! Check your credentials and try again!")}},Jo=()=>{let o=S.get("mail");if(o){let a=globalThis.prompt(`Mail ${o} again? (y)es/(no)`,"yeap");if(a===null)return a;if(a.slice(0,1).toLowerCase()==="y")return o}let r=globalThis.prompt("Where do you wanna send the mail to?"),e=globalThis.prompt("Do you wanna save that to your preferences for later on? (y)es/(no)","yeap");return e&&e.slice(0,1).toLowerCase()==="y"&&S.set("mail",r),r},Cr=o=>{let r=Jo();if(r===null){M.info("Sending mail cancelled \u{1F636}");return}M.info("Sending mail... \u{1F680}");let e=ge(o),a=Fe(o);qo(a,r,e)};var ae=async(o,r="\u{1F4CB} Copied to clipboard")=>{try{await navigator.clipboard.writeText(o),M.success(r)}catch(e){M.error(e.message)}};var $e=(o,r,e)=>{let a=ue(o)?o:[o],s=document.createElement("button");return s.setAttribute("type","button"),e&&s.setAttribute("id",e),a.forEach(h=>{typeof h=="string"?s.appendChild(document.createTextNode(h)):s.appendChild(h)}),s.onclick=h=>r(h),s};var Ko={view:m(".preview"),init:function(){return this.update(),m(".terminal").listen("input",()=>this.update()),!!A.getSearchParam("md")?this.view.show():this.view.hide(),this},autoLink:function(){let o=S.parse("__auto-links__"),r=Object.keys(o).map(s=>`${s}\\w+`).join("|"),e=new RegExp(`(${r})`,"g"),a=this.view.el.innerHTML.replace(e,s=>{let h=Object.keys(o).find(y=>s.startsWith(y)),g=o[h];return g.startsWith("http")?`${s}`:`${s}`});this.view.innerHTML(a)},update:function(){let md=m(".terminal").getValue();this.view.innerHTML(Fe(md)),this.autoLink();let{elements}=m("pre");Array.prototype.slice.call(elements).forEach(o=>{let r=$e("\u{1F4CB} Copy",async e=>{e.stopPropagation();let a=e.srcElement.previousSibling.innerHTML;await ae(a,"\u{1F4CB} Code copied to clipboard")});o.appendChild(r)}),m("code").listenAll("click",({innerHTML})=>{let result=eval(innerHTML);m(".console").show().innerHTML(result)}),m(".console").listen("click",async o=>{o.srcElement.classList.add("hidden");let r=o.srcElement.innerHTML;await ae(r,"\u{1F4CB} Code copied to clipboard")})},show:function(o=!0){this.view.show(),A.set(void 0,{md:o})},hide:function(){this.view.hide(),A.deleteParam("md")},toggle:function(o="true"){return A.getSearchParam("md")===o?this.hide():this.show(o),this}},ie=Ko;var Yo=o=>{let r=document.querySelector(o);if(Ae(r.value)){let e=JSON.stringify(JSON.parse(r.value),null,2);r.value=e,M.success("\u{1F44D} JSON value prettified")}else M.error("\u{1F627} Value is not in valid JSON format")},Sr=Yo;var zr=(o=1e3)=>new Promise(r=>{setTimeout(r,o)});var I=(o,r,e)=>{let a=document.createElement("IMG");return e&&a.classList.add(e),r&&a.setAttribute("alt",r),a.setAttribute("src",o),a};var dt={};$(dt,{default:()=>Xo});var Xo="./list-LK7OCHR7.svg";var be={};$(be,{default:()=>en});var en="./trash-RDL437QG.svg";var at={};$(at,{default:()=>rn});var rn="./checkmark-circle-JQ7ADSUI.svg";var it={};$(it,{default:()=>nn});var nn="./cloud-sync-F3RLGHML.svg";var st={};$(st,{default:()=>an});var an="./lighter-UBEI67LL.svg";var ut={};$(ut,{default:()=>un});var un="./enter-down-6TVO6OFR.svg";var ct={};$(ct,{default:()=>ln});var ln="./download-FVXMIYZ4.svg";var lt={};$(lt,{default:()=>hn});var hn="./envelope-Z2VRVSLR.svg";var ft={};$(ft,{default:()=>mn});var mn="./bug-36UGMUXT.svg";var ht={};$(ht,{default:()=>bn});var bn="./picture-3TDOSVS3.svg";var pt={};$(pt,{default:()=>yn});var yn="./printer-B7RMPYZC.svg";var mt={};$(mt,{default:()=>kn});var kn="./page-break-BLVP5QBQ.svg";var gt={};$(gt,{default:()=>xn});var xn="./frame-expand-CX6CNP53.svg";var bt={};$(bt,{default:()=>Sn});var Sn="./arrow-right-circle-2Q6EHM2H.svg";var wt={};$(wt,{default:()=>Mn});var Mn="./magic-wand-JQJ6EKRO.svg";var yt={};$(yt,{default:()=>Pn});var Pn="./rocket-AIY2RJJS.svg";var vt={};$(vt,{default:()=>An});var An="./spell-check-V6QYTGNT.svg";var kt={};$(kt,{default:()=>Ln});var Ln="./pencil-X3ZMY3QU.svg";var Ge={};$(Ge,{default:()=>Nn});var Nn="./exit-up-GH6BPN2X.svg";var _t={};$(_t,{default:()=>In});var In="./leaf-CGBE7XAJ.svg";var Mr=async()=>{try{let o=G(),r=A.get();await navigator.share({title:o?o.title:"\u270D\uFE0F MiroPad",text:o?o.text:"Temporary note keeping app for the browser",url:r})}catch(o){M.info(`${o.message}`)}};var On=()=>{let o=S.get("gistId");return S.get("authToken")?o?"Sync: Notes with my GitHub Gist":"Sync: Pick your Gist to sync with":"Sync: Authorize your GitHub account for synchronisation"},Fn={title:"Share note",icon:I(Ge,"share note"),sortTitle:"Share",call:Mr},$n={title:"Share public link",key:null,icon:I(Ge,"share public link"),sortTitle:"Share public link",call:async()=>{j.hide(),await Be(m(".terminal").getValue());let o=G();if(o){let e=(await $t({note:o})).history[0].url,a=await fetch(e).then(E=>E.json()),{files:s}=a,h=Object.values(s),[g]=h,{raw_url:y}=g,x=`${A.baseUrl}?raw=${y}`;ae(x,"MiroPad public link copied to clipboard \u{1F4CB}!")}}},xt=()=>[{title:"New note",icon:I(kt,"new note"),sortTitle:"New",key:"n",call:Ne},{title:"Save",key:"s",icon:I(at,"save"),sortTitle:"Save",call:async()=>{j.hide(),await Be(m(".terminal").getValue());let o=G();o&&!o.disableSync&&It([o]),se()}},...navigator.share?[Fn]:[],{title:"Toggle MarkDown Viewer",icon:I(mt,"toggle markdown viewer","rotate90"),sortTitle:"Split",key:"m",call:()=>{ie.toggle(),j.hide()}},{title:"Full MarkDown view",icon:I(gt,"full view"),sortTitle:"Full view",key:"shift m",call:()=>{ie.toggle("full"),j.hide()}},...fr()?[$n]:[],{title:"Zen mode",icon:I(_t,"zen mode"),sortTitle:"Zen mode",key:"shift z",call:()=>{!!A.getSearchParam("zen")?A.deleteParam("zen"):A.set(void 0,{zen:!0}),j.hide()}},{title:"List saved notes",icon:I(dt,"list notes"),sortTitle:"Notes",key:"p",call:()=>j.toggle(j.getModes().notes)},{title:"Delete note",key:"shift d",icon:I(be,"delete note"),sortTitle:"Delete",call:Ie},{title:On(),icon:I(it,"sync with github"),key:null,call:async()=>{let o=S.get("authToken");if(!o)return mr();if(!S.get("gistId"))return await gr(o);j.hide(),await xe()}},{title:"Sync: Reset Gist settings",icon:I(st,"reset github settings"),key:null,call:()=>{localStorage.removeItem("authToken"),localStorage.removeItem("gistId"),localStorage.removeItem("lastLocalUpdate"),localStorage.removeItem("lastSync"),M.info("Gist setting have been reset!"),j.hide()}},{title:"Toggle sidebar",experimental:!0,key:"shift l",call:()=>{m("aside").toggle()}},{title:"Save to File System...",experimental:!0,icon:I(ut,"save file"),key:"shift s",call:()=>{let o=G();if(o){let{text:r,title:e}=o;wr(r,e),j.hide()}}},{title:"Email note to...",experimental:!0,icon:I(lt,"email"),key:"e",call:()=>{let o=m(".terminal").getValue();Cr(o),j.hide()}},{title:"Toggle experimental features",experimental:!1,icon:I(ft,"lab"),key:null,call:()=>{let o=!!S.get("__experimental__");o?S.remove("__experimental__"):S.set("__experimental__",!0),M.showNotification(`Experimental features turned ${o?"off":"on"}`),j.hide()}},{title:"Toggle Autocompletion",experimental:!1,icon:I(bt,"autocompletion"),key:null,call:()=>{let o=!!S.get("__autocomplete__");o?S.remove("__autocomplete__"):S.set("__autocomplete__",!0),M.showNotification(`Autocomplete feature turned ${o?"off":"on"}`),j.hide(),m(".terminal").focus()}},{title:"Add a cover picture",experimental:!0,icon:I(ht,"cover picture"),key:null,call:async()=>{let o=prompt("Paste the image URL in here...");j.hide(),await zr(200),ae(`

`,"\u{1F44C}Copied! Paste the code on the MiroPad editor"),m(".terminal").focus(),M.info("Paste the cover picture wherever you prefer on the MirPad editor")}},{title:"Print MarkDown output",experimental:!0,icon:I(pt,"print"),key:null,call:()=>{m(".preview").show(),ie.init(),globalThis.print(),j.hide()}},{key:"j",title:"Prettify JSON document",icon:I(wt,"prettify json"),call:()=>{Sr(".terminal"),j.hide()}},{title:"Toggle command palette",icon:I(yt,"toggle command palette"),key:["shift p","k"],call:()=>j.toggle(j.getModes().commands)},{title:"Find and Replace...",experimental:!0,icon:I(vt,"find and replace"),key:"shift f",call:()=>{let o=m(".terminal").getValue().slice(m(".terminal").el.selectionStart,m(".terminal").el.selectionEnd),r=prompt("What do you wanna find?",o);if(!r)return M.info("Value not found");let e=m(".terminal").getValue().indexOf(r);m(".terminal").el.setSelectionRange(e,e+r.length);let a=prompt(`Replace ${r} with...`);a&&m(".terminal").el.setRangeText(a)}},{title:"Download all notes!",icon:I(ct,"Download all notes on your local file system"),call:()=>{let o=ee({includeDeleted:!0});yr(o),j.hide()}},{title:"Permanently delete ALL notes \u2757",icon:I(be,"delete note"),call:()=>{confirm("Are you sure you want do delete ALL your notes?")&&(ee({includeDeleted:!0}).forEach(e=>{S.remove(e.id)}),Ne()),j.hide()}}];var Gn={events:[],on(o,r){return Array.isArray(o)?(o.forEach(e=>{let a=e.key||e,s=e.call||r;this.on(a,s)}),this):(o&&typeof o=="string"&&r&&typeof r=="function"&&(this.events=[...this.events,{key:o.includes("shift")?o.replace("shift","").trim():o,shift:o.includes("shift"),fn(){r()}}]),this)},listen(){return document.addEventListener("keydown",o=>{this.handleEvent(o)}),this},handleEvent(o){this.events.map(r=>(r.key===o.key&&(o.ctrlKey===!0||o.metaKey===!0)&&o.shiftKey===r.shift&&(o.preventDefault(),r.fn()),!0))}},Tr=Gn;var Pr=(o,r)=>{let e=document.createElement("a");return e.href=r,e.appendChild(ce(o)?o:document.createTextNode(o)),e};var Ct=(o,r=new Date)=>{let e=new Date(o).getFullYear(),a=new Date(r).getFullYear();return e===a},Dr=(o,r=new Date)=>{let e=new Date(o).getMonth(),a=new Date(r).getMonth();return e===a},Vn=(o,r=new Date)=>{let e=new Date(o).getDate(),a=new Date(r).getDate();return e===a},Er=(o,r=new Date)=>Ct(o,r)&&Dr(o,r)&&Vn(o,r),Hn=["January","February","March","April","May","June","July","August","September","October","November","December"],Un=Hn.map(o=>o.slice(0,3)),Ar=(o=new Date)=>{let r=new Date(o),e=new Date().getDate()-1;return Dr(r)&&Ct(r)&&r.getDate()===e},Ce=o=>{let r=new Date(o),e=Ar(o)?"":Un[r.getMonth()],a=Ct(r)?"":r.getFullYear(),s=Ar(r)?"Yesterday":r.getDate();return`${Er(r)?"":`${s} ${e} ${a}`} ${Er(r)?r.toLocaleTimeString():""}`};var Lr=o=>o.reduce((e,a)=>{if(e.length===0)return[a];let s=Math.max(...e);return[...e,...a>=s?[a]:[]]},[]).length===o.length;var St=(o,r)=>{let e=o.split(" ").map(h=>h.toLowerCase()),s=r.split(" ").map(h=>h.toLowerCase()).map(h=>e.map((x,P)=>x.includes(h)?P:-1).reduce((x,P)=>P>-1?P:x,-1));return s.includes(-1)?!1:Lr(s)};var jr=async()=>{if(!S.get("__notification-permission__")){let o=await globalThis.Notification.requestPermission();S.set("__notification-permission__",o)}},Nr=()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(`${globalThis.location.pathname}service-worker.js?v=v3.1.2`)};var Br=o=>Array.isArray(o)?o.map(r=>Br(r)).join(", "):o?`\u2318+${o.toUpperCase()}`:"",Rn=(()=>{let o;(y=>(y.off="off",y.notes="notes",y.revisions="revisions",y.commands="commands",y.gists="gists"))(o||(o={}));let r={input:"",mode:"off",options:{selected:0,length:0}};return{getState:function(){return r},getModes:function(){return o},setState:function(e){return r={...r,...e},r},show:function(e="commands"){switch(m("#commander").show(),m("#commander input").focus(),e){case"commands":this.generateCommands(),m("#commander input").setValue("> "),this.setState({mode:"commands"});break;case"notes":this.generateNotes(),m("#commander input").setValue(""),this.setState({mode:"notes"});break;case"revisions":this.generateRevisions(),m("#commander input").setValue(""),this.setState({mode:"revisions"});break;default:break}return this},hide:function(){return m("#commander").hide(),r.mode="off",this},toggle:function(e){return jr(),r.mode==="off"||r.mode!==e?this.show(e):this.hide(),this},commands:function(){return xt()},selectOption:function(e="down"){let a=r.options.selected,s=r.options.length-1,x=e==="down"?a===s?0:a+1:a===0?s:a-1;r.options={...r.options,selected:x}},initCommander:function(){return xt().slice(0,5).map(e=>{m(".mobile-dock").append($e([e.icon,document.createTextNode(e.sortTitle)],e.call,e.title.toLowerCase().replace(/\s/g,"-")))}),m("#commander button").listen("click",()=>{this.hide()}),m("#commander input").listen("keydown",e=>{e.keyCode===40&&(r.mode==="revisions"&&m("#commands li.selected").click(),this.selectOption("down")),e.keyCode===38&&(r.mode==="revisions"&&m("#commands li.selected").click(),this.selectOption("up"))}).listen("keyup",e=>{e.keyCode===13&&(r.mode==="commands"?m("#commands li.selected div").click():m("#commands li.selected a").click()),e.keyCode===27&&m(".terminal").focus();let a=e.target;r.input!==a.value&&(r.options.selected=0),r.input=a.value,this.generateOptions(a.value)}),this},init:function(){return this.initCommander(),Tr.listen().on(this.commands()),m(".menu").listen("click",()=>this.toggle()),m("#revisions").listen("click",()=>this.generateRevisions()),this},generateRevisions:function(){this.show(),r.mode="revisions";let e=G();if(e){let{revisions:a}=e,s=r.options.selected,h=Object.keys(a).sort((g,y)=>{let{dateCreated:x}=a[g],{dateCreated:P}=a[y];return P-x}).map((g,y)=>({title:ne({content:`...${g.slice(-10)}`}),secondary:`${Ce(a[g].dateCreated)}`,onclick:()=>{A.set(void 0,{v:g}),r.options.selected=y,this.generateRevisions()}})).map((g,y)=>de(g,y===s));m("#commands").html(h),r.options={...r.options,length:h.length}}return this},generateOptions:function(e){switch(r.mode){case"commands":case"notes":e.slice(0,1)===">"?(r.mode="commands",this.generateCommands(e.slice(1).trim()),m("#commander input").placeholder("Search for commands...")):(r.mode="notes",this.generateNotes(e));return;case"revisions":return this.generateRevisions();case"off":break;default:break}},generateNotes:function(e=""){let a=r.options.selected,s=ee().filter(({title:h})=>St(h,e)).filter(({id:h,deleted:g})=>!g&&h!==A.getPageId()).sort((h,g)=>{let y=Le(h.title);return Le(g.title)-y}).map(({id:h,title:g},y)=>{let x=Le(g),P=`${globalThis.location.origin}${globalThis.location.pathname}#${h}`,E=Pr(ne({content:g,highlight:e}),P);return de({title:E,secondary:Ce(x),onclick:()=>{this.hide(),m(".terminal").focus()}},y===a)});return m("#commands").html(s),m("#commander input").placeholder(`Search from ${s.length} saved notes...`),r.options={...r.options,length:s.length},this},generateCommands:function(e=""){let a=r.options.selected,s=this.commands().filter(({title:h})=>St(h,e)).filter(({experimental:h=!1})=>S.get("__experimental__")?!0:!h).map(({title:h,key:g,call:y,icon:x},P)=>de({title:ne({content:h,highlight:e}),icon:x,secondary:Br(g),onclick:y},P===a));return m("#commands").html(s),r.options={...r.options,length:s.length},this}}})(),j=Rn;var Ir="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Or=(o=21)=>{let r="",e=crypto.getRandomValues(new Uint8Array(o));for(;o--;)r+=Ir[e[o]&63];return r};var $r=Lt(Fr());var Wn=o=>{let r=o.replace(/[\r\n\t]+/g,"").toLowerCase();return Se.getMatchingWords(r)},zt=(o,r)=>{let e="",a=r-1;do{let s=o[a]||"";a=s.trim()===""?-1:a-1,e=s.trim()!==""?`${s}${e}`:e}while(a>=0);return e},Mt=o=>{let r=(0,$r.default)(o,o.selectionEnd),{top:e,left:a}=r,s=m(".terminal").el.scrollHeight,h=m("main").el;h.style.height=`${s}px`,m(".suggestion").el.style.top=`${e}px`,m(".suggestion").el.style.left=`${a}px`},Tt=(o,r)=>o[r]===void 0||o[r].trim()==="",Gr=o=>{let r=o.target.selectionEnd,e=D.el.getValue(),a=e[r-1];if(o.inputType==="deleteContentBackward"||a===" ")return D.setState({prediction:null,currentWord:null}),m(".suggestion").hide();let s=zt(e,r);if(o.inputType==="insertText"&&Tt(e,r)&&!s.startsWith("#")){Mt(o.target);let g=Wn(s),[y]=g,x=y||"";D.setState({prediction:x,currentWord:s,matches:g.slice(0,10),options:{selected:0,length:g.length}});let P=D.getState();P.currentWord&&P.prediction&&P.currentWord.length>1?(D.renderInlineSuggestion(),D.renderOptions()):m(".suggestion").hide()}};var Vr=(o,r)=>o.split(` + `,qo=async(o,r,e="MiroPad note")=>{if(!o){M.error("\u{1F47B} No message to send, type something and try again! \u{1F913}");return}try{await fetch(`${te.mail_service.api}`,{method:"POST",headers:{"x-secret-token":S.get("MIROPAD_SECRET_TOKEN"),accept:"application/json","content-type":"application/json"},body:JSON.stringify({to:r,subject:e,html:Wo(o)})}).then(nt).then(a=>a.json()),M.success("Email sent \u{1F680}")}catch{M.error("Error not went through \u{1F4A5}! Check your credentials and try again!")}},Jo=()=>{let o=S.get("mail");if(o){let a=globalThis.prompt(`Mail ${o} again? (y)es/(no)`,"yeap");if(a===null)return a;if(a.slice(0,1).toLowerCase()==="y")return o}let r=globalThis.prompt("Where do you wanna send the mail to?"),e=globalThis.prompt("Do you wanna save that to your preferences for later on? (y)es/(no)","yeap");return e&&e.slice(0,1).toLowerCase()==="y"&&S.set("mail",r),r},Cr=o=>{let r=Jo();if(r===null){M.info("Sending mail cancelled \u{1F636}");return}M.info("Sending mail... \u{1F680}");let e=ge(o),a=Fe(o);qo(a,r,e)};var ae=async(o,r="\u{1F4CB} Copied to clipboard")=>{try{await navigator.clipboard.writeText(o),M.success(r)}catch(e){M.error(e.message)}};var $e=(o,r,e)=>{let a=ue(o)?o:[o],s=document.createElement("button");return s.setAttribute("type","button"),e&&s.setAttribute("id",e),a.forEach(h=>{typeof h=="string"?s.appendChild(document.createTextNode(h)):s.appendChild(h)}),s.onclick=h=>r(h),s};var Ko={view:m(".preview"),init:function(){return this.update(),m(".terminal").listen("input",()=>this.update()),!!A.getSearchParam("md")?this.view.show():this.view.hide(),this},autoLink:function(){let o=S.parse("__auto-links__"),r=Object.keys(o).map(s=>`${s}\\w+`).join("|"),e=new RegExp(`(${r})`,"g"),a=this.view.el.innerHTML.replace(e,s=>{let h=Object.keys(o).find(y=>s.startsWith(y)),g=o[h];return g.startsWith("http")?`${s}`:`${s}`});this.view.innerHTML(a)},update:function(){let md=m(".terminal").getValue();this.view.innerHTML(Fe(md)),this.autoLink();let{elements}=m("pre");Array.prototype.slice.call(elements).forEach(o=>{let r=$e("\u{1F4CB} Copy",async e=>{e.stopPropagation();let a=e.srcElement.previousSibling.innerHTML;await ae(a,"\u{1F4CB} Code copied to clipboard")});o.appendChild(r)}),m("code").listenAll("click",({innerHTML})=>{let result=eval(innerHTML);m(".console").show().innerHTML(result)}),m(".console").listen("click",async o=>{o.srcElement.classList.add("hidden");let r=o.srcElement.innerHTML;await ae(r,"\u{1F4CB} Code copied to clipboard")})},show:function(o=!0){this.view.show(),A.set(void 0,{md:o})},hide:function(){this.view.hide(),A.deleteParam("md")},toggle:function(o="true"){return A.getSearchParam("md")===o?this.hide():this.show(o),this}},ie=Ko;var Yo=o=>{let r=document.querySelector(o);if(Ae(r.value)){let e=JSON.stringify(JSON.parse(r.value),null,2);r.value=e,M.success("\u{1F44D} JSON value prettified")}else M.error("\u{1F627} Value is not in valid JSON format")},Sr=Yo;var zr=(o=1e3)=>new Promise(r=>{setTimeout(r,o)});var I=(o,r,e)=>{let a=document.createElement("IMG");return e&&a.classList.add(e),r&&a.setAttribute("alt",r),a.setAttribute("src",o),a};var dt={};$(dt,{default:()=>Xo});var Xo="./list-LK7OCHR7.svg";var be={};$(be,{default:()=>en});var en="./trash-RDL437QG.svg";var at={};$(at,{default:()=>rn});var rn="./checkmark-circle-JQ7ADSUI.svg";var it={};$(it,{default:()=>nn});var nn="./cloud-sync-F3RLGHML.svg";var st={};$(st,{default:()=>an});var an="./lighter-UBEI67LL.svg";var ut={};$(ut,{default:()=>un});var un="./enter-down-6TVO6OFR.svg";var ct={};$(ct,{default:()=>ln});var ln="./download-FVXMIYZ4.svg";var lt={};$(lt,{default:()=>hn});var hn="./envelope-Z2VRVSLR.svg";var ft={};$(ft,{default:()=>mn});var mn="./bug-36UGMUXT.svg";var ht={};$(ht,{default:()=>bn});var bn="./picture-3TDOSVS3.svg";var pt={};$(pt,{default:()=>yn});var yn="./printer-B7RMPYZC.svg";var mt={};$(mt,{default:()=>kn});var kn="./page-break-BLVP5QBQ.svg";var gt={};$(gt,{default:()=>xn});var xn="./frame-expand-CX6CNP53.svg";var bt={};$(bt,{default:()=>Sn});var Sn="./arrow-right-circle-2Q6EHM2H.svg";var wt={};$(wt,{default:()=>Mn});var Mn="./magic-wand-JQJ6EKRO.svg";var yt={};$(yt,{default:()=>Pn});var Pn="./rocket-AIY2RJJS.svg";var vt={};$(vt,{default:()=>An});var An="./spell-check-V6QYTGNT.svg";var kt={};$(kt,{default:()=>Ln});var Ln="./pencil-X3ZMY3QU.svg";var Ge={};$(Ge,{default:()=>Nn});var Nn="./exit-up-GH6BPN2X.svg";var _t={};$(_t,{default:()=>In});var In="./leaf-CGBE7XAJ.svg";var Mr=async()=>{try{let o=G(),r=A.get();await navigator.share({title:o?o.title:"\u270D\uFE0F MiroPad",text:o?o.text:"Temporary note keeping app for the browser",url:r})}catch(o){M.info(`${o.message}`)}};var On=()=>{let o=S.get("gistId");return S.get("authToken")?o?"Sync: Notes with my GitHub Gist":"Sync: Pick your Gist to sync with":"Sync: Authorize your GitHub account for synchronisation"},Fn={title:"Share note",icon:I(Ge,"share note"),sortTitle:"Share",call:Mr},$n={title:"Share public link",key:null,icon:I(Ge,"share public link"),sortTitle:"Share public link",call:async()=>{j.hide(),await Be(m(".terminal").getValue());let o=G();if(o){let e=(await $t({note:o})).history[0].url,a=await fetch(e).then(E=>E.json()),{files:s}=a,h=Object.values(s),[g]=h,{raw_url:y}=g,x=`${A.baseUrl}?raw=${y}`;ae(x,"MiroPad public link copied to clipboard \u{1F4CB}!")}}},xt=()=>[{title:"New note",icon:I(kt,"new note"),sortTitle:"New",key:"n",call:Ne},{title:"Save",key:"s",icon:I(at,"save"),sortTitle:"Save",call:async()=>{j.hide(),await Be(m(".terminal").getValue());let o=G();o&&!o.disableSync&&It([o]),se()}},...navigator.share?[Fn]:[],{title:"Toggle MarkDown Viewer",icon:I(mt,"toggle markdown viewer","rotate90"),sortTitle:"Split",key:"m",call:()=>{ie.toggle(),j.hide()}},{title:"Full MarkDown view",icon:I(gt,"full view"),sortTitle:"Full view",key:"shift m",call:()=>{ie.toggle("full"),j.hide()}},...fr()?[$n]:[],{title:"Zen mode",icon:I(_t,"zen mode"),sortTitle:"Zen mode",key:"shift z",call:()=>{!!A.getSearchParam("zen")?A.deleteParam("zen"):A.set(void 0,{zen:!0}),j.hide()}},{title:"List saved notes",icon:I(dt,"list notes"),sortTitle:"Notes",key:"p",call:()=>j.toggle(j.getModes().notes)},{title:"Delete note",key:"shift d",icon:I(be,"delete note"),sortTitle:"Delete",call:Ie},{title:On(),icon:I(it,"sync with github"),key:null,call:async()=>{let o=S.get("authToken");if(!o)return mr();if(!S.get("gistId"))return await gr(o);j.hide(),await xe()}},{title:"Sync: Reset Gist settings",icon:I(st,"reset github settings"),key:null,call:()=>{localStorage.removeItem("authToken"),localStorage.removeItem("gistId"),localStorage.removeItem("lastLocalUpdate"),localStorage.removeItem("lastSync"),M.info("Gist setting have been reset!"),j.hide()}},{title:"Toggle sidebar",experimental:!0,key:"shift l",call:()=>{m("aside").toggle()}},{title:"Save to File System...",experimental:!0,icon:I(ut,"save file"),key:"shift s",call:()=>{let o=G();if(o){let{text:r,title:e}=o;wr(r,e),j.hide()}}},{title:"Email note to...",experimental:!0,icon:I(lt,"email"),key:"e",call:()=>{let o=m(".terminal").getValue();Cr(o),j.hide()}},{title:"Toggle experimental features",experimental:!1,icon:I(ft,"lab"),key:null,call:()=>{let o=!!S.get("__experimental__");o?S.remove("__experimental__"):S.set("__experimental__",!0),M.showNotification(`Experimental features turned ${o?"off":"on"}`),j.hide()}},{title:"Toggle Autocompletion",experimental:!1,icon:I(bt,"autocompletion"),key:null,call:()=>{let o=!!S.get("__autocomplete__");o?S.remove("__autocomplete__"):S.set("__autocomplete__",!0),M.showNotification(`Autocomplete feature turned ${o?"off":"on"}`),j.hide(),m(".terminal").focus()}},{title:"Add a cover picture",experimental:!0,icon:I(ht,"cover picture"),key:null,call:async()=>{let o=prompt("Paste the image URL in here...");j.hide(),await zr(200),ae(`
`,"\u{1F44C}Copied! Paste the code on the MiroPad editor"),m(".terminal").focus(),M.info("Paste the cover picture wherever you prefer on the MirPad editor")}},{title:"Print MarkDown output",experimental:!0,icon:I(pt,"print"),key:null,call:()=>{m(".preview").show(),ie.init(),globalThis.print(),j.hide()}},{key:"j",title:"Prettify JSON document",icon:I(wt,"prettify json"),call:()=>{Sr(".terminal"),j.hide()}},{title:"Toggle command palette",icon:I(yt,"toggle command palette"),key:["shift p","k"],call:()=>j.toggle(j.getModes().commands)},{title:"Find and Replace...",experimental:!0,icon:I(vt,"find and replace"),key:"shift f",call:()=>{let o=m(".terminal").getValue().slice(m(".terminal").el.selectionStart,m(".terminal").el.selectionEnd),r=prompt("What do you wanna find?",o);if(!r)return M.info("Value not found");let e=m(".terminal").getValue().indexOf(r);m(".terminal").el.setSelectionRange(e,e+r.length);let a=prompt(`Replace ${r} with...`);a&&m(".terminal").el.setRangeText(a)}},{title:"Download all notes!",icon:I(ct,"Download all notes on your local file system"),call:()=>{let o=ee({includeDeleted:!0});yr(o),j.hide()}},{title:"Permanently delete ALL notes \u2757",icon:I(be,"delete note"),call:()=>{confirm("Are you sure you want do delete ALL your notes?")&&(ee({includeDeleted:!0}).forEach(e=>{S.remove(e.id)}),Ne()),j.hide()}}];var Gn={events:[],on(o,r){return Array.isArray(o)?(o.forEach(e=>{let a=e.key||e,s=e.call||r;this.on(a,s)}),this):(o&&typeof o=="string"&&r&&typeof r=="function"&&(this.events=[...this.events,{key:o.includes("shift")?o.replace("shift","").trim():o,shift:o.includes("shift"),fn(){r()}}]),this)},listen(){return document.addEventListener("keydown",o=>{this.handleEvent(o)}),this},handleEvent(o){this.events.map(r=>(r.key===o.key&&(o.ctrlKey===!0||o.metaKey===!0)&&o.shiftKey===r.shift&&(o.preventDefault(),r.fn()),!0))}},Tr=Gn;var Pr=(o,r)=>{let e=document.createElement("a");return e.href=r,e.appendChild(ce(o)?o:document.createTextNode(o)),e};var Ct=(o,r=new Date)=>{let e=new Date(o).getFullYear(),a=new Date(r).getFullYear();return e===a},Dr=(o,r=new Date)=>{let e=new Date(o).getMonth(),a=new Date(r).getMonth();return e===a},Vn=(o,r=new Date)=>{let e=new Date(o).getDate(),a=new Date(r).getDate();return e===a},Er=(o,r=new Date)=>Ct(o,r)&&Dr(o,r)&&Vn(o,r),Hn=["January","February","March","April","May","June","July","August","September","October","November","December"],Un=Hn.map(o=>o.slice(0,3)),Ar=(o=new Date)=>{let r=new Date(o),e=new Date().getDate()-1;return Dr(r)&&Ct(r)&&r.getDate()===e},Ce=o=>{let r=new Date(o),e=Ar(o)?"":Un[r.getMonth()],a=Ct(r)?"":r.getFullYear(),s=Ar(r)?"Yesterday":r.getDate();return`${Er(r)?"":`${s} ${e} ${a}`} ${Er(r)?r.toLocaleTimeString():""}`};var Lr=o=>o.reduce((e,a)=>{if(e.length===0)return[a];let s=Math.max(...e);return[...e,...a>=s?[a]:[]]},[]).length===o.length;var St=(o,r)=>{let e=o.split(" ").map(h=>h.toLowerCase()),s=r.split(" ").map(h=>h.toLowerCase()).map(h=>e.map((x,P)=>x.includes(h)?P:-1).reduce((x,P)=>P>-1?P:x,-1));return s.includes(-1)?!1:Lr(s)};var jr=async()=>{if(!S.get("__notification-permission__")){let o=await globalThis.Notification.requestPermission();S.set("__notification-permission__",o)}},Nr=()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(`${globalThis.location.pathname}service-worker.js?v=v3.1.3`)};var Br=o=>Array.isArray(o)?o.map(r=>Br(r)).join(", "):o?`\u2318+${o.toUpperCase()}`:"",Rn=(()=>{let o;(y=>(y.off="off",y.notes="notes",y.revisions="revisions",y.commands="commands",y.gists="gists"))(o||(o={}));let r={input:"",mode:"off",options:{selected:0,length:0}};return{getState:function(){return r},getModes:function(){return o},setState:function(e){return r={...r,...e},r},show:function(e="commands"){switch(m("#commander").show(),m("#commander input").focus(),e){case"commands":this.generateCommands(),m("#commander input").setValue("> "),this.setState({mode:"commands"});break;case"notes":this.generateNotes(),m("#commander input").setValue(""),this.setState({mode:"notes"});break;case"revisions":this.generateRevisions(),m("#commander input").setValue(""),this.setState({mode:"revisions"});break;default:break}return this},hide:function(){return m("#commander").hide(),r.mode="off",this},toggle:function(e){return jr(),r.mode==="off"||r.mode!==e?this.show(e):this.hide(),this},commands:function(){return xt()},selectOption:function(e="down"){let a=r.options.selected,s=r.options.length-1,x=e==="down"?a===s?0:a+1:a===0?s:a-1;r.options={...r.options,selected:x}},initCommander:function(){return xt().slice(0,5).map(e=>{m(".mobile-dock").append($e([e.icon,document.createTextNode(e.sortTitle)],e.call,e.title.toLowerCase().replace(/\s/g,"-")))}),m("#commander button").listen("click",()=>{this.hide()}),m("#commander input").listen("keydown",e=>{e.keyCode===40&&(r.mode==="revisions"&&m("#commands li.selected").click(),this.selectOption("down")),e.keyCode===38&&(r.mode==="revisions"&&m("#commands li.selected").click(),this.selectOption("up"))}).listen("keyup",e=>{e.keyCode===13&&(r.mode==="commands"?m("#commands li.selected div").click():m("#commands li.selected a").click()),e.keyCode===27&&m(".terminal").focus();let a=e.target;r.input!==a.value&&(r.options.selected=0),r.input=a.value,this.generateOptions(a.value)}),this},init:function(){return this.initCommander(),Tr.listen().on(this.commands()),m(".menu").listen("click",()=>this.toggle()),m("#revisions").listen("click",()=>this.generateRevisions()),this},generateRevisions:function(){this.show(),r.mode="revisions";let e=G();if(e){let{revisions:a}=e,s=r.options.selected,h=Object.keys(a).sort((g,y)=>{let{dateCreated:x}=a[g],{dateCreated:P}=a[y];return P-x}).map((g,y)=>({title:ne({content:`...${g.slice(-10)}`}),secondary:`${Ce(a[g].dateCreated)}`,onclick:()=>{A.set(void 0,{v:g}),r.options.selected=y,this.generateRevisions()}})).map((g,y)=>de(g,y===s));m("#commands").html(h),r.options={...r.options,length:h.length}}return this},generateOptions:function(e){switch(r.mode){case"commands":case"notes":e.slice(0,1)===">"?(r.mode="commands",this.generateCommands(e.slice(1).trim()),m("#commander input").placeholder("Search for commands...")):(r.mode="notes",this.generateNotes(e));return;case"revisions":return this.generateRevisions();case"off":break;default:break}},generateNotes:function(e=""){let a=r.options.selected,s=ee().filter(({title:h})=>St(h,e)).filter(({id:h,deleted:g})=>!g&&h!==A.getPageId()).sort((h,g)=>{let y=Le(h.title);return Le(g.title)-y}).map(({id:h,title:g},y)=>{let x=Le(g),P=`${globalThis.location.origin}${globalThis.location.pathname}#${h}`,E=Pr(ne({content:g,highlight:e}),P);return de({title:E,secondary:Ce(x),onclick:()=>{this.hide(),m(".terminal").focus()}},y===a)});return m("#commands").html(s),m("#commander input").placeholder(`Search from ${s.length} saved notes...`),r.options={...r.options,length:s.length},this},generateCommands:function(e=""){let a=r.options.selected,s=this.commands().filter(({title:h})=>St(h,e)).filter(({experimental:h=!1})=>S.get("__experimental__")?!0:!h).map(({title:h,key:g,call:y,icon:x},P)=>de({title:ne({content:h,highlight:e}),icon:x,secondary:Br(g),onclick:y},P===a));return m("#commands").html(s),r.options={...r.options,length:s.length},this}}})(),j=Rn;var Ir="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Or=(o=21)=>{let r="",e=crypto.getRandomValues(new Uint8Array(o));for(;o--;)r+=Ir[e[o]&63];return r};var $r=Lt(Fr());var Wn=o=>{let r=o.replace(/[\r\n\t]+/g,"").toLowerCase();return Se.getMatchingWords(r)},zt=(o,r)=>{let e="",a=r-1;do{let s=o[a]||"";a=s.trim()===""?-1:a-1,e=s.trim()!==""?`${s}${e}`:e}while(a>=0);return e},Mt=o=>{let r=(0,$r.default)(o,o.selectionEnd),{top:e,left:a}=r,s=m(".terminal").el.scrollHeight,h=m("main").el;h.style.height=`${s}px`,m(".suggestion").el.style.top=`${e}px`,m(".suggestion").el.style.left=`${a}px`},Tt=(o,r)=>o[r]===void 0||o[r].trim()==="",Gr=o=>{let r=o.target.selectionEnd,e=D.el.getValue(),a=e[r-1];if(o.inputType==="deleteContentBackward"||a===" ")return D.setState({prediction:null,currentWord:null}),m(".suggestion").hide();let s=zt(e,r);if(o.inputType==="insertText"&&Tt(e,r)&&!s.startsWith("#")){Mt(o.target);let g=Wn(s),[y]=g,x=y||"";D.setState({prediction:x,currentWord:s,matches:g.slice(0,10),options:{selected:0,length:g.length}});let P=D.getState();P.currentWord&&P.prediction&&P.currentWord.length>1?(D.renderInlineSuggestion(),D.renderOptions()):m(".suggestion").hide()}};var Vr=(o,r)=>o.split(` `).reduce((s,h)=>{let{isFound:g}=s;if(g)return s;let y=`${s.text}${h} `,x=y.length;return r>=x?{text:y,isFound:!1}:{text:h,isFound:!0}},{text:"",isFound:!1}).text;var Hr=o=>{let r=Vr(o.target.value,o.target.selectionEnd),e={"* [":` * [] `,"* ":` diff --git a/index.js.map b/index.js.map index 0a70a7a..0938da2 100644 --- a/index.js.map +++ b/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/options.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/showdown.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/helpers.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/converter.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/anchors.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/autoLinks.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/blockGamut.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/blockQuotes.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/codeBlocks.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/codeSpans.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/completeHTMLDocument.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/detab.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/ellipsis.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/emoji.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/encodeAmpsAndAngles.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/encodeBackslashEscapes.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/encodeCode.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/escapeSpecialCharsWithinTagAttributes.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/githubCodeBlocks.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/hashBlock.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/hashCodeTags.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/hashElement.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/hashHTMLBlocks.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/hashHTMLSpans.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/hashPreCodeTags.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/headers.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/horizontalRule.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/images.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/italicsAndBold.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/lists.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/metadata.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/outdent.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/paragraphs.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/runExtension.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/spanGamut.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/strikethrough.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/stripLinkDefinitions.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/tables.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/underline.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/unescapeSpecialChars.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/blockquote.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/codeBlock.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/codeSpan.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/emphasis.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/header.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/hr.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/image.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/links.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/list.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/listItem.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/node.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/paragraph.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/pre.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/strikethrough.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/strong.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/table.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/tableCell.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/subParsers/makeMarkdown/txt.js", "../node_modules/.deno/showdown@2.1.0/node_modules/showdown/src/loader.js", "../node_modules/.deno/textarea-caret@3.1.0/node_modules/textarea-caret/index.js", "../src/js/utils/isArray.ts", "../src/js/utils/dom.js", "../src/js/components/molecules/notify.ts", "../src/js/components/molecules/welcome.js", "../src/js/utils/localstorage.js", "../src/configuration.ts", "../src/js/utils/github/api.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/bytes.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/vendor/base-x.js", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/bases/base.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/bases/base32.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/bases/base36.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/bases/base58.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/vendor/varint.js", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/varint.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/hashes/digest.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/cid.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/codecs/json.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/hashes/hasher.ts", "../node_modules/.deno/multiformats@13.3.1/node_modules/multiformats/src/hashes/sha2-browser.ts", "../src/js/utils/hashBrowser.ts", "../src/js/utils/isJSON.ts", "../src/js/utils/pageTitle.js", "../src/js/utils/urlManager.ts", "../src/js/ui/functions/savedState.ts", "../src/js/components/organisms/noteManager/noteManager.ts", "../src/js/utils/isUserLoggedIn.js", "../src/js/components/molecules/commands/command.js", "../src/js/components/atoms/div/wordParts.ts", "../src/js/components/atoms/div/div.js", "../src/js/utils/github/actions.js", "../src/js/utils/fileSystem/fileSystem.ts", "../src/js/components/organisms/markdown/mdToHtml.ts", "../src/js/utils/mail.js", "../src/js/utils/copyToClipboard.ts", "../src/js/components/atoms/button/button.js", "../src/js/components/organisms/markdown/markDownViewer.js", "../src/js/utils/prettifyJSON.js", "../src/js/utils/sleep.js", "../src/js/components/atoms/icon/icon.js", "../src/js/utils/webShare.js", "../src/js/components/organisms/commander/commands.ts", "../src/js/utils/keyListener.js", "../src/js/components/atoms/link/link.js", "../src/js/utils/dates.js", "../src/js/utils/isArraySorted.ts", "../src/js/components/organisms/commander/smartFilter.ts", "../src/js/registerServiceWorker.js", "../src/js/components/organisms/commander/commander.ts", "../node_modules/.deno/nanoid@5.0.8/node_modules/nanoid/url-alphabet/index.js", "../node_modules/.deno/nanoid@5.0.8/node_modules/nanoid/index.browser.js", "../src/js/features/autoComplete.ts", "../src/js/utils/text/index.ts", "../src/js/utils/text/autoCompleteCheckboxes.js", "../src/js/features/inter-linking/renderInterNotes.ts", "../src/js/components/organisms/terminal.ts", "../src/js/isSyncEnabled.js", "../src/js/utils/Trie/Trie.ts", "../src/js/utils/errorHandler.js", "../src/js/listeners/urlChange.ts", "../src/js/ui/markdown/preview/autoMagicallyCheckBoxes.js", "../src/js/main.js", "../src/index.ts"], - "sourcesContent": ["/**\n * Created by Tivie on 13-07-2015.\n */\n\nfunction getDefaultOpts (simple) {\n 'use strict';\n\n var defaultOptions = {\n omitExtraWLInCodeBlocks: {\n defaultValue: false,\n describe: 'Omit the default extra whiteline added to code blocks',\n type: 'boolean'\n },\n noHeaderId: {\n defaultValue: false,\n describe: 'Turn on/off generated header id',\n type: 'boolean'\n },\n prefixHeaderId: {\n defaultValue: false,\n describe: 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \\'section-\\' prefix',\n type: 'string'\n },\n rawPrefixHeaderId: {\n defaultValue: false,\n describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the \" char is used in the prefix)',\n type: 'boolean'\n },\n ghCompatibleHeaderId: {\n defaultValue: false,\n describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',\n type: 'boolean'\n },\n rawHeaderId: {\n defaultValue: false,\n describe: 'Remove only spaces, \\' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',\n type: 'boolean'\n },\n headerLevelStart: {\n defaultValue: false,\n describe: 'The header blocks level start',\n type: 'integer'\n },\n parseImgDimensions: {\n defaultValue: false,\n describe: 'Turn on/off image dimension parsing',\n type: 'boolean'\n },\n simplifiedAutoLink: {\n defaultValue: false,\n describe: 'Turn on/off GFM autolink style',\n type: 'boolean'\n },\n excludeTrailingPunctuationFromURLs: {\n defaultValue: false,\n describe: 'Excludes trailing punctuation from links generated with autoLinking',\n type: 'boolean'\n },\n literalMidWordUnderscores: {\n defaultValue: false,\n describe: 'Parse midword underscores as literal underscores',\n type: 'boolean'\n },\n literalMidWordAsterisks: {\n defaultValue: false,\n describe: 'Parse midword asterisks as literal asterisks',\n type: 'boolean'\n },\n strikethrough: {\n defaultValue: false,\n describe: 'Turn on/off strikethrough support',\n type: 'boolean'\n },\n tables: {\n defaultValue: false,\n describe: 'Turn on/off tables support',\n type: 'boolean'\n },\n tablesHeaderId: {\n defaultValue: false,\n describe: 'Add an id to table headers',\n type: 'boolean'\n },\n ghCodeBlocks: {\n defaultValue: true,\n describe: 'Turn on/off GFM fenced code blocks support',\n type: 'boolean'\n },\n tasklists: {\n defaultValue: false,\n describe: 'Turn on/off GFM tasklist support',\n type: 'boolean'\n },\n smoothLivePreview: {\n defaultValue: false,\n describe: 'Prevents weird effects in live previews due to incomplete input',\n type: 'boolean'\n },\n smartIndentationFix: {\n defaultValue: false,\n describe: 'Tries to smartly fix indentation in es6 strings',\n type: 'boolean'\n },\n disableForced4SpacesIndentedSublists: {\n defaultValue: false,\n describe: 'Disables the requirement of indenting nested sublists by 4 spaces',\n type: 'boolean'\n },\n simpleLineBreaks: {\n defaultValue: false,\n describe: 'Parses simple line breaks as
(GFM Style)',\n type: 'boolean'\n },\n requireSpaceBeforeHeadingText: {\n defaultValue: false,\n describe: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',\n type: 'boolean'\n },\n ghMentions: {\n defaultValue: false,\n describe: 'Enables github @mentions',\n type: 'boolean'\n },\n ghMentionsLink: {\n defaultValue: 'https://github.com/{u}',\n describe: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',\n type: 'string'\n },\n encodeEmails: {\n defaultValue: true,\n describe: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',\n type: 'boolean'\n },\n openLinksInNewWindow: {\n defaultValue: false,\n describe: 'Open all links in new windows',\n type: 'boolean'\n },\n backslashEscapesHTMLTags: {\n defaultValue: false,\n describe: 'Support for HTML Tag escaping. ex: \\
foo\\
',\n type: 'boolean'\n },\n emoji: {\n defaultValue: false,\n describe: 'Enable emoji support. Ex: `this is a :smile: emoji`',\n type: 'boolean'\n },\n underline: {\n defaultValue: false,\n describe: 'Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``',\n type: 'boolean'\n },\n ellipsis: {\n defaultValue: true,\n describe: 'Replaces three dots with the ellipsis unicode character',\n type: 'boolean'\n },\n completeHTMLDocument: {\n defaultValue: false,\n describe: 'Outputs a complete html document, including ``, `` and `` tags',\n type: 'boolean'\n },\n metadata: {\n defaultValue: false,\n describe: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).',\n type: 'boolean'\n },\n splitAdjacentBlockquotes: {\n defaultValue: false,\n describe: 'Split adjacent blockquote blocks',\n type: 'boolean'\n }\n };\n if (simple === false) {\n return JSON.parse(JSON.stringify(defaultOptions));\n }\n var ret = {};\n for (var opt in defaultOptions) {\n if (defaultOptions.hasOwnProperty(opt)) {\n ret[opt] = defaultOptions[opt].defaultValue;\n }\n }\n return ret;\n}\n\nfunction allOptionsOn () {\n 'use strict';\n var options = getDefaultOpts(true),\n ret = {};\n for (var opt in options) {\n if (options.hasOwnProperty(opt)) {\n ret[opt] = true;\n }\n }\n return ret;\n}\n", "/**\n * Created by Tivie on 06-01-2015.\n */\n\n// Private properties\nvar showdown = {},\n parsers = {},\n extensions = {},\n globalOptions = getDefaultOpts(true),\n setFlavor = 'vanilla',\n flavor = {\n github: {\n omitExtraWLInCodeBlocks: true,\n simplifiedAutoLink: true,\n excludeTrailingPunctuationFromURLs: true,\n literalMidWordUnderscores: true,\n strikethrough: true,\n tables: true,\n tablesHeaderId: true,\n ghCodeBlocks: true,\n tasklists: true,\n disableForced4SpacesIndentedSublists: true,\n simpleLineBreaks: true,\n requireSpaceBeforeHeadingText: true,\n ghCompatibleHeaderId: true,\n ghMentions: true,\n backslashEscapesHTMLTags: true,\n emoji: true,\n splitAdjacentBlockquotes: true\n },\n original: {\n noHeaderId: true,\n ghCodeBlocks: false\n },\n ghost: {\n omitExtraWLInCodeBlocks: true,\n parseImgDimensions: true,\n simplifiedAutoLink: true,\n excludeTrailingPunctuationFromURLs: true,\n literalMidWordUnderscores: true,\n strikethrough: true,\n tables: true,\n tablesHeaderId: true,\n ghCodeBlocks: true,\n tasklists: true,\n smoothLivePreview: true,\n simpleLineBreaks: true,\n requireSpaceBeforeHeadingText: true,\n ghMentions: false,\n encodeEmails: true\n },\n vanilla: getDefaultOpts(true),\n allOn: allOptionsOn()\n };\n\n/**\n * helper namespace\n * @type {{}}\n */\nshowdown.helper = {};\n\n/**\n * TODO LEGACY SUPPORT CODE\n * @type {{}}\n */\nshowdown.extensions = {};\n\n/**\n * Set a global option\n * @static\n * @param {string} key\n * @param {*} value\n * @returns {showdown}\n */\nshowdown.setOption = function (key, value) {\n 'use strict';\n globalOptions[key] = value;\n return this;\n};\n\n/**\n * Get a global option\n * @static\n * @param {string} key\n * @returns {*}\n */\nshowdown.getOption = function (key) {\n 'use strict';\n return globalOptions[key];\n};\n\n/**\n * Get the global options\n * @static\n * @returns {{}}\n */\nshowdown.getOptions = function () {\n 'use strict';\n return globalOptions;\n};\n\n/**\n * Reset global options to the default values\n * @static\n */\nshowdown.resetOptions = function () {\n 'use strict';\n globalOptions = getDefaultOpts(true);\n};\n\n/**\n * Set the flavor showdown should use as default\n * @param {string} name\n */\nshowdown.setFlavor = function (name) {\n 'use strict';\n if (!flavor.hasOwnProperty(name)) {\n throw Error(name + ' flavor was not found');\n }\n showdown.resetOptions();\n var preset = flavor[name];\n setFlavor = name;\n for (var option in preset) {\n if (preset.hasOwnProperty(option)) {\n globalOptions[option] = preset[option];\n }\n }\n};\n\n/**\n * Get the currently set flavor\n * @returns {string}\n */\nshowdown.getFlavor = function () {\n 'use strict';\n return setFlavor;\n};\n\n/**\n * Get the options of a specified flavor. Returns undefined if the flavor was not found\n * @param {string} name Name of the flavor\n * @returns {{}|undefined}\n */\nshowdown.getFlavorOptions = function (name) {\n 'use strict';\n if (flavor.hasOwnProperty(name)) {\n return flavor[name];\n }\n};\n\n/**\n * Get the default options\n * @static\n * @param {boolean} [simple=true]\n * @returns {{}}\n */\nshowdown.getDefaultOptions = function (simple) {\n 'use strict';\n return getDefaultOpts(simple);\n};\n\n/**\n * Get or set a subParser\n *\n * subParser(name) - Get a registered subParser\n * subParser(name, func) - Register a subParser\n * @static\n * @param {string} name\n * @param {function} [func]\n * @returns {*}\n */\nshowdown.subParser = function (name, func) {\n 'use strict';\n if (showdown.helper.isString(name)) {\n if (typeof func !== 'undefined') {\n parsers[name] = func;\n } else {\n if (parsers.hasOwnProperty(name)) {\n return parsers[name];\n } else {\n throw Error('SubParser named ' + name + ' not registered!');\n }\n }\n }\n};\n\n/**\n * Gets or registers an extension\n * @static\n * @param {string} name\n * @param {object|object[]|function=} ext\n * @returns {*}\n */\nshowdown.extension = function (name, ext) {\n 'use strict';\n\n if (!showdown.helper.isString(name)) {\n throw Error('Extension \\'name\\' must be a string');\n }\n\n name = showdown.helper.stdExtName(name);\n\n // Getter\n if (showdown.helper.isUndefined(ext)) {\n if (!extensions.hasOwnProperty(name)) {\n throw Error('Extension named ' + name + ' is not registered!');\n }\n return extensions[name];\n\n // Setter\n } else {\n // Expand extension if it's wrapped in a function\n if (typeof ext === 'function') {\n ext = ext();\n }\n\n // Ensure extension is an array\n if (!showdown.helper.isArray(ext)) {\n ext = [ext];\n }\n\n var validExtension = validate(ext, name);\n\n if (validExtension.valid) {\n extensions[name] = ext;\n } else {\n throw Error(validExtension.error);\n }\n }\n};\n\n/**\n * Gets all extensions registered\n * @returns {{}}\n */\nshowdown.getAllExtensions = function () {\n 'use strict';\n return extensions;\n};\n\n/**\n * Remove an extension\n * @param {string} name\n */\nshowdown.removeExtension = function (name) {\n 'use strict';\n delete extensions[name];\n};\n\n/**\n * Removes all extensions\n */\nshowdown.resetExtensions = function () {\n 'use strict';\n extensions = {};\n};\n\n/**\n * Validate extension\n * @param {array} extension\n * @param {string} name\n * @returns {{valid: boolean, error: string}}\n */\nfunction validate (extension, name) {\n 'use strict';\n\n var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',\n ret = {\n valid: true,\n error: ''\n };\n\n if (!showdown.helper.isArray(extension)) {\n extension = [extension];\n }\n\n for (var i = 0; i < extension.length; ++i) {\n var baseMsg = errMsg + ' sub-extension ' + i + ': ',\n ext = extension[i];\n if (typeof ext !== 'object') {\n ret.valid = false;\n ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';\n return ret;\n }\n\n if (!showdown.helper.isString(ext.type)) {\n ret.valid = false;\n ret.error = baseMsg + 'property \"type\" must be a string, but ' + typeof ext.type + ' given';\n return ret;\n }\n\n var type = ext.type = ext.type.toLowerCase();\n\n // normalize extension type\n if (type === 'language') {\n type = ext.type = 'lang';\n }\n\n if (type === 'html') {\n type = ext.type = 'output';\n }\n\n if (type !== 'lang' && type !== 'output' && type !== 'listener') {\n ret.valid = false;\n ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: \"lang/language\", \"output/html\" or \"listener\"';\n return ret;\n }\n\n if (type === 'listener') {\n if (showdown.helper.isUndefined(ext.listeners)) {\n ret.valid = false;\n ret.error = baseMsg + '. Extensions of type \"listener\" must have a property called \"listeners\"';\n return ret;\n }\n } else {\n if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {\n ret.valid = false;\n ret.error = baseMsg + type + ' extensions must define either a \"regex\" property or a \"filter\" method';\n return ret;\n }\n }\n\n if (ext.listeners) {\n if (typeof ext.listeners !== 'object') {\n ret.valid = false;\n ret.error = baseMsg + '\"listeners\" property must be an object but ' + typeof ext.listeners + ' given';\n return ret;\n }\n for (var ln in ext.listeners) {\n if (ext.listeners.hasOwnProperty(ln)) {\n if (typeof ext.listeners[ln] !== 'function') {\n ret.valid = false;\n ret.error = baseMsg + '\"listeners\" property must be an hash of [event name]: [callback]. listeners.' + ln +\n ' must be a function but ' + typeof ext.listeners[ln] + ' given';\n return ret;\n }\n }\n }\n }\n\n if (ext.filter) {\n if (typeof ext.filter !== 'function') {\n ret.valid = false;\n ret.error = baseMsg + '\"filter\" must be a function, but ' + typeof ext.filter + ' given';\n return ret;\n }\n } else if (ext.regex) {\n if (showdown.helper.isString(ext.regex)) {\n ext.regex = new RegExp(ext.regex, 'g');\n }\n if (!(ext.regex instanceof RegExp)) {\n ret.valid = false;\n ret.error = baseMsg + '\"regex\" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';\n return ret;\n }\n if (showdown.helper.isUndefined(ext.replace)) {\n ret.valid = false;\n ret.error = baseMsg + '\"regex\" extensions must implement a replace string or function';\n return ret;\n }\n }\n }\n return ret;\n}\n\n/**\n * Validate extension\n * @param {object} ext\n * @returns {boolean}\n */\nshowdown.validateExtension = function (ext) {\n 'use strict';\n\n var validateExtension = validate(ext, null);\n if (!validateExtension.valid) {\n console.warn(validateExtension.error);\n return false;\n }\n return true;\n};\n", "/**\n * showdownjs helper functions\n */\n\nif (!showdown.hasOwnProperty('helper')) {\n showdown.helper = {};\n}\n\n/**\n * Check if var is string\n * @static\n * @param {string} a\n * @returns {boolean}\n */\nshowdown.helper.isString = function (a) {\n 'use strict';\n return (typeof a === 'string' || a instanceof String);\n};\n\n/**\n * Check if var is a function\n * @static\n * @param {*} a\n * @returns {boolean}\n */\nshowdown.helper.isFunction = function (a) {\n 'use strict';\n var getType = {};\n return a && getType.toString.call(a) === '[object Function]';\n};\n\n/**\n * isArray helper function\n * @static\n * @param {*} a\n * @returns {boolean}\n */\nshowdown.helper.isArray = function (a) {\n 'use strict';\n return Array.isArray(a);\n};\n\n/**\n * Check if value is undefined\n * @static\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n */\nshowdown.helper.isUndefined = function (value) {\n 'use strict';\n return typeof value === 'undefined';\n};\n\n/**\n * ForEach helper function\n * Iterates over Arrays and Objects (own properties only)\n * @static\n * @param {*} obj\n * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object\n */\nshowdown.helper.forEach = function (obj, callback) {\n 'use strict';\n // check if obj is defined\n if (showdown.helper.isUndefined(obj)) {\n throw new Error('obj param is required');\n }\n\n if (showdown.helper.isUndefined(callback)) {\n throw new Error('callback param is required');\n }\n\n if (!showdown.helper.isFunction(callback)) {\n throw new Error('callback param must be a function/closure');\n }\n\n if (typeof obj.forEach === 'function') {\n obj.forEach(callback);\n } else if (showdown.helper.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n callback(obj[i], i, obj);\n }\n } else if (typeof (obj) === 'object') {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n callback(obj[prop], prop, obj);\n }\n }\n } else {\n throw new Error('obj does not seem to be an array or an iterable object');\n }\n};\n\n/**\n * Standardidize extension name\n * @static\n * @param {string} s extension name\n * @returns {string}\n */\nshowdown.helper.stdExtName = function (s) {\n 'use strict';\n return s.replace(/[_?*+\\/\\\\.^-]/g, '').replace(/\\s/g, '').toLowerCase();\n};\n\nfunction escapeCharactersCallback (wholeMatch, m1) {\n 'use strict';\n var charCodeToEscape = m1.charCodeAt(0);\n return '¨E' + charCodeToEscape + 'E';\n}\n\n/**\n * Callback used to escape characters when passing through String.replace\n * @static\n * @param {string} wholeMatch\n * @param {string} m1\n * @returns {string}\n */\nshowdown.helper.escapeCharactersCallback = escapeCharactersCallback;\n\n/**\n * Escape characters in a string\n * @static\n * @param {string} text\n * @param {string} charsToEscape\n * @param {boolean} afterBackslash\n * @returns {XML|string|void|*}\n */\nshowdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) {\n 'use strict';\n // First we have to escape the escape characters so that\n // we can build a character class out of them\n var regexString = '([' + charsToEscape.replace(/([\\[\\]\\\\])/g, '\\\\$1') + '])';\n\n if (afterBackslash) {\n regexString = '\\\\\\\\' + regexString;\n }\n\n var regex = new RegExp(regexString, 'g');\n text = text.replace(regex, escapeCharactersCallback);\n\n return text;\n};\n\n/**\n * Unescape HTML entities\n * @param txt\n * @returns {string}\n */\nshowdown.helper.unescapeHTMLEntities = function (txt) {\n 'use strict';\n\n return txt\n .replace(/"/g, '\"')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/&/g, '&');\n};\n\nvar rgxFindMatchPos = function (str, left, right, flags) {\n 'use strict';\n var f = flags || '',\n g = f.indexOf('g') > -1,\n x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),\n l = new RegExp(left, f.replace(/g/g, '')),\n pos = [],\n t, s, m, start, end;\n\n do {\n t = 0;\n while ((m = x.exec(str))) {\n if (l.test(m[0])) {\n if (!(t++)) {\n s = x.lastIndex;\n start = s - m[0].length;\n }\n } else if (t) {\n if (!--t) {\n end = m.index + m[0].length;\n var obj = {\n left: {start: start, end: s},\n match: {start: s, end: m.index},\n right: {start: m.index, end: end},\n wholeMatch: {start: start, end: end}\n };\n pos.push(obj);\n if (!g) {\n return pos;\n }\n }\n }\n }\n } while (t && (x.lastIndex = s));\n\n return pos;\n};\n\n/**\n * matchRecursiveRegExp\n *\n * (c) 2007 Steven Levithan \n * MIT License\n *\n * Accepts a string to search, a left and right format delimiter\n * as regex patterns, and optional regex flags. Returns an array\n * of matches, allowing nested instances of left/right delimiters.\n * Use the \"g\" flag to return all matches, otherwise only the\n * first is returned. Be careful to ensure that the left and\n * right format delimiters produce mutually exclusive matches.\n * Backreferences are not supported within the right delimiter\n * due to how it is internally combined with the left delimiter.\n * When matching strings whose format delimiters are unbalanced\n * to the left or right, the output is intentionally as a\n * conventional regex library with recursion support would\n * produce, e.g. \"<\" and \">\" both produce [\"x\"] when using\n * \"<\" and \">\" as the delimiters (both strings contain a single,\n * balanced instance of \"\").\n *\n * examples:\n * matchRecursiveRegExp(\"test\", \"\\\\(\", \"\\\\)\")\n * returns: []\n * matchRecursiveRegExp(\">>t<>\", \"<\", \">\", \"g\")\n * returns: [\"t<>\", \"\"]\n * matchRecursiveRegExp(\"
test
\", \"]*>\", \"\", \"gi\")\n * returns: [\"test\"]\n */\nshowdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {\n 'use strict';\n\n var matchPos = rgxFindMatchPos (str, left, right, flags),\n results = [];\n\n for (var i = 0; i < matchPos.length; ++i) {\n results.push([\n str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),\n str.slice(matchPos[i].match.start, matchPos[i].match.end),\n str.slice(matchPos[i].left.start, matchPos[i].left.end),\n str.slice(matchPos[i].right.start, matchPos[i].right.end)\n ]);\n }\n return results;\n};\n\n/**\n *\n * @param {string} str\n * @param {string|function} replacement\n * @param {string} left\n * @param {string} right\n * @param {string} flags\n * @returns {string}\n */\nshowdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {\n 'use strict';\n\n if (!showdown.helper.isFunction(replacement)) {\n var repStr = replacement;\n replacement = function () {\n return repStr;\n };\n }\n\n var matchPos = rgxFindMatchPos(str, left, right, flags),\n finalStr = str,\n lng = matchPos.length;\n\n if (lng > 0) {\n var bits = [];\n if (matchPos[0].wholeMatch.start !== 0) {\n bits.push(str.slice(0, matchPos[0].wholeMatch.start));\n }\n for (var i = 0; i < lng; ++i) {\n bits.push(\n replacement(\n str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),\n str.slice(matchPos[i].match.start, matchPos[i].match.end),\n str.slice(matchPos[i].left.start, matchPos[i].left.end),\n str.slice(matchPos[i].right.start, matchPos[i].right.end)\n )\n );\n if (i < lng - 1) {\n bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));\n }\n }\n if (matchPos[lng - 1].wholeMatch.end < str.length) {\n bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));\n }\n finalStr = bits.join('');\n }\n return finalStr;\n};\n\n/**\n * Returns the index within the passed String object of the first occurrence of the specified regex,\n * starting the search at fromIndex. Returns -1 if the value is not found.\n *\n * @param {string} str string to search\n * @param {RegExp} regex Regular expression to search\n * @param {int} [fromIndex = 0] Index to start the search\n * @returns {Number}\n * @throws InvalidArgumentError\n */\nshowdown.helper.regexIndexOf = function (str, regex, fromIndex) {\n 'use strict';\n if (!showdown.helper.isString(str)) {\n throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';\n }\n if (regex instanceof RegExp === false) {\n throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp';\n }\n var indexOf = str.substring(fromIndex || 0).search(regex);\n return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf;\n};\n\n/**\n * Splits the passed string object at the defined index, and returns an array composed of the two substrings\n * @param {string} str string to split\n * @param {int} index index to split string at\n * @returns {[string,string]}\n * @throws InvalidArgumentError\n */\nshowdown.helper.splitAtIndex = function (str, index) {\n 'use strict';\n if (!showdown.helper.isString(str)) {\n throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';\n }\n return [str.substring(0, index), str.substring(index)];\n};\n\n/**\n * Obfuscate an e-mail address through the use of Character Entities,\n * transforming ASCII characters into their equivalent decimal or hex entities.\n *\n * Since it has a random component, subsequent calls to this function produce different results\n *\n * @param {string} mail\n * @returns {string}\n */\nshowdown.helper.encodeEmailAddress = function (mail) {\n 'use strict';\n var encode = [\n function (ch) {\n return '&#' + ch.charCodeAt(0) + ';';\n },\n function (ch) {\n return '&#x' + ch.charCodeAt(0).toString(16) + ';';\n },\n function (ch) {\n return ch;\n }\n ];\n\n mail = mail.replace(/./g, function (ch) {\n if (ch === '@') {\n // this *must* be encoded. I insist.\n ch = encode[Math.floor(Math.random() * 2)](ch);\n } else {\n var r = Math.random();\n // roughly 10% raw, 45% hex, 45% dec\n ch = (\n r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)\n );\n }\n return ch;\n });\n\n return mail;\n};\n\n/**\n *\n * @param str\n * @param targetLength\n * @param padString\n * @returns {string}\n */\nshowdown.helper.padEnd = function padEnd (str, targetLength, padString) {\n 'use strict';\n /*jshint bitwise: false*/\n // eslint-disable-next-line space-infix-ops\n targetLength = targetLength>>0; //floor if number or convert non-number to 0;\n /*jshint bitwise: true*/\n padString = String(padString || ' ');\n if (str.length > targetLength) {\n return String(str);\n } else {\n targetLength = targetLength - str.length;\n if (targetLength > padString.length) {\n padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed\n }\n return String(str) + padString.slice(0,targetLength);\n }\n};\n\n/**\n * POLYFILLS\n */\n// use this instead of builtin is undefined for IE8 compatibility\nif (typeof (console) === 'undefined') {\n console = {\n warn: function (msg) {\n 'use strict';\n alert(msg);\n },\n log: function (msg) {\n 'use strict';\n alert(msg);\n },\n error: function (msg) {\n 'use strict';\n throw msg;\n }\n };\n}\n\n/**\n * Common regexes.\n * We declare some common regexes to improve performance\n */\nshowdown.helper.regexes = {\n asteriskDashAndColon: /([*_:~])/g\n};\n\n/**\n * EMOJIS LIST\n */\nshowdown.helper.emojis = {\n '+1':'\\ud83d\\udc4d',\n '-1':'\\ud83d\\udc4e',\n '100':'\\ud83d\\udcaf',\n '1234':'\\ud83d\\udd22',\n '1st_place_medal':'\\ud83e\\udd47',\n '2nd_place_medal':'\\ud83e\\udd48',\n '3rd_place_medal':'\\ud83e\\udd49',\n '8ball':'\\ud83c\\udfb1',\n 'a':'\\ud83c\\udd70\\ufe0f',\n 'ab':'\\ud83c\\udd8e',\n 'abc':'\\ud83d\\udd24',\n 'abcd':'\\ud83d\\udd21',\n 'accept':'\\ud83c\\ude51',\n 'aerial_tramway':'\\ud83d\\udea1',\n 'airplane':'\\u2708\\ufe0f',\n 'alarm_clock':'\\u23f0',\n 'alembic':'\\u2697\\ufe0f',\n 'alien':'\\ud83d\\udc7d',\n 'ambulance':'\\ud83d\\ude91',\n 'amphora':'\\ud83c\\udffa',\n 'anchor':'\\u2693\\ufe0f',\n 'angel':'\\ud83d\\udc7c',\n 'anger':'\\ud83d\\udca2',\n 'angry':'\\ud83d\\ude20',\n 'anguished':'\\ud83d\\ude27',\n 'ant':'\\ud83d\\udc1c',\n 'apple':'\\ud83c\\udf4e',\n 'aquarius':'\\u2652\\ufe0f',\n 'aries':'\\u2648\\ufe0f',\n 'arrow_backward':'\\u25c0\\ufe0f',\n 'arrow_double_down':'\\u23ec',\n 'arrow_double_up':'\\u23eb',\n 'arrow_down':'\\u2b07\\ufe0f',\n 'arrow_down_small':'\\ud83d\\udd3d',\n 'arrow_forward':'\\u25b6\\ufe0f',\n 'arrow_heading_down':'\\u2935\\ufe0f',\n 'arrow_heading_up':'\\u2934\\ufe0f',\n 'arrow_left':'\\u2b05\\ufe0f',\n 'arrow_lower_left':'\\u2199\\ufe0f',\n 'arrow_lower_right':'\\u2198\\ufe0f',\n 'arrow_right':'\\u27a1\\ufe0f',\n 'arrow_right_hook':'\\u21aa\\ufe0f',\n 'arrow_up':'\\u2b06\\ufe0f',\n 'arrow_up_down':'\\u2195\\ufe0f',\n 'arrow_up_small':'\\ud83d\\udd3c',\n 'arrow_upper_left':'\\u2196\\ufe0f',\n 'arrow_upper_right':'\\u2197\\ufe0f',\n 'arrows_clockwise':'\\ud83d\\udd03',\n 'arrows_counterclockwise':'\\ud83d\\udd04',\n 'art':'\\ud83c\\udfa8',\n 'articulated_lorry':'\\ud83d\\ude9b',\n 'artificial_satellite':'\\ud83d\\udef0',\n 'astonished':'\\ud83d\\ude32',\n 'athletic_shoe':'\\ud83d\\udc5f',\n 'atm':'\\ud83c\\udfe7',\n 'atom_symbol':'\\u269b\\ufe0f',\n 'avocado':'\\ud83e\\udd51',\n 'b':'\\ud83c\\udd71\\ufe0f',\n 'baby':'\\ud83d\\udc76',\n 'baby_bottle':'\\ud83c\\udf7c',\n 'baby_chick':'\\ud83d\\udc24',\n 'baby_symbol':'\\ud83d\\udebc',\n 'back':'\\ud83d\\udd19',\n 'bacon':'\\ud83e\\udd53',\n 'badminton':'\\ud83c\\udff8',\n 'baggage_claim':'\\ud83d\\udec4',\n 'baguette_bread':'\\ud83e\\udd56',\n 'balance_scale':'\\u2696\\ufe0f',\n 'balloon':'\\ud83c\\udf88',\n 'ballot_box':'\\ud83d\\uddf3',\n 'ballot_box_with_check':'\\u2611\\ufe0f',\n 'bamboo':'\\ud83c\\udf8d',\n 'banana':'\\ud83c\\udf4c',\n 'bangbang':'\\u203c\\ufe0f',\n 'bank':'\\ud83c\\udfe6',\n 'bar_chart':'\\ud83d\\udcca',\n 'barber':'\\ud83d\\udc88',\n 'baseball':'\\u26be\\ufe0f',\n 'basketball':'\\ud83c\\udfc0',\n 'basketball_man':'\\u26f9\\ufe0f',\n 'basketball_woman':'\\u26f9\\ufe0f‍\\u2640\\ufe0f',\n 'bat':'\\ud83e\\udd87',\n 'bath':'\\ud83d\\udec0',\n 'bathtub':'\\ud83d\\udec1',\n 'battery':'\\ud83d\\udd0b',\n 'beach_umbrella':'\\ud83c\\udfd6',\n 'bear':'\\ud83d\\udc3b',\n 'bed':'\\ud83d\\udecf',\n 'bee':'\\ud83d\\udc1d',\n 'beer':'\\ud83c\\udf7a',\n 'beers':'\\ud83c\\udf7b',\n 'beetle':'\\ud83d\\udc1e',\n 'beginner':'\\ud83d\\udd30',\n 'bell':'\\ud83d\\udd14',\n 'bellhop_bell':'\\ud83d\\udece',\n 'bento':'\\ud83c\\udf71',\n 'biking_man':'\\ud83d\\udeb4',\n 'bike':'\\ud83d\\udeb2',\n 'biking_woman':'\\ud83d\\udeb4‍\\u2640\\ufe0f',\n 'bikini':'\\ud83d\\udc59',\n 'biohazard':'\\u2623\\ufe0f',\n 'bird':'\\ud83d\\udc26',\n 'birthday':'\\ud83c\\udf82',\n 'black_circle':'\\u26ab\\ufe0f',\n 'black_flag':'\\ud83c\\udff4',\n 'black_heart':'\\ud83d\\udda4',\n 'black_joker':'\\ud83c\\udccf',\n 'black_large_square':'\\u2b1b\\ufe0f',\n 'black_medium_small_square':'\\u25fe\\ufe0f',\n 'black_medium_square':'\\u25fc\\ufe0f',\n 'black_nib':'\\u2712\\ufe0f',\n 'black_small_square':'\\u25aa\\ufe0f',\n 'black_square_button':'\\ud83d\\udd32',\n 'blonde_man':'\\ud83d\\udc71',\n 'blonde_woman':'\\ud83d\\udc71‍\\u2640\\ufe0f',\n 'blossom':'\\ud83c\\udf3c',\n 'blowfish':'\\ud83d\\udc21',\n 'blue_book':'\\ud83d\\udcd8',\n 'blue_car':'\\ud83d\\ude99',\n 'blue_heart':'\\ud83d\\udc99',\n 'blush':'\\ud83d\\ude0a',\n 'boar':'\\ud83d\\udc17',\n 'boat':'\\u26f5\\ufe0f',\n 'bomb':'\\ud83d\\udca3',\n 'book':'\\ud83d\\udcd6',\n 'bookmark':'\\ud83d\\udd16',\n 'bookmark_tabs':'\\ud83d\\udcd1',\n 'books':'\\ud83d\\udcda',\n 'boom':'\\ud83d\\udca5',\n 'boot':'\\ud83d\\udc62',\n 'bouquet':'\\ud83d\\udc90',\n 'bowing_man':'\\ud83d\\ude47',\n 'bow_and_arrow':'\\ud83c\\udff9',\n 'bowing_woman':'\\ud83d\\ude47‍\\u2640\\ufe0f',\n 'bowling':'\\ud83c\\udfb3',\n 'boxing_glove':'\\ud83e\\udd4a',\n 'boy':'\\ud83d\\udc66',\n 'bread':'\\ud83c\\udf5e',\n 'bride_with_veil':'\\ud83d\\udc70',\n 'bridge_at_night':'\\ud83c\\udf09',\n 'briefcase':'\\ud83d\\udcbc',\n 'broken_heart':'\\ud83d\\udc94',\n 'bug':'\\ud83d\\udc1b',\n 'building_construction':'\\ud83c\\udfd7',\n 'bulb':'\\ud83d\\udca1',\n 'bullettrain_front':'\\ud83d\\ude85',\n 'bullettrain_side':'\\ud83d\\ude84',\n 'burrito':'\\ud83c\\udf2f',\n 'bus':'\\ud83d\\ude8c',\n 'business_suit_levitating':'\\ud83d\\udd74',\n 'busstop':'\\ud83d\\ude8f',\n 'bust_in_silhouette':'\\ud83d\\udc64',\n 'busts_in_silhouette':'\\ud83d\\udc65',\n 'butterfly':'\\ud83e\\udd8b',\n 'cactus':'\\ud83c\\udf35',\n 'cake':'\\ud83c\\udf70',\n 'calendar':'\\ud83d\\udcc6',\n 'call_me_hand':'\\ud83e\\udd19',\n 'calling':'\\ud83d\\udcf2',\n 'camel':'\\ud83d\\udc2b',\n 'camera':'\\ud83d\\udcf7',\n 'camera_flash':'\\ud83d\\udcf8',\n 'camping':'\\ud83c\\udfd5',\n 'cancer':'\\u264b\\ufe0f',\n 'candle':'\\ud83d\\udd6f',\n 'candy':'\\ud83c\\udf6c',\n 'canoe':'\\ud83d\\udef6',\n 'capital_abcd':'\\ud83d\\udd20',\n 'capricorn':'\\u2651\\ufe0f',\n 'car':'\\ud83d\\ude97',\n 'card_file_box':'\\ud83d\\uddc3',\n 'card_index':'\\ud83d\\udcc7',\n 'card_index_dividers':'\\ud83d\\uddc2',\n 'carousel_horse':'\\ud83c\\udfa0',\n 'carrot':'\\ud83e\\udd55',\n 'cat':'\\ud83d\\udc31',\n 'cat2':'\\ud83d\\udc08',\n 'cd':'\\ud83d\\udcbf',\n 'chains':'\\u26d3',\n 'champagne':'\\ud83c\\udf7e',\n 'chart':'\\ud83d\\udcb9',\n 'chart_with_downwards_trend':'\\ud83d\\udcc9',\n 'chart_with_upwards_trend':'\\ud83d\\udcc8',\n 'checkered_flag':'\\ud83c\\udfc1',\n 'cheese':'\\ud83e\\uddc0',\n 'cherries':'\\ud83c\\udf52',\n 'cherry_blossom':'\\ud83c\\udf38',\n 'chestnut':'\\ud83c\\udf30',\n 'chicken':'\\ud83d\\udc14',\n 'children_crossing':'\\ud83d\\udeb8',\n 'chipmunk':'\\ud83d\\udc3f',\n 'chocolate_bar':'\\ud83c\\udf6b',\n 'christmas_tree':'\\ud83c\\udf84',\n 'church':'\\u26ea\\ufe0f',\n 'cinema':'\\ud83c\\udfa6',\n 'circus_tent':'\\ud83c\\udfaa',\n 'city_sunrise':'\\ud83c\\udf07',\n 'city_sunset':'\\ud83c\\udf06',\n 'cityscape':'\\ud83c\\udfd9',\n 'cl':'\\ud83c\\udd91',\n 'clamp':'\\ud83d\\udddc',\n 'clap':'\\ud83d\\udc4f',\n 'clapper':'\\ud83c\\udfac',\n 'classical_building':'\\ud83c\\udfdb',\n 'clinking_glasses':'\\ud83e\\udd42',\n 'clipboard':'\\ud83d\\udccb',\n 'clock1':'\\ud83d\\udd50',\n 'clock10':'\\ud83d\\udd59',\n 'clock1030':'\\ud83d\\udd65',\n 'clock11':'\\ud83d\\udd5a',\n 'clock1130':'\\ud83d\\udd66',\n 'clock12':'\\ud83d\\udd5b',\n 'clock1230':'\\ud83d\\udd67',\n 'clock130':'\\ud83d\\udd5c',\n 'clock2':'\\ud83d\\udd51',\n 'clock230':'\\ud83d\\udd5d',\n 'clock3':'\\ud83d\\udd52',\n 'clock330':'\\ud83d\\udd5e',\n 'clock4':'\\ud83d\\udd53',\n 'clock430':'\\ud83d\\udd5f',\n 'clock5':'\\ud83d\\udd54',\n 'clock530':'\\ud83d\\udd60',\n 'clock6':'\\ud83d\\udd55',\n 'clock630':'\\ud83d\\udd61',\n 'clock7':'\\ud83d\\udd56',\n 'clock730':'\\ud83d\\udd62',\n 'clock8':'\\ud83d\\udd57',\n 'clock830':'\\ud83d\\udd63',\n 'clock9':'\\ud83d\\udd58',\n 'clock930':'\\ud83d\\udd64',\n 'closed_book':'\\ud83d\\udcd5',\n 'closed_lock_with_key':'\\ud83d\\udd10',\n 'closed_umbrella':'\\ud83c\\udf02',\n 'cloud':'\\u2601\\ufe0f',\n 'cloud_with_lightning':'\\ud83c\\udf29',\n 'cloud_with_lightning_and_rain':'\\u26c8',\n 'cloud_with_rain':'\\ud83c\\udf27',\n 'cloud_with_snow':'\\ud83c\\udf28',\n 'clown_face':'\\ud83e\\udd21',\n 'clubs':'\\u2663\\ufe0f',\n 'cocktail':'\\ud83c\\udf78',\n 'coffee':'\\u2615\\ufe0f',\n 'coffin':'\\u26b0\\ufe0f',\n 'cold_sweat':'\\ud83d\\ude30',\n 'comet':'\\u2604\\ufe0f',\n 'computer':'\\ud83d\\udcbb',\n 'computer_mouse':'\\ud83d\\uddb1',\n 'confetti_ball':'\\ud83c\\udf8a',\n 'confounded':'\\ud83d\\ude16',\n 'confused':'\\ud83d\\ude15',\n 'congratulations':'\\u3297\\ufe0f',\n 'construction':'\\ud83d\\udea7',\n 'construction_worker_man':'\\ud83d\\udc77',\n 'construction_worker_woman':'\\ud83d\\udc77‍\\u2640\\ufe0f',\n 'control_knobs':'\\ud83c\\udf9b',\n 'convenience_store':'\\ud83c\\udfea',\n 'cookie':'\\ud83c\\udf6a',\n 'cool':'\\ud83c\\udd92',\n 'policeman':'\\ud83d\\udc6e',\n 'copyright':'\\u00a9\\ufe0f',\n 'corn':'\\ud83c\\udf3d',\n 'couch_and_lamp':'\\ud83d\\udecb',\n 'couple':'\\ud83d\\udc6b',\n 'couple_with_heart_woman_man':'\\ud83d\\udc91',\n 'couple_with_heart_man_man':'\\ud83d\\udc68‍\\u2764\\ufe0f‍\\ud83d\\udc68',\n 'couple_with_heart_woman_woman':'\\ud83d\\udc69‍\\u2764\\ufe0f‍\\ud83d\\udc69',\n 'couplekiss_man_man':'\\ud83d\\udc68‍\\u2764\\ufe0f‍\\ud83d\\udc8b‍\\ud83d\\udc68',\n 'couplekiss_man_woman':'\\ud83d\\udc8f',\n 'couplekiss_woman_woman':'\\ud83d\\udc69‍\\u2764\\ufe0f‍\\ud83d\\udc8b‍\\ud83d\\udc69',\n 'cow':'\\ud83d\\udc2e',\n 'cow2':'\\ud83d\\udc04',\n 'cowboy_hat_face':'\\ud83e\\udd20',\n 'crab':'\\ud83e\\udd80',\n 'crayon':'\\ud83d\\udd8d',\n 'credit_card':'\\ud83d\\udcb3',\n 'crescent_moon':'\\ud83c\\udf19',\n 'cricket':'\\ud83c\\udfcf',\n 'crocodile':'\\ud83d\\udc0a',\n 'croissant':'\\ud83e\\udd50',\n 'crossed_fingers':'\\ud83e\\udd1e',\n 'crossed_flags':'\\ud83c\\udf8c',\n 'crossed_swords':'\\u2694\\ufe0f',\n 'crown':'\\ud83d\\udc51',\n 'cry':'\\ud83d\\ude22',\n 'crying_cat_face':'\\ud83d\\ude3f',\n 'crystal_ball':'\\ud83d\\udd2e',\n 'cucumber':'\\ud83e\\udd52',\n 'cupid':'\\ud83d\\udc98',\n 'curly_loop':'\\u27b0',\n 'currency_exchange':'\\ud83d\\udcb1',\n 'curry':'\\ud83c\\udf5b',\n 'custard':'\\ud83c\\udf6e',\n 'customs':'\\ud83d\\udec3',\n 'cyclone':'\\ud83c\\udf00',\n 'dagger':'\\ud83d\\udde1',\n 'dancer':'\\ud83d\\udc83',\n 'dancing_women':'\\ud83d\\udc6f',\n 'dancing_men':'\\ud83d\\udc6f‍\\u2642\\ufe0f',\n 'dango':'\\ud83c\\udf61',\n 'dark_sunglasses':'\\ud83d\\udd76',\n 'dart':'\\ud83c\\udfaf',\n 'dash':'\\ud83d\\udca8',\n 'date':'\\ud83d\\udcc5',\n 'deciduous_tree':'\\ud83c\\udf33',\n 'deer':'\\ud83e\\udd8c',\n 'department_store':'\\ud83c\\udfec',\n 'derelict_house':'\\ud83c\\udfda',\n 'desert':'\\ud83c\\udfdc',\n 'desert_island':'\\ud83c\\udfdd',\n 'desktop_computer':'\\ud83d\\udda5',\n 'male_detective':'\\ud83d\\udd75\\ufe0f',\n 'diamond_shape_with_a_dot_inside':'\\ud83d\\udca0',\n 'diamonds':'\\u2666\\ufe0f',\n 'disappointed':'\\ud83d\\ude1e',\n 'disappointed_relieved':'\\ud83d\\ude25',\n 'dizzy':'\\ud83d\\udcab',\n 'dizzy_face':'\\ud83d\\ude35',\n 'do_not_litter':'\\ud83d\\udeaf',\n 'dog':'\\ud83d\\udc36',\n 'dog2':'\\ud83d\\udc15',\n 'dollar':'\\ud83d\\udcb5',\n 'dolls':'\\ud83c\\udf8e',\n 'dolphin':'\\ud83d\\udc2c',\n 'door':'\\ud83d\\udeaa',\n 'doughnut':'\\ud83c\\udf69',\n 'dove':'\\ud83d\\udd4a',\n 'dragon':'\\ud83d\\udc09',\n 'dragon_face':'\\ud83d\\udc32',\n 'dress':'\\ud83d\\udc57',\n 'dromedary_camel':'\\ud83d\\udc2a',\n 'drooling_face':'\\ud83e\\udd24',\n 'droplet':'\\ud83d\\udca7',\n 'drum':'\\ud83e\\udd41',\n 'duck':'\\ud83e\\udd86',\n 'dvd':'\\ud83d\\udcc0',\n 'e-mail':'\\ud83d\\udce7',\n 'eagle':'\\ud83e\\udd85',\n 'ear':'\\ud83d\\udc42',\n 'ear_of_rice':'\\ud83c\\udf3e',\n 'earth_africa':'\\ud83c\\udf0d',\n 'earth_americas':'\\ud83c\\udf0e',\n 'earth_asia':'\\ud83c\\udf0f',\n 'egg':'\\ud83e\\udd5a',\n 'eggplant':'\\ud83c\\udf46',\n 'eight_pointed_black_star':'\\u2734\\ufe0f',\n 'eight_spoked_asterisk':'\\u2733\\ufe0f',\n 'electric_plug':'\\ud83d\\udd0c',\n 'elephant':'\\ud83d\\udc18',\n 'email':'\\u2709\\ufe0f',\n 'end':'\\ud83d\\udd1a',\n 'envelope_with_arrow':'\\ud83d\\udce9',\n 'euro':'\\ud83d\\udcb6',\n 'european_castle':'\\ud83c\\udff0',\n 'european_post_office':'\\ud83c\\udfe4',\n 'evergreen_tree':'\\ud83c\\udf32',\n 'exclamation':'\\u2757\\ufe0f',\n 'expressionless':'\\ud83d\\ude11',\n 'eye':'\\ud83d\\udc41',\n 'eye_speech_bubble':'\\ud83d\\udc41‍\\ud83d\\udde8',\n 'eyeglasses':'\\ud83d\\udc53',\n 'eyes':'\\ud83d\\udc40',\n 'face_with_head_bandage':'\\ud83e\\udd15',\n 'face_with_thermometer':'\\ud83e\\udd12',\n 'fist_oncoming':'\\ud83d\\udc4a',\n 'factory':'\\ud83c\\udfed',\n 'fallen_leaf':'\\ud83c\\udf42',\n 'family_man_woman_boy':'\\ud83d\\udc6a',\n 'family_man_boy':'\\ud83d\\udc68‍\\ud83d\\udc66',\n 'family_man_boy_boy':'\\ud83d\\udc68‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_man_girl':'\\ud83d\\udc68‍\\ud83d\\udc67',\n 'family_man_girl_boy':'\\ud83d\\udc68‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_man_girl_girl':'\\ud83d\\udc68‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'family_man_man_boy':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc66',\n 'family_man_man_boy_boy':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_man_man_girl':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc67',\n 'family_man_man_girl_boy':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_man_man_girl_girl':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'family_man_woman_boy_boy':'\\ud83d\\udc68‍\\ud83d\\udc69‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_man_woman_girl':'\\ud83d\\udc68‍\\ud83d\\udc69‍\\ud83d\\udc67',\n 'family_man_woman_girl_boy':'\\ud83d\\udc68‍\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_man_woman_girl_girl':'\\ud83d\\udc68‍\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'family_woman_boy':'\\ud83d\\udc69‍\\ud83d\\udc66',\n 'family_woman_boy_boy':'\\ud83d\\udc69‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_woman_girl':'\\ud83d\\udc69‍\\ud83d\\udc67',\n 'family_woman_girl_boy':'\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_woman_girl_girl':'\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'family_woman_woman_boy':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc66',\n 'family_woman_woman_boy_boy':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_woman_woman_girl':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc67',\n 'family_woman_woman_girl_boy':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_woman_woman_girl_girl':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'fast_forward':'\\u23e9',\n 'fax':'\\ud83d\\udce0',\n 'fearful':'\\ud83d\\ude28',\n 'feet':'\\ud83d\\udc3e',\n 'female_detective':'\\ud83d\\udd75\\ufe0f‍\\u2640\\ufe0f',\n 'ferris_wheel':'\\ud83c\\udfa1',\n 'ferry':'\\u26f4',\n 'field_hockey':'\\ud83c\\udfd1',\n 'file_cabinet':'\\ud83d\\uddc4',\n 'file_folder':'\\ud83d\\udcc1',\n 'film_projector':'\\ud83d\\udcfd',\n 'film_strip':'\\ud83c\\udf9e',\n 'fire':'\\ud83d\\udd25',\n 'fire_engine':'\\ud83d\\ude92',\n 'fireworks':'\\ud83c\\udf86',\n 'first_quarter_moon':'\\ud83c\\udf13',\n 'first_quarter_moon_with_face':'\\ud83c\\udf1b',\n 'fish':'\\ud83d\\udc1f',\n 'fish_cake':'\\ud83c\\udf65',\n 'fishing_pole_and_fish':'\\ud83c\\udfa3',\n 'fist_raised':'\\u270a',\n 'fist_left':'\\ud83e\\udd1b',\n 'fist_right':'\\ud83e\\udd1c',\n 'flags':'\\ud83c\\udf8f',\n 'flashlight':'\\ud83d\\udd26',\n 'fleur_de_lis':'\\u269c\\ufe0f',\n 'flight_arrival':'\\ud83d\\udeec',\n 'flight_departure':'\\ud83d\\udeeb',\n 'floppy_disk':'\\ud83d\\udcbe',\n 'flower_playing_cards':'\\ud83c\\udfb4',\n 'flushed':'\\ud83d\\ude33',\n 'fog':'\\ud83c\\udf2b',\n 'foggy':'\\ud83c\\udf01',\n 'football':'\\ud83c\\udfc8',\n 'footprints':'\\ud83d\\udc63',\n 'fork_and_knife':'\\ud83c\\udf74',\n 'fountain':'\\u26f2\\ufe0f',\n 'fountain_pen':'\\ud83d\\udd8b',\n 'four_leaf_clover':'\\ud83c\\udf40',\n 'fox_face':'\\ud83e\\udd8a',\n 'framed_picture':'\\ud83d\\uddbc',\n 'free':'\\ud83c\\udd93',\n 'fried_egg':'\\ud83c\\udf73',\n 'fried_shrimp':'\\ud83c\\udf64',\n 'fries':'\\ud83c\\udf5f',\n 'frog':'\\ud83d\\udc38',\n 'frowning':'\\ud83d\\ude26',\n 'frowning_face':'\\u2639\\ufe0f',\n 'frowning_man':'\\ud83d\\ude4d‍\\u2642\\ufe0f',\n 'frowning_woman':'\\ud83d\\ude4d',\n 'middle_finger':'\\ud83d\\udd95',\n 'fuelpump':'\\u26fd\\ufe0f',\n 'full_moon':'\\ud83c\\udf15',\n 'full_moon_with_face':'\\ud83c\\udf1d',\n 'funeral_urn':'\\u26b1\\ufe0f',\n 'game_die':'\\ud83c\\udfb2',\n 'gear':'\\u2699\\ufe0f',\n 'gem':'\\ud83d\\udc8e',\n 'gemini':'\\u264a\\ufe0f',\n 'ghost':'\\ud83d\\udc7b',\n 'gift':'\\ud83c\\udf81',\n 'gift_heart':'\\ud83d\\udc9d',\n 'girl':'\\ud83d\\udc67',\n 'globe_with_meridians':'\\ud83c\\udf10',\n 'goal_net':'\\ud83e\\udd45',\n 'goat':'\\ud83d\\udc10',\n 'golf':'\\u26f3\\ufe0f',\n 'golfing_man':'\\ud83c\\udfcc\\ufe0f',\n 'golfing_woman':'\\ud83c\\udfcc\\ufe0f‍\\u2640\\ufe0f',\n 'gorilla':'\\ud83e\\udd8d',\n 'grapes':'\\ud83c\\udf47',\n 'green_apple':'\\ud83c\\udf4f',\n 'green_book':'\\ud83d\\udcd7',\n 'green_heart':'\\ud83d\\udc9a',\n 'green_salad':'\\ud83e\\udd57',\n 'grey_exclamation':'\\u2755',\n 'grey_question':'\\u2754',\n 'grimacing':'\\ud83d\\ude2c',\n 'grin':'\\ud83d\\ude01',\n 'grinning':'\\ud83d\\ude00',\n 'guardsman':'\\ud83d\\udc82',\n 'guardswoman':'\\ud83d\\udc82‍\\u2640\\ufe0f',\n 'guitar':'\\ud83c\\udfb8',\n 'gun':'\\ud83d\\udd2b',\n 'haircut_woman':'\\ud83d\\udc87',\n 'haircut_man':'\\ud83d\\udc87‍\\u2642\\ufe0f',\n 'hamburger':'\\ud83c\\udf54',\n 'hammer':'\\ud83d\\udd28',\n 'hammer_and_pick':'\\u2692',\n 'hammer_and_wrench':'\\ud83d\\udee0',\n 'hamster':'\\ud83d\\udc39',\n 'hand':'\\u270b',\n 'handbag':'\\ud83d\\udc5c',\n 'handshake':'\\ud83e\\udd1d',\n 'hankey':'\\ud83d\\udca9',\n 'hatched_chick':'\\ud83d\\udc25',\n 'hatching_chick':'\\ud83d\\udc23',\n 'headphones':'\\ud83c\\udfa7',\n 'hear_no_evil':'\\ud83d\\ude49',\n 'heart':'\\u2764\\ufe0f',\n 'heart_decoration':'\\ud83d\\udc9f',\n 'heart_eyes':'\\ud83d\\ude0d',\n 'heart_eyes_cat':'\\ud83d\\ude3b',\n 'heartbeat':'\\ud83d\\udc93',\n 'heartpulse':'\\ud83d\\udc97',\n 'hearts':'\\u2665\\ufe0f',\n 'heavy_check_mark':'\\u2714\\ufe0f',\n 'heavy_division_sign':'\\u2797',\n 'heavy_dollar_sign':'\\ud83d\\udcb2',\n 'heavy_heart_exclamation':'\\u2763\\ufe0f',\n 'heavy_minus_sign':'\\u2796',\n 'heavy_multiplication_x':'\\u2716\\ufe0f',\n 'heavy_plus_sign':'\\u2795',\n 'helicopter':'\\ud83d\\ude81',\n 'herb':'\\ud83c\\udf3f',\n 'hibiscus':'\\ud83c\\udf3a',\n 'high_brightness':'\\ud83d\\udd06',\n 'high_heel':'\\ud83d\\udc60',\n 'hocho':'\\ud83d\\udd2a',\n 'hole':'\\ud83d\\udd73',\n 'honey_pot':'\\ud83c\\udf6f',\n 'horse':'\\ud83d\\udc34',\n 'horse_racing':'\\ud83c\\udfc7',\n 'hospital':'\\ud83c\\udfe5',\n 'hot_pepper':'\\ud83c\\udf36',\n 'hotdog':'\\ud83c\\udf2d',\n 'hotel':'\\ud83c\\udfe8',\n 'hotsprings':'\\u2668\\ufe0f',\n 'hourglass':'\\u231b\\ufe0f',\n 'hourglass_flowing_sand':'\\u23f3',\n 'house':'\\ud83c\\udfe0',\n 'house_with_garden':'\\ud83c\\udfe1',\n 'houses':'\\ud83c\\udfd8',\n 'hugs':'\\ud83e\\udd17',\n 'hushed':'\\ud83d\\ude2f',\n 'ice_cream':'\\ud83c\\udf68',\n 'ice_hockey':'\\ud83c\\udfd2',\n 'ice_skate':'\\u26f8',\n 'icecream':'\\ud83c\\udf66',\n 'id':'\\ud83c\\udd94',\n 'ideograph_advantage':'\\ud83c\\ude50',\n 'imp':'\\ud83d\\udc7f',\n 'inbox_tray':'\\ud83d\\udce5',\n 'incoming_envelope':'\\ud83d\\udce8',\n 'tipping_hand_woman':'\\ud83d\\udc81',\n 'information_source':'\\u2139\\ufe0f',\n 'innocent':'\\ud83d\\ude07',\n 'interrobang':'\\u2049\\ufe0f',\n 'iphone':'\\ud83d\\udcf1',\n 'izakaya_lantern':'\\ud83c\\udfee',\n 'jack_o_lantern':'\\ud83c\\udf83',\n 'japan':'\\ud83d\\uddfe',\n 'japanese_castle':'\\ud83c\\udfef',\n 'japanese_goblin':'\\ud83d\\udc7a',\n 'japanese_ogre':'\\ud83d\\udc79',\n 'jeans':'\\ud83d\\udc56',\n 'joy':'\\ud83d\\ude02',\n 'joy_cat':'\\ud83d\\ude39',\n 'joystick':'\\ud83d\\udd79',\n 'kaaba':'\\ud83d\\udd4b',\n 'key':'\\ud83d\\udd11',\n 'keyboard':'\\u2328\\ufe0f',\n 'keycap_ten':'\\ud83d\\udd1f',\n 'kick_scooter':'\\ud83d\\udef4',\n 'kimono':'\\ud83d\\udc58',\n 'kiss':'\\ud83d\\udc8b',\n 'kissing':'\\ud83d\\ude17',\n 'kissing_cat':'\\ud83d\\ude3d',\n 'kissing_closed_eyes':'\\ud83d\\ude1a',\n 'kissing_heart':'\\ud83d\\ude18',\n 'kissing_smiling_eyes':'\\ud83d\\ude19',\n 'kiwi_fruit':'\\ud83e\\udd5d',\n 'koala':'\\ud83d\\udc28',\n 'koko':'\\ud83c\\ude01',\n 'label':'\\ud83c\\udff7',\n 'large_blue_circle':'\\ud83d\\udd35',\n 'large_blue_diamond':'\\ud83d\\udd37',\n 'large_orange_diamond':'\\ud83d\\udd36',\n 'last_quarter_moon':'\\ud83c\\udf17',\n 'last_quarter_moon_with_face':'\\ud83c\\udf1c',\n 'latin_cross':'\\u271d\\ufe0f',\n 'laughing':'\\ud83d\\ude06',\n 'leaves':'\\ud83c\\udf43',\n 'ledger':'\\ud83d\\udcd2',\n 'left_luggage':'\\ud83d\\udec5',\n 'left_right_arrow':'\\u2194\\ufe0f',\n 'leftwards_arrow_with_hook':'\\u21a9\\ufe0f',\n 'lemon':'\\ud83c\\udf4b',\n 'leo':'\\u264c\\ufe0f',\n 'leopard':'\\ud83d\\udc06',\n 'level_slider':'\\ud83c\\udf9a',\n 'libra':'\\u264e\\ufe0f',\n 'light_rail':'\\ud83d\\ude88',\n 'link':'\\ud83d\\udd17',\n 'lion':'\\ud83e\\udd81',\n 'lips':'\\ud83d\\udc44',\n 'lipstick':'\\ud83d\\udc84',\n 'lizard':'\\ud83e\\udd8e',\n 'lock':'\\ud83d\\udd12',\n 'lock_with_ink_pen':'\\ud83d\\udd0f',\n 'lollipop':'\\ud83c\\udf6d',\n 'loop':'\\u27bf',\n 'loud_sound':'\\ud83d\\udd0a',\n 'loudspeaker':'\\ud83d\\udce2',\n 'love_hotel':'\\ud83c\\udfe9',\n 'love_letter':'\\ud83d\\udc8c',\n 'low_brightness':'\\ud83d\\udd05',\n 'lying_face':'\\ud83e\\udd25',\n 'm':'\\u24c2\\ufe0f',\n 'mag':'\\ud83d\\udd0d',\n 'mag_right':'\\ud83d\\udd0e',\n 'mahjong':'\\ud83c\\udc04\\ufe0f',\n 'mailbox':'\\ud83d\\udceb',\n 'mailbox_closed':'\\ud83d\\udcea',\n 'mailbox_with_mail':'\\ud83d\\udcec',\n 'mailbox_with_no_mail':'\\ud83d\\udced',\n 'man':'\\ud83d\\udc68',\n 'man_artist':'\\ud83d\\udc68‍\\ud83c\\udfa8',\n 'man_astronaut':'\\ud83d\\udc68‍\\ud83d\\ude80',\n 'man_cartwheeling':'\\ud83e\\udd38‍\\u2642\\ufe0f',\n 'man_cook':'\\ud83d\\udc68‍\\ud83c\\udf73',\n 'man_dancing':'\\ud83d\\udd7a',\n 'man_facepalming':'\\ud83e\\udd26‍\\u2642\\ufe0f',\n 'man_factory_worker':'\\ud83d\\udc68‍\\ud83c\\udfed',\n 'man_farmer':'\\ud83d\\udc68‍\\ud83c\\udf3e',\n 'man_firefighter':'\\ud83d\\udc68‍\\ud83d\\ude92',\n 'man_health_worker':'\\ud83d\\udc68‍\\u2695\\ufe0f',\n 'man_in_tuxedo':'\\ud83e\\udd35',\n 'man_judge':'\\ud83d\\udc68‍\\u2696\\ufe0f',\n 'man_juggling':'\\ud83e\\udd39‍\\u2642\\ufe0f',\n 'man_mechanic':'\\ud83d\\udc68‍\\ud83d\\udd27',\n 'man_office_worker':'\\ud83d\\udc68‍\\ud83d\\udcbc',\n 'man_pilot':'\\ud83d\\udc68‍\\u2708\\ufe0f',\n 'man_playing_handball':'\\ud83e\\udd3e‍\\u2642\\ufe0f',\n 'man_playing_water_polo':'\\ud83e\\udd3d‍\\u2642\\ufe0f',\n 'man_scientist':'\\ud83d\\udc68‍\\ud83d\\udd2c',\n 'man_shrugging':'\\ud83e\\udd37‍\\u2642\\ufe0f',\n 'man_singer':'\\ud83d\\udc68‍\\ud83c\\udfa4',\n 'man_student':'\\ud83d\\udc68‍\\ud83c\\udf93',\n 'man_teacher':'\\ud83d\\udc68‍\\ud83c\\udfeb',\n 'man_technologist':'\\ud83d\\udc68‍\\ud83d\\udcbb',\n 'man_with_gua_pi_mao':'\\ud83d\\udc72',\n 'man_with_turban':'\\ud83d\\udc73',\n 'tangerine':'\\ud83c\\udf4a',\n 'mans_shoe':'\\ud83d\\udc5e',\n 'mantelpiece_clock':'\\ud83d\\udd70',\n 'maple_leaf':'\\ud83c\\udf41',\n 'martial_arts_uniform':'\\ud83e\\udd4b',\n 'mask':'\\ud83d\\ude37',\n 'massage_woman':'\\ud83d\\udc86',\n 'massage_man':'\\ud83d\\udc86‍\\u2642\\ufe0f',\n 'meat_on_bone':'\\ud83c\\udf56',\n 'medal_military':'\\ud83c\\udf96',\n 'medal_sports':'\\ud83c\\udfc5',\n 'mega':'\\ud83d\\udce3',\n 'melon':'\\ud83c\\udf48',\n 'memo':'\\ud83d\\udcdd',\n 'men_wrestling':'\\ud83e\\udd3c‍\\u2642\\ufe0f',\n 'menorah':'\\ud83d\\udd4e',\n 'mens':'\\ud83d\\udeb9',\n 'metal':'\\ud83e\\udd18',\n 'metro':'\\ud83d\\ude87',\n 'microphone':'\\ud83c\\udfa4',\n 'microscope':'\\ud83d\\udd2c',\n 'milk_glass':'\\ud83e\\udd5b',\n 'milky_way':'\\ud83c\\udf0c',\n 'minibus':'\\ud83d\\ude90',\n 'minidisc':'\\ud83d\\udcbd',\n 'mobile_phone_off':'\\ud83d\\udcf4',\n 'money_mouth_face':'\\ud83e\\udd11',\n 'money_with_wings':'\\ud83d\\udcb8',\n 'moneybag':'\\ud83d\\udcb0',\n 'monkey':'\\ud83d\\udc12',\n 'monkey_face':'\\ud83d\\udc35',\n 'monorail':'\\ud83d\\ude9d',\n 'moon':'\\ud83c\\udf14',\n 'mortar_board':'\\ud83c\\udf93',\n 'mosque':'\\ud83d\\udd4c',\n 'motor_boat':'\\ud83d\\udee5',\n 'motor_scooter':'\\ud83d\\udef5',\n 'motorcycle':'\\ud83c\\udfcd',\n 'motorway':'\\ud83d\\udee3',\n 'mount_fuji':'\\ud83d\\uddfb',\n 'mountain':'\\u26f0',\n 'mountain_biking_man':'\\ud83d\\udeb5',\n 'mountain_biking_woman':'\\ud83d\\udeb5‍\\u2640\\ufe0f',\n 'mountain_cableway':'\\ud83d\\udea0',\n 'mountain_railway':'\\ud83d\\ude9e',\n 'mountain_snow':'\\ud83c\\udfd4',\n 'mouse':'\\ud83d\\udc2d',\n 'mouse2':'\\ud83d\\udc01',\n 'movie_camera':'\\ud83c\\udfa5',\n 'moyai':'\\ud83d\\uddff',\n 'mrs_claus':'\\ud83e\\udd36',\n 'muscle':'\\ud83d\\udcaa',\n 'mushroom':'\\ud83c\\udf44',\n 'musical_keyboard':'\\ud83c\\udfb9',\n 'musical_note':'\\ud83c\\udfb5',\n 'musical_score':'\\ud83c\\udfbc',\n 'mute':'\\ud83d\\udd07',\n 'nail_care':'\\ud83d\\udc85',\n 'name_badge':'\\ud83d\\udcdb',\n 'national_park':'\\ud83c\\udfde',\n 'nauseated_face':'\\ud83e\\udd22',\n 'necktie':'\\ud83d\\udc54',\n 'negative_squared_cross_mark':'\\u274e',\n 'nerd_face':'\\ud83e\\udd13',\n 'neutral_face':'\\ud83d\\ude10',\n 'new':'\\ud83c\\udd95',\n 'new_moon':'\\ud83c\\udf11',\n 'new_moon_with_face':'\\ud83c\\udf1a',\n 'newspaper':'\\ud83d\\udcf0',\n 'newspaper_roll':'\\ud83d\\uddde',\n 'next_track_button':'\\u23ed',\n 'ng':'\\ud83c\\udd96',\n 'no_good_man':'\\ud83d\\ude45‍\\u2642\\ufe0f',\n 'no_good_woman':'\\ud83d\\ude45',\n 'night_with_stars':'\\ud83c\\udf03',\n 'no_bell':'\\ud83d\\udd15',\n 'no_bicycles':'\\ud83d\\udeb3',\n 'no_entry':'\\u26d4\\ufe0f',\n 'no_entry_sign':'\\ud83d\\udeab',\n 'no_mobile_phones':'\\ud83d\\udcf5',\n 'no_mouth':'\\ud83d\\ude36',\n 'no_pedestrians':'\\ud83d\\udeb7',\n 'no_smoking':'\\ud83d\\udead',\n 'non-potable_water':'\\ud83d\\udeb1',\n 'nose':'\\ud83d\\udc43',\n 'notebook':'\\ud83d\\udcd3',\n 'notebook_with_decorative_cover':'\\ud83d\\udcd4',\n 'notes':'\\ud83c\\udfb6',\n 'nut_and_bolt':'\\ud83d\\udd29',\n 'o':'\\u2b55\\ufe0f',\n 'o2':'\\ud83c\\udd7e\\ufe0f',\n 'ocean':'\\ud83c\\udf0a',\n 'octopus':'\\ud83d\\udc19',\n 'oden':'\\ud83c\\udf62',\n 'office':'\\ud83c\\udfe2',\n 'oil_drum':'\\ud83d\\udee2',\n 'ok':'\\ud83c\\udd97',\n 'ok_hand':'\\ud83d\\udc4c',\n 'ok_man':'\\ud83d\\ude46‍\\u2642\\ufe0f',\n 'ok_woman':'\\ud83d\\ude46',\n 'old_key':'\\ud83d\\udddd',\n 'older_man':'\\ud83d\\udc74',\n 'older_woman':'\\ud83d\\udc75',\n 'om':'\\ud83d\\udd49',\n 'on':'\\ud83d\\udd1b',\n 'oncoming_automobile':'\\ud83d\\ude98',\n 'oncoming_bus':'\\ud83d\\ude8d',\n 'oncoming_police_car':'\\ud83d\\ude94',\n 'oncoming_taxi':'\\ud83d\\ude96',\n 'open_file_folder':'\\ud83d\\udcc2',\n 'open_hands':'\\ud83d\\udc50',\n 'open_mouth':'\\ud83d\\ude2e',\n 'open_umbrella':'\\u2602\\ufe0f',\n 'ophiuchus':'\\u26ce',\n 'orange_book':'\\ud83d\\udcd9',\n 'orthodox_cross':'\\u2626\\ufe0f',\n 'outbox_tray':'\\ud83d\\udce4',\n 'owl':'\\ud83e\\udd89',\n 'ox':'\\ud83d\\udc02',\n 'package':'\\ud83d\\udce6',\n 'page_facing_up':'\\ud83d\\udcc4',\n 'page_with_curl':'\\ud83d\\udcc3',\n 'pager':'\\ud83d\\udcdf',\n 'paintbrush':'\\ud83d\\udd8c',\n 'palm_tree':'\\ud83c\\udf34',\n 'pancakes':'\\ud83e\\udd5e',\n 'panda_face':'\\ud83d\\udc3c',\n 'paperclip':'\\ud83d\\udcce',\n 'paperclips':'\\ud83d\\udd87',\n 'parasol_on_ground':'\\u26f1',\n 'parking':'\\ud83c\\udd7f\\ufe0f',\n 'part_alternation_mark':'\\u303d\\ufe0f',\n 'partly_sunny':'\\u26c5\\ufe0f',\n 'passenger_ship':'\\ud83d\\udef3',\n 'passport_control':'\\ud83d\\udec2',\n 'pause_button':'\\u23f8',\n 'peace_symbol':'\\u262e\\ufe0f',\n 'peach':'\\ud83c\\udf51',\n 'peanuts':'\\ud83e\\udd5c',\n 'pear':'\\ud83c\\udf50',\n 'pen':'\\ud83d\\udd8a',\n 'pencil2':'\\u270f\\ufe0f',\n 'penguin':'\\ud83d\\udc27',\n 'pensive':'\\ud83d\\ude14',\n 'performing_arts':'\\ud83c\\udfad',\n 'persevere':'\\ud83d\\ude23',\n 'person_fencing':'\\ud83e\\udd3a',\n 'pouting_woman':'\\ud83d\\ude4e',\n 'phone':'\\u260e\\ufe0f',\n 'pick':'\\u26cf',\n 'pig':'\\ud83d\\udc37',\n 'pig2':'\\ud83d\\udc16',\n 'pig_nose':'\\ud83d\\udc3d',\n 'pill':'\\ud83d\\udc8a',\n 'pineapple':'\\ud83c\\udf4d',\n 'ping_pong':'\\ud83c\\udfd3',\n 'pisces':'\\u2653\\ufe0f',\n 'pizza':'\\ud83c\\udf55',\n 'place_of_worship':'\\ud83d\\uded0',\n 'plate_with_cutlery':'\\ud83c\\udf7d',\n 'play_or_pause_button':'\\u23ef',\n 'point_down':'\\ud83d\\udc47',\n 'point_left':'\\ud83d\\udc48',\n 'point_right':'\\ud83d\\udc49',\n 'point_up':'\\u261d\\ufe0f',\n 'point_up_2':'\\ud83d\\udc46',\n 'police_car':'\\ud83d\\ude93',\n 'policewoman':'\\ud83d\\udc6e‍\\u2640\\ufe0f',\n 'poodle':'\\ud83d\\udc29',\n 'popcorn':'\\ud83c\\udf7f',\n 'post_office':'\\ud83c\\udfe3',\n 'postal_horn':'\\ud83d\\udcef',\n 'postbox':'\\ud83d\\udcee',\n 'potable_water':'\\ud83d\\udeb0',\n 'potato':'\\ud83e\\udd54',\n 'pouch':'\\ud83d\\udc5d',\n 'poultry_leg':'\\ud83c\\udf57',\n 'pound':'\\ud83d\\udcb7',\n 'rage':'\\ud83d\\ude21',\n 'pouting_cat':'\\ud83d\\ude3e',\n 'pouting_man':'\\ud83d\\ude4e‍\\u2642\\ufe0f',\n 'pray':'\\ud83d\\ude4f',\n 'prayer_beads':'\\ud83d\\udcff',\n 'pregnant_woman':'\\ud83e\\udd30',\n 'previous_track_button':'\\u23ee',\n 'prince':'\\ud83e\\udd34',\n 'princess':'\\ud83d\\udc78',\n 'printer':'\\ud83d\\udda8',\n 'purple_heart':'\\ud83d\\udc9c',\n 'purse':'\\ud83d\\udc5b',\n 'pushpin':'\\ud83d\\udccc',\n 'put_litter_in_its_place':'\\ud83d\\udeae',\n 'question':'\\u2753',\n 'rabbit':'\\ud83d\\udc30',\n 'rabbit2':'\\ud83d\\udc07',\n 'racehorse':'\\ud83d\\udc0e',\n 'racing_car':'\\ud83c\\udfce',\n 'radio':'\\ud83d\\udcfb',\n 'radio_button':'\\ud83d\\udd18',\n 'radioactive':'\\u2622\\ufe0f',\n 'railway_car':'\\ud83d\\ude83',\n 'railway_track':'\\ud83d\\udee4',\n 'rainbow':'\\ud83c\\udf08',\n 'rainbow_flag':'\\ud83c\\udff3\\ufe0f‍\\ud83c\\udf08',\n 'raised_back_of_hand':'\\ud83e\\udd1a',\n 'raised_hand_with_fingers_splayed':'\\ud83d\\udd90',\n 'raised_hands':'\\ud83d\\ude4c',\n 'raising_hand_woman':'\\ud83d\\ude4b',\n 'raising_hand_man':'\\ud83d\\ude4b‍\\u2642\\ufe0f',\n 'ram':'\\ud83d\\udc0f',\n 'ramen':'\\ud83c\\udf5c',\n 'rat':'\\ud83d\\udc00',\n 'record_button':'\\u23fa',\n 'recycle':'\\u267b\\ufe0f',\n 'red_circle':'\\ud83d\\udd34',\n 'registered':'\\u00ae\\ufe0f',\n 'relaxed':'\\u263a\\ufe0f',\n 'relieved':'\\ud83d\\ude0c',\n 'reminder_ribbon':'\\ud83c\\udf97',\n 'repeat':'\\ud83d\\udd01',\n 'repeat_one':'\\ud83d\\udd02',\n 'rescue_worker_helmet':'\\u26d1',\n 'restroom':'\\ud83d\\udebb',\n 'revolving_hearts':'\\ud83d\\udc9e',\n 'rewind':'\\u23ea',\n 'rhinoceros':'\\ud83e\\udd8f',\n 'ribbon':'\\ud83c\\udf80',\n 'rice':'\\ud83c\\udf5a',\n 'rice_ball':'\\ud83c\\udf59',\n 'rice_cracker':'\\ud83c\\udf58',\n 'rice_scene':'\\ud83c\\udf91',\n 'right_anger_bubble':'\\ud83d\\uddef',\n 'ring':'\\ud83d\\udc8d',\n 'robot':'\\ud83e\\udd16',\n 'rocket':'\\ud83d\\ude80',\n 'rofl':'\\ud83e\\udd23',\n 'roll_eyes':'\\ud83d\\ude44',\n 'roller_coaster':'\\ud83c\\udfa2',\n 'rooster':'\\ud83d\\udc13',\n 'rose':'\\ud83c\\udf39',\n 'rosette':'\\ud83c\\udff5',\n 'rotating_light':'\\ud83d\\udea8',\n 'round_pushpin':'\\ud83d\\udccd',\n 'rowing_man':'\\ud83d\\udea3',\n 'rowing_woman':'\\ud83d\\udea3‍\\u2640\\ufe0f',\n 'rugby_football':'\\ud83c\\udfc9',\n 'running_man':'\\ud83c\\udfc3',\n 'running_shirt_with_sash':'\\ud83c\\udfbd',\n 'running_woman':'\\ud83c\\udfc3‍\\u2640\\ufe0f',\n 'sa':'\\ud83c\\ude02\\ufe0f',\n 'sagittarius':'\\u2650\\ufe0f',\n 'sake':'\\ud83c\\udf76',\n 'sandal':'\\ud83d\\udc61',\n 'santa':'\\ud83c\\udf85',\n 'satellite':'\\ud83d\\udce1',\n 'saxophone':'\\ud83c\\udfb7',\n 'school':'\\ud83c\\udfeb',\n 'school_satchel':'\\ud83c\\udf92',\n 'scissors':'\\u2702\\ufe0f',\n 'scorpion':'\\ud83e\\udd82',\n 'scorpius':'\\u264f\\ufe0f',\n 'scream':'\\ud83d\\ude31',\n 'scream_cat':'\\ud83d\\ude40',\n 'scroll':'\\ud83d\\udcdc',\n 'seat':'\\ud83d\\udcba',\n 'secret':'\\u3299\\ufe0f',\n 'see_no_evil':'\\ud83d\\ude48',\n 'seedling':'\\ud83c\\udf31',\n 'selfie':'\\ud83e\\udd33',\n 'shallow_pan_of_food':'\\ud83e\\udd58',\n 'shamrock':'\\u2618\\ufe0f',\n 'shark':'\\ud83e\\udd88',\n 'shaved_ice':'\\ud83c\\udf67',\n 'sheep':'\\ud83d\\udc11',\n 'shell':'\\ud83d\\udc1a',\n 'shield':'\\ud83d\\udee1',\n 'shinto_shrine':'\\u26e9',\n 'ship':'\\ud83d\\udea2',\n 'shirt':'\\ud83d\\udc55',\n 'shopping':'\\ud83d\\udecd',\n 'shopping_cart':'\\ud83d\\uded2',\n 'shower':'\\ud83d\\udebf',\n 'shrimp':'\\ud83e\\udd90',\n 'signal_strength':'\\ud83d\\udcf6',\n 'six_pointed_star':'\\ud83d\\udd2f',\n 'ski':'\\ud83c\\udfbf',\n 'skier':'\\u26f7',\n 'skull':'\\ud83d\\udc80',\n 'skull_and_crossbones':'\\u2620\\ufe0f',\n 'sleeping':'\\ud83d\\ude34',\n 'sleeping_bed':'\\ud83d\\udecc',\n 'sleepy':'\\ud83d\\ude2a',\n 'slightly_frowning_face':'\\ud83d\\ude41',\n 'slightly_smiling_face':'\\ud83d\\ude42',\n 'slot_machine':'\\ud83c\\udfb0',\n 'small_airplane':'\\ud83d\\udee9',\n 'small_blue_diamond':'\\ud83d\\udd39',\n 'small_orange_diamond':'\\ud83d\\udd38',\n 'small_red_triangle':'\\ud83d\\udd3a',\n 'small_red_triangle_down':'\\ud83d\\udd3b',\n 'smile':'\\ud83d\\ude04',\n 'smile_cat':'\\ud83d\\ude38',\n 'smiley':'\\ud83d\\ude03',\n 'smiley_cat':'\\ud83d\\ude3a',\n 'smiling_imp':'\\ud83d\\ude08',\n 'smirk':'\\ud83d\\ude0f',\n 'smirk_cat':'\\ud83d\\ude3c',\n 'smoking':'\\ud83d\\udeac',\n 'snail':'\\ud83d\\udc0c',\n 'snake':'\\ud83d\\udc0d',\n 'sneezing_face':'\\ud83e\\udd27',\n 'snowboarder':'\\ud83c\\udfc2',\n 'snowflake':'\\u2744\\ufe0f',\n 'snowman':'\\u26c4\\ufe0f',\n 'snowman_with_snow':'\\u2603\\ufe0f',\n 'sob':'\\ud83d\\ude2d',\n 'soccer':'\\u26bd\\ufe0f',\n 'soon':'\\ud83d\\udd1c',\n 'sos':'\\ud83c\\udd98',\n 'sound':'\\ud83d\\udd09',\n 'space_invader':'\\ud83d\\udc7e',\n 'spades':'\\u2660\\ufe0f',\n 'spaghetti':'\\ud83c\\udf5d',\n 'sparkle':'\\u2747\\ufe0f',\n 'sparkler':'\\ud83c\\udf87',\n 'sparkles':'\\u2728',\n 'sparkling_heart':'\\ud83d\\udc96',\n 'speak_no_evil':'\\ud83d\\ude4a',\n 'speaker':'\\ud83d\\udd08',\n 'speaking_head':'\\ud83d\\udde3',\n 'speech_balloon':'\\ud83d\\udcac',\n 'speedboat':'\\ud83d\\udea4',\n 'spider':'\\ud83d\\udd77',\n 'spider_web':'\\ud83d\\udd78',\n 'spiral_calendar':'\\ud83d\\uddd3',\n 'spiral_notepad':'\\ud83d\\uddd2',\n 'spoon':'\\ud83e\\udd44',\n 'squid':'\\ud83e\\udd91',\n 'stadium':'\\ud83c\\udfdf',\n 'star':'\\u2b50\\ufe0f',\n 'star2':'\\ud83c\\udf1f',\n 'star_and_crescent':'\\u262a\\ufe0f',\n 'star_of_david':'\\u2721\\ufe0f',\n 'stars':'\\ud83c\\udf20',\n 'station':'\\ud83d\\ude89',\n 'statue_of_liberty':'\\ud83d\\uddfd',\n 'steam_locomotive':'\\ud83d\\ude82',\n 'stew':'\\ud83c\\udf72',\n 'stop_button':'\\u23f9',\n 'stop_sign':'\\ud83d\\uded1',\n 'stopwatch':'\\u23f1',\n 'straight_ruler':'\\ud83d\\udccf',\n 'strawberry':'\\ud83c\\udf53',\n 'stuck_out_tongue':'\\ud83d\\ude1b',\n 'stuck_out_tongue_closed_eyes':'\\ud83d\\ude1d',\n 'stuck_out_tongue_winking_eye':'\\ud83d\\ude1c',\n 'studio_microphone':'\\ud83c\\udf99',\n 'stuffed_flatbread':'\\ud83e\\udd59',\n 'sun_behind_large_cloud':'\\ud83c\\udf25',\n 'sun_behind_rain_cloud':'\\ud83c\\udf26',\n 'sun_behind_small_cloud':'\\ud83c\\udf24',\n 'sun_with_face':'\\ud83c\\udf1e',\n 'sunflower':'\\ud83c\\udf3b',\n 'sunglasses':'\\ud83d\\ude0e',\n 'sunny':'\\u2600\\ufe0f',\n 'sunrise':'\\ud83c\\udf05',\n 'sunrise_over_mountains':'\\ud83c\\udf04',\n 'surfing_man':'\\ud83c\\udfc4',\n 'surfing_woman':'\\ud83c\\udfc4‍\\u2640\\ufe0f',\n 'sushi':'\\ud83c\\udf63',\n 'suspension_railway':'\\ud83d\\ude9f',\n 'sweat':'\\ud83d\\ude13',\n 'sweat_drops':'\\ud83d\\udca6',\n 'sweat_smile':'\\ud83d\\ude05',\n 'sweet_potato':'\\ud83c\\udf60',\n 'swimming_man':'\\ud83c\\udfca',\n 'swimming_woman':'\\ud83c\\udfca‍\\u2640\\ufe0f',\n 'symbols':'\\ud83d\\udd23',\n 'synagogue':'\\ud83d\\udd4d',\n 'syringe':'\\ud83d\\udc89',\n 'taco':'\\ud83c\\udf2e',\n 'tada':'\\ud83c\\udf89',\n 'tanabata_tree':'\\ud83c\\udf8b',\n 'taurus':'\\u2649\\ufe0f',\n 'taxi':'\\ud83d\\ude95',\n 'tea':'\\ud83c\\udf75',\n 'telephone_receiver':'\\ud83d\\udcde',\n 'telescope':'\\ud83d\\udd2d',\n 'tennis':'\\ud83c\\udfbe',\n 'tent':'\\u26fa\\ufe0f',\n 'thermometer':'\\ud83c\\udf21',\n 'thinking':'\\ud83e\\udd14',\n 'thought_balloon':'\\ud83d\\udcad',\n 'ticket':'\\ud83c\\udfab',\n 'tickets':'\\ud83c\\udf9f',\n 'tiger':'\\ud83d\\udc2f',\n 'tiger2':'\\ud83d\\udc05',\n 'timer_clock':'\\u23f2',\n 'tipping_hand_man':'\\ud83d\\udc81‍\\u2642\\ufe0f',\n 'tired_face':'\\ud83d\\ude2b',\n 'tm':'\\u2122\\ufe0f',\n 'toilet':'\\ud83d\\udebd',\n 'tokyo_tower':'\\ud83d\\uddfc',\n 'tomato':'\\ud83c\\udf45',\n 'tongue':'\\ud83d\\udc45',\n 'top':'\\ud83d\\udd1d',\n 'tophat':'\\ud83c\\udfa9',\n 'tornado':'\\ud83c\\udf2a',\n 'trackball':'\\ud83d\\uddb2',\n 'tractor':'\\ud83d\\ude9c',\n 'traffic_light':'\\ud83d\\udea5',\n 'train':'\\ud83d\\ude8b',\n 'train2':'\\ud83d\\ude86',\n 'tram':'\\ud83d\\ude8a',\n 'triangular_flag_on_post':'\\ud83d\\udea9',\n 'triangular_ruler':'\\ud83d\\udcd0',\n 'trident':'\\ud83d\\udd31',\n 'triumph':'\\ud83d\\ude24',\n 'trolleybus':'\\ud83d\\ude8e',\n 'trophy':'\\ud83c\\udfc6',\n 'tropical_drink':'\\ud83c\\udf79',\n 'tropical_fish':'\\ud83d\\udc20',\n 'truck':'\\ud83d\\ude9a',\n 'trumpet':'\\ud83c\\udfba',\n 'tulip':'\\ud83c\\udf37',\n 'tumbler_glass':'\\ud83e\\udd43',\n 'turkey':'\\ud83e\\udd83',\n 'turtle':'\\ud83d\\udc22',\n 'tv':'\\ud83d\\udcfa',\n 'twisted_rightwards_arrows':'\\ud83d\\udd00',\n 'two_hearts':'\\ud83d\\udc95',\n 'two_men_holding_hands':'\\ud83d\\udc6c',\n 'two_women_holding_hands':'\\ud83d\\udc6d',\n 'u5272':'\\ud83c\\ude39',\n 'u5408':'\\ud83c\\ude34',\n 'u55b6':'\\ud83c\\ude3a',\n 'u6307':'\\ud83c\\ude2f\\ufe0f',\n 'u6708':'\\ud83c\\ude37\\ufe0f',\n 'u6709':'\\ud83c\\ude36',\n 'u6e80':'\\ud83c\\ude35',\n 'u7121':'\\ud83c\\ude1a\\ufe0f',\n 'u7533':'\\ud83c\\ude38',\n 'u7981':'\\ud83c\\ude32',\n 'u7a7a':'\\ud83c\\ude33',\n 'umbrella':'\\u2614\\ufe0f',\n 'unamused':'\\ud83d\\ude12',\n 'underage':'\\ud83d\\udd1e',\n 'unicorn':'\\ud83e\\udd84',\n 'unlock':'\\ud83d\\udd13',\n 'up':'\\ud83c\\udd99',\n 'upside_down_face':'\\ud83d\\ude43',\n 'v':'\\u270c\\ufe0f',\n 'vertical_traffic_light':'\\ud83d\\udea6',\n 'vhs':'\\ud83d\\udcfc',\n 'vibration_mode':'\\ud83d\\udcf3',\n 'video_camera':'\\ud83d\\udcf9',\n 'video_game':'\\ud83c\\udfae',\n 'violin':'\\ud83c\\udfbb',\n 'virgo':'\\u264d\\ufe0f',\n 'volcano':'\\ud83c\\udf0b',\n 'volleyball':'\\ud83c\\udfd0',\n 'vs':'\\ud83c\\udd9a',\n 'vulcan_salute':'\\ud83d\\udd96',\n 'walking_man':'\\ud83d\\udeb6',\n 'walking_woman':'\\ud83d\\udeb6‍\\u2640\\ufe0f',\n 'waning_crescent_moon':'\\ud83c\\udf18',\n 'waning_gibbous_moon':'\\ud83c\\udf16',\n 'warning':'\\u26a0\\ufe0f',\n 'wastebasket':'\\ud83d\\uddd1',\n 'watch':'\\u231a\\ufe0f',\n 'water_buffalo':'\\ud83d\\udc03',\n 'watermelon':'\\ud83c\\udf49',\n 'wave':'\\ud83d\\udc4b',\n 'wavy_dash':'\\u3030\\ufe0f',\n 'waxing_crescent_moon':'\\ud83c\\udf12',\n 'wc':'\\ud83d\\udebe',\n 'weary':'\\ud83d\\ude29',\n 'wedding':'\\ud83d\\udc92',\n 'weight_lifting_man':'\\ud83c\\udfcb\\ufe0f',\n 'weight_lifting_woman':'\\ud83c\\udfcb\\ufe0f‍\\u2640\\ufe0f',\n 'whale':'\\ud83d\\udc33',\n 'whale2':'\\ud83d\\udc0b',\n 'wheel_of_dharma':'\\u2638\\ufe0f',\n 'wheelchair':'\\u267f\\ufe0f',\n 'white_check_mark':'\\u2705',\n 'white_circle':'\\u26aa\\ufe0f',\n 'white_flag':'\\ud83c\\udff3\\ufe0f',\n 'white_flower':'\\ud83d\\udcae',\n 'white_large_square':'\\u2b1c\\ufe0f',\n 'white_medium_small_square':'\\u25fd\\ufe0f',\n 'white_medium_square':'\\u25fb\\ufe0f',\n 'white_small_square':'\\u25ab\\ufe0f',\n 'white_square_button':'\\ud83d\\udd33',\n 'wilted_flower':'\\ud83e\\udd40',\n 'wind_chime':'\\ud83c\\udf90',\n 'wind_face':'\\ud83c\\udf2c',\n 'wine_glass':'\\ud83c\\udf77',\n 'wink':'\\ud83d\\ude09',\n 'wolf':'\\ud83d\\udc3a',\n 'woman':'\\ud83d\\udc69',\n 'woman_artist':'\\ud83d\\udc69‍\\ud83c\\udfa8',\n 'woman_astronaut':'\\ud83d\\udc69‍\\ud83d\\ude80',\n 'woman_cartwheeling':'\\ud83e\\udd38‍\\u2640\\ufe0f',\n 'woman_cook':'\\ud83d\\udc69‍\\ud83c\\udf73',\n 'woman_facepalming':'\\ud83e\\udd26‍\\u2640\\ufe0f',\n 'woman_factory_worker':'\\ud83d\\udc69‍\\ud83c\\udfed',\n 'woman_farmer':'\\ud83d\\udc69‍\\ud83c\\udf3e',\n 'woman_firefighter':'\\ud83d\\udc69‍\\ud83d\\ude92',\n 'woman_health_worker':'\\ud83d\\udc69‍\\u2695\\ufe0f',\n 'woman_judge':'\\ud83d\\udc69‍\\u2696\\ufe0f',\n 'woman_juggling':'\\ud83e\\udd39‍\\u2640\\ufe0f',\n 'woman_mechanic':'\\ud83d\\udc69‍\\ud83d\\udd27',\n 'woman_office_worker':'\\ud83d\\udc69‍\\ud83d\\udcbc',\n 'woman_pilot':'\\ud83d\\udc69‍\\u2708\\ufe0f',\n 'woman_playing_handball':'\\ud83e\\udd3e‍\\u2640\\ufe0f',\n 'woman_playing_water_polo':'\\ud83e\\udd3d‍\\u2640\\ufe0f',\n 'woman_scientist':'\\ud83d\\udc69‍\\ud83d\\udd2c',\n 'woman_shrugging':'\\ud83e\\udd37‍\\u2640\\ufe0f',\n 'woman_singer':'\\ud83d\\udc69‍\\ud83c\\udfa4',\n 'woman_student':'\\ud83d\\udc69‍\\ud83c\\udf93',\n 'woman_teacher':'\\ud83d\\udc69‍\\ud83c\\udfeb',\n 'woman_technologist':'\\ud83d\\udc69‍\\ud83d\\udcbb',\n 'woman_with_turban':'\\ud83d\\udc73‍\\u2640\\ufe0f',\n 'womans_clothes':'\\ud83d\\udc5a',\n 'womans_hat':'\\ud83d\\udc52',\n 'women_wrestling':'\\ud83e\\udd3c‍\\u2640\\ufe0f',\n 'womens':'\\ud83d\\udeba',\n 'world_map':'\\ud83d\\uddfa',\n 'worried':'\\ud83d\\ude1f',\n 'wrench':'\\ud83d\\udd27',\n 'writing_hand':'\\u270d\\ufe0f',\n 'x':'\\u274c',\n 'yellow_heart':'\\ud83d\\udc9b',\n 'yen':'\\ud83d\\udcb4',\n 'yin_yang':'\\u262f\\ufe0f',\n 'yum':'\\ud83d\\ude0b',\n 'zap':'\\u26a1\\ufe0f',\n 'zipper_mouth_face':'\\ud83e\\udd10',\n 'zzz':'\\ud83d\\udca4',\n\n /* special emojis :P */\n 'octocat': '\":octocat:\"',\n 'showdown': 'S'\n};\n", "/**\n * Created by Estevao on 31-05-2015.\n */\n\n/**\n * Showdown Converter class\n * @class\n * @param {object} [converterOptions]\n * @returns {Converter}\n */\nshowdown.Converter = function (converterOptions) {\n 'use strict';\n\n var\n /**\n * Options used by this converter\n * @private\n * @type {{}}\n */\n options = {},\n\n /**\n * Language extensions used by this converter\n * @private\n * @type {Array}\n */\n langExtensions = [],\n\n /**\n * Output modifiers extensions used by this converter\n * @private\n * @type {Array}\n */\n outputModifiers = [],\n\n /**\n * Event listeners\n * @private\n * @type {{}}\n */\n listeners = {},\n\n /**\n * The flavor set in this converter\n */\n setConvFlavor = setFlavor,\n\n /**\n * Metadata of the document\n * @type {{parsed: {}, raw: string, format: string}}\n */\n metadata = {\n parsed: {},\n raw: '',\n format: ''\n };\n\n _constructor();\n\n /**\n * Converter constructor\n * @private\n */\n function _constructor () {\n converterOptions = converterOptions || {};\n\n for (var gOpt in globalOptions) {\n if (globalOptions.hasOwnProperty(gOpt)) {\n options[gOpt] = globalOptions[gOpt];\n }\n }\n\n // Merge options\n if (typeof converterOptions === 'object') {\n for (var opt in converterOptions) {\n if (converterOptions.hasOwnProperty(opt)) {\n options[opt] = converterOptions[opt];\n }\n }\n } else {\n throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +\n ' was passed instead.');\n }\n\n if (options.extensions) {\n showdown.helper.forEach(options.extensions, _parseExtension);\n }\n }\n\n /**\n * Parse extension\n * @param {*} ext\n * @param {string} [name='']\n * @private\n */\n function _parseExtension (ext, name) {\n\n name = name || null;\n // If it's a string, the extension was previously loaded\n if (showdown.helper.isString(ext)) {\n ext = showdown.helper.stdExtName(ext);\n name = ext;\n\n // LEGACY_SUPPORT CODE\n if (showdown.extensions[ext]) {\n console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +\n 'Please inform the developer that the extension should be updated!');\n legacyExtensionLoading(showdown.extensions[ext], ext);\n return;\n // END LEGACY SUPPORT CODE\n\n } else if (!showdown.helper.isUndefined(extensions[ext])) {\n ext = extensions[ext];\n\n } else {\n throw Error('Extension \"' + ext + '\" could not be loaded. It was either not found or is not a valid extension.');\n }\n }\n\n if (typeof ext === 'function') {\n ext = ext();\n }\n\n if (!showdown.helper.isArray(ext)) {\n ext = [ext];\n }\n\n var validExt = validate(ext, name);\n if (!validExt.valid) {\n throw Error(validExt.error);\n }\n\n for (var i = 0; i < ext.length; ++i) {\n switch (ext[i].type) {\n\n case 'lang':\n langExtensions.push(ext[i]);\n break;\n\n case 'output':\n outputModifiers.push(ext[i]);\n break;\n }\n if (ext[i].hasOwnProperty('listeners')) {\n for (var ln in ext[i].listeners) {\n if (ext[i].listeners.hasOwnProperty(ln)) {\n listen(ln, ext[i].listeners[ln]);\n }\n }\n }\n }\n\n }\n\n /**\n * LEGACY_SUPPORT\n * @param {*} ext\n * @param {string} name\n */\n function legacyExtensionLoading (ext, name) {\n if (typeof ext === 'function') {\n ext = ext(new showdown.Converter());\n }\n if (!showdown.helper.isArray(ext)) {\n ext = [ext];\n }\n var valid = validate(ext, name);\n\n if (!valid.valid) {\n throw Error(valid.error);\n }\n\n for (var i = 0; i < ext.length; ++i) {\n switch (ext[i].type) {\n case 'lang':\n langExtensions.push(ext[i]);\n break;\n case 'output':\n outputModifiers.push(ext[i]);\n break;\n default:// should never reach here\n throw Error('Extension loader error: Type unrecognized!!!');\n }\n }\n }\n\n /**\n * Listen to an event\n * @param {string} name\n * @param {function} callback\n */\n function listen (name, callback) {\n if (!showdown.helper.isString(name)) {\n throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');\n }\n\n if (typeof callback !== 'function') {\n throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');\n }\n\n if (!listeners.hasOwnProperty(name)) {\n listeners[name] = [];\n }\n listeners[name].push(callback);\n }\n\n function rTrimInputText (text) {\n var rsp = text.match(/^\\s*/)[0].length,\n rgx = new RegExp('^\\\\s{0,' + rsp + '}', 'gm');\n return text.replace(rgx, '');\n }\n\n /**\n * Dispatch an event\n * @private\n * @param {string} evtName Event name\n * @param {string} text Text\n * @param {{}} options Converter Options\n * @param {{}} globals\n * @returns {string}\n */\n this._dispatch = function dispatch (evtName, text, options, globals) {\n if (listeners.hasOwnProperty(evtName)) {\n for (var ei = 0; ei < listeners[evtName].length; ++ei) {\n var nText = listeners[evtName][ei](evtName, text, this, options, globals);\n if (nText && typeof nText !== 'undefined') {\n text = nText;\n }\n }\n }\n return text;\n };\n\n /**\n * Listen to an event\n * @param {string} name\n * @param {function} callback\n * @returns {showdown.Converter}\n */\n this.listen = function (name, callback) {\n listen(name, callback);\n return this;\n };\n\n /**\n * Converts a markdown string into HTML\n * @param {string} text\n * @returns {*}\n */\n this.makeHtml = function (text) {\n //check if text is not falsy\n if (!text) {\n return text;\n }\n\n var globals = {\n gHtmlBlocks: [],\n gHtmlMdBlocks: [],\n gHtmlSpans: [],\n gUrls: {},\n gTitles: {},\n gDimensions: {},\n gListLevel: 0,\n hashLinkCounts: {},\n langExtensions: langExtensions,\n outputModifiers: outputModifiers,\n converter: this,\n ghCodeBlocks: [],\n metadata: {\n parsed: {},\n raw: '',\n format: ''\n }\n };\n\n // This lets us use ¨ trema as an escape char to avoid md5 hashes\n // The choice of character is arbitrary; anything that isn't\n // magic in Markdown will work.\n text = text.replace(/¨/g, '¨T');\n\n // Replace $ with ¨D\n // RegExp interprets $ as a special character\n // when it's in a replacement string\n text = text.replace(/\\$/g, '¨D');\n\n // Standardize line endings\n text = text.replace(/\\r\\n/g, '\\n'); // DOS to Unix\n text = text.replace(/\\r/g, '\\n'); // Mac to Unix\n\n // Stardardize line spaces\n text = text.replace(/\\u00A0/g, ' ');\n\n if (options.smartIndentationFix) {\n text = rTrimInputText(text);\n }\n\n // Make sure text begins and ends with a couple of newlines:\n text = '\\n\\n' + text + '\\n\\n';\n\n // detab\n text = showdown.subParser('detab')(text, options, globals);\n\n /**\n * Strip any lines consisting only of spaces and tabs.\n * This makes subsequent regexs easier to write, because we can\n * match consecutive blank lines with /\\n+/ instead of something\n * contorted like /[ \\t]*\\n+/\n */\n text = text.replace(/^[ \\t]+$/mg, '');\n\n //run languageExtensions\n showdown.helper.forEach(langExtensions, function (ext) {\n text = showdown.subParser('runExtension')(ext, text, options, globals);\n });\n\n // run the sub parsers\n text = showdown.subParser('metadata')(text, options, globals);\n text = showdown.subParser('hashPreCodeTags')(text, options, globals);\n text = showdown.subParser('githubCodeBlocks')(text, options, globals);\n text = showdown.subParser('hashHTMLBlocks')(text, options, globals);\n text = showdown.subParser('hashCodeTags')(text, options, globals);\n text = showdown.subParser('stripLinkDefinitions')(text, options, globals);\n text = showdown.subParser('blockGamut')(text, options, globals);\n text = showdown.subParser('unhashHTMLSpans')(text, options, globals);\n text = showdown.subParser('unescapeSpecialChars')(text, options, globals);\n\n // attacklab: Restore dollar signs\n text = text.replace(/¨D/g, '$$');\n\n // attacklab: Restore tremas\n text = text.replace(/¨T/g, '¨');\n\n // render a complete html document instead of a partial if the option is enabled\n text = showdown.subParser('completeHTMLDocument')(text, options, globals);\n\n // Run output modifiers\n showdown.helper.forEach(outputModifiers, function (ext) {\n text = showdown.subParser('runExtension')(ext, text, options, globals);\n });\n\n // update metadata\n metadata = globals.metadata;\n return text;\n };\n\n /**\n * Converts an HTML string into a markdown string\n * @param src\n * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used.\n * @returns {string}\n */\n this.makeMarkdown = this.makeMd = function (src, HTMLParser) {\n\n // replace \\r\\n with \\n\n src = src.replace(/\\r\\n/g, '\\n');\n src = src.replace(/\\r/g, '\\n'); // old macs\n\n // due to an edge case, we need to find this: > <\n // to prevent removing of non silent white spaces\n // ex: this is sparta\n src = src.replace(/>[ \\t]+¨NBSP;<');\n\n if (!HTMLParser) {\n if (window && window.document) {\n HTMLParser = window.document;\n } else {\n throw new Error('HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM');\n }\n }\n\n var doc = HTMLParser.createElement('div');\n doc.innerHTML = src;\n\n var globals = {\n preList: substitutePreCodeTags(doc)\n };\n\n // remove all newlines and collapse spaces\n clean(doc);\n\n // some stuff, like accidental reference links must now be escaped\n // TODO\n // doc.innerHTML = doc.innerHTML.replace(/\\[[\\S\\t ]]/);\n\n var nodes = doc.childNodes,\n mdDoc = '';\n\n for (var i = 0; i < nodes.length; i++) {\n mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals);\n }\n\n function clean (node) {\n for (var n = 0; n < node.childNodes.length; ++n) {\n var child = node.childNodes[n];\n if (child.nodeType === 3) {\n if (!/\\S/.test(child.nodeValue) && !/^[ ]+$/.test(child.nodeValue)) {\n node.removeChild(child);\n --n;\n } else {\n child.nodeValue = child.nodeValue.split('\\n').join(' ');\n child.nodeValue = child.nodeValue.replace(/(\\s)+/g, '$1');\n }\n } else if (child.nodeType === 1) {\n clean(child);\n }\n }\n }\n\n // find all pre tags and replace contents with placeholder\n // we need this so that we can remove all indentation from html\n // to ease up parsing\n function substitutePreCodeTags (doc) {\n\n var pres = doc.querySelectorAll('pre'),\n presPH = [];\n\n for (var i = 0; i < pres.length; ++i) {\n\n if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {\n var content = pres[i].firstChild.innerHTML.trim(),\n language = pres[i].firstChild.getAttribute('data-language') || '';\n\n // if data-language attribute is not defined, then we look for class language-*\n if (language === '') {\n var classes = pres[i].firstChild.className.split(' ');\n for (var c = 0; c < classes.length; ++c) {\n var matches = classes[c].match(/^language-(.+)$/);\n if (matches !== null) {\n language = matches[1];\n break;\n }\n }\n }\n\n // unescape html entities in content\n content = showdown.helper.unescapeHTMLEntities(content);\n\n presPH.push(content);\n pres[i].outerHTML = '';\n } else {\n presPH.push(pres[i].innerHTML);\n pres[i].innerHTML = '';\n pres[i].setAttribute('prenum', i.toString());\n }\n }\n return presPH;\n }\n\n return mdDoc;\n };\n\n /**\n * Set an option of this Converter instance\n * @param {string} key\n * @param {*} value\n */\n this.setOption = function (key, value) {\n options[key] = value;\n };\n\n /**\n * Get the option of this Converter instance\n * @param {string} key\n * @returns {*}\n */\n this.getOption = function (key) {\n return options[key];\n };\n\n /**\n * Get the options of this Converter instance\n * @returns {{}}\n */\n this.getOptions = function () {\n return options;\n };\n\n /**\n * Add extension to THIS converter\n * @param {{}} extension\n * @param {string} [name=null]\n */\n this.addExtension = function (extension, name) {\n name = name || null;\n _parseExtension(extension, name);\n };\n\n /**\n * Use a global registered extension with THIS converter\n * @param {string} extensionName Name of the previously registered extension\n */\n this.useExtension = function (extensionName) {\n _parseExtension(extensionName);\n };\n\n /**\n * Set the flavor THIS converter should use\n * @param {string} name\n */\n this.setFlavor = function (name) {\n if (!flavor.hasOwnProperty(name)) {\n throw Error(name + ' flavor was not found');\n }\n var preset = flavor[name];\n setConvFlavor = name;\n for (var option in preset) {\n if (preset.hasOwnProperty(option)) {\n options[option] = preset[option];\n }\n }\n };\n\n /**\n * Get the currently set flavor of this converter\n * @returns {string}\n */\n this.getFlavor = function () {\n return setConvFlavor;\n };\n\n /**\n * Remove an extension from THIS converter.\n * Note: This is a costly operation. It's better to initialize a new converter\n * and specify the extensions you wish to use\n * @param {Array} extension\n */\n this.removeExtension = function (extension) {\n if (!showdown.helper.isArray(extension)) {\n extension = [extension];\n }\n for (var a = 0; a < extension.length; ++a) {\n var ext = extension[a];\n for (var i = 0; i < langExtensions.length; ++i) {\n if (langExtensions[i] === ext) {\n langExtensions.splice(i, 1);\n }\n }\n for (var ii = 0; ii < outputModifiers.length; ++ii) {\n if (outputModifiers[ii] === ext) {\n outputModifiers.splice(ii, 1);\n }\n }\n }\n };\n\n /**\n * Get all extension of THIS converter\n * @returns {{language: Array, output: Array}}\n */\n this.getAllExtensions = function () {\n return {\n language: langExtensions,\n output: outputModifiers\n };\n };\n\n /**\n * Get the metadata of the previously parsed document\n * @param raw\n * @returns {string|{}}\n */\n this.getMetadata = function (raw) {\n if (raw) {\n return metadata.raw;\n } else {\n return metadata.parsed;\n }\n };\n\n /**\n * Get the metadata format of the previously parsed document\n * @returns {string}\n */\n this.getMetadataFormat = function () {\n return metadata.format;\n };\n\n /**\n * Private: set a single key, value metadata pair\n * @param {string} key\n * @param {string} value\n */\n this._setMetadataPair = function (key, value) {\n metadata.parsed[key] = value;\n };\n\n /**\n * Private: set metadata format\n * @param {string} format\n */\n this._setMetadataFormat = function (format) {\n metadata.format = format;\n };\n\n /**\n * Private: set metadata raw text\n * @param {string} raw\n */\n this._setMetadataRaw = function (raw) {\n metadata.raw = raw;\n };\n};\n", "/**\n * Turn Markdown link shortcuts into XHTML tags.\n */\nshowdown.subParser('anchors', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('anchors.before', text, options, globals);\n\n var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) {\n if (showdown.helper.isUndefined(title)) {\n title = '';\n }\n linkId = linkId.toLowerCase();\n\n // Special case for explicit empty url\n if (wholeMatch.search(/\\(? ?(['\"].*['\"])?\\)$/m) > -1) {\n url = '';\n } else if (!url) {\n if (!linkId) {\n // lower-case and turn embedded newlines into spaces\n linkId = linkText.toLowerCase().replace(/ ?\\n/g, ' ');\n }\n url = '#' + linkId;\n\n if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {\n url = globals.gUrls[linkId];\n if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {\n title = globals.gTitles[linkId];\n }\n } else {\n return wholeMatch;\n }\n }\n\n //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance\n url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);\n\n var result = '';\n\n return result;\n };\n\n // First, handle reference-style links: [link text] [id]\n text = text.replace(/\\[((?:\\[[^\\]]*]|[^\\[\\]])*)] ?(?:\\n *)?\\[(.*?)]()()()()/g, writeAnchorTag);\n\n // Next, inline-style links: [link text](url \"optional title\")\n // cases with crazy urls like ./image/cat1).png\n text = text.replace(/\\[((?:\\[[^\\]]*]|[^\\[\\]])*)]()[ \\t]*\\([ \\t]?<([^>]*)>(?:[ \\t]*(([\"'])([^\"]*?)\\5))?[ \\t]?\\)/g,\n writeAnchorTag);\n\n // normal cases\n text = text.replace(/\\[((?:\\[[^\\]]*]|[^\\[\\]])*)]()[ \\t]*\\([ \\t]??(?:[ \\t]*(([\"'])([^\"]*?)\\5))?[ \\t]?\\)/g,\n writeAnchorTag);\n\n // handle reference-style shortcuts: [link text]\n // These must come last in case you've also got [link test][1]\n // or [link test](/foo)\n text = text.replace(/\\[([^\\[\\]]+)]()()()()()/g, writeAnchorTag);\n\n // Lastly handle GithubMentions if option is enabled\n if (options.ghMentions) {\n text = text.replace(/(^|\\s)(\\\\)?(@([a-z\\d]+(?:[a-z\\d.-]+?[a-z\\d]+)*))/gmi, function (wm, st, escape, mentions, username) {\n if (escape === '\\\\') {\n return st + mentions;\n }\n\n //check if options.ghMentionsLink is a string\n if (!showdown.helper.isString(options.ghMentionsLink)) {\n throw new Error('ghMentionsLink option must be a string');\n }\n var lnk = options.ghMentionsLink.replace(/\\{u}/g, username),\n target = '';\n if (options.openLinksInNewWindow) {\n target = ' rel=\"noopener noreferrer\" target=\"¨E95Eblank\"';\n }\n return st + '' + mentions + '';\n });\n }\n\n text = globals.converter._dispatch('anchors.after', text, options, globals);\n return text;\n});\n", "// url allowed chars [a-z\\d_.~:/?#[]@!$&'()*+,;=-]\n\nvar simpleURLRegex = /([*~_]+|\\b)(((https?|ftp|dict):\\/\\/|www\\.)[^'\">\\s]+?\\.[^'\">\\s]+?)()(\\1)?(?=\\s|$)(?![\"<>])/gi,\n simpleURLRegex2 = /([*~_]+|\\b)(((https?|ftp|dict):\\/\\/|www\\.)[^'\">\\s]+\\.[^'\">\\s]+?)([.!?,()\\[\\]])?(\\1)?(?=\\s|$)(?![\"<>])/gi,\n delimUrlRegex = /()<(((https?|ftp|dict):\\/\\/|www\\.)[^'\">\\s]+)()>()/gi,\n simpleMailRegex = /(^|\\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)(?=$|\\s)/gmi,\n delimMailRegex = /<()(?:mailto:)?([-.\\w]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)>/gi,\n\n replaceLink = function (options) {\n 'use strict';\n return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {\n link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);\n var lnkTxt = link,\n append = '',\n target = '',\n lmc = leadingMagicChars || '',\n tmc = trailingMagicChars || '';\n if (/^www\\./i.test(link)) {\n link = link.replace(/^www\\./i, 'http://www.');\n }\n if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {\n append = trailingPunctuation;\n }\n if (options.openLinksInNewWindow) {\n target = ' rel=\"noopener noreferrer\" target=\"¨E95Eblank\"';\n }\n return lmc + '' + lnkTxt + '' + append + tmc;\n };\n },\n\n replaceMail = function (options, globals) {\n 'use strict';\n return function (wholeMatch, b, mail) {\n var href = 'mailto:';\n b = b || '';\n mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals);\n if (options.encodeEmails) {\n href = showdown.helper.encodeEmailAddress(href + mail);\n mail = showdown.helper.encodeEmailAddress(mail);\n } else {\n href = href + mail;\n }\n return b + '' + mail + '';\n };\n };\n\nshowdown.subParser('autoLinks', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('autoLinks.before', text, options, globals);\n\n text = text.replace(delimUrlRegex, replaceLink(options));\n text = text.replace(delimMailRegex, replaceMail(options, globals));\n\n text = globals.converter._dispatch('autoLinks.after', text, options, globals);\n\n return text;\n});\n\nshowdown.subParser('simplifiedAutoLinks', function (text, options, globals) {\n 'use strict';\n\n if (!options.simplifiedAutoLink) {\n return text;\n }\n\n text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals);\n\n if (options.excludeTrailingPunctuationFromURLs) {\n text = text.replace(simpleURLRegex2, replaceLink(options));\n } else {\n text = text.replace(simpleURLRegex, replaceLink(options));\n }\n text = text.replace(simpleMailRegex, replaceMail(options, globals));\n\n text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals);\n\n return text;\n});\n", "/**\n * These are all the transformations that form block-level\n * tags like paragraphs, headers, and list items.\n */\nshowdown.subParser('blockGamut', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('blockGamut.before', text, options, globals);\n\n // we parse blockquotes first so that we can have headings and hrs\n // inside blockquotes\n text = showdown.subParser('blockQuotes')(text, options, globals);\n text = showdown.subParser('headers')(text, options, globals);\n\n // Do Horizontal Rules:\n text = showdown.subParser('horizontalRule')(text, options, globals);\n\n text = showdown.subParser('lists')(text, options, globals);\n text = showdown.subParser('codeBlocks')(text, options, globals);\n text = showdown.subParser('tables')(text, options, globals);\n\n // We already ran _HashHTMLBlocks() before, in Markdown(), but that\n // was to escape raw HTML in the original Markdown source. This time,\n // we're escaping the markup we've just created, so that we don't wrap\n //

tags around block-level tags.\n text = showdown.subParser('hashHTMLBlocks')(text, options, globals);\n text = showdown.subParser('paragraphs')(text, options, globals);\n\n text = globals.converter._dispatch('blockGamut.after', text, options, globals);\n\n return text;\n});\n", "showdown.subParser('blockQuotes', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('blockQuotes.before', text, options, globals);\n\n // add a couple extra lines after the text and endtext mark\n text = text + '\\n\\n';\n\n var rgx = /(^ {0,3}>[ \\t]?.+\\n(.+\\n)*\\n*)+/gm;\n\n if (options.splitAdjacentBlockquotes) {\n rgx = /^ {0,3}>[\\s\\S]*?(?:\\n\\n)/gm;\n }\n\n text = text.replace(rgx, function (bq) {\n // attacklab: hack around Konqueror 3.5.4 bug:\n // \"----------bug\".replace(/^-/g,\"\") == \"bug\"\n bq = bq.replace(/^[ \\t]*>[ \\t]?/gm, ''); // trim one level of quoting\n\n // attacklab: clean up hack\n bq = bq.replace(/¨0/g, '');\n\n bq = bq.replace(/^[ \\t]+$/gm, ''); // trim whitespace-only lines\n bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);\n bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse\n\n bq = bq.replace(/(^|\\n)/g, '$1 ');\n // These leading spaces screw with

 content, so we need to fix that:\n    bq = bq.replace(/(\\s*
[^\\r]+?<\\/pre>)/gm, function (wholeMatch, m1) {\n      var pre = m1;\n      // attacklab: hack around Konqueror 3.5.4 bug:\n      pre = pre.replace(/^  /mg, '¨0');\n      pre = pre.replace(/¨0/g, '');\n      return pre;\n    });\n\n    return showdown.subParser('hashBlock')('
\\n' + bq + '\\n
', options, globals);\n });\n\n text = globals.converter._dispatch('blockQuotes.after', text, options, globals);\n return text;\n});\n", "/**\n * Process Markdown `
` blocks.\n */\nshowdown.subParser('codeBlocks', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('codeBlocks.before', text, options, globals);\n\n  // sentinel workarounds for lack of \\A and \\Z, safari\\khtml bug\n  text += '¨0';\n\n  var pattern = /(?:\\n\\n|^)((?:(?:[ ]{4}|\\t).*\\n+)+)(\\n*[ ]{0,3}[^ \\t\\n]|(?=¨0))/g;\n  text = text.replace(pattern, function (wholeMatch, m1, m2) {\n    var codeblock = m1,\n        nextChar = m2,\n        end = '\\n';\n\n    codeblock = showdown.subParser('outdent')(codeblock, options, globals);\n    codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);\n    codeblock = showdown.subParser('detab')(codeblock, options, globals);\n    codeblock = codeblock.replace(/^\\n+/g, ''); // trim leading newlines\n    codeblock = codeblock.replace(/\\n+$/g, ''); // trim trailing newlines\n\n    if (options.omitExtraWLInCodeBlocks) {\n      end = '';\n    }\n\n    codeblock = '
' + codeblock + end + '
';\n\n return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;\n });\n\n // strip sentinel\n text = text.replace(/¨0/, '');\n\n text = globals.converter._dispatch('codeBlocks.after', text, options, globals);\n return text;\n});\n", "/**\n *\n * * Backtick quotes are used for spans.\n *\n * * You can use multiple backticks as the delimiters if you want to\n * include literal backticks in the code span. So, this input:\n *\n * Just type ``foo `bar` baz`` at the prompt.\n *\n * Will translate to:\n *\n *

Just type foo `bar` baz at the prompt.

\n *\n * There's no arbitrary limit to the number of backticks you\n * can use as delimters. If you need three consecutive backticks\n * in your code, use four for delimiters, etc.\n *\n * * You can use spaces to get literal backticks at the edges:\n *\n * ... type `` `bar` `` ...\n *\n * Turns to:\n *\n * ... type `bar` ...\n */\nshowdown.subParser('codeSpans', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('codeSpans.before', text, options, globals);\n\n if (typeof (text) === 'undefined') {\n text = '';\n }\n text = text.replace(/(^|[^\\\\])(`+)([^\\r]*?[^`])\\2(?!`)/gm,\n function (wholeMatch, m1, m2, m3) {\n var c = m3;\n c = c.replace(/^([ \\t]*)/g, '');\t// leading whitespace\n c = c.replace(/[ \\t]*$/g, '');\t// trailing whitespace\n c = showdown.subParser('encodeCode')(c, options, globals);\n c = m1 + '' + c + '';\n c = showdown.subParser('hashHTMLSpans')(c, options, globals);\n return c;\n }\n );\n\n text = globals.converter._dispatch('codeSpans.after', text, options, globals);\n return text;\n});\n", "/**\n * Create a full HTML document from the processed markdown\n */\nshowdown.subParser('completeHTMLDocument', function (text, options, globals) {\n 'use strict';\n\n if (!options.completeHTMLDocument) {\n return text;\n }\n\n text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals);\n\n var doctype = 'html',\n doctypeParsed = '\\n',\n title = '',\n charset = '\\n',\n lang = '',\n metadata = '';\n\n if (typeof globals.metadata.parsed.doctype !== 'undefined') {\n doctypeParsed = '\\n';\n doctype = globals.metadata.parsed.doctype.toString().toLowerCase();\n if (doctype === 'html' || doctype === 'html5') {\n charset = '';\n }\n }\n\n for (var meta in globals.metadata.parsed) {\n if (globals.metadata.parsed.hasOwnProperty(meta)) {\n switch (meta.toLowerCase()) {\n case 'doctype':\n break;\n\n case 'title':\n title = '' + globals.metadata.parsed.title + '\\n';\n break;\n\n case 'charset':\n if (doctype === 'html' || doctype === 'html5') {\n charset = '\\n';\n } else {\n charset = '\\n';\n }\n break;\n\n case 'language':\n case 'lang':\n lang = ' lang=\"' + globals.metadata.parsed[meta] + '\"';\n metadata += '\\n';\n break;\n\n default:\n metadata += '\\n';\n }\n }\n }\n\n text = doctypeParsed + '\\n\\n' + title + charset + metadata + '\\n\\n' + text.trim() + '\\n\\n';\n\n text = globals.converter._dispatch('completeHTMLDocument.after', text, options, globals);\n return text;\n});\n", "/**\n * Convert all tabs to spaces\n */\nshowdown.subParser('detab', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('detab.before', text, options, globals);\n\n // expand first n-1 tabs\n text = text.replace(/\\t(?=\\t)/g, ' '); // g_tab_width\n\n // replace the nth with two sentinels\n text = text.replace(/\\t/g, '¨A¨B');\n\n // use the sentinel to anchor our regex so it doesn't explode\n text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) {\n var leadingText = m1,\n numSpaces = 4 - leadingText.length % 4; // g_tab_width\n\n // there *must* be a better way to do this:\n for (var i = 0; i < numSpaces; i++) {\n leadingText += ' ';\n }\n\n return leadingText;\n });\n\n // clean up sentinels\n text = text.replace(/¨A/g, ' '); // g_tab_width\n text = text.replace(/¨B/g, '');\n\n text = globals.converter._dispatch('detab.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('ellipsis', function (text, options, globals) {\n 'use strict';\n\n if (!options.ellipsis) {\n return text;\n }\n\n text = globals.converter._dispatch('ellipsis.before', text, options, globals);\n\n text = text.replace(/\\.\\.\\./g, '…');\n\n text = globals.converter._dispatch('ellipsis.after', text, options, globals);\n\n return text;\n});\n", "/**\n * Turn emoji codes into emojis\n *\n * List of supported emojis: https://github.com/showdownjs/showdown/wiki/Emojis\n */\nshowdown.subParser('emoji', function (text, options, globals) {\n 'use strict';\n\n if (!options.emoji) {\n return text;\n }\n\n text = globals.converter._dispatch('emoji.before', text, options, globals);\n\n var emojiRgx = /:([\\S]+?):/g;\n\n text = text.replace(emojiRgx, function (wm, emojiCode) {\n if (showdown.helper.emojis.hasOwnProperty(emojiCode)) {\n return showdown.helper.emojis[emojiCode];\n }\n return wm;\n });\n\n text = globals.converter._dispatch('emoji.after', text, options, globals);\n\n return text;\n});\n", "/**\n * Smart processing for ampersands and angle brackets that need to be encoded.\n */\nshowdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals);\n\n // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:\n // http://bumppo.net/projects/amputator/\n text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\\w+);)/g, '&');\n\n // Encode naked <'s\n text = text.replace(/<(?![a-z\\/?$!])/gi, '<');\n\n // Encode <\n text = text.replace(/\n text = text.replace(/>/g, '>');\n\n text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);\n return text;\n});\n", "/**\n * Returns the string, with after processing the following backslash escape sequences.\n *\n * attacklab: The polite way to do this is with the new escapeCharacters() function:\n *\n * text = escapeCharacters(text,\"\\\\\",true);\n * text = escapeCharacters(text,\"`*_{}[]()>#+-.!\",true);\n *\n * ...but we're sidestepping its use of the (slow) RegExp constructor\n * as an optimization for Firefox. This function gets called a LOT.\n */\nshowdown.subParser('encodeBackslashEscapes', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);\n\n text = text.replace(/\\\\(\\\\)/g, showdown.helper.escapeCharactersCallback);\n text = text.replace(/\\\\([`*_{}\\[\\]()>#+.!~=|:-])/g, showdown.helper.escapeCharactersCallback);\n\n text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);\n return text;\n});\n", "/**\n * Encode/escape certain characters inside Markdown code runs.\n * The point is that in code, these characters are literals,\n * and lose their special Markdown meanings.\n */\nshowdown.subParser('encodeCode', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('encodeCode.before', text, options, globals);\n\n // Encode all ampersands; HTML entities are not\n // entities within a Markdown code span.\n text = text\n .replace(/&/g, '&')\n // Do the angle bracket song and dance:\n .replace(//g, '>')\n // Now, escape characters that are magic in Markdown:\n .replace(/([*_{}\\[\\]\\\\=~-])/g, showdown.helper.escapeCharactersCallback);\n\n text = globals.converter._dispatch('encodeCode.after', text, options, globals);\n return text;\n});\n", "/**\n * Within tags -- meaning between < and > -- encode [\\ ` * _ ~ =] so they\n * don't conflict with their use in Markdown for code, italics and strong.\n */\nshowdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals);\n\n // Build a regex to find HTML tags.\n var tags = /<\\/?[a-z\\d_:-]+(?:[\\s]+[\\s\\S]+?)?>/gi,\n comments = /-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;\n\n text = text.replace(tags, function (wholeMatch) {\n return wholeMatch\n .replace(/(.)<\\/?code>(?=.)/g, '$1`')\n .replace(/([\\\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);\n });\n\n text = text.replace(comments, function (wholeMatch) {\n return wholeMatch\n .replace(/([\\\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);\n });\n\n text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);\n return text;\n});\n", "/**\n * Handle github codeblocks prior to running HashHTML so that\n * HTML contained within the codeblock gets escaped properly\n * Example:\n * ```ruby\n * def hello_world(x)\n * puts \"Hello, #{x}\"\n * end\n * ```\n */\nshowdown.subParser('githubCodeBlocks', function (text, options, globals) {\n 'use strict';\n\n // early exit if option is not enabled\n if (!options.ghCodeBlocks) {\n return text;\n }\n\n text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);\n\n text += '¨0';\n\n text = text.replace(/(?:^|\\n)(?: {0,3})(```+|~~~+)(?: *)([^\\s`~]*)\\n([\\s\\S]*?)\\n(?: {0,3})\\1/g, function (wholeMatch, delim, language, codeblock) {\n var end = (options.omitExtraWLInCodeBlocks) ? '' : '\\n';\n\n // First parse the github code block\n codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);\n codeblock = showdown.subParser('detab')(codeblock, options, globals);\n codeblock = codeblock.replace(/^\\n+/g, ''); // trim leading newlines\n codeblock = codeblock.replace(/\\n+$/g, ''); // trim trailing whitespace\n\n codeblock = '
' + codeblock + end + '
';\n\n codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);\n\n // Since GHCodeblocks can be false positives, we need to\n // store the primitive text and the parsed text in a global var,\n // and then return a token\n return '\\n\\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\\n\\n';\n });\n\n // attacklab: strip sentinel\n text = text.replace(/¨0/, '');\n\n return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);\n});\n", "showdown.subParser('hashBlock', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('hashBlock.before', text, options, globals);\n text = text.replace(/(^\\n+|\\n+$)/g, '');\n text = '\\n\\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\\n\\n';\n text = globals.converter._dispatch('hashBlock.after', text, options, globals);\n return text;\n});\n", "/**\n * Hash and escape elements that should not be parsed as markdown\n */\nshowdown.subParser('hashCodeTags', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('hashCodeTags.before', text, options, globals);\n\n var repFunc = function (wholeMatch, match, left, right) {\n var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;\n return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';\n };\n\n // Hash naked \n text = showdown.helper.replaceRecursiveRegExp(text, repFunc, ']*>', '', 'gim');\n\n text = globals.converter._dispatch('hashCodeTags.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('hashElement', function (text, options, globals) {\n 'use strict';\n\n return function (wholeMatch, m1) {\n var blockText = m1;\n\n // Undo double lines\n blockText = blockText.replace(/\\n\\n/g, '\\n');\n blockText = blockText.replace(/^\\n/, '');\n\n // strip trailing blank lines\n blockText = blockText.replace(/\\n+$/g, '');\n\n // Replace the element text with a marker (\"¨KxK\" where x is its key)\n blockText = '\\n\\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\\n\\n';\n\n return blockText;\n };\n});\n", "showdown.subParser('hashHTMLBlocks', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals);\n\n var blockTags = [\n 'pre',\n 'div',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'blockquote',\n 'table',\n 'dl',\n 'ol',\n 'ul',\n 'script',\n 'noscript',\n 'form',\n 'fieldset',\n 'iframe',\n 'math',\n 'style',\n 'section',\n 'header',\n 'footer',\n 'nav',\n 'article',\n 'aside',\n 'address',\n 'audio',\n 'canvas',\n 'figure',\n 'hgroup',\n 'output',\n 'video',\n 'p'\n ],\n repFunc = function (wholeMatch, match, left, right) {\n var txt = wholeMatch;\n // check if this html element is marked as markdown\n // if so, it's contents should be parsed as markdown\n if (left.search(/\\bmarkdown\\b/) !== -1) {\n txt = left + globals.converter.makeHtml(match) + right;\n }\n return '\\n\\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\\n\\n';\n };\n\n if (options.backslashEscapesHTMLTags) {\n // encode backslash escaped HTML tags\n text = text.replace(/\\\\<(\\/?[^>]+?)>/g, function (wm, inside) {\n return '<' + inside + '>';\n });\n }\n\n // hash HTML Blocks\n for (var i = 0; i < blockTags.length; ++i) {\n\n var opTagPos,\n rgx1 = new RegExp('^ {0,3}(<' + blockTags[i] + '\\\\b[^>]*>)', 'im'),\n patLeft = '<' + blockTags[i] + '\\\\b[^>]*>',\n patRight = '';\n // 1. Look for the first position of the first opening HTML tag in the text\n while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {\n\n // if the HTML tag is \\ escaped, we need to escape it and break\n\n\n //2. Split the text in that position\n var subTexts = showdown.helper.splitAtIndex(text, opTagPos),\n //3. Match recursively\n newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');\n\n // prevent an infinite loop\n if (newSubText1 === subTexts[1]) {\n break;\n }\n text = subTexts[0].concat(newSubText1);\n }\n }\n // HR SPECIAL CASE\n text = text.replace(/(\\n {0,3}(<(hr)\\b([^<>])*?\\/?>)[ \\t]*(?=\\n{2,}))/g,\n showdown.subParser('hashElement')(text, options, globals));\n\n // Special case for standalone HTML comments\n text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {\n return '\\n\\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\\n\\n';\n }, '^ {0,3}', 'gm');\n\n // PHP and ASP-style processor instructions ( and <%...%>)\n text = text.replace(/(?:\\n\\n)( {0,3}(?:<([?%])[^\\r]*?\\2>)[ \\t]*(?=\\n{2,}))/g,\n showdown.subParser('hashElement')(text, options, globals));\n\n text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals);\n return text;\n});\n", "/**\n * Hash span elements that should not be parsed as markdown\n */\nshowdown.subParser('hashHTMLSpans', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals);\n\n function hashHTMLSpan (html) {\n return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C';\n }\n\n // Hash Self Closing tags\n text = text.replace(/<[^>]+?\\/>/gi, function (wm) {\n return hashHTMLSpan(wm);\n });\n\n // Hash tags without properties\n text = text.replace(/<([^>]+?)>[\\s\\S]*?<\\/\\1>/g, function (wm) {\n return hashHTMLSpan(wm);\n });\n\n // Hash tags with properties\n text = text.replace(/<([^>]+?)\\s[^>]+?>[\\s\\S]*?<\\/\\1>/g, function (wm) {\n return hashHTMLSpan(wm);\n });\n\n // Hash self closing tags without />\n text = text.replace(/<[^>]+?>/gi, function (wm) {\n return hashHTMLSpan(wm);\n });\n\n /*showdown.helper.matchRecursiveRegExp(text, ']*>', '', 'gi');*/\n\n text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals);\n return text;\n});\n\n/**\n * Unhash HTML spans\n */\nshowdown.subParser('unhashHTMLSpans', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals);\n\n for (var i = 0; i < globals.gHtmlSpans.length; ++i) {\n var repText = globals.gHtmlSpans[i],\n // limiter to prevent infinite loop (assume 10 as limit for recurse)\n limit = 0;\n\n while (/¨C(\\d+)C/.test(repText)) {\n var num = RegExp.$1;\n repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);\n if (limit === 10) {\n console.error('maximum nesting of 10 spans reached!!!');\n break;\n }\n ++limit;\n }\n text = text.replace('¨C' + i + 'C', repText);\n }\n\n text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals);\n return text;\n});\n", "/**\n * Hash and escape
 elements that should not be parsed as markdown\n */\nshowdown.subParser('hashPreCodeTags', function (text, options, globals) {\n  'use strict';\n  text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals);\n\n  var repFunc = function (wholeMatch, match, left, right) {\n    // encode html entities\n    var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;\n    return '\\n\\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\\n\\n';\n  };\n\n  // Hash 
\n  text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}]*>\\\\s*]*>', '^ {0,3}\\\\s*
', 'gim');\n\n text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('headers', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('headers.before', text, options, globals);\n\n var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),\n\n // Set text-style headers:\n //\tHeader 1\n //\t========\n //\n //\tHeader 2\n //\t--------\n //\n setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \\t]*\\n={2,}[ \\t]*\\n+/gm : /^(.+)[ \\t]*\\n=+[ \\t]*\\n+/gm,\n setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \\t]*\\n-{2,}[ \\t]*\\n+/gm : /^(.+)[ \\t]*\\n-+[ \\t]*\\n+/gm;\n\n text = text.replace(setextRegexH1, function (wholeMatch, m1) {\n\n var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),\n hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m1) + '\"',\n hLevel = headerLevelStart,\n hashBlock = '' + spanGamut + '';\n return showdown.subParser('hashBlock')(hashBlock, options, globals);\n });\n\n text = text.replace(setextRegexH2, function (matchFound, m1) {\n var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),\n hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m1) + '\"',\n hLevel = headerLevelStart + 1,\n hashBlock = '' + spanGamut + '';\n return showdown.subParser('hashBlock')(hashBlock, options, globals);\n });\n\n // atx-style headers:\n // # Header 1\n // ## Header 2\n // ## Header 2 with closing hashes ##\n // ...\n // ###### Header 6\n //\n var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \\t]+(.+?)[ \\t]*#*\\n+/gm : /^(#{1,6})[ \\t]*(.+?)[ \\t]*#*\\n+/gm;\n\n text = text.replace(atxStyle, function (wholeMatch, m1, m2) {\n var hText = m2;\n if (options.customizedHeaderId) {\n hText = m2.replace(/\\s?\\{([^{]+?)}\\s*$/, '');\n }\n\n var span = showdown.subParser('spanGamut')(hText, options, globals),\n hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m2) + '\"',\n hLevel = headerLevelStart - 1 + m1.length,\n header = '' + span + '';\n\n return showdown.subParser('hashBlock')(header, options, globals);\n });\n\n function headerId (m) {\n var title,\n prefix;\n\n // It is separate from other options to allow combining prefix and customized\n if (options.customizedHeaderId) {\n var match = m.match(/\\{([^{]+?)}\\s*$/);\n if (match && match[1]) {\n m = match[1];\n }\n }\n\n title = m;\n\n // Prefix id to prevent causing inadvertent pre-existing style matches.\n if (showdown.helper.isString(options.prefixHeaderId)) {\n prefix = options.prefixHeaderId;\n } else if (options.prefixHeaderId === true) {\n prefix = 'section-';\n } else {\n prefix = '';\n }\n\n if (!options.rawPrefixHeaderId) {\n title = prefix + title;\n }\n\n if (options.ghCompatibleHeaderId) {\n title = title\n .replace(/ /g, '-')\n // replace previously escaped chars (&, ¨ and $)\n .replace(/&/g, '')\n .replace(/¨T/g, '')\n .replace(/¨D/g, '')\n // replace rest of the chars (&~$ are repeated as they might have been escaped)\n // borrowed from github's redcarpet (some they should produce similar results)\n .replace(/[&+$,\\/:;=?@\"#{}|^¨~\\[\\]`\\\\*)(%.!'<>]/g, '')\n .toLowerCase();\n } else if (options.rawHeaderId) {\n title = title\n .replace(/ /g, '-')\n // replace previously escaped chars (&, ¨ and $)\n .replace(/&/g, '&')\n .replace(/¨T/g, '¨')\n .replace(/¨D/g, '$')\n // replace \" and '\n .replace(/[\"']/g, '-')\n .toLowerCase();\n } else {\n title = title\n .replace(/[^\\w]/g, '')\n .toLowerCase();\n }\n\n if (options.rawPrefixHeaderId) {\n title = prefix + title;\n }\n\n if (globals.hashLinkCounts[title]) {\n title = title + '-' + (globals.hashLinkCounts[title]++);\n } else {\n globals.hashLinkCounts[title] = 1;\n }\n return title;\n }\n\n text = globals.converter._dispatch('headers.after', text, options, globals);\n return text;\n});\n", "/**\n * Turn Markdown link shortcuts into XHTML tags.\n */\nshowdown.subParser('horizontalRule', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('horizontalRule.before', text, options, globals);\n\n var key = showdown.subParser('hashBlock')('
', options, globals);\n text = text.replace(/^ {0,2}( ?-){3,}[ \\t]*$/gm, key);\n text = text.replace(/^ {0,2}( ?\\*){3,}[ \\t]*$/gm, key);\n text = text.replace(/^ {0,2}( ?_){3,}[ \\t]*$/gm, key);\n\n text = globals.converter._dispatch('horizontalRule.after', text, options, globals);\n return text;\n});\n", "/**\n * Turn Markdown image shortcuts into tags.\n */\nshowdown.subParser('images', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('images.before', text, options, globals);\n\n var inlineRegExp = /!\\[([^\\]]*?)][ \\t]*()\\([ \\t]??(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*(?:([\"'])([^\"]*?)\\6)?[ \\t]?\\)/g,\n crazyRegExp = /!\\[([^\\]]*?)][ \\t]*()\\([ \\t]?<([^>]*)>(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*(?:(?:([\"'])([^\"]*?)\\6))?[ \\t]?\\)/g,\n base64RegExp = /!\\[([^\\]]*?)][ \\t]*()\\([ \\t]??(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*(?:([\"'])([^\"]*?)\\6)?[ \\t]?\\)/g,\n referenceRegExp = /!\\[([^\\]]*?)] ?(?:\\n *)?\\[([\\s\\S]*?)]()()()()()/g,\n refShortcutRegExp = /!\\[([^\\[\\]]+)]()()()()()/g;\n\n function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {\n url = url.replace(/\\s/g, '');\n return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);\n }\n\n function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {\n\n var gUrls = globals.gUrls,\n gTitles = globals.gTitles,\n gDims = globals.gDimensions;\n\n linkId = linkId.toLowerCase();\n\n if (!title) {\n title = '';\n }\n // Special case for explicit empty url\n if (wholeMatch.search(/\\(? ?(['\"].*['\"])?\\)$/m) > -1) {\n url = '';\n\n } else if (url === '' || url === null) {\n if (linkId === '' || linkId === null) {\n // lower-case and turn embedded newlines into spaces\n linkId = altText.toLowerCase().replace(/ ?\\n/g, ' ');\n }\n url = '#' + linkId;\n\n if (!showdown.helper.isUndefined(gUrls[linkId])) {\n url = gUrls[linkId];\n if (!showdown.helper.isUndefined(gTitles[linkId])) {\n title = gTitles[linkId];\n }\n if (!showdown.helper.isUndefined(gDims[linkId])) {\n width = gDims[linkId].width;\n height = gDims[linkId].height;\n }\n } else {\n return wholeMatch;\n }\n }\n\n altText = altText\n .replace(/\"/g, '"')\n //altText = showdown.helper.escapeCharacters(altText, '*_', false);\n .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);\n //url = showdown.helper.escapeCharacters(url, '*_', false);\n url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);\n var result = '\"'x \"optional title\")\n\n // base64 encoded images\n text = text.replace(base64RegExp, writeImageTagBase64);\n\n // cases with crazy urls like ./image/cat1).png\n text = text.replace(crazyRegExp, writeImageTag);\n\n // normal cases\n text = text.replace(inlineRegExp, writeImageTag);\n\n // handle reference-style shortcuts: ![img text]\n text = text.replace(refShortcutRegExp, writeImageTag);\n\n text = globals.converter._dispatch('images.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('italicsAndBold', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);\n\n // it's faster to have 3 separate regexes for each case than have just one\n // because of backtracing, in some cases, it could lead to an exponential effect\n // called \"catastrophic backtrace\". Ominous!\n\n function parseInside (txt, left, right) {\n /*\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n */\n return left + txt + right;\n }\n\n // Parse underscores\n if (options.literalMidWordUnderscores) {\n text = text.replace(/\\b___(\\S[\\s\\S]*?)___\\b/g, function (wm, txt) {\n return parseInside (txt, '', '');\n });\n text = text.replace(/\\b__(\\S[\\s\\S]*?)__\\b/g, function (wm, txt) {\n return parseInside (txt, '', '');\n });\n text = text.replace(/\\b_(\\S[\\s\\S]*?)_\\b/g, function (wm, txt) {\n return parseInside (txt, '', '');\n });\n } else {\n text = text.replace(/___(\\S[\\s\\S]*?)___/g, function (wm, m) {\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n text = text.replace(/__(\\S[\\s\\S]*?)__/g, function (wm, m) {\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n text = text.replace(/_([^\\s_][\\s\\S]*?)_/g, function (wm, m) {\n // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it)\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n }\n\n // Now parse asterisks\n if (options.literalMidWordAsterisks) {\n text = text.replace(/([^*]|^)\\B\\*\\*\\*(\\S[\\s\\S]*?)\\*\\*\\*\\B(?!\\*)/g, function (wm, lead, txt) {\n return parseInside (txt, lead + '', '');\n });\n text = text.replace(/([^*]|^)\\B\\*\\*(\\S[\\s\\S]*?)\\*\\*\\B(?!\\*)/g, function (wm, lead, txt) {\n return parseInside (txt, lead + '', '');\n });\n text = text.replace(/([^*]|^)\\B\\*(\\S[\\s\\S]*?)\\*\\B(?!\\*)/g, function (wm, lead, txt) {\n return parseInside (txt, lead + '', '');\n });\n } else {\n text = text.replace(/\\*\\*\\*(\\S[\\s\\S]*?)\\*\\*\\*/g, function (wm, m) {\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n text = text.replace(/\\*\\*(\\S[\\s\\S]*?)\\*\\*/g, function (wm, m) {\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n text = text.replace(/\\*([^\\s*][\\s\\S]*?)\\*/g, function (wm, m) {\n // !/^\\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it)\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n }\n\n\n text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);\n return text;\n});\n", "/**\n * Form HTML ordered (numbered) and unordered (bulleted) lists.\n */\nshowdown.subParser('lists', function (text, options, globals) {\n 'use strict';\n\n /**\n * Process the contents of a single ordered or unordered list, splitting it\n * into individual list items.\n * @param {string} listStr\n * @param {boolean} trimTrailing\n * @returns {string}\n */\n function processListItems (listStr, trimTrailing) {\n // The $g_list_level global keeps track of when we're inside a list.\n // Each time we enter a list, we increment it; when we leave a list,\n // we decrement. If it's zero, we're not in a list anymore.\n //\n // We do this because when we're not inside a list, we want to treat\n // something like this:\n //\n // I recommend upgrading to version\n // 8. Oops, now this line is treated\n // as a sub-list.\n //\n // As a single paragraph, despite the fact that the second line starts\n // with a digit-period-space sequence.\n //\n // Whereas when we're inside a list (or sub-list), that line will be\n // treated as the start of a sub-list. What a kludge, huh? This is\n // an aspect of Markdown's syntax that's hard to parse perfectly\n // without resorting to mind-reading. Perhaps the solution is to\n // change the syntax rules such that sub-lists must start with a\n // starting cardinal number; e.g. \"1.\" or \"a.\".\n globals.gListLevel++;\n\n // trim trailing blank lines:\n listStr = listStr.replace(/\\n{2,}$/, '\\n');\n\n // attacklab: add sentinel to emulate \\z\n listStr += '¨0';\n\n var rgx = /(\\n)?(^ {0,3})([*+-]|\\d+[.])[ \\t]+((\\[(x|X| )?])?[ \\t]*[^\\r]+?(\\n{1,2}))(?=\\n*(¨0| {0,3}([*+-]|\\d+[.])[ \\t]+))/gm,\n isParagraphed = (/\\n[ \\t]*\\n(?!¨0)/.test(listStr));\n\n // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation,\n // which is a syntax breaking change\n // activating this option reverts to old behavior\n if (options.disableForced4SpacesIndentedSublists) {\n rgx = /(\\n)?(^ {0,3})([*+-]|\\d+[.])[ \\t]+((\\[(x|X| )?])?[ \\t]*[^\\r]+?(\\n{1,2}))(?=\\n*(¨0|\\2([*+-]|\\d+[.])[ \\t]+))/gm;\n }\n\n listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {\n checked = (checked && checked.trim() !== '');\n\n var item = showdown.subParser('outdent')(m4, options, globals),\n bulletStyle = '';\n\n // Support for github tasklists\n if (taskbtn && options.tasklists) {\n bulletStyle = ' class=\"task-list-item\" style=\"list-style-type: none;\"';\n item = item.replace(/^[ \\t]*\\[(x|X| )?]/m, function () {\n var otp = '
  • a
  • \n // instead of:\n //
    • - - a
    \n // So, to prevent it, we will put a marker (¨A)in the beginning of the line\n // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser\n item = item.replace(/^([-*+]|\\d\\.)[ \\t]+[\\S\\n ]*/g, function (wm2) {\n return '¨A' + wm2;\n });\n\n // m1 - Leading line or\n // Has a double return (multi paragraph) or\n // Has sublist\n if (m1 || (item.search(/\\n{2,}/) > -1)) {\n item = showdown.subParser('githubCodeBlocks')(item, options, globals);\n item = showdown.subParser('blockGamut')(item, options, globals);\n } else {\n // Recursion for sub-lists:\n item = showdown.subParser('lists')(item, options, globals);\n item = item.replace(/\\n$/, ''); // chomp(item)\n item = showdown.subParser('hashHTMLBlocks')(item, options, globals);\n\n // Colapse double linebreaks\n item = item.replace(/\\n\\n+/g, '\\n\\n');\n if (isParagraphed) {\n item = showdown.subParser('paragraphs')(item, options, globals);\n } else {\n item = showdown.subParser('spanGamut')(item, options, globals);\n }\n }\n\n // now we need to remove the marker (¨A)\n item = item.replace('¨A', '');\n // we can finally wrap the line in list item tags\n item = '' + item + '\\n';\n\n return item;\n });\n\n // attacklab: strip sentinel\n listStr = listStr.replace(/¨0/g, '');\n\n globals.gListLevel--;\n\n if (trimTrailing) {\n listStr = listStr.replace(/\\s+$/, '');\n }\n\n return listStr;\n }\n\n function styleStartNumber (list, listType) {\n // check if ol and starts by a number different than 1\n if (listType === 'ol') {\n var res = list.match(/^ *(\\d+)\\./);\n if (res && res[1] !== '1') {\n return ' start=\"' + res[1] + '\"';\n }\n }\n return '';\n }\n\n /**\n * Check and parse consecutive lists (better fix for issue #142)\n * @param {string} list\n * @param {string} listType\n * @param {boolean} trimTrailing\n * @returns {string}\n */\n function parseConsecutiveLists (list, listType, trimTrailing) {\n // check if we caught 2 or more consecutive lists by mistake\n // we use the counterRgx, meaning if listType is UL we look for OL and vice versa\n var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\\d+\\.[ \\t]/gm : /^ {0,3}\\d+\\.[ \\t]/gm,\n ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \\t]/gm : /^ {0,3}[*+-][ \\t]/gm,\n counterRxg = (listType === 'ul') ? olRgx : ulRgx,\n result = '';\n\n if (list.search(counterRxg) !== -1) {\n (function parseCL (txt) {\n var pos = txt.search(counterRxg),\n style = styleStartNumber(list, listType);\n if (pos !== -1) {\n // slice\n result += '\\n\\n<' + listType + style + '>\\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '\\n';\n\n // invert counterType and listType\n listType = (listType === 'ul') ? 'ol' : 'ul';\n counterRxg = (listType === 'ul') ? olRgx : ulRgx;\n\n //recurse\n parseCL(txt.slice(pos));\n } else {\n result += '\\n\\n<' + listType + style + '>\\n' + processListItems(txt, !!trimTrailing) + '\\n';\n }\n })(list);\n } else {\n var style = styleStartNumber(list, listType);\n result = '\\n\\n<' + listType + style + '>\\n' + processListItems(list, !!trimTrailing) + '\\n';\n }\n\n return result;\n }\n\n /** Start of list parsing **/\n text = globals.converter._dispatch('lists.before', text, options, globals);\n // add sentinel to hack around khtml/safari bug:\n // http://bugs.webkit.org/show_bug.cgi?id=11231\n text += '¨0';\n\n if (globals.gListLevel) {\n text = text.replace(/^(( {0,3}([*+-]|\\d+[.])[ \\t]+)[^\\r]+?(¨0|\\n{2,}(?=\\S)(?![ \\t]*(?:[*+-]|\\d+[.])[ \\t]+)))/gm,\n function (wholeMatch, list, m2) {\n var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';\n return parseConsecutiveLists(list, listType, true);\n }\n );\n } else {\n text = text.replace(/(\\n\\n|^\\n?)(( {0,3}([*+-]|\\d+[.])[ \\t]+)[^\\r]+?(¨0|\\n{2,}(?=\\S)(?![ \\t]*(?:[*+-]|\\d+[.])[ \\t]+)))/gm,\n function (wholeMatch, m1, list, m3) {\n var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';\n return parseConsecutiveLists(list, listType, false);\n }\n );\n }\n\n // strip sentinel\n text = text.replace(/¨0/, '');\n text = globals.converter._dispatch('lists.after', text, options, globals);\n return text;\n});\n", "/**\n * Parse metadata at the top of the document\n */\nshowdown.subParser('metadata', function (text, options, globals) {\n 'use strict';\n\n if (!options.metadata) {\n return text;\n }\n\n text = globals.converter._dispatch('metadata.before', text, options, globals);\n\n function parseMetadataContents (content) {\n // raw is raw so it's not changed in any way\n globals.metadata.raw = content;\n\n // escape chars forbidden in html attributes\n // double quotes\n content = content\n // ampersand first\n .replace(/&/g, '&')\n // double quotes\n .replace(/\"/g, '"');\n\n content = content.replace(/\\n {4}/g, ' ');\n content.replace(/^([\\S ]+): +([\\s\\S]+?)$/gm, function (wm, key, value) {\n globals.metadata.parsed[key] = value;\n return '';\n });\n }\n\n text = text.replace(/^\\s*«««+(\\S*?)\\n([\\s\\S]+?)\\n»»»+\\n/, function (wholematch, format, content) {\n parseMetadataContents(content);\n return '¨M';\n });\n\n text = text.replace(/^\\s*---+(\\S*?)\\n([\\s\\S]+?)\\n---+\\n/, function (wholematch, format, content) {\n if (format) {\n globals.metadata.format = format;\n }\n parseMetadataContents(content);\n return '¨M';\n });\n\n text = text.replace(/¨M/g, '');\n\n text = globals.converter._dispatch('metadata.after', text, options, globals);\n return text;\n});\n", "/**\n * Remove one level of line-leading tabs or spaces\n */\nshowdown.subParser('outdent', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('outdent.before', text, options, globals);\n\n // attacklab: hack around Konqueror 3.5.4 bug:\n // \"----------bug\".replace(/^-/g,\"\") == \"bug\"\n text = text.replace(/^(\\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width\n\n // attacklab: clean up hack\n text = text.replace(/¨0/g, '');\n\n text = globals.converter._dispatch('outdent.after', text, options, globals);\n return text;\n});\n", "/**\n *\n */\nshowdown.subParser('paragraphs', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('paragraphs.before', text, options, globals);\n // Strip leading and trailing lines:\n text = text.replace(/^\\n+/g, '');\n text = text.replace(/\\n+$/g, '');\n\n var grafs = text.split(/\\n{2,}/g),\n grafsOut = [],\n end = grafs.length; // Wrap

    tags\n\n for (var i = 0; i < end; i++) {\n var str = grafs[i];\n // if this is an HTML marker, copy it\n if (str.search(/¨(K|G)(\\d+)\\1/g) >= 0) {\n grafsOut.push(str);\n\n // test for presence of characters to prevent empty lines being parsed\n // as paragraphs (resulting in undesired extra empty paragraphs)\n } else if (str.search(/\\S/) >= 0) {\n str = showdown.subParser('spanGamut')(str, options, globals);\n str = str.replace(/^([ \\t]*)/g, '

    ');\n str += '

    ';\n grafsOut.push(str);\n }\n }\n\n /** Unhashify HTML blocks */\n end = grafsOut.length;\n for (i = 0; i < end; i++) {\n var blockText = '',\n grafsOutIt = grafsOut[i],\n codeFlag = false;\n // if this is a marker for an html block...\n // use RegExp.test instead of string.search because of QML bug\n while (/¨(K|G)(\\d+)\\1/.test(grafsOutIt)) {\n var delim = RegExp.$1,\n num = RegExp.$2;\n\n if (delim === 'K') {\n blockText = globals.gHtmlBlocks[num];\n } else {\n // we need to check if ghBlock is a false positive\n if (codeFlag) {\n // use encoded version of all text\n blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals);\n } else {\n blockText = globals.ghCodeBlocks[num].codeblock;\n }\n }\n blockText = blockText.replace(/\\$/g, '$$$$'); // Escape any dollar signs\n\n grafsOutIt = grafsOutIt.replace(/(\\n\\n)?¨(K|G)\\d+\\2(\\n\\n)?/, blockText);\n // Check if grafsOutIt is a pre->code\n if (/^]*>\\s*]*>/.test(grafsOutIt)) {\n codeFlag = true;\n }\n }\n grafsOut[i] = grafsOutIt;\n }\n text = grafsOut.join('\\n');\n // Strip leading and trailing lines:\n text = text.replace(/^\\n+/g, '');\n text = text.replace(/\\n+$/g, '');\n return globals.converter._dispatch('paragraphs.after', text, options, globals);\n});\n", "/**\n * Run extension\n */\nshowdown.subParser('runExtension', function (ext, text, options, globals) {\n 'use strict';\n\n if (ext.filter) {\n text = ext.filter(text, globals.converter, options);\n\n } else if (ext.regex) {\n // TODO remove this when old extension loading mechanism is deprecated\n var re = ext.regex;\n if (!(re instanceof RegExp)) {\n re = new RegExp(re, 'g');\n }\n text = text.replace(re, ext.replace);\n }\n\n return text;\n});\n", "/**\n * These are all the transformations that occur *within* block-level\n * tags like paragraphs, headers, and list items.\n */\nshowdown.subParser('spanGamut', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('spanGamut.before', text, options, globals);\n text = showdown.subParser('codeSpans')(text, options, globals);\n text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);\n text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);\n\n // Process anchor and image tags. Images must come first,\n // because ![foo][f] looks like an anchor.\n text = showdown.subParser('images')(text, options, globals);\n text = showdown.subParser('anchors')(text, options, globals);\n\n // Make links out of things like ``\n // Must come after anchors, because you can use < and >\n // delimiters in inline links like [this]().\n text = showdown.subParser('autoLinks')(text, options, globals);\n text = showdown.subParser('simplifiedAutoLinks')(text, options, globals);\n text = showdown.subParser('emoji')(text, options, globals);\n text = showdown.subParser('underline')(text, options, globals);\n text = showdown.subParser('italicsAndBold')(text, options, globals);\n text = showdown.subParser('strikethrough')(text, options, globals);\n text = showdown.subParser('ellipsis')(text, options, globals);\n\n // we need to hash HTML tags inside spans\n text = showdown.subParser('hashHTMLSpans')(text, options, globals);\n\n // now we encode amps and angles\n text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);\n\n // Do hard breaks\n if (options.simpleLineBreaks) {\n // GFM style hard breaks\n // only add line breaks if the text does not contain a block (special case for lists)\n if (!/\\n\\n¨K/.test(text)) {\n text = text.replace(/\\n+/g, '
    \\n');\n }\n } else {\n // Vanilla hard breaks\n text = text.replace(/ +\\n/g, '
    \\n');\n }\n\n text = globals.converter._dispatch('spanGamut.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('strikethrough', function (text, options, globals) {\n 'use strict';\n\n function parseInside (txt) {\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n return '' + txt + '';\n }\n\n if (options.strikethrough) {\n text = globals.converter._dispatch('strikethrough.before', text, options, globals);\n text = text.replace(/(?:~){2}([\\s\\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); });\n text = globals.converter._dispatch('strikethrough.after', text, options, globals);\n }\n\n return text;\n});\n", "/**\n * Strips link definitions from text, stores the URLs and titles in\n * hash references.\n * Link defs are in the form: ^[id]: url \"optional title\"\n */\nshowdown.subParser('stripLinkDefinitions', function (text, options, globals) {\n 'use strict';\n\n var regex = /^ {0,3}\\[([^\\]]+)]:[ \\t]*\\n?[ \\t]*\\s]+)>?(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*\\n?[ \\t]*(?:(\\n*)[\"|'(](.+?)[\"|')][ \\t]*)?(?:\\n+|(?=¨0))/gm,\n base64Regex = /^ {0,3}\\[([^\\]]+)]:[ \\t]*\\n?[ \\t]*?(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*\\n?[ \\t]*(?:(\\n*)[\"|'(](.+?)[\"|')][ \\t]*)?(?:\\n\\n|(?=¨0)|(?=\\n\\[))/gm;\n\n // attacklab: sentinel workarounds for lack of \\A and \\Z, safari\\khtml bug\n text += '¨0';\n\n var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {\n\n // if there aren't two instances of linkId it must not be a reference link so back out\n linkId = linkId.toLowerCase();\n if (text.toLowerCase().split(linkId).length - 1 < 2) {\n return wholeMatch;\n }\n if (url.match(/^data:.+?\\/.+?;base64,/)) {\n // remove newlines\n globals.gUrls[linkId] = url.replace(/\\s/g, '');\n } else {\n globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals); // Link IDs are case-insensitive\n }\n\n if (blankLines) {\n // Oops, found blank lines, so it's not a title.\n // Put back the parenthetical statement we stole.\n return blankLines + title;\n\n } else {\n if (title) {\n globals.gTitles[linkId] = title.replace(/\"|'/g, '"');\n }\n if (options.parseImgDimensions && width && height) {\n globals.gDimensions[linkId] = {\n width: width,\n height: height\n };\n }\n }\n // Completely remove the definition from the text\n return '';\n };\n\n // first we try to find base64 link references\n text = text.replace(base64Regex, replaceFunc);\n\n text = text.replace(regex, replaceFunc);\n\n // attacklab: strip sentinel\n text = text.replace(/¨0/, '');\n\n return text;\n});\n", "showdown.subParser('tables', function (text, options, globals) {\n 'use strict';\n\n if (!options.tables) {\n return text;\n }\n\n var tableRgx = /^ {0,3}\\|?.+\\|.+\\n {0,3}\\|?[ \\t]*:?[ \\t]*(?:[-=]){2,}[ \\t]*:?[ \\t]*\\|[ \\t]*:?[ \\t]*(?:[-=]){2,}[\\s\\S]+?(?:\\n\\n|¨0)/gm,\n //singeColTblRgx = /^ {0,3}\\|.+\\|\\n {0,3}\\|[ \\t]*:?[ \\t]*(?:[-=]){2,}[ \\t]*:?[ \\t]*\\|[ \\t]*\\n(?: {0,3}\\|.+\\|\\n)+(?:\\n\\n|¨0)/gm;\n singeColTblRgx = /^ {0,3}\\|.+\\|[ \\t]*\\n {0,3}\\|[ \\t]*:?[ \\t]*(?:[-=]){2,}[ \\t]*:?[ \\t]*\\|[ \\t]*\\n( {0,3}\\|.+\\|[ \\t]*\\n)*(?:\\n|¨0)/gm;\n\n function parseStyles (sLine) {\n if (/^:[ \\t]*--*$/.test(sLine)) {\n return ' style=\"text-align:left;\"';\n } else if (/^--*[ \\t]*:[ \\t]*$/.test(sLine)) {\n return ' style=\"text-align:right;\"';\n } else if (/^:[ \\t]*--*[ \\t]*:$/.test(sLine)) {\n return ' style=\"text-align:center;\"';\n } else {\n return '';\n }\n }\n\n function parseHeaders (header, style) {\n var id = '';\n header = header.trim();\n // support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility\n if (options.tablesHeaderId || options.tableHeaderId) {\n id = ' id=\"' + header.replace(/ /g, '_').toLowerCase() + '\"';\n }\n header = showdown.subParser('spanGamut')(header, options, globals);\n\n return '' + header + '\\n';\n }\n\n function parseCells (cell, style) {\n var subText = showdown.subParser('spanGamut')(cell, options, globals);\n return '' + subText + '\\n';\n }\n\n function buildTable (headers, cells) {\n var tb = '\\n\\n\\n',\n tblLgn = headers.length;\n\n for (var i = 0; i < tblLgn; ++i) {\n tb += headers[i];\n }\n tb += '\\n\\n\\n';\n\n for (i = 0; i < cells.length; ++i) {\n tb += '\\n';\n for (var ii = 0; ii < tblLgn; ++ii) {\n tb += cells[i][ii];\n }\n tb += '\\n';\n }\n tb += '\\n
    \\n';\n return tb;\n }\n\n function parseTable (rawTable) {\n var i, tableLines = rawTable.split('\\n');\n\n for (i = 0; i < tableLines.length; ++i) {\n // strip wrong first and last column if wrapped tables are used\n if (/^ {0,3}\\|/.test(tableLines[i])) {\n tableLines[i] = tableLines[i].replace(/^ {0,3}\\|/, '');\n }\n if (/\\|[ \\t]*$/.test(tableLines[i])) {\n tableLines[i] = tableLines[i].replace(/\\|[ \\t]*$/, '');\n }\n // parse code spans first, but we only support one line code spans\n tableLines[i] = showdown.subParser('codeSpans')(tableLines[i], options, globals);\n }\n\n var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),\n rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),\n rawCells = [],\n headers = [],\n styles = [],\n cells = [];\n\n tableLines.shift();\n tableLines.shift();\n\n for (i = 0; i < tableLines.length; ++i) {\n if (tableLines[i].trim() === '') {\n continue;\n }\n rawCells.push(\n tableLines[i]\n .split('|')\n .map(function (s) {\n return s.trim();\n })\n );\n }\n\n if (rawHeaders.length < rawStyles.length) {\n return rawTable;\n }\n\n for (i = 0; i < rawStyles.length; ++i) {\n styles.push(parseStyles(rawStyles[i]));\n }\n\n for (i = 0; i < rawHeaders.length; ++i) {\n if (showdown.helper.isUndefined(styles[i])) {\n styles[i] = '';\n }\n headers.push(parseHeaders(rawHeaders[i], styles[i]));\n }\n\n for (i = 0; i < rawCells.length; ++i) {\n var row = [];\n for (var ii = 0; ii < headers.length; ++ii) {\n if (showdown.helper.isUndefined(rawCells[i][ii])) {\n\n }\n row.push(parseCells(rawCells[i][ii], styles[ii]));\n }\n cells.push(row);\n }\n\n return buildTable(headers, cells);\n }\n\n text = globals.converter._dispatch('tables.before', text, options, globals);\n\n // find escaped pipe characters\n text = text.replace(/\\\\(\\|)/g, showdown.helper.escapeCharactersCallback);\n\n // parse multi column tables\n text = text.replace(tableRgx, parseTable);\n\n // parse one column tables\n text = text.replace(singeColTblRgx, parseTable);\n\n text = globals.converter._dispatch('tables.after', text, options, globals);\n\n return text;\n});\n", "showdown.subParser('underline', function (text, options, globals) {\n 'use strict';\n\n if (!options.underline) {\n return text;\n }\n\n text = globals.converter._dispatch('underline.before', text, options, globals);\n\n if (options.literalMidWordUnderscores) {\n text = text.replace(/\\b___(\\S[\\s\\S]*?)___\\b/g, function (wm, txt) {\n return '' + txt + '';\n });\n text = text.replace(/\\b__(\\S[\\s\\S]*?)__\\b/g, function (wm, txt) {\n return '' + txt + '';\n });\n } else {\n text = text.replace(/___(\\S[\\s\\S]*?)___/g, function (wm, m) {\n return (/\\S$/.test(m)) ? '' + m + '' : wm;\n });\n text = text.replace(/__(\\S[\\s\\S]*?)__/g, function (wm, m) {\n return (/\\S$/.test(m)) ? '' + m + '' : wm;\n });\n }\n\n // escape remaining underscores to prevent them being parsed by italic and bold\n text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);\n\n text = globals.converter._dispatch('underline.after', text, options, globals);\n\n return text;\n});\n", "/**\n * Swap back in all the special characters we've hidden.\n */\nshowdown.subParser('unescapeSpecialChars', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);\n\n text = text.replace(/¨E(\\d+)E/g, function (wholeMatch, m1) {\n var charCodeToReplace = parseInt(m1);\n return String.fromCharCode(charCodeToReplace);\n });\n\n text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('makeMarkdown.blockquote', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n var children = node.childNodes,\n childrenLength = children.length;\n\n for (var i = 0; i < childrenLength; ++i) {\n var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals);\n\n if (innerTxt === '') {\n continue;\n }\n txt += innerTxt;\n }\n }\n // cleanup\n txt = txt.trim();\n txt = '> ' + txt.split('\\n').join('\\n> ');\n return txt;\n});\n", "showdown.subParser('makeMarkdown.codeBlock', function (node, globals) {\n 'use strict';\n\n var lang = node.getAttribute('language'),\n num = node.getAttribute('precodenum');\n return '```' + lang + '\\n' + globals.preList[num] + '\\n```';\n});\n", "showdown.subParser('makeMarkdown.codeSpan', function (node) {\n 'use strict';\n\n return '`' + node.innerHTML + '`';\n});\n", "showdown.subParser('makeMarkdown.emphasis', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n txt += '*';\n var children = node.childNodes,\n childrenLength = children.length;\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n txt += '*';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) {\n 'use strict';\n\n var headerMark = new Array(headerLevel + 1).join('#'),\n txt = '';\n\n if (node.hasChildNodes()) {\n txt = headerMark + ' ';\n var children = node.childNodes,\n childrenLength = children.length;\n\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.hr', function () {\n 'use strict';\n\n return '---';\n});\n", "showdown.subParser('makeMarkdown.image', function (node) {\n 'use strict';\n\n var txt = '';\n if (node.hasAttribute('src')) {\n txt += '![' + node.getAttribute('alt') + '](';\n txt += '<' + node.getAttribute('src') + '>';\n if (node.hasAttribute('width') && node.hasAttribute('height')) {\n txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height');\n }\n\n if (node.hasAttribute('title')) {\n txt += ' \"' + node.getAttribute('title') + '\"';\n }\n txt += ')';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.links', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes() && node.hasAttribute('href')) {\n var children = node.childNodes,\n childrenLength = children.length;\n txt = '[';\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n txt += '](';\n txt += '<' + node.getAttribute('href') + '>';\n if (node.hasAttribute('title')) {\n txt += ' \"' + node.getAttribute('title') + '\"';\n }\n txt += ')';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.list', function (node, globals, type) {\n 'use strict';\n\n var txt = '';\n if (!node.hasChildNodes()) {\n return '';\n }\n var listItems = node.childNodes,\n listItemsLenght = listItems.length,\n listNum = node.getAttribute('start') || 1;\n\n for (var i = 0; i < listItemsLenght; ++i) {\n if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {\n continue;\n }\n\n // define the bullet to use in list\n var bullet = '';\n if (type === 'ol') {\n bullet = listNum.toString() + '. ';\n } else {\n bullet = '- ';\n }\n\n // parse list item\n txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals);\n ++listNum;\n }\n\n // add comment at the end to prevent consecutive lists to be parsed as one\n txt += '\\n\\n';\n return txt.trim();\n});\n", "showdown.subParser('makeMarkdown.listItem', function (node, globals) {\n 'use strict';\n\n var listItemTxt = '';\n\n var children = node.childNodes,\n childrenLenght = children.length;\n\n for (var i = 0; i < childrenLenght; ++i) {\n listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n // if it's only one liner, we need to add a newline at the end\n if (!/\\n$/.test(listItemTxt)) {\n listItemTxt += '\\n';\n } else {\n // it's multiparagraph, so we need to indent\n listItemTxt = listItemTxt\n .split('\\n')\n .join('\\n ')\n .replace(/^ {4}$/gm, '')\n .replace(/\\n\\n+/g, '\\n\\n');\n }\n\n return listItemTxt;\n});\n", "\n\nshowdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {\n 'use strict';\n\n spansOnly = spansOnly || false;\n\n var txt = '';\n\n // edge case of text without wrapper paragraph\n if (node.nodeType === 3) {\n return showdown.subParser('makeMarkdown.txt')(node, globals);\n }\n\n // HTML comment\n if (node.nodeType === 8) {\n return '\\n\\n';\n }\n\n // process only node elements\n if (node.nodeType !== 1) {\n return '';\n }\n\n var tagName = node.tagName.toLowerCase();\n\n switch (tagName) {\n\n //\n // BLOCKS\n //\n case 'h1':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\\n\\n'; }\n break;\n case 'h2':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\\n\\n'; }\n break;\n case 'h3':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\\n\\n'; }\n break;\n case 'h4':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\\n\\n'; }\n break;\n case 'h5':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\\n\\n'; }\n break;\n case 'h6':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\\n\\n'; }\n break;\n\n case 'p':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\\n\\n'; }\n break;\n\n case 'blockquote':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\\n\\n'; }\n break;\n\n case 'hr':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\\n\\n'; }\n break;\n\n case 'ol':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\\n\\n'; }\n break;\n\n case 'ul':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\\n\\n'; }\n break;\n\n case 'precode':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\\n\\n'; }\n break;\n\n case 'pre':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\\n\\n'; }\n break;\n\n case 'table':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\\n\\n'; }\n break;\n\n //\n // SPANS\n //\n case 'code':\n txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals);\n break;\n\n case 'em':\n case 'i':\n txt = showdown.subParser('makeMarkdown.emphasis')(node, globals);\n break;\n\n case 'strong':\n case 'b':\n txt = showdown.subParser('makeMarkdown.strong')(node, globals);\n break;\n\n case 'del':\n txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals);\n break;\n\n case 'a':\n txt = showdown.subParser('makeMarkdown.links')(node, globals);\n break;\n\n case 'img':\n txt = showdown.subParser('makeMarkdown.image')(node, globals);\n break;\n\n default:\n txt = node.outerHTML + '\\n\\n';\n }\n\n // common normalization\n // TODO eventually\n\n return txt;\n});\n", "showdown.subParser('makeMarkdown.paragraph', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n var children = node.childNodes,\n childrenLength = children.length;\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n }\n\n // some text normalization\n txt = txt.trim();\n\n return txt;\n});\n", "showdown.subParser('makeMarkdown.pre', function (node, globals) {\n 'use strict';\n\n var num = node.getAttribute('prenum');\n return '
    ' + globals.preList[num] + '
    ';\n});\n", "showdown.subParser('makeMarkdown.strikethrough', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n txt += '~~';\n var children = node.childNodes,\n childrenLength = children.length;\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n txt += '~~';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.strong', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n txt += '**';\n var children = node.childNodes,\n childrenLength = children.length;\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n txt += '**';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.table', function (node, globals) {\n 'use strict';\n\n var txt = '',\n tableArray = [[], []],\n headings = node.querySelectorAll('thead>tr>th'),\n rows = node.querySelectorAll('tbody>tr'),\n i, ii;\n for (i = 0; i < headings.length; ++i) {\n var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),\n allign = '---';\n\n if (headings[i].hasAttribute('style')) {\n var style = headings[i].getAttribute('style').toLowerCase().replace(/\\s/g, '');\n switch (style) {\n case 'text-align:left;':\n allign = ':---';\n break;\n case 'text-align:right;':\n allign = '---:';\n break;\n case 'text-align:center;':\n allign = ':---:';\n break;\n }\n }\n tableArray[0][i] = headContent.trim();\n tableArray[1][i] = allign;\n }\n\n for (i = 0; i < rows.length; ++i) {\n var r = tableArray.push([]) - 1,\n cols = rows[i].getElementsByTagName('td');\n\n for (ii = 0; ii < headings.length; ++ii) {\n var cellContent = ' ';\n if (typeof cols[ii] !== 'undefined') {\n cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);\n }\n tableArray[r].push(cellContent);\n }\n }\n\n var cellSpacesCount = 3;\n for (i = 0; i < tableArray.length; ++i) {\n for (ii = 0; ii < tableArray[i].length; ++ii) {\n var strLen = tableArray[i][ii].length;\n if (strLen > cellSpacesCount) {\n cellSpacesCount = strLen;\n }\n }\n }\n\n for (i = 0; i < tableArray.length; ++i) {\n for (ii = 0; ii < tableArray[i].length; ++ii) {\n if (i === 1) {\n if (tableArray[i][ii].slice(-1) === ':') {\n tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';\n } else {\n tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');\n }\n } else {\n tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);\n }\n }\n txt += '| ' + tableArray[i].join(' | ') + ' |\\n';\n }\n\n return txt.trim();\n});\n", "showdown.subParser('makeMarkdown.tableCell', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (!node.hasChildNodes()) {\n return '';\n }\n var children = node.childNodes,\n childrenLength = children.length;\n\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);\n }\n return txt.trim();\n});\n", "showdown.subParser('makeMarkdown.txt', function (node) {\n 'use strict';\n\n var txt = node.nodeValue;\n\n // multiple spaces are collapsed\n txt = txt.replace(/ +/g, ' ');\n\n // replace the custom ¨NBSP; with a space\n txt = txt.replace(/¨NBSP;/g, ' ');\n\n // \", <, > and & should replace escaped html entities\n txt = showdown.helper.unescapeHTMLEntities(txt);\n\n // escape markdown magic characters\n // emphasis, strong and strikethrough - can appear everywhere\n // we also escape pipe (|) because of tables\n // and escape ` because of code blocks and spans\n txt = txt.replace(/([*_~|`])/g, '\\\\$1');\n\n // escape > because of blockquotes\n txt = txt.replace(/^(\\s*)>/g, '\\\\$1>');\n\n // hash character, only troublesome at the beginning of a line because of headers\n txt = txt.replace(/^#/gm, '\\\\#');\n\n // horizontal rules\n txt = txt.replace(/^(\\s*)([-=]{3,})(\\s*)$/, '$1\\\\$2$3');\n\n // dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer\n txt = txt.replace(/^( {0,3}\\d+)\\./gm, '$1\\\\.');\n\n // +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)\n txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\\\$2');\n\n // images and links, ] followed by ( is problematic, so we escape it\n txt = txt.replace(/]([\\s]*)\\(/g, '\\\\]$1\\\\(');\n\n // reference URIs must also be escaped\n txt = txt.replace(/^ {0,3}\\[([\\S \\t]*?)]:/gm, '\\\\[$1]:');\n\n return txt;\n});\n", "var root = this;\n\n// AMD Loader\nif (typeof define === 'function' && define.amd) {\n define(function () {\n 'use strict';\n return showdown;\n });\n\n// CommonJS/nodeJS Loader\n} else if (typeof module !== 'undefined' && module.exports) {\n module.exports = showdown;\n\n// Regular Browser loader\n} else {\n root.showdown = showdown;\n}\n", "/* jshint browser: true */\n\n(function () {\n\n// We'll copy the properties below into the mirror div.\n// Note that some browsers, such as Firefox, do not concatenate properties\n// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),\n// so we have to list every single property explicitly.\nvar properties = [\n 'direction', // RTL support\n 'boxSizing',\n 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does\n 'height',\n 'overflowX',\n 'overflowY', // copy the scrollbar for IE\n\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderStyle',\n\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n 'fontStyle',\n 'fontVariant',\n 'fontWeight',\n 'fontStretch',\n 'fontSize',\n 'fontSizeAdjust',\n 'lineHeight',\n 'fontFamily',\n\n 'textAlign',\n 'textTransform',\n 'textIndent',\n 'textDecoration', // might not make a difference, but better be safe\n\n 'letterSpacing',\n 'wordSpacing',\n\n 'tabSize',\n 'MozTabSize'\n\n];\n\nvar isBrowser = (typeof window !== 'undefined');\nvar isFirefox = (isBrowser && window.mozInnerScreenX != null);\n\nfunction getCaretCoordinates(element, position, options) {\n if (!isBrowser) {\n throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser');\n }\n\n var debug = options && options.debug || false;\n if (debug) {\n var el = document.querySelector('#input-textarea-caret-position-mirror-div');\n if (el) el.parentNode.removeChild(el);\n }\n\n // The mirror div will replicate the textarea's style\n var div = document.createElement('div');\n div.id = 'input-textarea-caret-position-mirror-div';\n document.body.appendChild(div);\n\n var style = div.style;\n var computed = window.getComputedStyle ? window.getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9\n var isInput = element.nodeName === 'INPUT';\n\n // Default textarea styles\n style.whiteSpace = 'pre-wrap';\n if (!isInput)\n style.wordWrap = 'break-word'; // only for textarea-s\n\n // Position off-screen\n style.position = 'absolute'; // required to return coordinates properly\n if (!debug)\n style.visibility = 'hidden'; // not 'display: none' because we want rendering\n\n // Transfer the element's properties to the div\n properties.forEach(function (prop) {\n if (isInput && prop === 'lineHeight') {\n // Special case for s because text is rendered centered and line height may be != height\n style.lineHeight = computed.height;\n } else {\n style[prop] = computed[prop];\n }\n });\n\n if (isFirefox) {\n // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275\n if (element.scrollHeight > parseInt(computed.height))\n style.overflowY = 'scroll';\n } else {\n style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'\n }\n\n div.textContent = element.value.substring(0, position);\n // The second special handling for input type=\"text\" vs textarea:\n // spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037\n if (isInput)\n div.textContent = div.textContent.replace(/\\s/g, '\\u00a0');\n\n var span = document.createElement('span');\n // Wrapping must be replicated *exactly*, including when a long word gets\n // onto the next line, with whitespace at the end of the line before (#7).\n // The *only* reliable way to do that is to copy the *entire* rest of the\n // textarea's content into the created at the caret position.\n // For inputs, just '.' would be enough, but no need to bother.\n span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all\n div.appendChild(span);\n\n var coordinates = {\n top: span.offsetTop + parseInt(computed['borderTopWidth']),\n left: span.offsetLeft + parseInt(computed['borderLeftWidth']),\n height: parseInt(computed['lineHeight'])\n };\n\n if (debug) {\n span.style.backgroundColor = '#aaa';\n } else {\n document.body.removeChild(div);\n }\n\n return coordinates;\n}\n\nif (typeof module != 'undefined' && typeof module.exports != 'undefined') {\n module.exports = getCaretCoordinates;\n} else if(isBrowser) {\n window.getCaretCoordinates = getCaretCoordinates;\n}\n\n}());\n", "export const isArray = (what: unknown): boolean => Array.isArray(what);\n", "import { isArray } from \"./isArray.ts\";\n\nconst select = (selector) => ({\n el: document.querySelector(selector),\n elements: document.querySelectorAll(selector),\n placeholder(what) {\n this.el.placeholder = what;\n return this;\n },\n getValue() {\n return this.el.value;\n },\n insertAtCaret(text) {\n this.el.setRangeText(\n text,\n this.el.selectionStart,\n this.el.selectionEnd,\n \"end\",\n );\n return this;\n },\n setValue(value) {\n this.el.value = value;\n const event = new Event(\"input\", {\n bubbles: true,\n cancelable: true,\n });\n this.el.dispatchEvent(event);\n return this;\n },\n innerHTML(htmlString) {\n this.el.innerHTML = htmlString;\n return this;\n },\n html(content) {\n this.el.innerHTML = \"\";\n this.append(content);\n return this;\n },\n append(el) {\n const elements = isArray(el) ? el : [el];\n elements.forEach((e) => {\n const newContent = isElement(e) ? e : document.createTextNode(e);\n this.el.appendChild(newContent);\n });\n return this;\n },\n appendListElement(text) {\n const li = document.createElement(\"LI\");\n li.appendChild(document.createTextNode(text));\n this.el.appendChild(li);\n return this;\n },\n removeClass(className) {\n this.el.classList.remove(className);\n return this;\n },\n removeClasses(classes = []) {\n classes.map((className) => this.removeClass(className));\n return this;\n },\n addClass(className) {\n this.el.classList.add(className);\n return this;\n },\n hasClass(cls) {\n return (\" \" + this.el.className + \" \").indexOf(\" \" + cls + \" \") > -1;\n },\n show(shouldShow = true) {\n if (shouldShow) {\n this.removeClass(\"hidden\");\n } else {\n this.hide();\n }\n return this;\n },\n hide() {\n this.addClass(\"hidden\");\n return this;\n },\n toggle(className = \"hidden\") {\n if (this.hasClass(className)) this.removeClass(className);\n else this.addClass(className);\n return this;\n },\n focus() {\n this.el.focus();\n return this;\n },\n listenAll(event, fn) {\n const elements = Array.prototype.slice.call(this.elements);\n elements.map((el) => {\n el.addEventListener(event, (e) => fn(e.srcElement));\n });\n return this;\n },\n listen(event, fn) {\n this.el.addEventListener(event, (e) => fn(e, this));\n return this;\n },\n click() {\n if (this.el) {\n this.el.click();\n }\n },\n checked(value) {\n this.el.checked = !!value;\n return this;\n },\n disable(shouldDisable = true) {\n this.el.disabled = shouldDisable;\n return this;\n },\n});\n\nexport const isElement = (obj) => {\n try {\n return obj instanceof HTMLElement;\n } catch (_e) {\n //Browsers not supporting W3 DOM2 don't have HTMLElement and\n //an exception is thrown and we end up here. Testing some\n //properties that all elements have (works on IE7)\n return (\n typeof obj === \"object\" &&\n obj.nodeType === 1 &&\n typeof obj.style === \"object\" &&\n typeof obj.ownerDocument === \"object\"\n );\n }\n};\n\nexport default select;\n", "import select from \"../../utils/dom.js\";\n\ntype NotificationType = \"info\" | \"success\" | \"error\" | \"warning\";\n\nconst notificationTypes: Record = {\n info: \"info\",\n success: \"success\",\n error: \"error\",\n warning: \"warning\",\n};\n\nconst notification = select(\"#notification\");\n\nconst cleanNotificationClasses = (): void => {\n notification.removeClasses(Object.values(notificationTypes));\n};\n\nnotification.el.onclick = () => cleanNotificationClasses();\n\nconst notificationFactory = () =>\n Object.values(notificationTypes).reduce(\n (acc, notificationType) => ({\n ...acc,\n [notificationType](message: string): void {\n // @ts-ignore fix later\n this.showNotification(message, notificationType);\n },\n }),\n {} as Record void>,\n );\n\ninterface Notification {\n autohideDuration: number;\n timer?: number;\n removeAfter(): void;\n showNotification(message: string, type?: NotificationType): void;\n info(message: string): void;\n success(message: string): void;\n error(message: string): void;\n warning(message: string): void;\n}\n\nconst Notification = (autohideDuration = 5): Notification => ({\n autohideDuration,\n timer: undefined,\n removeAfter() {\n this.timer = self.setTimeout(() => {\n cleanNotificationClasses();\n }, this.autohideDuration * 1000);\n },\n showNotification(message, type = notificationTypes.info) {\n cleanNotificationClasses();\n notification.innerHTML(message).addClass(type);\n clearTimeout(this.timer);\n this.removeAfter();\n },\n ...notificationFactory(),\n});\n\nconst notify = Notification();\nexport default notify;\n", "import notify from \"./notify.ts\";\n\nconst welcomeUser = () => {\n const lastVisit = localStorage.getItem(\"miropad.user\");\n if (lastVisit) {\n notify.info(`\uD83E\uDD17 Happy to see you again from ${lastVisit}`);\n } else {\n notify.info(\n `

    Welcome \uD83D\uDC4B \uD83D\uDE03

    \n

    Use Ctrl+S: to save your note

    \n

    & Ctrl+P: to format a JSON doc

    \n `,\n 100,\n );\n }\n localStorage.setItem(\"miropad.user\", new Date().toLocaleDateString());\n};\n\nexport default welcomeUser;\n", "import notify from \"../components/molecules/notify.ts\";\nimport { isArray } from \"./isArray.ts\";\n\nconst storage = (() => {\n return {\n set: function (key, what) {\n localStorage.setItem(key, what);\n return this;\n },\n update: function (key, attr) {\n const current = JSON.parse(this.get(key));\n localStorage.setItem(\n key,\n JSON.stringify({\n ...current,\n ...attr,\n }),\n );\n return this;\n },\n remove: function (key) {\n localStorage.removeItem(key);\n return this;\n },\n get: function (key) {\n if (isArray(key)) {\n return key.reduce((acc, k) => {\n return {\n ...acc,\n [k]: this.get(k),\n };\n }, {});\n }\n\n return localStorage.getItem(key);\n },\n parse: function (key) {\n const value = this.get(key);\n return JSON.parse(value);\n },\n getDictionary: function () {\n const savedTxt = localStorage.getItem(\"__dictionary__\");\n return savedTxt ? JSON.parse(savedTxt) : [];\n },\n removeFromDictionary: function (word) {\n const currentDictionary = this.getDictionary();\n const newDictionary = currentDictionary.filter((w) => {\n return w !== word;\n });\n\n localStorage.setItem(\"__dictionary__\", JSON.stringify(newDictionary));\n },\n saveToDictionary: async function (what) {\n if (what.length) {\n try {\n const cleanText = what.toLowerCase().replace(/[^a-zA-Z\u03AC-\u03CE\u0391-\u03A9]/g, \" \");\n const current = await this.getDictionary();\n const words = [\n ...cleanText.split(\" \").filter((w) => w.length > 3),\n ...current,\n ];\n const distinctWords = [...new Set(words)];\n localStorage.setItem(\"__dictionary__\", JSON.stringify(distinctWords));\n } catch (e) {\n notify.error(\n `\uD83D\uDE31 Something went wrong while trying to save to local storage ${e}`,\n );\n }\n } else {\n notify.warning(\"\uD83D\uDE15 Nothing to save!\");\n }\n return this;\n },\n };\n})();\n\nexport default storage;\n", "export const configuration = {\n github: {\n client_id: \"70c1955dfe4914c52c10\",\n request_state: \"miro-pad\",\n },\n auth_service: \"https://vercel-api-phi.vercel.app/api/auth\",\n mail_service: {\n api: \"https://vercel-api-phi.vercel.app/api/mail\",\n signature: `Theo Mironidis
    \n Software Engineer
    \n https://teomrd.github.io`,\n },\n file_service: {\n api: \"https://vercel-api-phi.vercel.app/api/upload\",\n },\n} as const;\n", "import storage from \"../localstorage.js\";\nimport {\n getNotes,\n Note,\n} from \"../../components/organisms/noteManager/noteManager.ts\";\nimport notify from \"../../components/molecules/notify.ts\";\nimport { configuration } from \"../../../configuration.ts\";\n\nexport const getGist = (id: string, token = storage.get(\"authToken\")) =>\n fetch(`https://api.github.com/gists/${id}`, {\n headers: {\n Authorization: `token ${token}`,\n },\n }).then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response.json();\n });\n\nexport const getAuthenticatedUsersGists = (token = storage.get(\"authToken\")) =>\n fetch(\"https://api.github.com/gists\", {\n headers: {\n Authorization: `token ${token}`,\n },\n }).then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response.json();\n });\n\nexport const deleteFileOnGist = async (\n fileName: string,\n gistId = storage.get(\"gistId\"),\n token = storage.get(\"authToken\"),\n) => {\n const response = await fetch(`https://api.github.com/gists/${gistId}`, {\n method: \"PATCH\",\n headers: {\n Authorization: `token ${token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n files: {\n [fileName]: null,\n },\n description: \"MiroPad Gist\",\n public: false,\n }),\n });\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n const responseAsJson = await response.json();\n notify.info(`${fileName} deleted on Gist!`);\n return responseAsJson;\n};\n\nexport const updateGist = (\n notes = getNotes(),\n gistId = storage.get(\"gistId\"),\n token = storage.get(\"authToken\"),\n) => {\n if (gistId && token) {\n const noteToFiles = notes.reduce((acc, { id, text, deleted }) => {\n return {\n ...acc,\n [id]: deleted ? null : { content: text },\n };\n }, {});\n return fetch(`https://api.github.com/gists/${gistId}`, {\n method: \"PATCH\",\n headers: {\n Authorization: `token ${token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n files: noteToFiles,\n description: \"MiroPad Gist\",\n public: false,\n }),\n })\n .then((response) => {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response.json();\n })\n .then((responseAsJson) => {\n notes.map(({ id, deleted }) => {\n if (deleted) localStorage.removeItem(id);\n });\n return responseAsJson;\n });\n }\n};\n\nexport const createNewGist = async (token = storage.get(\"authToken\")) => {\n const notes = getNotes();\n const noteToFiles = notes.reduce((acc, note) => {\n return {\n ...acc,\n [note.id]: {\n content: note.text,\n },\n };\n }, {});\n const response = await fetch(\"https://api.github.com/gists\", {\n method: \"POST\",\n headers: {\n Authorization: `token ${token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n files: noteToFiles,\n description: \"MiroPad Gist\",\n public: false,\n }),\n });\n if (!response.ok) {\n throw Error(response.statusText);\n }\n const responseAsJson = await response.json();\n return responseAsJson;\n};\n\nexport const getAuthToken = (code: string, state: string) =>\n fetch(`${configuration.auth_service}?state=${state}&code=${code}`, {\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response.json();\n })\n .then((responseAsJson) => {\n return responseAsJson;\n });\n\nexport const publishGist = async ({\n note,\n token = storage.get(\"authToken\"),\n}: {\n note: Note;\n token?: string;\n}) => {\n const response = await fetch(\"https://api.github.com/gists\", {\n method: \"POST\",\n headers: {\n Authorization: `token ${token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n files: {\n [note.id]: {\n content: note.text,\n },\n },\n description: \"MiroPad Gist\",\n public: true,\n }),\n });\n if (!response.ok) {\n throw Error(response.statusText);\n }\n const responseAsJson = await response.json();\n return responseAsJson;\n};\n", "export const empty = new Uint8Array(0)\n\nexport function toHex (d: Uint8Array): string {\n return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '')\n}\n\nexport function fromHex (hex: string): Uint8Array {\n const hexes = hex.match(/../g)\n return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty\n}\n\nexport function equals (aa: Uint8Array, bb: Uint8Array): boolean {\n if (aa === bb) return true\n if (aa.byteLength !== bb.byteLength) {\n return false\n }\n\n for (let ii = 0; ii < aa.byteLength; ii++) {\n if (aa[ii] !== bb[ii]) {\n return false\n }\n }\n\n return true\n}\n\nexport function coerce (o: ArrayBufferView | ArrayBuffer | Uint8Array): Uint8Array {\n if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o\n if (o instanceof ArrayBuffer) return new Uint8Array(o)\n if (ArrayBuffer.isView(o)) {\n return new Uint8Array(o.buffer, o.byteOffset, o.byteLength)\n }\n throw new Error('Unknown type, must be binary type')\n}\n\nexport function isBinary (o: unknown): o is ArrayBuffer | ArrayBufferView {\n return o instanceof ArrayBuffer || ArrayBuffer.isView(o)\n}\n\nexport function fromString (str: string): Uint8Array {\n return new TextEncoder().encode(str)\n}\n\nexport function toString (b: Uint8Array): string {\n return new TextDecoder().decode(b)\n}\n", "/* eslint-disable */\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\n/**\n * @param {string} ALPHABET\n * @param {any} name\n */\nfunction base (ALPHABET, name) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256);\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i);\n var xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i;\n }\n var BASE = ALPHABET.length;\n var LEADER = ALPHABET.charAt(0);\n var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up\n /**\n * @param {any[] | Iterable} source\n */\n function encode (source) {\n // @ts-ignore\n if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0;\n var length = 0;\n var pbegin = 0;\n var pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;\n var b58 = new Uint8Array(size);\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin];\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0;\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0;\n b58[it1] = (carry % BASE) >>> 0;\n carry = (carry / BASE) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n pbegin++;\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }\n return str\n }\n /**\n * @param {string | string[]} source\n */\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n var psz = 0;\n // Skip leading spaces.\n if (source[psz] === ' ') { return }\n // Skip and count leading '1's.\n var zeroes = 0;\n var length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size);\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)];\n // Invalid character\n if (carry === 255) { return }\n var i = 0;\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0;\n b256[it3] = (carry % 256) >>> 0;\n carry = (carry / 256) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n psz++;\n }\n // Skip trailing spaces.\n if (source[psz] === ' ') { return }\n // Skip leading zeroes in b256.\n var it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n var vch = new Uint8Array(zeroes + (size - it4));\n var j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch\n }\n /**\n * @param {string | string[]} string\n */\n function decode (string) {\n var buffer = decodeUnsafe(string);\n if (buffer) { return buffer }\n throw new Error(`Non-${name} character`)\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nvar src = base;\n\nvar _brrp__multiformats_scope_baseX = src;\n\nexport default _brrp__multiformats_scope_baseX;\n", "import { coerce } from '../bytes.js'\nimport basex from '../vendor/base-x.js'\nimport type { BaseCodec, BaseDecoder, BaseEncoder, CombobaseDecoder, Multibase, MultibaseCodec, MultibaseDecoder, MultibaseEncoder, UnibaseDecoder } from './interface.js'\n\ninterface EncodeFn { (bytes: Uint8Array): string }\ninterface DecodeFn { (text: string): Uint8Array }\n\n/**\n * Class represents both BaseEncoder and MultibaseEncoder meaning it\n * can be used to encode to multibase or base encode without multibase\n * prefix.\n */\nclass Encoder implements MultibaseEncoder, BaseEncoder {\n readonly name: Base\n readonly prefix: Prefix\n readonly baseEncode: EncodeFn\n\n constructor (name: Base, prefix: Prefix, baseEncode: EncodeFn) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n }\n\n encode (bytes: Uint8Array): Multibase {\n if (bytes instanceof Uint8Array) {\n return `${this.prefix}${this.baseEncode(bytes)}`\n } else {\n throw Error('Unknown type, must be binary type')\n }\n }\n}\n\n/**\n * Class represents both BaseDecoder and MultibaseDecoder so it could be used\n * to decode multibases (with matching prefix) or just base decode strings\n * with corresponding base encoding.\n */\nclass Decoder implements MultibaseDecoder, UnibaseDecoder, BaseDecoder {\n readonly name: Base\n readonly prefix: Prefix\n readonly baseDecode: DecodeFn\n private readonly prefixCodePoint: number\n\n constructor (name: Base, prefix: Prefix, baseDecode: DecodeFn) {\n this.name = name\n this.prefix = prefix\n const prefixCodePoint = prefix.codePointAt(0)\n /* c8 ignore next 3 */\n if (prefixCodePoint === undefined) {\n throw new Error('Invalid prefix character')\n }\n this.prefixCodePoint = prefixCodePoint\n this.baseDecode = baseDecode\n }\n\n decode (text: string): Uint8Array {\n if (typeof text === 'string') {\n if (text.codePointAt(0) !== this.prefixCodePoint) {\n throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)\n }\n return this.baseDecode(text.slice(this.prefix.length))\n } else {\n throw Error('Can only multibase decode strings')\n }\n }\n\n or (decoder: UnibaseDecoder | ComposedDecoder): ComposedDecoder {\n return or(this, decoder)\n }\n}\n\ntype Decoders = Record>\n\nclass ComposedDecoder implements MultibaseDecoder, CombobaseDecoder {\n readonly decoders: Decoders\n\n constructor (decoders: Decoders) {\n this.decoders = decoders\n }\n\n or (decoder: UnibaseDecoder | ComposedDecoder): ComposedDecoder {\n return or(this, decoder)\n }\n\n decode (input: string): Uint8Array {\n const prefix = input[0] as Prefix\n const decoder = this.decoders[prefix]\n if (decoder != null) {\n return decoder.decode(input)\n } else {\n throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)\n }\n }\n}\n\nexport function or (left: UnibaseDecoder | CombobaseDecoder, right: UnibaseDecoder | CombobaseDecoder): ComposedDecoder {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n return new ComposedDecoder({\n ...(left.decoders ?? { [(left as UnibaseDecoder).prefix]: left }),\n ...(right.decoders ?? { [(right as UnibaseDecoder).prefix]: right })\n } as Decoders)\n}\n\nexport class Codec implements MultibaseCodec, MultibaseEncoder, MultibaseDecoder, BaseCodec, BaseEncoder, BaseDecoder {\n readonly name: Base\n readonly prefix: Prefix\n readonly baseEncode: EncodeFn\n readonly baseDecode: DecodeFn\n readonly encoder: Encoder\n readonly decoder: Decoder\n\n constructor (name: Base, prefix: Prefix, baseEncode: EncodeFn, baseDecode: DecodeFn) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n this.baseDecode = baseDecode\n this.encoder = new Encoder(name, prefix, baseEncode)\n this.decoder = new Decoder(name, prefix, baseDecode)\n }\n\n encode (input: Uint8Array): string {\n return this.encoder.encode(input)\n }\n\n decode (input: string): Uint8Array {\n return this.decoder.decode(input)\n }\n}\n\nexport function from ({ name, prefix, encode, decode }: { name: Base, prefix: Prefix, encode: EncodeFn, decode: DecodeFn }): Codec {\n return new Codec(name, prefix, encode, decode)\n}\n\nexport function baseX ({ name, prefix, alphabet }: { name: Base, prefix: Prefix, alphabet: string }): Codec {\n const { encode, decode } = basex(alphabet, name)\n return from({\n prefix,\n name,\n encode,\n decode: (text: string): Uint8Array => coerce(decode(text))\n })\n}\n\nfunction decode (string: string, alphabet: string, bitsPerChar: number, name: string): Uint8Array {\n // Build the character lookup table:\n const codes: Record = {}\n for (let i = 0; i < alphabet.length; ++i) {\n codes[alphabet[i]] = i\n }\n\n // Count the padding bytes:\n let end = string.length\n while (string[end - 1] === '=') {\n --end\n }\n\n // Allocate the output:\n const out = new Uint8Array((end * bitsPerChar / 8) | 0)\n\n // Parse the data:\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n let written = 0 // Next byte to write\n for (let i = 0; i < end; ++i) {\n // Read one character from the string:\n const value = codes[string[i]]\n if (value === undefined) {\n throw new SyntaxError(`Non-${name} character`)\n }\n\n // Append the bits to the buffer:\n buffer = (buffer << bitsPerChar) | value\n bits += bitsPerChar\n\n // Write out some bits if the buffer has a byte's worth:\n if (bits >= 8) {\n bits -= 8\n out[written++] = 0xff & (buffer >> bits)\n }\n }\n\n // Verify that we have received just enough bits:\n if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) {\n throw new SyntaxError('Unexpected end of data')\n }\n\n return out\n}\n\nfunction encode (data: Uint8Array, alphabet: string, bitsPerChar: number): string {\n const pad = alphabet[alphabet.length - 1] === '='\n const mask = (1 << bitsPerChar) - 1\n let out = ''\n\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n for (let i = 0; i < data.length; ++i) {\n // Slurp data into the buffer:\n buffer = (buffer << 8) | data[i]\n bits += 8\n\n // Write out as much as we can:\n while (bits > bitsPerChar) {\n bits -= bitsPerChar\n out += alphabet[mask & (buffer >> bits)]\n }\n }\n\n // Partial character:\n if (bits !== 0) {\n out += alphabet[mask & (buffer << (bitsPerChar - bits))]\n }\n\n // Add padding characters until we hit a byte boundary:\n if (pad) {\n while (((out.length * bitsPerChar) & 7) !== 0) {\n out += '='\n }\n }\n\n return out\n}\n\n/**\n * RFC4648 Factory\n */\nexport function rfc4648 ({ name, prefix, bitsPerChar, alphabet }: { name: Base, prefix: Prefix, bitsPerChar: number, alphabet: string }): Codec {\n return from({\n prefix,\n name,\n encode (input: Uint8Array): string {\n return encode(input, alphabet, bitsPerChar)\n },\n decode (input: string): Uint8Array {\n return decode(input, alphabet, bitsPerChar, name)\n }\n })\n}\n", "import { rfc4648 } from './base.js'\n\nexport const base32 = rfc4648({\n prefix: 'b',\n name: 'base32',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567',\n bitsPerChar: 5\n})\n\nexport const base32upper = rfc4648({\n prefix: 'B',\n name: 'base32upper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',\n bitsPerChar: 5\n})\n\nexport const base32pad = rfc4648({\n prefix: 'c',\n name: 'base32pad',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',\n bitsPerChar: 5\n})\n\nexport const base32padupper = rfc4648({\n prefix: 'C',\n name: 'base32padupper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',\n bitsPerChar: 5\n})\n\nexport const base32hex = rfc4648({\n prefix: 'v',\n name: 'base32hex',\n alphabet: '0123456789abcdefghijklmnopqrstuv',\n bitsPerChar: 5\n})\n\nexport const base32hexupper = rfc4648({\n prefix: 'V',\n name: 'base32hexupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',\n bitsPerChar: 5\n})\n\nexport const base32hexpad = rfc4648({\n prefix: 't',\n name: 'base32hexpad',\n alphabet: '0123456789abcdefghijklmnopqrstuv=',\n bitsPerChar: 5\n})\n\nexport const base32hexpadupper = rfc4648({\n prefix: 'T',\n name: 'base32hexpadupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',\n bitsPerChar: 5\n})\n\nexport const base32z = rfc4648({\n prefix: 'h',\n name: 'base32z',\n alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',\n bitsPerChar: 5\n})\n", "import { baseX } from './base.js'\n\nexport const base36 = baseX({\n prefix: 'k',\n name: 'base36',\n alphabet: '0123456789abcdefghijklmnopqrstuvwxyz'\n})\n\nexport const base36upper = baseX({\n prefix: 'K',\n name: 'base36upper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n})\n", "import { baseX } from './base.js'\n\nexport const base58btc = baseX({\n name: 'base58btc',\n prefix: 'z',\n alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n})\n\nexport const base58flickr = baseX({\n name: 'base58flickr',\n prefix: 'Z',\n alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n})\n", "/* eslint-disable */\nvar encode_1 = encode;\n\nvar MSB = 0x80\n , REST = 0x7F\n , MSBALL = ~REST\n , INT = Math.pow(2, 31);\n\n/**\n * @param {number} num\n * @param {number[]} out\n * @param {number} offset\n */\nfunction encode(num, out, offset) {\n out = out || [];\n offset = offset || 0;\n var oldOffset = offset;\n\n while(num >= INT) {\n out[offset++] = (num & 0xFF) | MSB;\n num /= 128;\n }\n while(num & MSBALL) {\n out[offset++] = (num & 0xFF) | MSB;\n num >>>= 7;\n }\n out[offset] = num | 0;\n \n // @ts-ignore\n encode.bytes = offset - oldOffset + 1;\n \n return out\n}\n\nvar decode = read;\n\nvar MSB$1 = 0x80\n , REST$1 = 0x7F;\n\n/**\n * @param {string | any[]} buf\n * @param {number} offset\n */\nfunction read(buf, offset) {\n var res = 0\n , offset = offset || 0\n , shift = 0\n , counter = offset\n , b\n , l = buf.length;\n\n do {\n if (counter >= l) {\n // @ts-ignore\n read.bytes = 0;\n throw new RangeError('Could not decode varint')\n }\n b = buf[counter++];\n res += shift < 28\n ? (b & REST$1) << shift\n : (b & REST$1) * Math.pow(2, shift);\n shift += 7;\n } while (b >= MSB$1)\n\n // @ts-ignore\n read.bytes = counter - offset;\n\n return res\n}\n\nvar N1 = Math.pow(2, 7);\nvar N2 = Math.pow(2, 14);\nvar N3 = Math.pow(2, 21);\nvar N4 = Math.pow(2, 28);\nvar N5 = Math.pow(2, 35);\nvar N6 = Math.pow(2, 42);\nvar N7 = Math.pow(2, 49);\nvar N8 = Math.pow(2, 56);\nvar N9 = Math.pow(2, 63);\n\nvar length = function (/** @type {number} */ value) {\n return (\n value < N1 ? 1\n : value < N2 ? 2\n : value < N3 ? 3\n : value < N4 ? 4\n : value < N5 ? 5\n : value < N6 ? 6\n : value < N7 ? 7\n : value < N8 ? 8\n : value < N9 ? 9\n : 10\n )\n};\n\nvar varint = {\n encode: encode_1\n , decode: decode\n , encodingLength: length\n};\n\nvar _brrp_varint = varint;\n\nexport default _brrp_varint;\n", "import varint from './vendor/varint.js'\n\nexport function decode (data: Uint8Array, offset = 0): [number, number] {\n const code = varint.decode(data, offset)\n return [code, varint.decode.bytes]\n}\n\nexport function encodeTo (int: number, target: Uint8Array, offset = 0): Uint8Array {\n varint.encode(int, target, offset)\n return target\n}\n\nexport function encodingLength (int: number): number {\n return varint.encodingLength(int)\n}\n", "import { coerce, equals as equalBytes } from '../bytes.js'\nimport * as varint from '../varint.js'\nimport type { MultihashDigest } from './interface.js'\n\n/**\n * Creates a multihash digest.\n */\nexport function create (code: Code, digest: Uint8Array): Digest {\n const size = digest.byteLength\n const sizeOffset = varint.encodingLength(code)\n const digestOffset = sizeOffset + varint.encodingLength(size)\n\n const bytes = new Uint8Array(digestOffset + size)\n varint.encodeTo(code, bytes, 0)\n varint.encodeTo(size, bytes, sizeOffset)\n bytes.set(digest, digestOffset)\n\n return new Digest(code, size, digest, bytes)\n}\n\n/**\n * Turns bytes representation of multihash digest into an instance.\n */\nexport function decode (multihash: Uint8Array): MultihashDigest {\n const bytes = coerce(multihash)\n const [code, sizeOffset] = varint.decode(bytes)\n const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset))\n const digest = bytes.subarray(sizeOffset + digestOffset)\n\n if (digest.byteLength !== size) {\n throw new Error('Incorrect length')\n }\n\n return new Digest(code, size, digest, bytes)\n}\n\nexport function equals (a: MultihashDigest, b: unknown): b is MultihashDigest {\n if (a === b) {\n return true\n } else {\n const data = b as { code?: unknown, size?: unknown, bytes?: unknown }\n\n return (\n a.code === data.code &&\n a.size === data.size &&\n data.bytes instanceof Uint8Array &&\n equalBytes(a.bytes, data.bytes)\n )\n }\n}\n\n/**\n * Represents a multihash digest which carries information about the\n * hashing algorithm and an actual hash digest.\n */\nexport class Digest implements MultihashDigest {\n readonly code: Code\n readonly size: Size\n readonly digest: Uint8Array\n readonly bytes: Uint8Array\n\n /**\n * Creates a multihash digest.\n */\n constructor (code: Code, size: Size, digest: Uint8Array, bytes: Uint8Array) {\n this.code = code\n this.size = size\n this.digest = digest\n this.bytes = bytes\n }\n}\n\n/**\n * Used to check that the passed multihash has the passed code\n */\nexport function hasCode (digest: MultihashDigest, code: T): digest is MultihashDigest {\n return digest.code === code\n}\n", "import { base32 } from './bases/base32.js'\nimport { base36 } from './bases/base36.js'\nimport { base58btc } from './bases/base58.js'\nimport { coerce } from './bytes.js'\nimport * as Digest from './hashes/digest.js'\nimport * as varint from './varint.js'\nimport type * as API from './link/interface.js'\n\n// This way TS will also expose all the types from module\nexport * from './link/interface.js'\n\nexport function format , Prefix extends string> (link: T, base?: API.MultibaseEncoder): API.ToString {\n const { bytes, version } = link\n switch (version) {\n case 0:\n return toStringV0(\n bytes,\n baseCache(link),\n base as API.MultibaseEncoder<'z'> ?? base58btc.encoder\n )\n default:\n return toStringV1(\n bytes,\n baseCache(link),\n (base ?? base32.encoder) as API.MultibaseEncoder\n )\n }\n}\n\nexport function toJSON (link: Link): API.LinkJSON {\n return {\n '/': format(link)\n }\n}\n\nexport function fromJSON (json: API.LinkJSON): CID {\n return CID.parse(json['/'])\n}\n\nconst cache = new WeakMap>()\n\nfunction baseCache (cid: API.UnknownLink): Map {\n const baseCache = cache.get(cid)\n if (baseCache == null) {\n const baseCache = new Map()\n cache.set(cid, baseCache)\n return baseCache\n }\n return baseCache\n}\n\nexport class CID implements API.Link {\n readonly code: Format\n readonly version: Version\n readonly multihash: API.MultihashDigest\n readonly bytes: Uint8Array\n readonly '/': Uint8Array\n\n /**\n * @param version - Version of the CID\n * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv\n * @param multihash - (Multi)hash of the of the content.\n */\n constructor (version: Version, code: Format, multihash: API.MultihashDigest, bytes: Uint8Array) {\n this.code = code\n this.version = version\n this.multihash = multihash\n this.bytes = bytes\n\n // flag to serializers that this is a CID and\n // should be treated specially\n this['/'] = bytes\n }\n\n /**\n * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes`\n * please either use `CID.asCID(cid)` or switch to new signalling mechanism\n *\n * @deprecated\n */\n get asCID (): this {\n return this\n }\n\n // ArrayBufferView\n get byteOffset (): number {\n return this.bytes.byteOffset\n }\n\n // ArrayBufferView\n get byteLength (): number {\n return this.bytes.byteLength\n }\n\n toV0 (): CID {\n switch (this.version) {\n case 0: {\n return this as CID\n }\n case 1: {\n const { code, multihash } = this\n\n if (code !== DAG_PB_CODE) {\n throw new Error('Cannot convert a non dag-pb CID to CIDv0')\n }\n\n // sha2-256\n if (multihash.code !== SHA_256_CODE) {\n throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0')\n }\n\n return (\n CID.createV0(\n multihash as API.MultihashDigest\n )\n )\n }\n default: {\n throw Error(\n `Can not convert CID version ${this.version} to version 0. This is a bug please report`\n )\n }\n }\n }\n\n toV1 (): CID {\n switch (this.version) {\n case 0: {\n const { code, digest } = this.multihash\n const multihash = Digest.create(code, digest)\n return (\n CID.createV1(this.code, multihash)\n )\n }\n case 1: {\n return this as CID\n }\n default: {\n throw Error(\n `Can not convert CID version ${this.version} to version 1. This is a bug please report`\n )\n }\n }\n }\n\n equals (other: unknown): other is CID {\n return CID.equals(this, other)\n }\n\n static equals (self: API.Link, other: unknown): other is CID {\n const unknown = other as { code?: unknown, version?: unknown, multihash?: unknown }\n return (\n unknown != null &&\n self.code === unknown.code &&\n self.version === unknown.version &&\n Digest.equals(self.multihash, unknown.multihash)\n )\n }\n\n toString (base?: API.MultibaseEncoder): string {\n return format(this, base)\n }\n\n toJSON (): API.LinkJSON {\n return { '/': format(this) }\n }\n\n link (): this {\n return this\n }\n\n readonly [Symbol.toStringTag] = 'CID';\n\n // Legacy\n\n [Symbol.for('nodejs.util.inspect.custom')] (): string {\n return `CID(${this.toString()})`\n }\n\n /**\n * Takes any input `value` and returns a `CID` instance if it was\n * a `CID` otherwise returns `null`. If `value` is instanceof `CID`\n * it will return value back. If `value` is not instance of this CID\n * class, but is compatible CID it will return new instance of this\n * `CID` class. Otherwise returns null.\n *\n * This allows two different incompatible versions of CID library to\n * co-exist and interop as long as binary interface is compatible.\n */\n static asCID (input: API.Link | U): CID | null {\n if (input == null) {\n return null\n }\n\n const value = input as any\n if (value instanceof CID) {\n // If value is instance of CID then we're all set.\n return value\n } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) {\n // If value isn't instance of this CID class but `this.asCID === this` or\n // `value['/'] === value.bytes` is true it is CID instance coming from a\n // different implementation (diff version or duplicate). In that case we\n // rebase it to this `CID` implementation so caller is guaranteed to get\n // instance with expected API.\n const { version, code, multihash, bytes } = value\n return new CID(\n version,\n code,\n multihash as API.MultihashDigest,\n bytes ?? encodeCID(version, code, multihash.bytes)\n )\n } else if (value[cidSymbol] === true) {\n // If value is a CID from older implementation that used to be tagged via\n // symbol we still rebase it to the this `CID` implementation by\n // delegating that to a constructor.\n const { version, multihash, code } = value\n const digest = Digest.decode(multihash) as API.MultihashDigest\n return CID.create(version, code, digest)\n } else {\n // Otherwise value is not a CID (or an incompatible version of it) in\n // which case we return `null`.\n return null\n }\n }\n\n /**\n * @param version - Version of the CID\n * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv\n * @param digest - (Multi)hash of the of the content.\n */\n static create (version: Version, code: Format, digest: API.MultihashDigest): CID {\n if (typeof code !== 'number') {\n throw new Error('String codecs are no longer supported')\n }\n\n if (!(digest.bytes instanceof Uint8Array)) {\n throw new Error('Invalid digest')\n }\n\n switch (version) {\n case 0: {\n if (code !== DAG_PB_CODE) {\n throw new Error(\n `Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`\n )\n } else {\n return new CID(version, code, digest, digest.bytes)\n }\n }\n case 1: {\n const bytes = encodeCID(version, code, digest.bytes)\n return new CID(version, code, digest, bytes)\n }\n default: {\n throw new Error('Invalid version')\n }\n }\n }\n\n /**\n * Simplified version of `create` for CIDv0.\n */\n static createV0 (digest: API.MultihashDigest): CID {\n return CID.create(0, DAG_PB_CODE, digest)\n }\n\n /**\n * Simplified version of `create` for CIDv1.\n *\n * @param code - Content encoding format code.\n * @param digest - Multihash of the content.\n */\n static createV1 (code: Code, digest: API.MultihashDigest): CID {\n return CID.create(1, code, digest)\n }\n\n /**\n * Decoded a CID from its binary representation. The byte array must contain\n * only the CID with no additional bytes.\n *\n * An error will be thrown if the bytes provided do not contain a valid\n * binary representation of a CID.\n */\n static decode (bytes: API.ByteView>): CID {\n const [cid, remainder] = CID.decodeFirst(bytes)\n if (remainder.length !== 0) {\n throw new Error('Incorrect length')\n }\n return cid\n }\n\n /**\n * Decoded a CID from its binary representation at the beginning of a byte\n * array.\n *\n * Returns an array with the first element containing the CID and the second\n * element containing the remainder of the original byte array. The remainder\n * will be a zero-length byte array if the provided bytes only contained a\n * binary CID representation.\n */\n static decodeFirst (bytes: API.ByteView>): [CID, Uint8Array] {\n const specs = CID.inspectBytes(bytes)\n const prefixSize = specs.size - specs.multihashSize\n const multihashBytes = coerce(\n bytes.subarray(prefixSize, prefixSize + specs.multihashSize)\n )\n if (multihashBytes.byteLength !== specs.multihashSize) {\n throw new Error('Incorrect length')\n }\n const digestBytes = multihashBytes.subarray(\n specs.multihashSize - specs.digestSize\n )\n const digest = new Digest.Digest(\n specs.multihashCode,\n specs.digestSize,\n digestBytes,\n multihashBytes\n )\n const cid =\n specs.version === 0\n ? CID.createV0(digest as API.MultihashDigest)\n : CID.createV1(specs.codec, digest)\n return [cid as CID, bytes.subarray(specs.size)]\n }\n\n /**\n * Inspect the initial bytes of a CID to determine its properties.\n *\n * Involves decoding up to 4 varints. Typically this will require only 4 to 6\n * bytes but for larger multicodec code values and larger multihash digest\n * lengths these varints can be quite large. It is recommended that at least\n * 10 bytes be made available in the `initialBytes` argument for a complete\n * inspection.\n */\n static inspectBytes (initialBytes: API.ByteView>): { version: V, codec: C, multihashCode: A, digestSize: number, multihashSize: number, size: number } {\n let offset = 0\n const next = (): number => {\n const [i, length] = varint.decode(initialBytes.subarray(offset))\n offset += length\n return i\n }\n\n let version = next() as V\n let codec = DAG_PB_CODE as C\n if (version as number === 18) {\n // CIDv0\n version = 0 as V\n offset = 0\n } else {\n codec = next() as C\n }\n\n if (version !== 0 && version !== 1) {\n throw new RangeError(`Invalid CID version ${version}`)\n }\n\n const prefixSize = offset\n const multihashCode = next() as A // multihash code\n const digestSize = next() // multihash length\n const size = offset + digestSize\n const multihashSize = size - prefixSize\n\n return { version, codec, multihashCode, digestSize, multihashSize, size }\n }\n\n /**\n * Takes cid in a string representation and creates an instance. If `base`\n * decoder is not provided will use a default from the configuration. It will\n * throw an error if encoding of the CID is not compatible with supplied (or\n * a default decoder).\n */\n static parse (source: API.ToString, Prefix>, base?: API.MultibaseDecoder): CID {\n const [prefix, bytes] = parseCIDtoBytes(source, base)\n\n const cid = CID.decode(bytes)\n\n if (cid.version === 0 && source[0] !== 'Q') {\n throw Error('Version 0 CID string must not include multibase prefix')\n }\n\n // Cache string representation to avoid computing it on `this.toString()`\n baseCache(cid).set(prefix, source)\n\n return cid\n }\n}\n\nfunction parseCIDtoBytes (source: API.ToString, Prefix>, base?: API.MultibaseDecoder): [Prefix, API.ByteView>] {\n switch (source[0]) {\n // CIDv0 is parsed differently\n case 'Q': {\n const decoder = base ?? base58btc\n return [\n base58btc.prefix as Prefix,\n decoder.decode(`${base58btc.prefix}${source}`)\n ]\n }\n case base58btc.prefix: {\n const decoder = base ?? base58btc\n return [base58btc.prefix as Prefix, decoder.decode(source)]\n }\n case base32.prefix: {\n const decoder = base ?? base32\n return [base32.prefix as Prefix, decoder.decode(source)]\n }\n case base36.prefix: {\n const decoder = base ?? base36\n return [base36.prefix as Prefix, decoder.decode(source)]\n }\n default: {\n if (base == null) {\n throw Error(\n 'To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided'\n )\n }\n return [source[0] as Prefix, base.decode(source)]\n }\n }\n}\n\nfunction toStringV0 (bytes: Uint8Array, cache: Map, base: API.MultibaseEncoder<'z'>): string {\n const { prefix } = base\n if (prefix !== base58btc.prefix) {\n throw Error(`Cannot string encode V0 in ${base.name} encoding`)\n }\n\n const cid = cache.get(prefix)\n if (cid == null) {\n const cid = base.encode(bytes).slice(1)\n cache.set(prefix, cid)\n return cid\n } else {\n return cid\n }\n}\n\nfunction toStringV1 (bytes: Uint8Array, cache: Map, base: API.MultibaseEncoder): string {\n const { prefix } = base\n const cid = cache.get(prefix)\n if (cid == null) {\n const cid = base.encode(bytes)\n cache.set(prefix, cid)\n return cid\n } else {\n return cid\n }\n}\n\nconst DAG_PB_CODE = 0x70\nconst SHA_256_CODE = 0x12\n\nfunction encodeCID (version: API.Version, code: number, multihash: Uint8Array): Uint8Array {\n const codeOffset = varint.encodingLength(version)\n const hashOffset = codeOffset + varint.encodingLength(code)\n const bytes = new Uint8Array(hashOffset + multihash.byteLength)\n varint.encodeTo(version, bytes, 0)\n varint.encodeTo(code, bytes, codeOffset)\n bytes.set(multihash, hashOffset)\n return bytes\n}\n\nconst cidSymbol = Symbol.for('@ipld/js-cid/CID')\n", "import type { ArrayBufferView, ByteView } from './interface.js'\n\nconst textEncoder = new TextEncoder()\nconst textDecoder = new TextDecoder()\n\nexport const name = 'json'\nexport const code = 0x0200\n\nexport function encode (node: T): ByteView {\n return textEncoder.encode(JSON.stringify(node))\n}\n\nexport function decode (data: ByteView | ArrayBufferView): T {\n return JSON.parse(textDecoder.decode(data))\n}\n", "import * as Digest from './digest.js'\nimport type { MultihashHasher } from './interface.js'\n\ntype Await = Promise | T\n\nexport function from ({ name, code, encode }: { name: Name, code: Code, encode(input: Uint8Array): Await }): Hasher {\n return new Hasher(name, code, encode)\n}\n\n/**\n * Hasher represents a hashing algorithm implementation that produces as\n * `MultihashDigest`.\n */\nexport class Hasher implements MultihashHasher {\n readonly name: Name\n readonly code: Code\n readonly encode: (input: Uint8Array) => Await\n\n constructor (name: Name, code: Code, encode: (input: Uint8Array) => Await) {\n this.name = name\n this.code = code\n this.encode = encode\n }\n\n digest (input: Uint8Array): Await> {\n if (input instanceof Uint8Array) {\n const result = this.encode(input)\n return result instanceof Uint8Array\n ? Digest.create(this.code, result)\n /* c8 ignore next 1 */\n : result.then(digest => Digest.create(this.code, digest))\n } else {\n throw Error('Unknown type, must be binary type')\n /* c8 ignore next 1 */\n }\n }\n}\n", "/* global crypto */\n\nimport { from } from './hasher.js'\n\nfunction sha (name: AlgorithmIdentifier): (data: Uint8Array) => Promise {\n return async data => new Uint8Array(await crypto.subtle.digest(name, data))\n}\n\nexport const sha256 = from({\n name: 'sha2-256',\n code: 0x12,\n encode: sha('SHA-256')\n})\n\nexport const sha512 = from({\n name: 'sha2-512',\n code: 0x13,\n encode: sha('SHA-512')\n})\n", "import { CID } from \"multiformats/cid\";\nimport * as json from \"multiformats/codecs/json\";\nimport { sha256 } from \"multiformats/hashes/sha2\";\n\nconst hashBrowser = async (val: string) => {\n const bytes = json.encode(val);\n\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, json.code, hash);\n\n return cid.toString();\n};\n\nexport default hashBrowser;\n", "const isJSON = (str: string) => {\n try {\n JSON.parse(str);\n } catch (_e) {\n return false;\n }\n return true;\n};\n\nexport default isJSON;\n", "import select from \"./dom.js\";\n\nconst _getBasePageTitle = () => {\n const titleSections = document.title.split(\"|\");\n const baseTitle = titleSections[0];\n return baseTitle;\n};\n\nconst setPageTitle = (what) => {\n const baseTitle = _getBasePageTitle();\n document.title = baseTitle.trim() + \" | \" + what.trim();\n select(\".title h3\").html(what.trim());\n};\n\nconst resetPageTitle = () => {\n const baseTitle = _getBasePageTitle();\n document.title = baseTitle;\n select(\"title\").innerHTML(`${TITLE_NAME} v${VERSION}`);\n select(\".title h3\").innerHTML(\n `${TITLE_NAME} v${VERSION}`,\n );\n};\n\nexport { resetPageTitle, setPageTitle };\n", "export const url = {\n baseUrl: `${globalThis.location.origin}${globalThis.location.pathname}`,\n get: function () {\n return globalThis.location.href;\n },\n getPageId: function (url = globalThis.location.href) {\n const URLObject = new URL(url);\n const hash = URLObject.hash.slice(1);\n const hashWithVersion = hash.split(\"?\");\n const pageId = hashWithVersion[0] || null;\n return pageId;\n },\n getSearchParams: function (url = globalThis.location.href) {\n const URLObject = new URL(url);\n const urlParts = URLObject.href.split(\"?\");\n const currentParams = urlParts[1] || \"\";\n const searchParams = new URLSearchParams(currentParams);\n return searchParams;\n },\n getParamsObject: function (\n url = globalThis.location.href,\n ): Record {\n const params = this.getSearchParams(url);\n let parametersObject = {};\n for (const key of params.keys()) {\n parametersObject = {\n ...parametersObject,\n [key]: this.getSearchParam(key, url),\n };\n }\n return parametersObject;\n },\n getSearchParam(param: string, url = globalThis.location.href) {\n const params = this.getSearchParams(url);\n const paramValue = params.get(param);\n return paramValue;\n },\n deleteParam: function (param: string | Array) {\n const searchParams = this.getSearchParams();\n if (Array.isArray(param)) {\n param.forEach((p) => {\n searchParams.delete(p);\n });\n } else {\n searchParams.delete(param);\n }\n const { pathname } = globalThis.location;\n const hash = this.getPageId();\n return globalThis.location.assign(\n `${hash ? `#${hash}` : pathname}${\n searchParams.toString() ? `?${searchParams.toString()}` : \"\"\n }`,\n );\n },\n // @ts-ignore as this is not ideal here along with TS\n set: function (pageId = this.getPageId(), params = this.getParamsObject()) {\n const allParams = {\n ...this.getParamsObject(),\n ...params,\n };\n const newParams = new URLSearchParams(allParams);\n return globalThis.location.assign(`#${pageId}?${newParams.toString()}`);\n },\n};\n", "import select from \"../../utils/dom.js\";\n\nexport const setSavedState = (saved = true) => {\n if (saved) {\n select(\"#save\").removeClass(\"unsaved\");\n select(\"#logo\").removeClass(\"unsaved\");\n } else {\n select(\"#save\").addClass(\"unsaved\");\n select(\"#logo\").addClass(\"unsaved\");\n }\n};\n", "import select from \"../../../utils/dom.js\";\nimport { deleteFileOnGist } from \"../../../utils/github/api.ts\";\nimport hashBrowser from \"../../../utils/hashBrowser.ts\";\nimport isJSON from \"../../../utils/isJSON.ts\";\nimport storage from \"../../../utils/localstorage.js\";\nimport { resetPageTitle, setPageTitle } from \"../../../utils/pageTitle.js\";\nimport { url } from \"../../../utils/urlManager.ts\";\nimport notify from \"../../molecules/notify.ts\";\nimport commander from \"../commander/commander.ts\";\nimport { setSavedState } from \"../../../ui/functions/savedState.ts\";\n\nconst encodeTitle = (title: string) => {\n const encodedTitle = encodeURIComponent(title);\n if (encodedTitle.length === 0) {\n throw new Error(\"You need to start with a valid title for your note!\");\n }\n return encodedTitle;\n};\n\nexport const getDateCreatedFromTitle = (title: string): number => {\n const titleID = getTitleId(title);\n const note = getNote(titleID);\n if (note) {\n const { dateCreated } = note;\n return dateCreated;\n }\n throw new Error(`Note \"${title}\" cannot found!`);\n};\n\nexport const markNoteForDeletion = (id: string) => {\n const note = getNote(id);\n if (note) {\n localStorage.setItem(\n id,\n JSON.stringify({\n title: note.title,\n deleted: true,\n revisions: note.revisions,\n }),\n );\n }\n};\n\nexport type Note = {\n id: string;\n title: string;\n text: string;\n dateCreated: number;\n deleted: boolean;\n lines: Array;\n numberOfRevisions: number;\n disableSync: boolean;\n revisions: {\n [key: string]: {\n text: string;\n dateCreated: number;\n };\n };\n};\n\nexport const getNote = (\n titleID = url.getPageId(),\n revision?: string,\n): Note | null => {\n let doc;\n try {\n doc = JSON.parse(storage.get(titleID));\n if (!doc.revisions) {\n throw new Error(\"This is not a note!\");\n }\n } catch (_e) {\n return null;\n }\n\n const newerNote = doc\n ? Object.values(doc.revisions).reduce(\n // deno-lint-ignore no-explicit-any\n (acc: any, note: any) => note.dateCreated > acc.dateCreated ? note : acc,\n { dateCreated: 0 },\n )\n : {};\n\n const noteToReturn = revision ? doc.revisions[revision] : newerNote;\n\n return titleID\n ? {\n ...doc,\n id: titleID,\n ...(noteToReturn ? noteToReturn : {}),\n numberOfRevisions: doc && doc.revisions\n ? Object.keys(doc.revisions).length\n : undefined,\n title: doc.title,\n }\n : null;\n};\n\nexport const disableSyncOnCurrentNote = (value: boolean) => {\n const note = getNote();\n if (note) {\n storage.update(note.id, {\n disableSync: value,\n });\n notify.info(\n `\"${note.title}\" cloud sync ${value ? \"disabled \uD83D\uDE36\" : \"enabled \u26A1\uFE0F\"}`,\n );\n }\n};\n\nexport const setNoteFromHash = (hash = url.getPageId()) => {\n if (hash) {\n const version = url.getSearchParam(\"v\") || undefined;\n const note = getNote(undefined, version);\n if (note) {\n select(\"#revisions\").html(\n `${note.numberOfRevisions} revision${\n note.numberOfRevisions > 1 ? \"s\" : \"\"\n }`,\n );\n setPageTitle(note.title);\n select(\".terminal\").setValue(note.text);\n }\n\n if (!note) {\n notify.error(\"404 Note not found \uD83E\uDD37\u200D\u2642\uFE0F\");\n }\n }\n};\n\nexport const resetNoteManager = () => {\n location.hash = \"\";\n resetPageTitle();\n select(\"#revisions\").html(\"\");\n select(\".terminal\").setValue(\"\").focus();\n setSavedState();\n};\n\nexport const getTitle = (note = \"\") =>\n note.split(\"\\n\")[0].trim().replace(\"#\", \"\").trim();\n\nexport const getTitleId = (note: string) => {\n const title = getTitle(note);\n return encodeTitle(title);\n};\n\nexport const updateNote = async (what: string) => {\n if (what.length) {\n const titleID = getTitleId(what);\n const title = getTitle(what);\n const existingNote = getNote(titleID);\n if (existingNote === null) {\n // new existingNote\n return saveNote(what);\n }\n const { text } = existingNote;\n const hashOfIncomingNote = await hashBrowser(what);\n const hashOfCurrentNote = await hashBrowser(text);\n\n if (hashOfIncomingNote === hashOfCurrentNote) {\n return;\n }\n\n const currentNote = storage.get(titleID);\n const note = JSON.parse(currentNote);\n storage.set(\n titleID,\n JSON.stringify({\n ...note,\n title,\n revisions: {\n ...((note && note.revisions) || {}),\n [hashOfIncomingNote]: {\n dateCreated: Date.now(),\n text: what,\n },\n },\n }),\n );\n }\n};\n\nexport const saveNote = async (\n what = select(\".terminal\").getValue(),\n) => {\n await storage.saveToDictionary(what);\n if (what.length) {\n const hash = await hashBrowser(what);\n try {\n const title = what.split(\"\\n\")[0].trim().replace(\"#\", \"\").trim();\n\n setPageTitle(title);\n\n const titleID = encodeTitle(title);\n const currentNote = storage.get(titleID);\n const note = JSON.parse(currentNote);\n storage.set(\n titleID,\n JSON.stringify({\n ...note,\n title,\n lines: what.split(\"\\n\"),\n revisions: {\n ...((note && note.revisions) || {}),\n [hash]: {\n dateCreated: Date.now(),\n text: what,\n },\n },\n }),\n );\n url.set(titleID, {\n v: hash,\n });\n storage.set(\"lastLocalUpdate\", new Date());\n notify.success(\"\uD83D\uDC4C Note saved!\");\n setSavedState();\n } catch (e) {\n notify.error(\n `\uD83D\uDE31 Something went wrong while trying to save to local storage ${e}`,\n );\n }\n } else {\n notify.warning(\"\uD83D\uDE15 Nothing to save!\"); // eslint-disable-line\n }\n};\n\nexport const getNotes = ({\n includeDeleted = false,\n}: {\n includeDeleted?: boolean;\n} = {}): Array =>\n Object.entries(localStorage)\n .filter(([, body]) => typeof body === \"string\")\n .filter(([id, body]) => !id.startsWith(\"__\") && isJSON(body))\n .map(([id, body]) => [id, JSON.parse(body)])\n .filter(([, body]) => !!body.title) // check if title exists and therefore is a note\n .reduce((acc, [noteId]) => [...acc, getNote(noteId)], [])\n .filter(({ deleted }) => (includeDeleted ? true : !deleted));\n\nexport const search = (q: string | null = null) => {\n if (!q) {\n return undefined;\n }\n\n const results = getNotes()\n .map(({ id }) => getNote(id))\n .filter((note) => note !== null)\n .filter(({ text }) => {\n return text.toLowerCase().includes(q.toLowerCase());\n });\n\n return results[0];\n};\n\nexport const deleteNote = () => {\n const confirmation = confirm(\"Are you sure you want do that?\");\n if (confirmation) {\n const note = getNote();\n resetNoteManager();\n if (note && note.id) {\n deleteFileOnGist(note.id);\n markNoteForDeletion(note.id);\n }\n }\n commander.hide();\n};\n", "import storage from \"./localstorage.js\";\n\nexport const isUserLoggedIn = () => {\n return !!storage.get(\"authToken\");\n};\n", "import { isElement } from \"../../../utils/dom.js\";\n\nexport const command = (\n { title, secondary, onclick, onSecondaryClick, icon },\n selected = false,\n) => {\n const li = document.createElement(\"LI\");\n li.className = selected ? \"selected\" : \"\";\n if (icon) {\n const iconClone = icon.cloneNode(true);\n li.appendChild(iconClone);\n }\n const liContent = isElement(title) ? title : document.createTextNode(title);\n liContent.onclick = onclick;\n li.appendChild(liContent);\n\n const span = document.createElement(\"span\");\n if (secondary) {\n span.className = \"secondary\";\n const secondaryElement = isElement(secondary)\n ? secondary\n : document.createTextNode(secondary);\n secondaryElement.onclick = onSecondaryClick;\n span.appendChild(secondaryElement);\n }\n li.appendChild(span);\n\n return li;\n};\n", "export const wordParts = (word: string, match: string) => {\n const parts = word.toLowerCase().split(match);\n\n let indexInWord = 0;\n return parts\n // @ts-ignore js-to-ts wider refactoring required\n .reduce((acc, part, i) => {\n return [...acc, ...(i === 0 ? [part] : [match, part])];\n }, [])\n // @ts-ignore js-to-ts wider refactoring required\n .filter((p) => p !== \"\")\n // @ts-ignore js-to-ts wider refactoring required\n .map((syllable) => {\n indexInWord = indexInWord + syllable.length;\n const start = indexInWord - syllable.length;\n const end = start + syllable.length;\n const originalSyllable = word.slice(start, end);\n return originalSyllable;\n });\n};\n", "import { wordParts } from \"./wordParts.ts\";\n\nconst mark = (word) => {\n const markEl = document.createElement(\"mark\");\n markEl.appendChild(document.createTextNode(word));\n return markEl;\n};\n\nexport const div = ({ content = \"\", highlight = \"\" }) => {\n const div = document.createElement(\"div\");\n const words = content.split(\" \");\n const wordsToHighlight = highlight.toLowerCase().split(\" \");\n if (highlight.trim() === \"\") {\n div.appendChild(document.createTextNode(content));\n return div;\n }\n words\n .map((word) => {\n const matches = wordsToHighlight\n .map((wordToHighlight) => {\n return word.toLocaleLowerCase().includes(wordToHighlight)\n ? wordToHighlight\n : undefined;\n })\n .filter((m) => m !== undefined);\n\n return {\n word: word,\n matches: matches,\n };\n })\n .forEach(({ word, matches }) => {\n if (matches.length > 0) {\n const match = matches[0];\n if (word === match) {\n div.appendChild(mark(` ${word}`));\n } else {\n const parts = wordParts(word, match);\n const wordElements = parts.map((syllable) =>\n syllable.toLowerCase() === match\n ? mark(syllable)\n : document.createTextNode(syllable)\n );\n div.appendChild(document.createTextNode(\" \"));\n wordElements.forEach((w) => {\n div.appendChild(w);\n });\n }\n } else {\n div.appendChild(document.createTextNode(` ${word} `));\n }\n });\n return div;\n};\n", "import {\n createNewGist,\n getAuthenticatedUsersGists,\n getAuthToken,\n getGist,\n} from \"./api.ts\";\nimport storage from \"../localstorage.js\";\nimport { url } from \"../urlManager.ts\";\nimport select from \"../dom.js\";\nimport { configuration } from \"../../../configuration.ts\";\nimport { updateNote } from \"../../components/organisms/noteManager/noteManager.ts\";\nimport notify from \"../../components/molecules/notify.ts\";\nimport { command } from \"../../components/molecules/commands/command.js\";\nimport commander from \"../../components/organisms/commander/commander.ts\";\nimport { div } from \"../../components/atoms/div/div.js\";\n\nexport const goAuthenticate = () => {\n notify.info(\"You need to be authenticated!\");\n commander.hide();\n return globalThis.location.replace(\n `https://github.com/login/oauth/authorize?client_id=${configuration.github.client_id}&scope=gist&state=${configuration.github.request_state}`,\n );\n};\n\nexport const setGistToSyncWith = async (token) => {\n notify.info(\"Downloading my Gists!\");\n const gists = await getAuthenticatedUsersGists(token);\n commander.setState({\n mode: commander.getModes().gists,\n });\n\n notify.info(\"Select Gist to sync with\");\n const gistOptions = gists\n .sort(\n (a, b) =>\n new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime(),\n )\n .map(({ description, updated_at, id }) => ({\n title: div({ content: `${description}(${id})` }),\n secondary: updated_at,\n onclick: async () => {\n await storage.set(\"gistId\", id);\n notify.success(`${description}(${id}) selected for synchronization!`);\n syncNotesWithGitHub();\n commander.hide();\n },\n }));\n\n const gistOptionComponents = command([\n {\n title: \"Create a new Gist\",\n onclick: async () => {\n notify.info(\"Syncing your MiroPads to a new Gist\");\n try {\n const { id } = await createNewGist();\n storage.set(\"gistId\", id);\n notify.success(\"MiroPads synced to a new Gist \uD83C\uDF89\");\n } catch (error) {\n notify.error(error.message);\n }\n commander.hide();\n },\n },\n ...gistOptions,\n ]);\n select(\"#commands\").html(\"\");\n select(\"#commands\").append(gistOptionComponents);\n};\n\nexport const syncNotesWithGitHub = async (gistId = storage.get(\"gistId\")) => {\n const authToken = storage.get(\"authToken\");\n if (authToken && gistId) {\n select(\"#logo\").addClass(\"loading\");\n const { files } = await getGist(gistId);\n Object.values(files).forEach(({ content }) => {\n updateNote(content);\n });\n storage.set(\"lastSync\", new Date());\n notify.success(\"\u2B07 MiroPad synced \u2705\");\n select(\"#logo\").removeClass(\"loading\");\n }\n};\n\nexport const setAuthTokenFromCallback = async () => {\n const code = url.getSearchParam(\"code\");\n const state = url.getSearchParam(\"state\");\n if (code && state) {\n select(\"#logo\").addClass(\"loading\");\n notify.info(\"\uD83D\uDD10 Authenticating...\");\n try {\n const { token } = await getAuthToken(code, state);\n storage.set(\"authToken\", token);\n notify.info(\"\u26F3 You have been authenticated!\");\n url.deleteParam([\"code\", \"state\"]);\n } catch (error) {\n notify.error(error.message);\n }\n select(\"#logo\").removeClass(\"loading\");\n }\n};\n", "import notify from \"../../components/molecules/notify.ts\";\n\nconst getNewFileHandle = async (title = \"no-titled\") => {\n const options = {\n suggestedName: `${title}`,\n types: [\n {\n description: \"MiroPad text notes\",\n accept: {\n \"text/plain\": [\".miropad\"],\n },\n },\n ],\n };\n\n // @ts-ignore as this is an experimental browser feature\n // and may need to change https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker\n const handle = await globalThis.showSaveFilePicker(options);\n return handle;\n};\n\nexport const writeFile = async (\n fileHandle: FileSystemFileHandle,\n contents: string,\n) => {\n // Create a FileSystemWritableFileStream to write to.\n const writable = await fileHandle.createWritable();\n // Write the contents of the file to the stream.\n await writable.write(contents);\n // Close the file and write the contents to disk.\n await writable.close();\n};\n\n/**\n * Saves a new file to disk.\n */\nexport const saveFileAs = async (contents: string, title?: string) => {\n try {\n const fileHandle = await getNewFileHandle(title);\n await writeFile(fileHandle, contents);\n } catch (_e) {\n const msg = \"An error occurred trying to save the file.\";\n notify.error(msg);\n return;\n }\n};\n\nexport const saveDataToFile = (() => {\n const a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.setAttribute(\"style\", \"display: none\");\n return (\n data: unknown,\n fileName = `MiroPad-${new Date().toISOString()}.json`,\n ) => {\n const json = JSON.stringify(data),\n blob = new Blob([json], { type: \"octet/stream\" }),\n url = globalThis.URL.createObjectURL(blob);\n a.href = url;\n a.download = fileName;\n a.click();\n globalThis.URL.revokeObjectURL(url);\n };\n})();\n", "import type _Showdown from \"npm:@types/showdown\";\nimport showdown from \"showdown\";\n\nconst converter = new showdown.Converter({\n tasklists: true,\n underline: true,\n emoji: true,\n simplifiedAutoLink: true,\n tables: true,\n openLinksInNewWindow: true,\n});\n\nconverter.setFlavor(\"github\");\n\nexport const convertMarkDownToHtml = (md: string) => converter.makeHtml(md);\n", "import storage from \"./localstorage.js\";\nimport notify from \"../components/molecules/notify.ts\";\nimport { configuration } from \"../../configuration.ts\";\nimport { getTitle } from \"../components/organisms/noteManager/noteManager.ts\";\nimport { convertMarkDownToHtml } from \"../components/organisms/markdown/mdToHtml.ts\";\n\nexport const handleErrorResponse = (response) => {\n const isSuccessfulRequest = response.status.toString().slice(0, 1) === \"2\";\n if (isSuccessfulRequest) return response;\n else throw new Error(response);\n};\n\nconst wrapTemplate = (body = \"\") => {\n return `\n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n\n \n
    \n
    \n `;\n};\n\nconst sendMail = async (body, email, subject = \"MiroPad note\") => {\n if (!body) {\n notify.error(\"\uD83D\uDC7B No message to send, type something and try again! \uD83E\uDD13\");\n return undefined;\n }\n try {\n await fetch(`${configuration.mail_service.api}`, {\n method: \"POST\",\n headers: {\n \"x-secret-token\": storage.get(\"MIROPAD_SECRET_TOKEN\"),\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n },\n body: JSON.stringify({\n to: email,\n subject,\n html: wrapTemplate(body),\n }),\n })\n .then(handleErrorResponse)\n .then((response) => response.json());\n\n notify.success(\"Email sent \uD83D\uDE80\");\n } catch (_e) {\n notify.error(\n \"Error not went through \uD83D\uDCA5! Check your credentials and try again!\",\n );\n }\n};\n\nconst getUserMailingPreferences = () => {\n const savedMail = storage.get(\"mail\");\n if (savedMail) {\n const mailSameAgainQuestion = globalThis.prompt(\n `Mail ${savedMail} again? (y)es/(no)`,\n \"yeap\",\n );\n if (mailSameAgainQuestion === null) {\n return mailSameAgainQuestion;\n }\n if (mailSameAgainQuestion.slice(0, 1).toLowerCase() === \"y\") {\n return savedMail;\n }\n }\n const whoMailing = globalThis.prompt(\"Where do you wanna send the mail to?\");\n const wannaSaveDat = globalThis.prompt(\n \"Do you wanna save that to your preferences for later on? (y)es/(no)\",\n \"yeap\",\n );\n if (wannaSaveDat && wannaSaveDat.slice(0, 1).toLowerCase() === \"y\") {\n storage.set(\"mail\", whoMailing);\n }\n return whoMailing;\n};\n\nconst mailTo = (what) => {\n const email = getUserMailingPreferences();\n if (email === null) {\n notify.info(\"Sending mail cancelled \uD83D\uDE36\");\n return undefined;\n }\n\n notify.info(\"Sending mail... \uD83D\uDE80\");\n const title = getTitle(what);\n const htmlBody = convertMarkDownToHtml(what);\n\n sendMail(htmlBody, email, title);\n};\n\nexport { mailTo };\n", "import notify from \"../components/molecules/notify.ts\";\n\nexport const copyToClipboard = async (\n what: string,\n message = \"\uD83D\uDCCB Copied to clipboard\",\n) => {\n try {\n await navigator.clipboard.writeText(what);\n notify.success(message);\n } catch (error) {\n notify.error((error as Error).message);\n }\n};\n", "import { isArray } from \"../../../utils/isArray.ts\";\n\nexport const button = (els, fn, id) => {\n const elements = isArray(els) ? els : [els];\n const button = document.createElement(\"button\");\n button.setAttribute(\"type\", \"button\");\n if (id) {\n button.setAttribute(\"id\", id);\n }\n elements.forEach((element) => {\n if (typeof element === \"string\") {\n button.appendChild(document.createTextNode(element));\n } else {\n button.appendChild(element);\n }\n });\n button.onclick = (e) => fn(e);\n\n return button;\n};\n", "import select from \"../../../utils/dom.js\";\nimport { url } from \"../../../utils/urlManager.ts\";\nimport { copyToClipboard } from \"../../../utils/copyToClipboard.ts\";\nimport { button } from \"../../atoms/button/button.js\";\nimport { convertMarkDownToHtml } from \"./mdToHtml.ts\";\nimport storage from \"../../../utils/localstorage.js\";\n\nconst markDownViewer = (() => {\n return {\n view: select(\".preview\"),\n init: function () {\n this.update();\n select(\".terminal\").listen(\"input\", () => this.update());\n const isVisible = Boolean(url.getSearchParam(\"md\"));\n if (isVisible) {\n this.view.show();\n } else {\n this.view.hide();\n }\n return this;\n },\n autoLink: function () {\n const autoLinks = storage.parse(\"__auto-links__\");\n // Regular expression to match any words starting with the given patterns\n const replacingPatterns = Object.keys(autoLinks)\n .map((pattern) => `${pattern}\\\\w+`)\n .join(\"|\");\n const regex = new RegExp(`(${replacingPatterns})`, \"g\");\n\n const updatedHTML = this.view.el.innerHTML.replace(regex, (match) => {\n const matchingKey = Object.keys(autoLinks).find((link) =>\n match.startsWith(link)\n );\n const link = autoLinks[matchingKey];\n return link.startsWith(\"http\")\n ? `
    ${match}`\n : `${match}`;\n });\n // Replace each matching text with a link\n this.view.innerHTML(updatedHTML);\n },\n update: function () {\n const md = select(\".terminal\").getValue();\n\n this.view.innerHTML(convertMarkDownToHtml(md));\n\n this.autoLink();\n\n const { elements } = select(\"pre\");\n Array.prototype.slice.call(elements).forEach((el) => {\n const copyBtn = button(\"\uD83D\uDCCB Copy\", async (e) => {\n e.stopPropagation();\n const codeToCopy = e.srcElement.previousSibling.innerHTML;\n await copyToClipboard(codeToCopy, \"\uD83D\uDCCB Code copied to clipboard\");\n });\n el.appendChild(copyBtn);\n });\n\n select(\"code\").listenAll(\"click\", ({ innerHTML }) => {\n const result = eval(innerHTML);\n select(\".console\").show().innerHTML(result);\n });\n select(\".console\").listen(\"click\", async (e) => {\n e.srcElement.classList.add(\"hidden\");\n const codeToCopy = e.srcElement.innerHTML;\n await copyToClipboard(codeToCopy, \"\uD83D\uDCCB Code copied to clipboard\");\n });\n },\n show: function (mode = true) {\n this.view.show();\n url.set(undefined, {\n md: mode,\n });\n },\n hide: function () {\n this.view.hide();\n url.deleteParam(\"md\");\n },\n toggle: function (mode = \"true\") {\n if (url.getSearchParam(\"md\") === mode) {\n this.hide();\n } else {\n this.show(mode);\n }\n return this;\n },\n };\n})();\n\nexport default markDownViewer;\n", "import isJSON from \"./isJSON.ts\";\nimport notify from \"../components/molecules/notify.ts\";\n\nconst prettifyJSON = (selector) => {\n const el = document.querySelector(selector);\n if (isJSON(el.value)) {\n const prettifiedJSON = JSON.stringify(JSON.parse(el.value), null, 2);\n el.value = prettifiedJSON;\n notify.success(\"\uD83D\uDC4D JSON value prettified\");\n } else {\n notify.error(\"\uD83D\uDE27 Value is not in valid JSON format\");\n }\n};\n\nexport default prettifyJSON;\n", "export const sleep = (ms = 1000) =>\n new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n", "export const icon = (svgIcon, altText, className) => {\n const image = document.createElement(\"IMG\");\n\n if (className) image.classList.add(className);\n if (altText) image.setAttribute(\"alt\", altText);\n image.setAttribute(\"src\", svgIcon);\n return image;\n};\n", "import notify from \"../components/molecules/notify.ts\";\nimport { getNote } from \"../components/organisms/noteManager/noteManager.ts\";\nimport { url } from \"./urlManager.ts\";\n\nexport const share = async () => {\n try {\n const note = getNote();\n const currentUrl = url.get();\n await navigator.share({\n title: note ? note.title : TITLE_NAME,\n text: note ? note.text : \"Temporary note keeping app for the browser\",\n url: currentUrl,\n });\n } catch (error) {\n notify.info(`${error.message}`);\n }\n};\n", "import {\n deleteNote,\n getNote,\n getNotes,\n resetNoteManager,\n saveNote,\n} from \"../noteManager/noteManager.ts\";\nimport select from \"../../../utils/dom.js\";\nimport storage from \"../../../utils/localstorage.js\";\nimport { isUserLoggedIn } from \"../../../utils/isUserLoggedIn.js\";\nimport {\n goAuthenticate,\n setGistToSyncWith,\n syncNotesWithGitHub,\n} from \"../../../utils/github/actions.js\";\nimport commander from \"./commander.ts\";\nimport {\n saveDataToFile,\n saveFileAs,\n} from \"../../../utils/fileSystem/fileSystem.ts\";\nimport { url } from \"../../../utils/urlManager.ts\";\nimport { mailTo } from \"../../../utils/mail.js\";\nimport markDownViewer from \"../markdown/markDownViewer.js\";\nimport prettifyJSON from \"../../../utils/prettifyJSON.js\";\nimport notify from \"../../molecules/notify.ts\";\nimport { copyToClipboard } from \"../../../utils/copyToClipboard.ts\";\nimport { sleep } from \"../../../utils/sleep.js\";\nimport { publishGist, updateGist } from \"../../../utils/github/api.ts\";\nimport { icon } from \"../../atoms/icon/icon.js\";\nimport * as ListSVG from \"../../../../assets/svg/list.svg\";\nimport * as TrashSVG from \"../../../../assets/svg/trash.svg\";\nimport * as CheckmarkCircleSVG from \"../../../../assets/svg/checkmark-circle.svg\";\nimport * as CloudSyncSVG from \"../../../../assets/svg/cloud-sync.svg\";\nimport * as LighterSVG from \"../../../../assets/svg/lighter.svg\";\nimport * as EnterDownSVG from \"../../../../assets/svg/enter-down.svg\";\nimport * as DownloadSVG from \"../../../../assets/svg/download.svg\";\nimport * as EnvelopeSVG from \"../../../../assets/svg/envelope.svg\";\nimport * as BugSVG from \"../../../../assets/svg/bug.svg\";\nimport * as PictureSVG from \"../../../../assets/svg/picture.svg\";\nimport * as PrinterSVG from \"../../../../assets/svg/printer.svg\";\nimport * as PageBreakSVG from \"../../../../assets/svg/page-break.svg\";\nimport * as FrameExpandSVG from \"../../../../assets/svg/frame-expand.svg\";\nimport * as ArrowRightCircleSVG from \"../../../../assets/svg/arrow-right-circle.svg\";\nimport * as MagicWandSVG from \"../../../../assets/svg/magic-wand.svg\";\nimport * as RocketSVG from \"../../../../assets/svg/rocket.svg\";\nimport * as SpellCheckSVG from \"../../../../assets/svg/spell-check.svg\";\nimport * as PencilSVG from \"../../../../assets/svg/pencil.svg\";\nimport * as ShareSVG from \"../../../../assets/svg/exit-up.svg\";\nimport * as LeafSVG from \"../../../../assets/svg/leaf.svg\";\nimport { share } from \"../../../utils/webShare.js\";\nimport { setSavedState } from \"../../../ui/functions/savedState.ts\";\n\nconst getSyncTitle = () => {\n const gistId = storage.get(\"gistId\");\n const authToken = storage.get(\"authToken\");\n if (!authToken) {\n return \"Sync: Authorize your GitHub account for synchronisation\";\n }\n if (!gistId) {\n return \"Sync: Pick your Gist to sync with\";\n }\n return \"Sync: Notes with my GitHub Gist\";\n};\n\nconst shareNoteCommand = {\n title: \"Share note\",\n icon: icon(ShareSVG, \"share note\"),\n sortTitle: \"Share\",\n call: share,\n};\n\nconst sharePublicLinkCommand = {\n title: \"Share public link\",\n key: null,\n icon: icon(ShareSVG, \"share public link\"),\n sortTitle: \"Share public link\",\n call: async () => {\n commander.hide();\n await saveNote(select(\".terminal\").getValue());\n const note = getNote();\n if (note) {\n const response = await publishGist({\n note,\n });\n const rawLink = response.history[0].url;\n const gitResponse = await fetch(rawLink).then((response) =>\n response.json()\n );\n const { files } = gitResponse;\n const fileContents = Object.values(files);\n const [gistFile] = fileContents;\n const { raw_url: rawUrl } = gistFile as { raw_url: string };\n const linkToShare = `${url.baseUrl}?raw=${rawUrl}`;\n const successMessage = \"MiroPad public link copied to clipboard \uD83D\uDCCB!\";\n copyToClipboard(linkToShare, successMessage);\n }\n },\n};\n\nexport const commands = () => {\n return [\n {\n title: \"New note\",\n icon: icon(PencilSVG, \"new note\"),\n sortTitle: \"New\",\n key: \"n\",\n call: resetNoteManager,\n },\n {\n title: \"Save\",\n key: \"s\",\n icon: icon(CheckmarkCircleSVG, \"save\"),\n sortTitle: \"Save\",\n call: async () => {\n commander.hide();\n await saveNote(select(\".terminal\").getValue());\n const note = getNote();\n if (note && !note.disableSync) {\n updateGist([note]);\n }\n setSavedState();\n },\n },\n // @ts-ignore ts cannot cope with browser mess\n ...(navigator.share ? [shareNoteCommand] : []),\n {\n title: \"Toggle MarkDown Viewer\",\n icon: icon(PageBreakSVG, \"toggle markdown viewer\", \"rotate90\"),\n sortTitle: \"Split\",\n key: \"m\",\n call: () => {\n markDownViewer.toggle();\n commander.hide();\n },\n },\n {\n title: \"Full MarkDown view\",\n icon: icon(FrameExpandSVG, \"full view\"),\n sortTitle: \"Full view\",\n key: \"shift m\",\n call: () => {\n markDownViewer.toggle(\"full\");\n commander.hide();\n },\n },\n ...(isUserLoggedIn() ? [sharePublicLinkCommand] : []),\n {\n title: \"Zen mode\",\n icon: icon(LeafSVG, \"zen mode\"),\n sortTitle: \"Zen mode\",\n key: \"shift z\",\n call: () => {\n const isZen = Boolean(url.getSearchParam(\"zen\"));\n if (isZen) {\n url.deleteParam(\"zen\");\n } else {\n url.set(undefined, {\n zen: true,\n });\n }\n commander.hide();\n },\n },\n {\n title: \"List saved notes\",\n icon: icon(ListSVG, \"list notes\"),\n sortTitle: \"Notes\",\n key: \"p\",\n call: () => commander.toggle(commander.getModes().notes),\n },\n {\n title: \"Delete note\",\n key: \"shift d\",\n icon: icon(TrashSVG, \"delete note\"),\n sortTitle: \"Delete\",\n call: deleteNote,\n },\n {\n title: getSyncTitle(),\n icon: icon(CloudSyncSVG, \"sync with github\"),\n key: null,\n call: async () => {\n const token = storage.get(\"authToken\");\n if (!token) {\n return goAuthenticate();\n }\n const gistId = storage.get(\"gistId\");\n if (!gistId) {\n return await setGistToSyncWith(token);\n }\n commander.hide();\n await syncNotesWithGitHub();\n },\n },\n {\n title: \"Sync: Reset Gist settings\",\n icon: icon(LighterSVG, \"reset github settings\"),\n key: null,\n call: () => {\n localStorage.removeItem(\"authToken\");\n localStorage.removeItem(\"gistId\");\n localStorage.removeItem(\"lastLocalUpdate\");\n localStorage.removeItem(\"lastSync\");\n notify.info(\"Gist setting have been reset!\");\n commander.hide();\n },\n },\n {\n title: \"Toggle sidebar\",\n experimental: true,\n key: \"shift l\",\n call: () => {\n select(\"aside\").toggle();\n },\n },\n {\n title: \"Save to File System...\",\n experimental: true,\n icon: icon(EnterDownSVG, \"save file\"),\n key: \"shift s\",\n call: () => {\n const note = getNote();\n if (note) {\n const { text, title } = note;\n saveFileAs(text, title);\n commander.hide();\n }\n },\n },\n {\n title: \"Email note to...\",\n experimental: true,\n icon: icon(EnvelopeSVG, \"email\"),\n key: \"e\",\n call: () => {\n const note = select(\".terminal\").getValue();\n mailTo(note);\n commander.hide();\n },\n },\n {\n title: \"Toggle experimental features\",\n experimental: false,\n icon: icon(BugSVG, \"lab\"),\n key: null,\n call: () => {\n const previousStatus = Boolean(storage.get(\"__experimental__\"));\n\n if (previousStatus) {\n storage.remove(\"__experimental__\");\n } else {\n storage.set(\"__experimental__\", true);\n }\n notify.showNotification(\n `Experimental features turned ${previousStatus ? \"off\" : \"on\"}`,\n );\n commander.hide();\n },\n },\n {\n title: \"Toggle Autocompletion\",\n experimental: false,\n icon: icon(ArrowRightCircleSVG, \"autocompletion\"),\n key: null,\n call: () => {\n const previousStatus = Boolean(storage.get(\"__autocomplete__\"));\n\n if (previousStatus) {\n storage.remove(\"__autocomplete__\");\n } else {\n storage.set(\"__autocomplete__\", true);\n }\n notify.showNotification(\n `Autocomplete feature turned ${previousStatus ? \"off\" : \"on\"}`,\n );\n commander.hide();\n select(\".terminal\").focus();\n },\n },\n {\n title: \"Add a cover picture\",\n experimental: true,\n icon: icon(PictureSVG, \"cover picture\"),\n key: null,\n call: async () => {\n const bgImage = prompt(\"Paste the image URL in here...\");\n commander.hide();\n await sleep(200); // need to wait after prompt for some reason before copy\n copyToClipboard(\n `

    `,\n \"\uD83D\uDC4CCopied! Paste the code on the MiroPad editor\",\n );\n select(\".terminal\").focus();\n notify.info(\n \"Paste the cover picture wherever you prefer on the MirPad editor\",\n );\n },\n },\n {\n title: \"Print MarkDown output\",\n experimental: true,\n icon: icon(PrinterSVG, \"print\"),\n key: null,\n call: () => {\n select(\".preview\").show();\n markDownViewer.init();\n globalThis.print();\n commander.hide();\n },\n },\n {\n key: \"j\",\n title: \"Prettify JSON document\",\n icon: icon(MagicWandSVG, \"prettify json\"),\n call: () => {\n prettifyJSON(\".terminal\");\n commander.hide();\n },\n },\n {\n title: \"Toggle command palette\",\n icon: icon(RocketSVG, \"toggle command palette\"),\n key: [\"shift p\", \"k\"],\n call: () => commander.toggle(commander.getModes().commands),\n },\n {\n title: \"Find and Replace...\",\n experimental: true,\n icon: icon(SpellCheckSVG, \"find and replace\"),\n key: \"shift f\",\n call: () => {\n const selectedValue = select(\".terminal\")\n .getValue()\n .slice(\n select(\".terminal\").el.selectionStart,\n select(\".terminal\").el.selectionEnd,\n );\n const valueToFind = prompt(\"What do you wanna find?\", selectedValue);\n if (!valueToFind) {\n return notify.info(\"Value not found\");\n }\n const positionOfFirstChar = select(\".terminal\")\n .getValue()\n .indexOf(valueToFind);\n\n select(\".terminal\").el.setSelectionRange(\n positionOfFirstChar,\n positionOfFirstChar + valueToFind.length,\n );\n const replacementValue = prompt(`Replace ${valueToFind} with...`);\n if (replacementValue) {\n select(\".terminal\").el.setRangeText(replacementValue);\n }\n },\n },\n {\n title: \"Download all notes!\",\n icon: icon(DownloadSVG, \"Download all notes on your local file system\"),\n call: () => {\n const notes = getNotes({\n includeDeleted: true,\n });\n saveDataToFile(notes);\n commander.hide();\n },\n },\n {\n title: \"Permanently delete ALL notes \u2757\",\n icon: icon(TrashSVG, \"delete note\"),\n call: () => {\n const confirmation = confirm(\n \"Are you sure you want do delete ALL your notes?\",\n );\n if (confirmation) {\n const notes = getNotes({\n includeDeleted: true,\n });\n notes.forEach((note) => {\n storage.remove(note.id);\n });\n resetNoteManager();\n }\n commander.hide();\n },\n },\n ] as const;\n};\n", "const keyListener = {\n events: [],\n on(key, fn) {\n if (Array.isArray(key)) {\n key.forEach((k) => {\n const finalKey = k.key || k;\n const functionToCall = k.call || fn;\n this.on(finalKey, functionToCall);\n });\n\n return this;\n }\n\n if (key && typeof key === \"string\" && fn && typeof fn === \"function\") {\n this.events = [\n ...this.events,\n {\n key: key.includes(\"shift\") ? key.replace(\"shift\", \"\").trim() : key,\n shift: key.includes(\"shift\"),\n fn() {\n fn();\n },\n },\n ];\n }\n return this;\n },\n listen() {\n document.addEventListener(\"keydown\", (e) => {\n this.handleEvent(e);\n });\n return this;\n },\n handleEvent(e) {\n this.events.map((event) => {\n if (\n event.key === e.key &&\n (e.ctrlKey === true || e.metaKey === true) &&\n e.shiftKey === event.shift\n ) {\n e.preventDefault();\n event.fn();\n }\n return true;\n });\n },\n};\n\nexport default keyListener;\n", "import { isElement } from \"../../../utils/dom.js\";\n\nexport const link = (textOrNode, url) => {\n const a = document.createElement(\"a\");\n a.href = url;\n a.appendChild(\n isElement(textOrNode) ? textOrNode : document.createTextNode(textOrNode),\n );\n return a;\n};\n", "const isSameYear = (aDate, bDate = new Date()) => {\n const yearA = new Date(aDate).getFullYear();\n const yearB = new Date(bDate).getFullYear();\n\n return yearA === yearB;\n};\n\nconst isSameMonth = (aDate, bDate = new Date()) => {\n const monthA = new Date(aDate).getMonth();\n const monthB = new Date(bDate).getMonth();\n\n return monthA === monthB;\n};\n\nconst isSameDateOfMonth = (aDate, bDate = new Date()) => {\n const dateA = new Date(aDate).getDate();\n const dateB = new Date(bDate).getDate();\n\n return dateA === dateB;\n};\n\nconst isSameDate = (aDate, bDate = new Date()) => {\n return (\n isSameYear(aDate, bDate) &&\n isSameMonth(aDate, bDate) &&\n isSameDateOfMonth(aDate, bDate)\n );\n};\n\nconst monthNames = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst shortMonthNames = monthNames.map((name) => name.slice(0, 3));\n\nconst isYesterday = (date = new Date()) => {\n const theDate = new Date(date);\n const yesterDate = new Date().getDate() - 1;\n return (\n isSameMonth(theDate) &&\n isSameYear(theDate) &&\n theDate.getDate() === yesterDate\n );\n};\n\nexport const relativeDate = (dateCreated) => {\n const date = new Date(dateCreated);\n const month = !isYesterday(dateCreated)\n ? shortMonthNames[date.getMonth()]\n : \"\";\n const year = isSameYear(date) ? \"\" : date.getFullYear();\n const day = isYesterday(date) ? \"Yesterday\" : date.getDate();\n\n return `${isSameDate(date) ? \"\" : `${day} ${month} ${year}`} ${\n isSameDate(date) ? date.toLocaleTimeString() : \"\"\n }`;\n};\n", "export const isArraySorted = (arr: Array) => {\n const someArray = arr.reduce((currentValue, item) => {\n if (currentValue.length === 0) {\n return [item];\n }\n const max = Math.max(...currentValue);\n return [...currentValue, ...(item >= max ? [item] : [])];\n }, [] as Array);\n return someArray.length === arr.length;\n};\n", "import { isArraySorted } from \"../../../utils/isArraySorted.ts\";\n\nexport const smartFilter = (phrase: string, filter: string) => {\n const wordParts = phrase.split(\" \").map((w) => w.toLowerCase());\n const filterParts = filter.split(\" \").map((f) => f.toLowerCase());\n const indexes = filterParts.map((f) => {\n const foundIndexes = wordParts.map((w, i) => {\n return w.includes(f) ? i : -1;\n });\n const firstIndexFound = foundIndexes.reduce((currentValue, fi) => {\n return fi > -1 ? fi : currentValue;\n }, -1);\n return firstIndexFound;\n });\n\n if (indexes.includes(-1)) {\n return false;\n }\n return isArraySorted(indexes);\n};\n", "import storage from \"./utils/localstorage.js\";\n\nexport const requestNotificationPermission = async () => {\n if (!storage.get(\"__notification-permission__\")) {\n const permission = await globalThis.Notification.requestPermission();\n storage.set(\"__notification-permission__\", permission);\n }\n};\n\nexport const registerServiceWorker = () => {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker.register(\n `${globalThis.location.pathname}service-worker.js?v=${VERSION}`,\n );\n }\n};\n", "import {\n getDateCreatedFromTitle,\n getNote,\n getNotes,\n} from \"../noteManager/noteManager.ts\";\nimport { commands } from \"./commands.ts\";\nimport keyListener from \"../../../utils/keyListener.js\";\nimport select from \"../../../utils/dom.js\";\nimport { url } from \"../../../utils/urlManager.ts\";\nimport { command } from \"../../molecules/commands/command.js\";\nimport { link } from \"../../atoms/link/link.js\";\nimport { div } from \"../../atoms/div/div.js\";\nimport { relativeDate } from \"../../../utils/dates.js\";\nimport { smartFilter } from \"./smartFilter.ts\";\nimport { button } from \"../../atoms/button/button.js\";\nimport { requestNotificationPermission } from \"../../../registerServiceWorker.js\";\nimport storage from \"../../../utils/localstorage.js\";\n\nconst getShortcut = (key: string | Array): string => {\n if (Array.isArray(key)) {\n return key.map((k) => getShortcut(k)).join(\", \");\n }\n return key ? `\u2318+${key.toUpperCase()}` : \"\";\n};\n\nconst commander = (() => {\n enum CommanderModes {\n off = \"off\",\n notes = \"notes\",\n revisions = \"revisions\",\n commands = \"commands\",\n gists = \"gists\",\n }\n let state = {\n input: \"\",\n mode: CommanderModes.off,\n options: {\n selected: 0,\n length: 0,\n },\n };\n return {\n getState: function () {\n return state;\n },\n getModes: function () {\n return CommanderModes;\n },\n setState: function (newState: Record) {\n state = {\n ...state,\n ...newState,\n };\n return state;\n },\n show: function (what = CommanderModes.commands) {\n select(\"#commander\").show();\n select(\"#commander input\").focus();\n switch (what) {\n case CommanderModes.commands:\n this.generateCommands();\n select(\"#commander input\").setValue(\"> \");\n this.setState({\n mode: CommanderModes.commands,\n });\n break;\n case CommanderModes.notes:\n this.generateNotes();\n select(\"#commander input\").setValue(\"\");\n this.setState({\n mode: CommanderModes.notes,\n });\n break;\n case CommanderModes.revisions:\n this.generateRevisions();\n select(\"#commander input\").setValue(\"\");\n this.setState({\n mode: CommanderModes.revisions,\n });\n break;\n default:\n // do nothing;\n break;\n }\n return this;\n },\n hide: function () {\n select(\"#commander\").hide();\n state.mode = CommanderModes.off;\n return this;\n },\n toggle: function (mode?: CommanderModes) {\n requestNotificationPermission();\n if (state.mode === CommanderModes.off || state.mode !== mode) {\n this.show(mode);\n } else {\n this.hide();\n }\n return this;\n },\n commands: function () {\n return commands();\n },\n selectOption: function (direction: \"down\" | \"up\" = \"down\") {\n const currentlySelected = state.options.selected;\n const lastOption = state.options.length - 1;\n const isLastOption = currentlySelected === lastOption;\n const isFirstOption = currentlySelected === 0;\n const isDown = direction === \"down\";\n\n const indexToSelect = isDown\n ? isLastOption ? 0 : currentlySelected + 1\n : isFirstOption\n ? lastOption\n : currentlySelected - 1;\n\n state.options = {\n ...state.options,\n selected: indexToSelect,\n };\n },\n initCommander: function () {\n // initialize mobile-dock\n commands()\n .slice(0, 5)\n .map((command) => {\n select(\".mobile-dock\").append(\n button(\n // @ts-ignore js-to-ts wider refactoring required\n [command.icon, document.createTextNode(command.sortTitle)],\n command.call,\n command.title.toLowerCase().replace(/\\s/g, \"-\"),\n ),\n );\n });\n\n select(\"#commander button\").listen(\"click\", () => {\n this.hide();\n });\n\n select(\"#commander input\")\n .listen(\"keydown\", (e: KeyboardEvent) => {\n // arrow down 40\n if (e.keyCode === 40) {\n if (state.mode === CommanderModes.revisions) {\n select(\"#commands li.selected\").click();\n }\n this.selectOption(\"down\");\n }\n // arrow up 38\n if (e.keyCode === 38) {\n if (state.mode === CommanderModes.revisions) {\n select(\"#commands li.selected\").click();\n }\n this.selectOption(\"up\");\n }\n })\n .listen(\"keyup\", (e: KeyboardEvent) => {\n // enter\n if (e.keyCode === 13) {\n if (state.mode === CommanderModes.commands) {\n select(\"#commands li.selected div\").click();\n } else {\n select(\"#commands li.selected a\").click();\n }\n }\n // escape\n if (e.keyCode === 27) {\n select(\".terminal\").focus();\n }\n const el = e.target as HTMLTextAreaElement;\n if (state.input !== el.value) {\n state.options.selected = 0;\n }\n state.input = el.value;\n this.generateOptions(el.value);\n });\n return this;\n },\n init: function () {\n this.initCommander();\n keyListener.listen().on(this.commands());\n select(\".menu\").listen(\"click\", () => this.toggle());\n select(\"#revisions\").listen(\"click\", () => this.generateRevisions());\n return this;\n },\n generateRevisions: function () {\n this.show();\n state.mode = CommanderModes.revisions;\n const note = getNote();\n if (note) {\n const { revisions } = note;\n const indexToSelect = state.options.selected;\n const revisionsOptions = Object.keys(revisions)\n .sort((a, b) => {\n const { dateCreated: aDateCreated } = revisions[a];\n const { dateCreated: bDateCreated } = revisions[b];\n return bDateCreated - aDateCreated;\n })\n .map((id, i) => ({\n title: div({ content: `...${id.slice(-10)}` }),\n secondary: `${relativeDate(revisions[id].dateCreated)}`,\n onclick: () => {\n url.set(undefined, {\n v: id,\n });\n state.options.selected = i;\n this.generateRevisions();\n },\n }))\n // @ts-ignore js-to-ts wider refactoring required\n .map((r, i) => command(r, i === indexToSelect));\n select(\"#commands\").html(revisionsOptions);\n state.options = {\n ...state.options,\n length: revisionsOptions.length,\n };\n }\n\n return this;\n },\n generateOptions: function (value: string) {\n switch (state.mode) {\n case CommanderModes.commands:\n case CommanderModes.notes:\n if (value.slice(0, 1) === \">\") {\n state.mode = CommanderModes.commands;\n this.generateCommands(value.slice(1).trim());\n select(\"#commander input\").placeholder(\"Search for commands...\");\n } else {\n state.mode = CommanderModes.notes;\n this.generateNotes(value);\n }\n return;\n case CommanderModes.revisions:\n return this.generateRevisions();\n case CommanderModes.off:\n break;\n default:\n break;\n }\n },\n generateNotes: function (value = \"\") {\n const indexToSelect = state.options.selected;\n const notes = getNotes()\n .filter(({ title }) => {\n return smartFilter(title, value);\n })\n .filter(({ id, deleted }) => !deleted && id !== url.getPageId())\n .sort((a, b) => {\n const aDateCreated = getDateCreatedFromTitle(a.title);\n const bDateCreated = getDateCreatedFromTitle(b.title);\n return bDateCreated - aDateCreated;\n })\n .map(({ id, title }, i) => {\n const dateCreated = getDateCreatedFromTitle(title);\n const href =\n `${globalThis.location.origin}${globalThis.location.pathname}#${id}`;\n\n const noteLink = link(\n div({ content: title, highlight: value }),\n href,\n );\n\n const noteCommand = command(\n // @ts-ignore until command.js makes it to ts\n {\n title: noteLink,\n secondary: relativeDate(dateCreated),\n onclick: () => {\n this.hide();\n select(\".terminal\").focus();\n },\n },\n i === indexToSelect,\n );\n return noteCommand;\n });\n select(\"#commands\").html(notes);\n select(\"#commander input\").placeholder(\n `Search from ${notes.length} saved notes...`,\n );\n state.options = {\n ...state.options,\n length: notes.length,\n };\n return this;\n },\n generateCommands: function (value = \"\") {\n const indexToSelect = state.options.selected;\n const commandComponents = this.commands()\n .filter(({ title }) => smartFilter(title, value))\n // @ts-ignore js-to-ts wider refactoring required\n .filter(({ experimental = false }) => {\n return storage.get(\"__experimental__\") ? true : !experimental;\n })\n // @ts-ignore js-to-ts wider refactoring required\n .map(({ title, key, call, icon }, i) => {\n const commandComponent = command(\n // @ts-ignore until command.js makes it to ts\n {\n title: div({ content: title, highlight: value }),\n icon: icon,\n secondary: getShortcut(key),\n onclick: call,\n },\n i === indexToSelect,\n );\n return commandComponent;\n });\n select(\"#commands\").html(commandComponents);\n state.options = {\n ...state.options,\n length: commandComponents.length,\n };\n return this;\n },\n };\n})();\n\nexport default commander;\n", "export const urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n", "import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js'\nexport { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << Math.log2(alphabet.length - 1)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nexport let nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n id += scopedUrlAlphabet[bytes[size] & 63]\n }\n return id\n}\n", "import getCaretCoordinates from \"textarea-caret\";\nimport { terminal } from \"../components/organisms/terminal.ts\";\nimport select from \"../utils/dom.js\";\nimport { trieDictionary } from \"../main.js\";\n\nconst getPredictions = (word: string) => {\n const sanitizedWord = word.replace(/[\\r\\n\\t]+/g, \"\").toLowerCase();\n\n return trieDictionary.getMatchingWords(sanitizedWord);\n};\n\nexport const getCurrentlyTypingWord = (\n text: string,\n cursorIndexPosition: number,\n) => {\n let word = \"\";\n let currentIndex = cursorIndexPosition - 1;\n do {\n const character = text[currentIndex] || \"\";\n currentIndex = character.trim() === \"\" ? -1 : currentIndex - 1;\n word = character.trim() !== \"\" ? `${character}${word}` : word;\n } while (currentIndex >= 0);\n return word;\n};\n\nexport const placeSuggestion = (textEl: HTMLTextAreaElement) => {\n const coords = getCaretCoordinates(\n textEl,\n textEl.selectionEnd,\n );\n const { top, left } = coords;\n\n // This does the trick! `main` is getting the same\n // height as the textarea so the suggestion will be placed\n // right!\n // TODO: change that on terminal size change!\n const actualTerminalHeight = select(\".terminal\").el.scrollHeight;\n const main = select(\"main\").el;\n main.style.height = `${actualTerminalHeight}px`;\n\n select(\".suggestion\").el.style.top = `${top}px`;\n select(\".suggestion\").el.style.left = `${left}px`;\n};\n\nexport const isLastCharacterInTheWord = (\n text: string,\n characterIndex: number,\n) => text[characterIndex] === undefined || text[characterIndex].trim() === \"\";\n\nexport const autoComplete = (e: InputEvent) => {\n const cursorIndexPosition = (e.target as HTMLTextAreaElement).selectionEnd;\n const fullText = terminal.el.getValue();\n\n const charTyped = fullText[cursorIndexPosition - 1];\n if (e.inputType === \"deleteContentBackward\" || charTyped === \" \") {\n terminal.setState({\n prediction: null,\n currentWord: null,\n });\n return select(\".suggestion\").hide();\n }\n const word = getCurrentlyTypingWord(fullText, cursorIndexPosition);\n\n const shouldDisplaySuggestion = e.inputType === \"insertText\" &&\n isLastCharacterInTheWord(fullText, cursorIndexPosition) &&\n !word.startsWith(\"#\");\n\n if (shouldDisplaySuggestion) {\n placeSuggestion(e.target as HTMLTextAreaElement);\n const matches = getPredictions(word);\n\n const [firstMatch] = matches;\n const prediction = firstMatch || \"\";\n\n terminal.setState({\n prediction,\n currentWord: word,\n matches: matches.slice(0, 10),\n options: {\n selected: 0,\n length: matches.length,\n },\n });\n const state = terminal.getState();\n if (state.currentWord && state.prediction && state.currentWord.length > 1) {\n terminal.renderInlineSuggestion();\n terminal.renderOptions();\n } else {\n select(\".suggestion\").hide();\n }\n }\n};\n", "export const findCurrentLine = (text: string, caretIndex: number): string => {\n const lines = text.split(\"\\n\");\n type MyAcc = {\n text: string;\n isFound: boolean;\n };\n const line = lines.reduce(\n (acc: MyAcc, line) => {\n const { isFound } = acc;\n if (isFound) return acc;\n const recon = `${acc.text}${line}\\n`;\n const currentLength = recon.length;\n\n if (caretIndex >= currentLength) {\n return {\n text: recon,\n isFound: false,\n };\n }\n\n return {\n text: line,\n isFound: true,\n };\n },\n {\n text: \"\",\n isFound: false,\n },\n );\n\n return line.text;\n};\n", "import select from \"../dom.js\";\nimport { findCurrentLine } from \"./index.ts\";\n\nexport const autoCompleteCheckboxes = (e) => {\n const currentLine = findCurrentLine(e.target.value, e.target.selectionEnd);\n\n const completers = {\n \"* [\": \"\\n* [] \",\n \"* \": \"\\n* \",\n \" * [\": \"\\n * [] \",\n \" * \": \"\\n * \",\n };\n\n for (const [startsWith, compleano] of Object.entries(completers)) {\n if (currentLine.startsWith(startsWith)) {\n e.preventDefault();\n select(\".terminal\").insertAtCaret(compleano);\n break;\n }\n }\n};\n", "import { getNotes } from \"../../components/organisms/noteManager/noteManager.ts\";\nimport { terminal } from \"../../components/organisms/terminal.ts\";\nimport select from \"../../utils/dom.js\";\nimport {\n getCurrentlyTypingWord,\n isLastCharacterInTheWord,\n placeSuggestion,\n} from \"../autoComplete.ts\";\n\nexport const renderInterNotes = (e: InputEvent) => {\n const target = e.target as HTMLTextAreaElement | null;\n if (!target) return;\n const cursorIndexPosition = target.selectionEnd;\n const fullText = terminal.el.getValue();\n const charTyped = fullText[cursorIndexPosition - 1];\n if (e.inputType === \"deleteContentBackward\" || charTyped === \" \") {\n terminal.setState({\n prediction: null,\n currentWord: null,\n });\n return select(\".suggestion\").hide();\n }\n const word = getCurrentlyTypingWord(fullText, cursorIndexPosition);\n if (word.startsWith(\"#\")) {\n const shouldDisplaySuggestion = e.inputType === \"insertText\" &&\n isLastCharacterInTheWord(fullText, cursorIndexPosition);\n\n if (shouldDisplaySuggestion) {\n placeSuggestion(e.target as HTMLTextAreaElement);\n const allNoteIds = getNotes().map((note) => note.id);\n const actualNoteSearch = word.slice(1);\n const matches = allNoteIds.filter((noteId) => {\n return noteId.startsWith(actualNoteSearch);\n });\n const [firstMatch] = matches;\n const prediction = firstMatch;\n const currentWord = actualNoteSearch;\n\n terminal.setState({\n prediction,\n currentWord,\n matches: matches.slice(0, 10),\n options: {\n selected: 0,\n length: matches.length,\n },\n });\n const state = terminal.getState();\n if (\n state.currentWord &&\n state.prediction &&\n state.currentWord.length > 1\n ) {\n terminal.renderInlineSuggestion();\n terminal.renderOptions();\n } else {\n select(\".suggestion\").hide();\n }\n }\n }\n};\n", "import { nanoid } from \"nanoid\";\nimport * as TrashSVG from \"../../../assets/svg/trash.svg\";\nimport { configuration } from \"../../../configuration.ts\";\nimport { autoComplete } from \"../../features/autoComplete.ts\";\nimport { setSavedState } from \"../../ui/functions/savedState.ts\";\nimport select from \"../../utils/dom.js\";\nimport storage from \"../../utils/localstorage.js\";\nimport { handleErrorResponse } from \"../../utils/mail.js\";\nimport { autoCompleteCheckboxes } from \"../../utils/text/autoCompleteCheckboxes.js\";\nimport { div } from \"../atoms/div/div.js\";\nimport { icon } from \"../atoms/icon/icon.js\";\nimport { command } from \"../molecules/commands/command.js\";\nimport notify from \"../molecules/notify.ts\";\nimport commander from \"./commander/commander.ts\";\nimport markDownViewer from \"./markdown/markDownViewer.js\";\nimport { getNote, getTitle } from \"./noteManager/noteManager.ts\";\nimport { trieDictionary } from \"../../main.js\";\nimport { renderInterNotes } from \"../../features/inter-linking/renderInterNotes.ts\";\n\ntype TerminalState = {\n matches: Array;\n currentWord: null | string;\n prediction: null | string;\n options: {\n selected: number;\n length: number;\n };\n};\n\nexport const terminal = (() => {\n const initState = {\n matches: [],\n currentWord: null,\n prediction: null,\n options: {\n selected: 0,\n length: 0,\n },\n } as TerminalState;\n let state = initState;\n return {\n el: select(\".terminal\"),\n getState: function (): TerminalState {\n return state;\n },\n setState: function (newState: Partial) {\n state = {\n ...state,\n ...newState,\n };\n return state;\n },\n resetState: function () {\n terminal.setState(initState);\n },\n selectOption: function (direction: \"down\" | \"up\" = \"down\") {\n const currentlySelected = state.options.selected;\n const lastOption = state.options.length - 1;\n const isLastOption = currentlySelected === lastOption;\n const isFirstOption = currentlySelected === 0;\n const isDown = direction === \"down\";\n\n const indexToSelect = isDown\n ? isLastOption ? 0 : currentlySelected + 1\n : isFirstOption\n ? lastOption\n : currentlySelected - 1;\n\n state.options = {\n ...state.options,\n selected: indexToSelect,\n };\n\n terminal.setState({\n prediction: state.matches[state.options.selected],\n });\n terminal.renderInlineSuggestion();\n terminal.renderOptions();\n },\n acceptCompletion: (word?: string) => {\n const complete = (word: string, currentWord: string) => {\n const completion = word\n .toLowerCase()\n .replace(currentWord.toLowerCase(), \"\");\n if (completion) {\n select(\".terminal\").insertAtCaret(`${completion} `);\n } else {\n select(\".terminal\").insertAtCaret(\" \");\n }\n select(\".suggestion\").hide();\n terminal.resetState();\n };\n\n const { prediction, currentWord } = state;\n\n if (word && currentWord) {\n return complete(word, currentWord);\n }\n\n if (prediction && currentWord) {\n complete(prediction, currentWord);\n // +1 to the score of the word autocompleted\n trieDictionary.insert(prediction);\n }\n },\n renderInlineSuggestion: () => {\n const { prediction, currentWord } = state;\n if (prediction && currentWord) {\n const inlineSuggestion = div({\n content: `${prediction.slice(currentWord.length)}`,\n });\n inlineSuggestion.setAttribute(\"id\", \"inlineSuggestion\");\n select(\".suggestion\").show().html(inlineSuggestion);\n }\n },\n renderOptions: () => {\n const optionsUl = select(\".suggestion .options\");\n if (optionsUl && optionsUl.el) optionsUl.el.remove();\n\n const selectedIndex = state.options.selected;\n const options = state.matches.map((word, i) =>\n command(\n {\n title: div({ content: word }),\n secondary: icon(TrashSVG, \"delete word\"),\n onSecondaryClick: () => {\n storage.removeFromDictionary(word);\n terminal.setState({\n matches: state.matches.filter((m) => m !== word),\n });\n terminal.renderOptions();\n },\n onclick: () => {\n terminal.acceptCompletion(word);\n },\n icon: null,\n },\n i === selectedIndex,\n )\n );\n const optionList = document.createElement(\"ul\");\n optionList.classList.add(\"options\");\n optionList.classList.add(\"frost\");\n options.forEach((el) => optionList.append(el));\n\n select(\".suggestion\").el.append(optionList);\n },\n onFocus: () => {\n commander.hide();\n select(\".note-info\").hide();\n },\n onInput: (e: InputEvent) => {\n const isAutocompleteEnabled = !!storage.get(\"__autocomplete__\");\n if (isAutocompleteEnabled) {\n autoComplete(e);\n }\n renderInterNotes(e);\n },\n onArrowDown: (e: KeyboardEvent) => {\n if (state.matches.length > 0) {\n e.preventDefault();\n terminal.selectOption(\"down\");\n }\n },\n onArrowUp: (e: KeyboardEvent) => {\n if (state.matches.length > 0) {\n e.preventDefault();\n terminal.selectOption(\"up\");\n }\n },\n onEnter: (e: KeyboardEvent) => {\n if (state.matches.length > 0) {\n e.preventDefault();\n terminal.acceptCompletion();\n }\n\n // auto-magically handle checkboxes\n autoCompleteCheckboxes(e);\n },\n onEscape: () => {\n terminal.resetState();\n select(\".suggestion\").hide();\n },\n onTab: (e: KeyboardEvent) => {\n e.preventDefault();\n terminal.acceptCompletion();\n },\n onKeyDown: (e: KeyboardEvent) => {\n // enter\n if (e.keyCode === 13) {\n terminal.onEnter(e);\n }\n // arrow down\n if (e.keyCode === 40) {\n terminal.onArrowDown(e);\n }\n\n // arrow up\n if (e.keyCode === 38) {\n terminal.onArrowUp(e);\n }\n\n if (e.keyCode === 9) {\n terminal.onTab(e);\n }\n\n if (e.keyCode === 32) {\n terminal.setState({\n prediction: \"\",\n });\n }\n\n // escape\n if (e.keyCode === 27) {\n terminal.onEscape();\n }\n },\n onKeyUp: (e: KeyboardEvent) => {\n const currentlySavedNote = getNote();\n const title = getTitle((e.target as HTMLInputElement).value);\n select(\".title h3\").html(title);\n\n const { text = \"\" } = currentlySavedNote || {};\n const isNoteSaved =\n !!(currentlySavedNote && terminal.el.getValue() === text);\n setSavedState(isNoteSaved);\n },\n onPaste: async () => {\n const clipboardItems = await navigator.clipboard.read();\n for (const clipboardItem of clipboardItems) {\n const imageTypes = clipboardItem.types?.filter((type) =>\n type.startsWith(\"image/\")\n );\n for (const imageType of imageTypes) {\n const blob = await clipboardItem.getType(imageType);\n const token = storage.get(\"MIROPAD_SECRET_TOKEN\");\n if (token) {\n const [_image, fileExtension] = imageType.split(\"/\");\n const fileName = `${nanoid()}.${fileExtension}`;\n\n select(\"#logo\").addClass(\"loading\");\n try {\n const { url } = await fetch(\n `${configuration.file_service.api}?fileName=${fileName}`,\n {\n method: \"POST\",\n headers: {\n \"x-secret-token\": token,\n accept: \"application/json\",\n \"content-type\": \"application/octet-stream\",\n },\n body: blob,\n },\n )\n .then(handleErrorResponse)\n .then((response) => response.json());\n select(\".terminal\").insertAtCaret(`![image](${url})`);\n } catch (error) {\n console.error(error);\n notify.error(`Uploading file failed \uD83D\uDCA5!`);\n }\n select(\"#logo\").removeClass(\"loading\");\n } else {\n const imageURI = URL.createObjectURL(blob);\n select(\".terminal\").insertAtCaret(`![image](${imageURI})`);\n }\n markDownViewer.update();\n }\n }\n },\n init: function () {\n this.el\n .listen(\"focus\", this.onFocus)\n .listen(\"input\", this.onInput)\n .listen(\"keydown\", this.onKeyDown)\n .listen(\"keyup\", this.onKeyUp)\n .listen(\"paste\", this.onPaste);\n },\n };\n})();\n", "import storage from \"./utils/localstorage.js\";\n\nexport const isSyncEnabled = () => {\n const { authToken, gistId } = storage.get([\"authToken\", \"gistId\"]);\n return !!(authToken && gistId);\n};\n", "type FrequencyGroups = {\n [key: string]: Array;\n};\n\nconst groupByFrequency = (entries: Dictionary): FrequencyGroups => {\n return Object.entries(entries).reduce((acc, [word, frequency]) => {\n const cc = acc[frequency] || [];\n return {\n ...acc,\n [`${frequency}`]: [word, ...cc],\n };\n }, {} as FrequencyGroups);\n};\n\ntype Dictionary = {\n [key: string]: number;\n};\ntype Node = {\n char: string | null;\n children: {\n [key: string]: Node;\n };\n frequency: number;\n hasChildren: () => boolean;\n isWord: () => boolean;\n contains: (char: string) => boolean;\n getWords: (\n char: string,\n dictionary?: Dictionary,\n ) => Dictionary;\n increaseFrequency: () => void;\n insert: (word: string) => void;\n insertNode: (char: string, isLast?: boolean) => Node;\n};\n\nconst Node = (): Node => ({\n char: null,\n children: {},\n frequency: 0,\n hasChildren: function () {\n return Object.keys(this.children).length > 0;\n },\n isWord: function () {\n return this.frequency > 0;\n },\n contains: function (char: string) {\n return Object.keys(this.children).includes(char);\n },\n getWords: function (prefix, dictionary = {}) {\n const nodeInstance = this as Node;\n if (nodeInstance.isWord()) {\n dictionary = {\n ...dictionary,\n [prefix]: this.frequency,\n };\n }\n\n if (nodeInstance.hasChildren()) {\n for (const node of Object.values(nodeInstance.children)) {\n dictionary = node.getWords(`${prefix}${node.char}`, dictionary);\n }\n }\n\n return dictionary;\n },\n increaseFrequency: function () {\n this.frequency = this.frequency + 1;\n },\n insert: function (word: Array | string) {\n const [firstChar, ...rest] = word;\n if (firstChar) {\n const isLast = rest.length === 0;\n if (this.contains(firstChar)) {\n const node = this.children[firstChar];\n node.char = firstChar;\n if (isLast) node.increaseFrequency();\n\n return node.insert(rest.join(\"\"));\n } else {\n const node = this.insertNode(firstChar, isLast);\n return node.insert(rest.join(\"\"));\n }\n }\n },\n insertNode: function (char, isLast = false) {\n const newNode = Node();\n if (isLast) newNode.increaseFrequency();\n newNode.char = char;\n this.children = {\n ...this.children,\n [char]: newNode,\n };\n return newNode;\n },\n});\n\nexport const Trie = () => {\n const rootNode = Node();\n\n return {\n insert: function (word: string | Array = []) {\n const words = Array.isArray(word) ? word : [word];\n words.forEach((word) => rootNode.insert(word));\n return this;\n },\n search: function (prefix = \"\") {\n let node = rootNode;\n prefix.split(\"\").forEach((character) => {\n if (node) node = node.children[character];\n });\n\n return node ? node.getWords(prefix) : {};\n },\n // get sorted matching words\n // first by frequency\n // and then alphabetically\n getMatchingWords: function (prefix = \"\") {\n const frequencyGroups = groupByFrequency(this.search(prefix));\n return Object.keys(frequencyGroups)\n .sort((a, b) => parseInt(b, 10) - parseInt(a, 10))\n .flatMap((key) => frequencyGroups[key].sort());\n },\n };\n};\n", "import notify from \"../components/molecules/notify.ts\";\n\nconst errorHandler = (error) => {\n const { message = \"Unexpected error occurred!\" } = error;\n notify.error(message);\n};\n\nexport default errorHandler;\n", "import \"github-markdown-css\";\nimport \"../../css/print.css\";\nimport \"../../css/styles.css\";\nimport notify from \"../components/molecules/notify.ts\";\nimport {\n search,\n setNoteFromHash,\n} from \"../components/organisms/noteManager/noteManager.ts\";\nimport select from \"../utils/dom.js\";\nimport { url } from \"../utils/urlManager.ts\";\nimport { getGist } from \"../utils/github/api.ts\";\n\nconst setNoteFromRawUrl = async (rawUrl: string) => {\n if (rawUrl) {\n const response = await fetch(rawUrl).then((response) => {\n if (response.ok) return response.text();\n throw new Error(\n `Remote note could not be retrieved! code: ${response.status}`,\n );\n });\n select(\".terminal\").setValue(response);\n }\n};\n\nconst setNoteFromGist = async (gistId: string) => {\n if (gistId) {\n try {\n const gist = await getGist(gistId);\n const { files } = gist;\n const fileContents = Object.values(files);\n const [gistFile] = fileContents;\n\n // @ts-ignore as gistFile always has content\n const { content } = gistFile;\n select(\".terminal\").setValue(content);\n } catch (_e) {\n notify.error(\"MiroPad note not found! \uD83E\uDD37\u200D\u2642\uFE0F\");\n }\n }\n};\n\nexport const actOnURLStateChange = async (e: HashChangeEvent) => {\n try {\n const { oldURL, newURL } = e;\n const oldPageId = url.getPageId(oldURL);\n const newPageId = url.getPageId(newURL);\n const hasPageIdChanged = oldPageId !== newPageId;\n const { v: oldV } = url.getParamsObject(oldURL);\n const { v: newV } = url.getParamsObject(newURL);\n const hasPageVersionChanged = oldV !== newV;\n const shouldChangeNote = [hasPageIdChanged, hasPageVersionChanged].some(\n (r) => r,\n );\n if (shouldChangeNote) setNoteFromHash();\n\n const { gistId, raw } = url.getParamsObject(newURL);\n await setNoteFromGist(gistId);\n await setNoteFromRawUrl(raw);\n } catch (e: unknown) {\n if (e instanceof Error) {\n notify.error(e.message);\n } else {\n notify.error(\"An unknown error occurred\");\n }\n }\n\n const isANewNote = !url.getPageId();\n select(\"#note-info-button\").show(!isANewNote);\n select(\"#new-note\").disable(isANewNote);\n\n if (url.getSearchParam(\"md\") === \"full\") {\n select(\".terminal\").hide();\n } else {\n select(\".terminal\").show();\n }\n\n if (url.getSearchParam(\"zen\") === \"true\") {\n select(\".header\").hide();\n } else {\n select(\".header\").show();\n }\n\n select(\".note-info\").hide();\n\n const q = url.getSearchParam(\"q\");\n const queryResult = search(q);\n if (queryResult) select(\".terminal\").setValue(queryResult.text);\n};\n", "import select from \"../../../utils/dom.js\";\n\n// This is a feature where you can easily tick on/off\n// checkboxes \u2705 on the Markdown preview.\n// It does NOT persist the state on the data layer,\n// but lives temporarily on the browser's state\n// Useful feature when you are going to the Super market \uD83D\uDE04\n\n// Technically I cloud re-enable the checkboxes that ShowdownJS generates,\n// which are by default disabled, but couldn't figure that out. \u00AF\\_(\u30C4)_/\u00AF\n\nexport const autoMagicallyCheckBoxes = () => {\n select(\".task-list-item\").listenAll(\"click\", (el) => {\n el.firstChild.checked = !el.firstChild.checked;\n });\n};\n", "import \"github-markdown-css\";\nimport \"../css/print.css\";\nimport \"../css/styles.css\";\nimport welcomeUser from \"./components/molecules/welcome.js\";\nimport commander from \"./components/organisms/commander/commander.ts\";\nimport markDownViewer from \"./components/organisms/markdown/markDownViewer.js\";\nimport {\n deleteNote,\n disableSyncOnCurrentNote,\n getNote,\n setNoteFromHash,\n} from \"./components/organisms/noteManager/noteManager.ts\";\nimport { terminal } from \"./components/organisms/terminal.ts\";\nimport { isSyncEnabled } from \"./isSyncEnabled.js\";\nimport { registerServiceWorker } from \"./registerServiceWorker.js\";\nimport { Trie } from \"./utils/Trie/Trie.ts\";\nimport { copyToClipboard } from \"./utils/copyToClipboard.ts\";\nimport { relativeDate } from \"./utils/dates.js\";\nimport select from \"./utils/dom.js\";\nimport errorHandler from \"./utils/errorHandler.js\";\nimport {\n setAuthTokenFromCallback,\n syncNotesWithGitHub,\n} from \"./utils/github/actions.js\";\nimport storage from \"./utils/localstorage.js\";\nimport { resetPageTitle } from \"./utils/pageTitle.js\";\nimport { url } from \"./utils/urlManager.ts\";\nimport { actOnURLStateChange } from \"./listeners/urlChange.ts\";\nimport { autoMagicallyCheckBoxes } from \"./ui/markdown/preview/autoMagicallyCheckBoxes.js\";\n\n// Initialize a Trie tree to be used for the predictions\nexport const trieDictionary = Trie();\n\nconst initInfoPanel = () => {\n select(\"#note-info-close\").listen(\"click\", () => {\n select(\".note-info\").hide();\n });\n select(\"#note-info-button\").listen(\"click\", () => {\n const note = getNote();\n select(\".note-info\").show();\n\n select(\".note-info .details\").innerHTML(\n `

    \n \n ${note.title}\n

    \n

    \n \n ${relativeDate(note.dateCreated)}\n

    \n

    \n \n ${note.numberOfRevisions}\n

    \n `,\n );\n\n const isSyncOn = isSyncEnabled();\n if (isSyncOn && note) {\n const syncEl = (() => {\n const { disableSync } = note;\n const p = document.createElement(\"P\");\n p.innerHTML = `\n \n \n `;\n return p;\n })();\n select(\".note-info .details\").append(syncEl);\n select(\"#sync\").listen(\"click\", (e) => {\n disableSyncOnCurrentNote(!e.target.checked);\n });\n }\n const deleteButton = (() => {\n const p = document.createElement(\"P\");\n p.innerHTML = `\n \n \n \n \n \n \n \n Delete\n \n `;\n return p;\n })();\n select(\".note-info .details\").append(deleteButton);\n select(\"#delete-note\").listen(\"click\", () => {\n deleteNote();\n });\n });\n};\n\nconst main = async () => {\n // Insert all the saved data from dictionary to the Trie tree\n const words = storage.getDictionary();\n trieDictionary.insert(words);\n\n globalThis.addEventListener(\"error\", errorHandler);\n welcomeUser();\n commander.init();\n\n initInfoPanel();\n\n terminal.init();\n resetPageTitle();\n setNoteFromHash(url.getPageId());\n select(\".logo\").listen(\"click\", () => {\n commander.toggle(commander.getModes().notes);\n });\n select(\"#permalink\").listen(\"click\", async () => {\n await copyToClipboard(url.get());\n });\n\n markDownViewer.init();\n\n globalThis.addEventListener(\"hashchange\", actOnURLStateChange);\n actOnURLStateChange();\n\n registerServiceWorker();\n\n autoMagicallyCheckBoxes();\n\n await syncNotesWithGitHub();\n await setAuthTokenFromCallback();\n};\n\nexport default main;\n", "import main from \"./js/main.js\";\n\n(() => {\n main();\n})();\n"], - "mappings": "4vBAIA,SAASA,EAAgBC,EAAQ,CAC/B,aAEA,IAAIC,EAAiB,CACnB,wBAAyB,CACvB,aAAc,GACd,SAAU,wDACV,KAAM,SACR,EACA,WAAY,CACV,aAAc,GACd,SAAU,kCACV,KAAM,SACR,EACA,eAAgB,CACd,aAAc,GACd,SAAU,4JACV,KAAM,QACR,EACA,kBAAmB,CACjB,aAAc,GACd,SAAU,uKACV,KAAM,SACR,EACA,qBAAsB,CACpB,aAAc,GACd,SAAU,oIACV,KAAM,SACR,EACA,YAAa,CACX,aAAc,GACd,SAAU,0JACV,KAAM,SACR,EACA,iBAAkB,CAChB,aAAc,GACd,SAAU,gCACV,KAAM,SACR,EACA,mBAAoB,CAClB,aAAc,GACd,SAAU,sCACV,KAAM,SACR,EACA,mBAAoB,CAClB,aAAc,GACd,SAAU,iCACV,KAAM,SACR,EACA,mCAAoC,CAClC,aAAc,GACd,SAAU,sEACV,KAAM,SACR,EACA,0BAA2B,CACzB,aAAc,GACd,SAAU,mDACV,KAAM,SACR,EACA,wBAAyB,CACvB,aAAc,GACd,SAAU,+CACV,KAAM,SACR,EACA,cAAe,CACb,aAAc,GACd,SAAU,oCACV,KAAM,SACR,EACA,OAAQ,CACN,aAAc,GACd,SAAU,6BACV,KAAM,SACR,EACA,eAAgB,CACd,aAAc,GACd,SAAU,6BACV,KAAM,SACR,EACA,aAAc,CACZ,aAAc,GACd,SAAU,6CACV,KAAM,SACR,EACA,UAAW,CACT,aAAc,GACd,SAAU,mCACV,KAAM,SACR,EACA,kBAAmB,CACjB,aAAc,GACd,SAAU,kEACV,KAAM,SACR,EACA,oBAAqB,CACnB,aAAc,GACd,SAAU,kDACV,KAAM,SACR,EACA,qCAAsC,CACpC,aAAc,GACd,SAAU,oEACV,KAAM,SACR,EACA,iBAAkB,CAChB,aAAc,GACd,SAAU,gDACV,KAAM,SACR,EACA,8BAA+B,CAC7B,aAAc,GACd,SAAU,6EACV,KAAM,SACR,EACA,WAAY,CACV,aAAc,GACd,SAAU,2BACV,KAAM,SACR,EACA,eAAgB,CACd,aAAc,yBACd,SAAU,yFACV,KAAM,QACR,EACA,aAAc,CACZ,aAAc,GACd,SAAU,0IACV,KAAM,SACR,EACA,qBAAsB,CACpB,aAAc,GACd,SAAU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M,CAC3CW,GAAW,CACb,CAAC,CACH,CAAC,CACH,EAEMC,GAAO,SAAY,CAEvB,IAAMC,EAAQC,EAAQ,cAAc,EACpCjB,GAAe,OAAOgB,CAAK,EAE3B,WAAW,iBAAiB,QAASE,EAAY,EACjDC,GAAY,EACZC,EAAU,KAAK,EAEflB,GAAc,EAEdmB,EAAS,KAAK,EACdC,GAAe,EACfC,GAAgBC,EAAI,UAAU,CAAC,EAC/BrB,EAAO,OAAO,EAAE,OAAO,QAAS,IAAM,CACpCiB,EAAU,OAAOA,EAAU,SAAS,EAAE,KAAK,CAC7C,CAAC,EACDjB,EAAO,YAAY,EAAE,OAAO,QAAS,SAAY,CAC/C,MAAMsB,GAAgBD,EAAI,IAAI,CAAC,CACjC,CAAC,EAEDE,GAAe,KAAK,EAEpB,WAAW,iBAAiB,aAAcC,EAAmB,EAC7DA,GAAoB,EAEpBC,GAAsB,EAEtBC,GAAwB,EAExB,MAAMC,GAAoB,EAC1B,MAAMC,GAAyB,CACjC,EAEOC,GAAQjB,GC3IbkB,GAAK", + "sourcesContent": ["/**\n * Created by Tivie on 13-07-2015.\n */\n\nfunction getDefaultOpts (simple) {\n 'use strict';\n\n var defaultOptions = {\n omitExtraWLInCodeBlocks: {\n defaultValue: false,\n describe: 'Omit the default extra whiteline added to code blocks',\n type: 'boolean'\n },\n noHeaderId: {\n defaultValue: false,\n describe: 'Turn on/off generated header id',\n type: 'boolean'\n },\n prefixHeaderId: {\n defaultValue: false,\n describe: 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \\'section-\\' prefix',\n type: 'string'\n },\n rawPrefixHeaderId: {\n defaultValue: false,\n describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the \" char is used in the prefix)',\n type: 'boolean'\n },\n ghCompatibleHeaderId: {\n defaultValue: false,\n describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',\n type: 'boolean'\n },\n rawHeaderId: {\n defaultValue: false,\n describe: 'Remove only spaces, \\' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',\n type: 'boolean'\n },\n headerLevelStart: {\n defaultValue: false,\n describe: 'The header blocks level start',\n type: 'integer'\n },\n parseImgDimensions: {\n defaultValue: false,\n describe: 'Turn on/off image dimension parsing',\n type: 'boolean'\n },\n simplifiedAutoLink: {\n defaultValue: false,\n describe: 'Turn on/off GFM autolink style',\n type: 'boolean'\n },\n excludeTrailingPunctuationFromURLs: {\n defaultValue: false,\n describe: 'Excludes trailing punctuation from links generated with autoLinking',\n type: 'boolean'\n },\n literalMidWordUnderscores: {\n defaultValue: false,\n describe: 'Parse midword underscores as literal underscores',\n type: 'boolean'\n },\n literalMidWordAsterisks: {\n defaultValue: false,\n describe: 'Parse midword asterisks as literal asterisks',\n type: 'boolean'\n },\n strikethrough: {\n defaultValue: false,\n describe: 'Turn on/off strikethrough support',\n type: 'boolean'\n },\n tables: {\n defaultValue: false,\n describe: 'Turn on/off tables support',\n type: 'boolean'\n },\n tablesHeaderId: {\n defaultValue: false,\n describe: 'Add an id to table headers',\n type: 'boolean'\n },\n ghCodeBlocks: {\n defaultValue: true,\n describe: 'Turn on/off GFM fenced code blocks support',\n type: 'boolean'\n },\n tasklists: {\n defaultValue: false,\n describe: 'Turn on/off GFM tasklist support',\n type: 'boolean'\n },\n smoothLivePreview: {\n defaultValue: false,\n describe: 'Prevents weird effects in live previews due to incomplete input',\n type: 'boolean'\n },\n smartIndentationFix: {\n defaultValue: false,\n describe: 'Tries to smartly fix indentation in es6 strings',\n type: 'boolean'\n },\n disableForced4SpacesIndentedSublists: {\n defaultValue: false,\n describe: 'Disables the requirement of indenting nested sublists by 4 spaces',\n type: 'boolean'\n },\n simpleLineBreaks: {\n defaultValue: false,\n describe: 'Parses simple line breaks as
    (GFM Style)',\n type: 'boolean'\n },\n requireSpaceBeforeHeadingText: {\n defaultValue: false,\n describe: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',\n type: 'boolean'\n },\n ghMentions: {\n defaultValue: false,\n describe: 'Enables github @mentions',\n type: 'boolean'\n },\n ghMentionsLink: {\n defaultValue: 'https://github.com/{u}',\n describe: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',\n type: 'string'\n },\n encodeEmails: {\n defaultValue: true,\n describe: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',\n type: 'boolean'\n },\n openLinksInNewWindow: {\n defaultValue: false,\n describe: 'Open all links in new windows',\n type: 'boolean'\n },\n backslashEscapesHTMLTags: {\n defaultValue: false,\n describe: 'Support for HTML Tag escaping. ex: \\
    foo\\
    ',\n type: 'boolean'\n },\n emoji: {\n defaultValue: false,\n describe: 'Enable emoji support. Ex: `this is a :smile: emoji`',\n type: 'boolean'\n },\n underline: {\n defaultValue: false,\n describe: 'Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``',\n type: 'boolean'\n },\n ellipsis: {\n defaultValue: true,\n describe: 'Replaces three dots with the ellipsis unicode character',\n type: 'boolean'\n },\n completeHTMLDocument: {\n defaultValue: false,\n describe: 'Outputs a complete html document, including ``, `` and `` tags',\n type: 'boolean'\n },\n metadata: {\n defaultValue: false,\n describe: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).',\n type: 'boolean'\n },\n splitAdjacentBlockquotes: {\n defaultValue: false,\n describe: 'Split adjacent blockquote blocks',\n type: 'boolean'\n }\n };\n if (simple === false) {\n return JSON.parse(JSON.stringify(defaultOptions));\n }\n var ret = {};\n for (var opt in defaultOptions) {\n if (defaultOptions.hasOwnProperty(opt)) {\n ret[opt] = defaultOptions[opt].defaultValue;\n }\n }\n return ret;\n}\n\nfunction allOptionsOn () {\n 'use strict';\n var options = getDefaultOpts(true),\n ret = {};\n for (var opt in options) {\n if (options.hasOwnProperty(opt)) {\n ret[opt] = true;\n }\n }\n return ret;\n}\n", "/**\n * Created by Tivie on 06-01-2015.\n */\n\n// Private properties\nvar showdown = {},\n parsers = {},\n extensions = {},\n globalOptions = getDefaultOpts(true),\n setFlavor = 'vanilla',\n flavor = {\n github: {\n omitExtraWLInCodeBlocks: true,\n simplifiedAutoLink: true,\n excludeTrailingPunctuationFromURLs: true,\n literalMidWordUnderscores: true,\n strikethrough: true,\n tables: true,\n tablesHeaderId: true,\n ghCodeBlocks: true,\n tasklists: true,\n disableForced4SpacesIndentedSublists: true,\n simpleLineBreaks: true,\n requireSpaceBeforeHeadingText: true,\n ghCompatibleHeaderId: true,\n ghMentions: true,\n backslashEscapesHTMLTags: true,\n emoji: true,\n splitAdjacentBlockquotes: true\n },\n original: {\n noHeaderId: true,\n ghCodeBlocks: false\n },\n ghost: {\n omitExtraWLInCodeBlocks: true,\n parseImgDimensions: true,\n simplifiedAutoLink: true,\n excludeTrailingPunctuationFromURLs: true,\n literalMidWordUnderscores: true,\n strikethrough: true,\n tables: true,\n tablesHeaderId: true,\n ghCodeBlocks: true,\n tasklists: true,\n smoothLivePreview: true,\n simpleLineBreaks: true,\n requireSpaceBeforeHeadingText: true,\n ghMentions: false,\n encodeEmails: true\n },\n vanilla: getDefaultOpts(true),\n allOn: allOptionsOn()\n };\n\n/**\n * helper namespace\n * @type {{}}\n */\nshowdown.helper = {};\n\n/**\n * TODO LEGACY SUPPORT CODE\n * @type {{}}\n */\nshowdown.extensions = {};\n\n/**\n * Set a global option\n * @static\n * @param {string} key\n * @param {*} value\n * @returns {showdown}\n */\nshowdown.setOption = function (key, value) {\n 'use strict';\n globalOptions[key] = value;\n return this;\n};\n\n/**\n * Get a global option\n * @static\n * @param {string} key\n * @returns {*}\n */\nshowdown.getOption = function (key) {\n 'use strict';\n return globalOptions[key];\n};\n\n/**\n * Get the global options\n * @static\n * @returns {{}}\n */\nshowdown.getOptions = function () {\n 'use strict';\n return globalOptions;\n};\n\n/**\n * Reset global options to the default values\n * @static\n */\nshowdown.resetOptions = function () {\n 'use strict';\n globalOptions = getDefaultOpts(true);\n};\n\n/**\n * Set the flavor showdown should use as default\n * @param {string} name\n */\nshowdown.setFlavor = function (name) {\n 'use strict';\n if (!flavor.hasOwnProperty(name)) {\n throw Error(name + ' flavor was not found');\n }\n showdown.resetOptions();\n var preset = flavor[name];\n setFlavor = name;\n for (var option in preset) {\n if (preset.hasOwnProperty(option)) {\n globalOptions[option] = preset[option];\n }\n }\n};\n\n/**\n * Get the currently set flavor\n * @returns {string}\n */\nshowdown.getFlavor = function () {\n 'use strict';\n return setFlavor;\n};\n\n/**\n * Get the options of a specified flavor. Returns undefined if the flavor was not found\n * @param {string} name Name of the flavor\n * @returns {{}|undefined}\n */\nshowdown.getFlavorOptions = function (name) {\n 'use strict';\n if (flavor.hasOwnProperty(name)) {\n return flavor[name];\n }\n};\n\n/**\n * Get the default options\n * @static\n * @param {boolean} [simple=true]\n * @returns {{}}\n */\nshowdown.getDefaultOptions = function (simple) {\n 'use strict';\n return getDefaultOpts(simple);\n};\n\n/**\n * Get or set a subParser\n *\n * subParser(name) - Get a registered subParser\n * subParser(name, func) - Register a subParser\n * @static\n * @param {string} name\n * @param {function} [func]\n * @returns {*}\n */\nshowdown.subParser = function (name, func) {\n 'use strict';\n if (showdown.helper.isString(name)) {\n if (typeof func !== 'undefined') {\n parsers[name] = func;\n } else {\n if (parsers.hasOwnProperty(name)) {\n return parsers[name];\n } else {\n throw Error('SubParser named ' + name + ' not registered!');\n }\n }\n }\n};\n\n/**\n * Gets or registers an extension\n * @static\n * @param {string} name\n * @param {object|object[]|function=} ext\n * @returns {*}\n */\nshowdown.extension = function (name, ext) {\n 'use strict';\n\n if (!showdown.helper.isString(name)) {\n throw Error('Extension \\'name\\' must be a string');\n }\n\n name = showdown.helper.stdExtName(name);\n\n // Getter\n if (showdown.helper.isUndefined(ext)) {\n if (!extensions.hasOwnProperty(name)) {\n throw Error('Extension named ' + name + ' is not registered!');\n }\n return extensions[name];\n\n // Setter\n } else {\n // Expand extension if it's wrapped in a function\n if (typeof ext === 'function') {\n ext = ext();\n }\n\n // Ensure extension is an array\n if (!showdown.helper.isArray(ext)) {\n ext = [ext];\n }\n\n var validExtension = validate(ext, name);\n\n if (validExtension.valid) {\n extensions[name] = ext;\n } else {\n throw Error(validExtension.error);\n }\n }\n};\n\n/**\n * Gets all extensions registered\n * @returns {{}}\n */\nshowdown.getAllExtensions = function () {\n 'use strict';\n return extensions;\n};\n\n/**\n * Remove an extension\n * @param {string} name\n */\nshowdown.removeExtension = function (name) {\n 'use strict';\n delete extensions[name];\n};\n\n/**\n * Removes all extensions\n */\nshowdown.resetExtensions = function () {\n 'use strict';\n extensions = {};\n};\n\n/**\n * Validate extension\n * @param {array} extension\n * @param {string} name\n * @returns {{valid: boolean, error: string}}\n */\nfunction validate (extension, name) {\n 'use strict';\n\n var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',\n ret = {\n valid: true,\n error: ''\n };\n\n if (!showdown.helper.isArray(extension)) {\n extension = [extension];\n }\n\n for (var i = 0; i < extension.length; ++i) {\n var baseMsg = errMsg + ' sub-extension ' + i + ': ',\n ext = extension[i];\n if (typeof ext !== 'object') {\n ret.valid = false;\n ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';\n return ret;\n }\n\n if (!showdown.helper.isString(ext.type)) {\n ret.valid = false;\n ret.error = baseMsg + 'property \"type\" must be a string, but ' + typeof ext.type + ' given';\n return ret;\n }\n\n var type = ext.type = ext.type.toLowerCase();\n\n // normalize extension type\n if (type === 'language') {\n type = ext.type = 'lang';\n }\n\n if (type === 'html') {\n type = ext.type = 'output';\n }\n\n if (type !== 'lang' && type !== 'output' && type !== 'listener') {\n ret.valid = false;\n ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: \"lang/language\", \"output/html\" or \"listener\"';\n return ret;\n }\n\n if (type === 'listener') {\n if (showdown.helper.isUndefined(ext.listeners)) {\n ret.valid = false;\n ret.error = baseMsg + '. Extensions of type \"listener\" must have a property called \"listeners\"';\n return ret;\n }\n } else {\n if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {\n ret.valid = false;\n ret.error = baseMsg + type + ' extensions must define either a \"regex\" property or a \"filter\" method';\n return ret;\n }\n }\n\n if (ext.listeners) {\n if (typeof ext.listeners !== 'object') {\n ret.valid = false;\n ret.error = baseMsg + '\"listeners\" property must be an object but ' + typeof ext.listeners + ' given';\n return ret;\n }\n for (var ln in ext.listeners) {\n if (ext.listeners.hasOwnProperty(ln)) {\n if (typeof ext.listeners[ln] !== 'function') {\n ret.valid = false;\n ret.error = baseMsg + '\"listeners\" property must be an hash of [event name]: [callback]. listeners.' + ln +\n ' must be a function but ' + typeof ext.listeners[ln] + ' given';\n return ret;\n }\n }\n }\n }\n\n if (ext.filter) {\n if (typeof ext.filter !== 'function') {\n ret.valid = false;\n ret.error = baseMsg + '\"filter\" must be a function, but ' + typeof ext.filter + ' given';\n return ret;\n }\n } else if (ext.regex) {\n if (showdown.helper.isString(ext.regex)) {\n ext.regex = new RegExp(ext.regex, 'g');\n }\n if (!(ext.regex instanceof RegExp)) {\n ret.valid = false;\n ret.error = baseMsg + '\"regex\" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';\n return ret;\n }\n if (showdown.helper.isUndefined(ext.replace)) {\n ret.valid = false;\n ret.error = baseMsg + '\"regex\" extensions must implement a replace string or function';\n return ret;\n }\n }\n }\n return ret;\n}\n\n/**\n * Validate extension\n * @param {object} ext\n * @returns {boolean}\n */\nshowdown.validateExtension = function (ext) {\n 'use strict';\n\n var validateExtension = validate(ext, null);\n if (!validateExtension.valid) {\n console.warn(validateExtension.error);\n return false;\n }\n return true;\n};\n", "/**\n * showdownjs helper functions\n */\n\nif (!showdown.hasOwnProperty('helper')) {\n showdown.helper = {};\n}\n\n/**\n * Check if var is string\n * @static\n * @param {string} a\n * @returns {boolean}\n */\nshowdown.helper.isString = function (a) {\n 'use strict';\n return (typeof a === 'string' || a instanceof String);\n};\n\n/**\n * Check if var is a function\n * @static\n * @param {*} a\n * @returns {boolean}\n */\nshowdown.helper.isFunction = function (a) {\n 'use strict';\n var getType = {};\n return a && getType.toString.call(a) === '[object Function]';\n};\n\n/**\n * isArray helper function\n * @static\n * @param {*} a\n * @returns {boolean}\n */\nshowdown.helper.isArray = function (a) {\n 'use strict';\n return Array.isArray(a);\n};\n\n/**\n * Check if value is undefined\n * @static\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n */\nshowdown.helper.isUndefined = function (value) {\n 'use strict';\n return typeof value === 'undefined';\n};\n\n/**\n * ForEach helper function\n * Iterates over Arrays and Objects (own properties only)\n * @static\n * @param {*} obj\n * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object\n */\nshowdown.helper.forEach = function (obj, callback) {\n 'use strict';\n // check if obj is defined\n if (showdown.helper.isUndefined(obj)) {\n throw new Error('obj param is required');\n }\n\n if (showdown.helper.isUndefined(callback)) {\n throw new Error('callback param is required');\n }\n\n if (!showdown.helper.isFunction(callback)) {\n throw new Error('callback param must be a function/closure');\n }\n\n if (typeof obj.forEach === 'function') {\n obj.forEach(callback);\n } else if (showdown.helper.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n callback(obj[i], i, obj);\n }\n } else if (typeof (obj) === 'object') {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n callback(obj[prop], prop, obj);\n }\n }\n } else {\n throw new Error('obj does not seem to be an array or an iterable object');\n }\n};\n\n/**\n * Standardidize extension name\n * @static\n * @param {string} s extension name\n * @returns {string}\n */\nshowdown.helper.stdExtName = function (s) {\n 'use strict';\n return s.replace(/[_?*+\\/\\\\.^-]/g, '').replace(/\\s/g, '').toLowerCase();\n};\n\nfunction escapeCharactersCallback (wholeMatch, m1) {\n 'use strict';\n var charCodeToEscape = m1.charCodeAt(0);\n return '¨E' + charCodeToEscape + 'E';\n}\n\n/**\n * Callback used to escape characters when passing through String.replace\n * @static\n * @param {string} wholeMatch\n * @param {string} m1\n * @returns {string}\n */\nshowdown.helper.escapeCharactersCallback = escapeCharactersCallback;\n\n/**\n * Escape characters in a string\n * @static\n * @param {string} text\n * @param {string} charsToEscape\n * @param {boolean} afterBackslash\n * @returns {XML|string|void|*}\n */\nshowdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) {\n 'use strict';\n // First we have to escape the escape characters so that\n // we can build a character class out of them\n var regexString = '([' + charsToEscape.replace(/([\\[\\]\\\\])/g, '\\\\$1') + '])';\n\n if (afterBackslash) {\n regexString = '\\\\\\\\' + regexString;\n }\n\n var regex = new RegExp(regexString, 'g');\n text = text.replace(regex, escapeCharactersCallback);\n\n return text;\n};\n\n/**\n * Unescape HTML entities\n * @param txt\n * @returns {string}\n */\nshowdown.helper.unescapeHTMLEntities = function (txt) {\n 'use strict';\n\n return txt\n .replace(/"/g, '\"')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/&/g, '&');\n};\n\nvar rgxFindMatchPos = function (str, left, right, flags) {\n 'use strict';\n var f = flags || '',\n g = f.indexOf('g') > -1,\n x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),\n l = new RegExp(left, f.replace(/g/g, '')),\n pos = [],\n t, s, m, start, end;\n\n do {\n t = 0;\n while ((m = x.exec(str))) {\n if (l.test(m[0])) {\n if (!(t++)) {\n s = x.lastIndex;\n start = s - m[0].length;\n }\n } else if (t) {\n if (!--t) {\n end = m.index + m[0].length;\n var obj = {\n left: {start: start, end: s},\n match: {start: s, end: m.index},\n right: {start: m.index, end: end},\n wholeMatch: {start: start, end: end}\n };\n pos.push(obj);\n if (!g) {\n return pos;\n }\n }\n }\n }\n } while (t && (x.lastIndex = s));\n\n return pos;\n};\n\n/**\n * matchRecursiveRegExp\n *\n * (c) 2007 Steven Levithan \n * MIT License\n *\n * Accepts a string to search, a left and right format delimiter\n * as regex patterns, and optional regex flags. Returns an array\n * of matches, allowing nested instances of left/right delimiters.\n * Use the \"g\" flag to return all matches, otherwise only the\n * first is returned. Be careful to ensure that the left and\n * right format delimiters produce mutually exclusive matches.\n * Backreferences are not supported within the right delimiter\n * due to how it is internally combined with the left delimiter.\n * When matching strings whose format delimiters are unbalanced\n * to the left or right, the output is intentionally as a\n * conventional regex library with recursion support would\n * produce, e.g. \"<\" and \">\" both produce [\"x\"] when using\n * \"<\" and \">\" as the delimiters (both strings contain a single,\n * balanced instance of \"\").\n *\n * examples:\n * matchRecursiveRegExp(\"test\", \"\\\\(\", \"\\\\)\")\n * returns: []\n * matchRecursiveRegExp(\">>t<>\", \"<\", \">\", \"g\")\n * returns: [\"t<>\", \"\"]\n * matchRecursiveRegExp(\"
    test
    \", \"]*>\", \"\", \"gi\")\n * returns: [\"test\"]\n */\nshowdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {\n 'use strict';\n\n var matchPos = rgxFindMatchPos (str, left, right, flags),\n results = [];\n\n for (var i = 0; i < matchPos.length; ++i) {\n results.push([\n str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),\n str.slice(matchPos[i].match.start, matchPos[i].match.end),\n str.slice(matchPos[i].left.start, matchPos[i].left.end),\n str.slice(matchPos[i].right.start, matchPos[i].right.end)\n ]);\n }\n return results;\n};\n\n/**\n *\n * @param {string} str\n * @param {string|function} replacement\n * @param {string} left\n * @param {string} right\n * @param {string} flags\n * @returns {string}\n */\nshowdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {\n 'use strict';\n\n if (!showdown.helper.isFunction(replacement)) {\n var repStr = replacement;\n replacement = function () {\n return repStr;\n };\n }\n\n var matchPos = rgxFindMatchPos(str, left, right, flags),\n finalStr = str,\n lng = matchPos.length;\n\n if (lng > 0) {\n var bits = [];\n if (matchPos[0].wholeMatch.start !== 0) {\n bits.push(str.slice(0, matchPos[0].wholeMatch.start));\n }\n for (var i = 0; i < lng; ++i) {\n bits.push(\n replacement(\n str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),\n str.slice(matchPos[i].match.start, matchPos[i].match.end),\n str.slice(matchPos[i].left.start, matchPos[i].left.end),\n str.slice(matchPos[i].right.start, matchPos[i].right.end)\n )\n );\n if (i < lng - 1) {\n bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));\n }\n }\n if (matchPos[lng - 1].wholeMatch.end < str.length) {\n bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));\n }\n finalStr = bits.join('');\n }\n return finalStr;\n};\n\n/**\n * Returns the index within the passed String object of the first occurrence of the specified regex,\n * starting the search at fromIndex. Returns -1 if the value is not found.\n *\n * @param {string} str string to search\n * @param {RegExp} regex Regular expression to search\n * @param {int} [fromIndex = 0] Index to start the search\n * @returns {Number}\n * @throws InvalidArgumentError\n */\nshowdown.helper.regexIndexOf = function (str, regex, fromIndex) {\n 'use strict';\n if (!showdown.helper.isString(str)) {\n throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';\n }\n if (regex instanceof RegExp === false) {\n throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp';\n }\n var indexOf = str.substring(fromIndex || 0).search(regex);\n return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf;\n};\n\n/**\n * Splits the passed string object at the defined index, and returns an array composed of the two substrings\n * @param {string} str string to split\n * @param {int} index index to split string at\n * @returns {[string,string]}\n * @throws InvalidArgumentError\n */\nshowdown.helper.splitAtIndex = function (str, index) {\n 'use strict';\n if (!showdown.helper.isString(str)) {\n throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';\n }\n return [str.substring(0, index), str.substring(index)];\n};\n\n/**\n * Obfuscate an e-mail address through the use of Character Entities,\n * transforming ASCII characters into their equivalent decimal or hex entities.\n *\n * Since it has a random component, subsequent calls to this function produce different results\n *\n * @param {string} mail\n * @returns {string}\n */\nshowdown.helper.encodeEmailAddress = function (mail) {\n 'use strict';\n var encode = [\n function (ch) {\n return '&#' + ch.charCodeAt(0) + ';';\n },\n function (ch) {\n return '&#x' + ch.charCodeAt(0).toString(16) + ';';\n },\n function (ch) {\n return ch;\n }\n ];\n\n mail = mail.replace(/./g, function (ch) {\n if (ch === '@') {\n // this *must* be encoded. I insist.\n ch = encode[Math.floor(Math.random() * 2)](ch);\n } else {\n var r = Math.random();\n // roughly 10% raw, 45% hex, 45% dec\n ch = (\n r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)\n );\n }\n return ch;\n });\n\n return mail;\n};\n\n/**\n *\n * @param str\n * @param targetLength\n * @param padString\n * @returns {string}\n */\nshowdown.helper.padEnd = function padEnd (str, targetLength, padString) {\n 'use strict';\n /*jshint bitwise: false*/\n // eslint-disable-next-line space-infix-ops\n targetLength = targetLength>>0; //floor if number or convert non-number to 0;\n /*jshint bitwise: true*/\n padString = String(padString || ' ');\n if (str.length > targetLength) {\n return String(str);\n } else {\n targetLength = targetLength - str.length;\n if (targetLength > padString.length) {\n padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed\n }\n return String(str) + padString.slice(0,targetLength);\n }\n};\n\n/**\n * POLYFILLS\n */\n// use this instead of builtin is undefined for IE8 compatibility\nif (typeof (console) === 'undefined') {\n console = {\n warn: function (msg) {\n 'use strict';\n alert(msg);\n },\n log: function (msg) {\n 'use strict';\n alert(msg);\n },\n error: function (msg) {\n 'use strict';\n throw msg;\n }\n };\n}\n\n/**\n * Common regexes.\n * We declare some common regexes to improve performance\n */\nshowdown.helper.regexes = {\n asteriskDashAndColon: /([*_:~])/g\n};\n\n/**\n * EMOJIS LIST\n */\nshowdown.helper.emojis = {\n '+1':'\\ud83d\\udc4d',\n '-1':'\\ud83d\\udc4e',\n '100':'\\ud83d\\udcaf',\n '1234':'\\ud83d\\udd22',\n '1st_place_medal':'\\ud83e\\udd47',\n '2nd_place_medal':'\\ud83e\\udd48',\n '3rd_place_medal':'\\ud83e\\udd49',\n '8ball':'\\ud83c\\udfb1',\n 'a':'\\ud83c\\udd70\\ufe0f',\n 'ab':'\\ud83c\\udd8e',\n 'abc':'\\ud83d\\udd24',\n 'abcd':'\\ud83d\\udd21',\n 'accept':'\\ud83c\\ude51',\n 'aerial_tramway':'\\ud83d\\udea1',\n 'airplane':'\\u2708\\ufe0f',\n 'alarm_clock':'\\u23f0',\n 'alembic':'\\u2697\\ufe0f',\n 'alien':'\\ud83d\\udc7d',\n 'ambulance':'\\ud83d\\ude91',\n 'amphora':'\\ud83c\\udffa',\n 'anchor':'\\u2693\\ufe0f',\n 'angel':'\\ud83d\\udc7c',\n 'anger':'\\ud83d\\udca2',\n 'angry':'\\ud83d\\ude20',\n 'anguished':'\\ud83d\\ude27',\n 'ant':'\\ud83d\\udc1c',\n 'apple':'\\ud83c\\udf4e',\n 'aquarius':'\\u2652\\ufe0f',\n 'aries':'\\u2648\\ufe0f',\n 'arrow_backward':'\\u25c0\\ufe0f',\n 'arrow_double_down':'\\u23ec',\n 'arrow_double_up':'\\u23eb',\n 'arrow_down':'\\u2b07\\ufe0f',\n 'arrow_down_small':'\\ud83d\\udd3d',\n 'arrow_forward':'\\u25b6\\ufe0f',\n 'arrow_heading_down':'\\u2935\\ufe0f',\n 'arrow_heading_up':'\\u2934\\ufe0f',\n 'arrow_left':'\\u2b05\\ufe0f',\n 'arrow_lower_left':'\\u2199\\ufe0f',\n 'arrow_lower_right':'\\u2198\\ufe0f',\n 'arrow_right':'\\u27a1\\ufe0f',\n 'arrow_right_hook':'\\u21aa\\ufe0f',\n 'arrow_up':'\\u2b06\\ufe0f',\n 'arrow_up_down':'\\u2195\\ufe0f',\n 'arrow_up_small':'\\ud83d\\udd3c',\n 'arrow_upper_left':'\\u2196\\ufe0f',\n 'arrow_upper_right':'\\u2197\\ufe0f',\n 'arrows_clockwise':'\\ud83d\\udd03',\n 'arrows_counterclockwise':'\\ud83d\\udd04',\n 'art':'\\ud83c\\udfa8',\n 'articulated_lorry':'\\ud83d\\ude9b',\n 'artificial_satellite':'\\ud83d\\udef0',\n 'astonished':'\\ud83d\\ude32',\n 'athletic_shoe':'\\ud83d\\udc5f',\n 'atm':'\\ud83c\\udfe7',\n 'atom_symbol':'\\u269b\\ufe0f',\n 'avocado':'\\ud83e\\udd51',\n 'b':'\\ud83c\\udd71\\ufe0f',\n 'baby':'\\ud83d\\udc76',\n 'baby_bottle':'\\ud83c\\udf7c',\n 'baby_chick':'\\ud83d\\udc24',\n 'baby_symbol':'\\ud83d\\udebc',\n 'back':'\\ud83d\\udd19',\n 'bacon':'\\ud83e\\udd53',\n 'badminton':'\\ud83c\\udff8',\n 'baggage_claim':'\\ud83d\\udec4',\n 'baguette_bread':'\\ud83e\\udd56',\n 'balance_scale':'\\u2696\\ufe0f',\n 'balloon':'\\ud83c\\udf88',\n 'ballot_box':'\\ud83d\\uddf3',\n 'ballot_box_with_check':'\\u2611\\ufe0f',\n 'bamboo':'\\ud83c\\udf8d',\n 'banana':'\\ud83c\\udf4c',\n 'bangbang':'\\u203c\\ufe0f',\n 'bank':'\\ud83c\\udfe6',\n 'bar_chart':'\\ud83d\\udcca',\n 'barber':'\\ud83d\\udc88',\n 'baseball':'\\u26be\\ufe0f',\n 'basketball':'\\ud83c\\udfc0',\n 'basketball_man':'\\u26f9\\ufe0f',\n 'basketball_woman':'\\u26f9\\ufe0f‍\\u2640\\ufe0f',\n 'bat':'\\ud83e\\udd87',\n 'bath':'\\ud83d\\udec0',\n 'bathtub':'\\ud83d\\udec1',\n 'battery':'\\ud83d\\udd0b',\n 'beach_umbrella':'\\ud83c\\udfd6',\n 'bear':'\\ud83d\\udc3b',\n 'bed':'\\ud83d\\udecf',\n 'bee':'\\ud83d\\udc1d',\n 'beer':'\\ud83c\\udf7a',\n 'beers':'\\ud83c\\udf7b',\n 'beetle':'\\ud83d\\udc1e',\n 'beginner':'\\ud83d\\udd30',\n 'bell':'\\ud83d\\udd14',\n 'bellhop_bell':'\\ud83d\\udece',\n 'bento':'\\ud83c\\udf71',\n 'biking_man':'\\ud83d\\udeb4',\n 'bike':'\\ud83d\\udeb2',\n 'biking_woman':'\\ud83d\\udeb4‍\\u2640\\ufe0f',\n 'bikini':'\\ud83d\\udc59',\n 'biohazard':'\\u2623\\ufe0f',\n 'bird':'\\ud83d\\udc26',\n 'birthday':'\\ud83c\\udf82',\n 'black_circle':'\\u26ab\\ufe0f',\n 'black_flag':'\\ud83c\\udff4',\n 'black_heart':'\\ud83d\\udda4',\n 'black_joker':'\\ud83c\\udccf',\n 'black_large_square':'\\u2b1b\\ufe0f',\n 'black_medium_small_square':'\\u25fe\\ufe0f',\n 'black_medium_square':'\\u25fc\\ufe0f',\n 'black_nib':'\\u2712\\ufe0f',\n 'black_small_square':'\\u25aa\\ufe0f',\n 'black_square_button':'\\ud83d\\udd32',\n 'blonde_man':'\\ud83d\\udc71',\n 'blonde_woman':'\\ud83d\\udc71‍\\u2640\\ufe0f',\n 'blossom':'\\ud83c\\udf3c',\n 'blowfish':'\\ud83d\\udc21',\n 'blue_book':'\\ud83d\\udcd8',\n 'blue_car':'\\ud83d\\ude99',\n 'blue_heart':'\\ud83d\\udc99',\n 'blush':'\\ud83d\\ude0a',\n 'boar':'\\ud83d\\udc17',\n 'boat':'\\u26f5\\ufe0f',\n 'bomb':'\\ud83d\\udca3',\n 'book':'\\ud83d\\udcd6',\n 'bookmark':'\\ud83d\\udd16',\n 'bookmark_tabs':'\\ud83d\\udcd1',\n 'books':'\\ud83d\\udcda',\n 'boom':'\\ud83d\\udca5',\n 'boot':'\\ud83d\\udc62',\n 'bouquet':'\\ud83d\\udc90',\n 'bowing_man':'\\ud83d\\ude47',\n 'bow_and_arrow':'\\ud83c\\udff9',\n 'bowing_woman':'\\ud83d\\ude47‍\\u2640\\ufe0f',\n 'bowling':'\\ud83c\\udfb3',\n 'boxing_glove':'\\ud83e\\udd4a',\n 'boy':'\\ud83d\\udc66',\n 'bread':'\\ud83c\\udf5e',\n 'bride_with_veil':'\\ud83d\\udc70',\n 'bridge_at_night':'\\ud83c\\udf09',\n 'briefcase':'\\ud83d\\udcbc',\n 'broken_heart':'\\ud83d\\udc94',\n 'bug':'\\ud83d\\udc1b',\n 'building_construction':'\\ud83c\\udfd7',\n 'bulb':'\\ud83d\\udca1',\n 'bullettrain_front':'\\ud83d\\ude85',\n 'bullettrain_side':'\\ud83d\\ude84',\n 'burrito':'\\ud83c\\udf2f',\n 'bus':'\\ud83d\\ude8c',\n 'business_suit_levitating':'\\ud83d\\udd74',\n 'busstop':'\\ud83d\\ude8f',\n 'bust_in_silhouette':'\\ud83d\\udc64',\n 'busts_in_silhouette':'\\ud83d\\udc65',\n 'butterfly':'\\ud83e\\udd8b',\n 'cactus':'\\ud83c\\udf35',\n 'cake':'\\ud83c\\udf70',\n 'calendar':'\\ud83d\\udcc6',\n 'call_me_hand':'\\ud83e\\udd19',\n 'calling':'\\ud83d\\udcf2',\n 'camel':'\\ud83d\\udc2b',\n 'camera':'\\ud83d\\udcf7',\n 'camera_flash':'\\ud83d\\udcf8',\n 'camping':'\\ud83c\\udfd5',\n 'cancer':'\\u264b\\ufe0f',\n 'candle':'\\ud83d\\udd6f',\n 'candy':'\\ud83c\\udf6c',\n 'canoe':'\\ud83d\\udef6',\n 'capital_abcd':'\\ud83d\\udd20',\n 'capricorn':'\\u2651\\ufe0f',\n 'car':'\\ud83d\\ude97',\n 'card_file_box':'\\ud83d\\uddc3',\n 'card_index':'\\ud83d\\udcc7',\n 'card_index_dividers':'\\ud83d\\uddc2',\n 'carousel_horse':'\\ud83c\\udfa0',\n 'carrot':'\\ud83e\\udd55',\n 'cat':'\\ud83d\\udc31',\n 'cat2':'\\ud83d\\udc08',\n 'cd':'\\ud83d\\udcbf',\n 'chains':'\\u26d3',\n 'champagne':'\\ud83c\\udf7e',\n 'chart':'\\ud83d\\udcb9',\n 'chart_with_downwards_trend':'\\ud83d\\udcc9',\n 'chart_with_upwards_trend':'\\ud83d\\udcc8',\n 'checkered_flag':'\\ud83c\\udfc1',\n 'cheese':'\\ud83e\\uddc0',\n 'cherries':'\\ud83c\\udf52',\n 'cherry_blossom':'\\ud83c\\udf38',\n 'chestnut':'\\ud83c\\udf30',\n 'chicken':'\\ud83d\\udc14',\n 'children_crossing':'\\ud83d\\udeb8',\n 'chipmunk':'\\ud83d\\udc3f',\n 'chocolate_bar':'\\ud83c\\udf6b',\n 'christmas_tree':'\\ud83c\\udf84',\n 'church':'\\u26ea\\ufe0f',\n 'cinema':'\\ud83c\\udfa6',\n 'circus_tent':'\\ud83c\\udfaa',\n 'city_sunrise':'\\ud83c\\udf07',\n 'city_sunset':'\\ud83c\\udf06',\n 'cityscape':'\\ud83c\\udfd9',\n 'cl':'\\ud83c\\udd91',\n 'clamp':'\\ud83d\\udddc',\n 'clap':'\\ud83d\\udc4f',\n 'clapper':'\\ud83c\\udfac',\n 'classical_building':'\\ud83c\\udfdb',\n 'clinking_glasses':'\\ud83e\\udd42',\n 'clipboard':'\\ud83d\\udccb',\n 'clock1':'\\ud83d\\udd50',\n 'clock10':'\\ud83d\\udd59',\n 'clock1030':'\\ud83d\\udd65',\n 'clock11':'\\ud83d\\udd5a',\n 'clock1130':'\\ud83d\\udd66',\n 'clock12':'\\ud83d\\udd5b',\n 'clock1230':'\\ud83d\\udd67',\n 'clock130':'\\ud83d\\udd5c',\n 'clock2':'\\ud83d\\udd51',\n 'clock230':'\\ud83d\\udd5d',\n 'clock3':'\\ud83d\\udd52',\n 'clock330':'\\ud83d\\udd5e',\n 'clock4':'\\ud83d\\udd53',\n 'clock430':'\\ud83d\\udd5f',\n 'clock5':'\\ud83d\\udd54',\n 'clock530':'\\ud83d\\udd60',\n 'clock6':'\\ud83d\\udd55',\n 'clock630':'\\ud83d\\udd61',\n 'clock7':'\\ud83d\\udd56',\n 'clock730':'\\ud83d\\udd62',\n 'clock8':'\\ud83d\\udd57',\n 'clock830':'\\ud83d\\udd63',\n 'clock9':'\\ud83d\\udd58',\n 'clock930':'\\ud83d\\udd64',\n 'closed_book':'\\ud83d\\udcd5',\n 'closed_lock_with_key':'\\ud83d\\udd10',\n 'closed_umbrella':'\\ud83c\\udf02',\n 'cloud':'\\u2601\\ufe0f',\n 'cloud_with_lightning':'\\ud83c\\udf29',\n 'cloud_with_lightning_and_rain':'\\u26c8',\n 'cloud_with_rain':'\\ud83c\\udf27',\n 'cloud_with_snow':'\\ud83c\\udf28',\n 'clown_face':'\\ud83e\\udd21',\n 'clubs':'\\u2663\\ufe0f',\n 'cocktail':'\\ud83c\\udf78',\n 'coffee':'\\u2615\\ufe0f',\n 'coffin':'\\u26b0\\ufe0f',\n 'cold_sweat':'\\ud83d\\ude30',\n 'comet':'\\u2604\\ufe0f',\n 'computer':'\\ud83d\\udcbb',\n 'computer_mouse':'\\ud83d\\uddb1',\n 'confetti_ball':'\\ud83c\\udf8a',\n 'confounded':'\\ud83d\\ude16',\n 'confused':'\\ud83d\\ude15',\n 'congratulations':'\\u3297\\ufe0f',\n 'construction':'\\ud83d\\udea7',\n 'construction_worker_man':'\\ud83d\\udc77',\n 'construction_worker_woman':'\\ud83d\\udc77‍\\u2640\\ufe0f',\n 'control_knobs':'\\ud83c\\udf9b',\n 'convenience_store':'\\ud83c\\udfea',\n 'cookie':'\\ud83c\\udf6a',\n 'cool':'\\ud83c\\udd92',\n 'policeman':'\\ud83d\\udc6e',\n 'copyright':'\\u00a9\\ufe0f',\n 'corn':'\\ud83c\\udf3d',\n 'couch_and_lamp':'\\ud83d\\udecb',\n 'couple':'\\ud83d\\udc6b',\n 'couple_with_heart_woman_man':'\\ud83d\\udc91',\n 'couple_with_heart_man_man':'\\ud83d\\udc68‍\\u2764\\ufe0f‍\\ud83d\\udc68',\n 'couple_with_heart_woman_woman':'\\ud83d\\udc69‍\\u2764\\ufe0f‍\\ud83d\\udc69',\n 'couplekiss_man_man':'\\ud83d\\udc68‍\\u2764\\ufe0f‍\\ud83d\\udc8b‍\\ud83d\\udc68',\n 'couplekiss_man_woman':'\\ud83d\\udc8f',\n 'couplekiss_woman_woman':'\\ud83d\\udc69‍\\u2764\\ufe0f‍\\ud83d\\udc8b‍\\ud83d\\udc69',\n 'cow':'\\ud83d\\udc2e',\n 'cow2':'\\ud83d\\udc04',\n 'cowboy_hat_face':'\\ud83e\\udd20',\n 'crab':'\\ud83e\\udd80',\n 'crayon':'\\ud83d\\udd8d',\n 'credit_card':'\\ud83d\\udcb3',\n 'crescent_moon':'\\ud83c\\udf19',\n 'cricket':'\\ud83c\\udfcf',\n 'crocodile':'\\ud83d\\udc0a',\n 'croissant':'\\ud83e\\udd50',\n 'crossed_fingers':'\\ud83e\\udd1e',\n 'crossed_flags':'\\ud83c\\udf8c',\n 'crossed_swords':'\\u2694\\ufe0f',\n 'crown':'\\ud83d\\udc51',\n 'cry':'\\ud83d\\ude22',\n 'crying_cat_face':'\\ud83d\\ude3f',\n 'crystal_ball':'\\ud83d\\udd2e',\n 'cucumber':'\\ud83e\\udd52',\n 'cupid':'\\ud83d\\udc98',\n 'curly_loop':'\\u27b0',\n 'currency_exchange':'\\ud83d\\udcb1',\n 'curry':'\\ud83c\\udf5b',\n 'custard':'\\ud83c\\udf6e',\n 'customs':'\\ud83d\\udec3',\n 'cyclone':'\\ud83c\\udf00',\n 'dagger':'\\ud83d\\udde1',\n 'dancer':'\\ud83d\\udc83',\n 'dancing_women':'\\ud83d\\udc6f',\n 'dancing_men':'\\ud83d\\udc6f‍\\u2642\\ufe0f',\n 'dango':'\\ud83c\\udf61',\n 'dark_sunglasses':'\\ud83d\\udd76',\n 'dart':'\\ud83c\\udfaf',\n 'dash':'\\ud83d\\udca8',\n 'date':'\\ud83d\\udcc5',\n 'deciduous_tree':'\\ud83c\\udf33',\n 'deer':'\\ud83e\\udd8c',\n 'department_store':'\\ud83c\\udfec',\n 'derelict_house':'\\ud83c\\udfda',\n 'desert':'\\ud83c\\udfdc',\n 'desert_island':'\\ud83c\\udfdd',\n 'desktop_computer':'\\ud83d\\udda5',\n 'male_detective':'\\ud83d\\udd75\\ufe0f',\n 'diamond_shape_with_a_dot_inside':'\\ud83d\\udca0',\n 'diamonds':'\\u2666\\ufe0f',\n 'disappointed':'\\ud83d\\ude1e',\n 'disappointed_relieved':'\\ud83d\\ude25',\n 'dizzy':'\\ud83d\\udcab',\n 'dizzy_face':'\\ud83d\\ude35',\n 'do_not_litter':'\\ud83d\\udeaf',\n 'dog':'\\ud83d\\udc36',\n 'dog2':'\\ud83d\\udc15',\n 'dollar':'\\ud83d\\udcb5',\n 'dolls':'\\ud83c\\udf8e',\n 'dolphin':'\\ud83d\\udc2c',\n 'door':'\\ud83d\\udeaa',\n 'doughnut':'\\ud83c\\udf69',\n 'dove':'\\ud83d\\udd4a',\n 'dragon':'\\ud83d\\udc09',\n 'dragon_face':'\\ud83d\\udc32',\n 'dress':'\\ud83d\\udc57',\n 'dromedary_camel':'\\ud83d\\udc2a',\n 'drooling_face':'\\ud83e\\udd24',\n 'droplet':'\\ud83d\\udca7',\n 'drum':'\\ud83e\\udd41',\n 'duck':'\\ud83e\\udd86',\n 'dvd':'\\ud83d\\udcc0',\n 'e-mail':'\\ud83d\\udce7',\n 'eagle':'\\ud83e\\udd85',\n 'ear':'\\ud83d\\udc42',\n 'ear_of_rice':'\\ud83c\\udf3e',\n 'earth_africa':'\\ud83c\\udf0d',\n 'earth_americas':'\\ud83c\\udf0e',\n 'earth_asia':'\\ud83c\\udf0f',\n 'egg':'\\ud83e\\udd5a',\n 'eggplant':'\\ud83c\\udf46',\n 'eight_pointed_black_star':'\\u2734\\ufe0f',\n 'eight_spoked_asterisk':'\\u2733\\ufe0f',\n 'electric_plug':'\\ud83d\\udd0c',\n 'elephant':'\\ud83d\\udc18',\n 'email':'\\u2709\\ufe0f',\n 'end':'\\ud83d\\udd1a',\n 'envelope_with_arrow':'\\ud83d\\udce9',\n 'euro':'\\ud83d\\udcb6',\n 'european_castle':'\\ud83c\\udff0',\n 'european_post_office':'\\ud83c\\udfe4',\n 'evergreen_tree':'\\ud83c\\udf32',\n 'exclamation':'\\u2757\\ufe0f',\n 'expressionless':'\\ud83d\\ude11',\n 'eye':'\\ud83d\\udc41',\n 'eye_speech_bubble':'\\ud83d\\udc41‍\\ud83d\\udde8',\n 'eyeglasses':'\\ud83d\\udc53',\n 'eyes':'\\ud83d\\udc40',\n 'face_with_head_bandage':'\\ud83e\\udd15',\n 'face_with_thermometer':'\\ud83e\\udd12',\n 'fist_oncoming':'\\ud83d\\udc4a',\n 'factory':'\\ud83c\\udfed',\n 'fallen_leaf':'\\ud83c\\udf42',\n 'family_man_woman_boy':'\\ud83d\\udc6a',\n 'family_man_boy':'\\ud83d\\udc68‍\\ud83d\\udc66',\n 'family_man_boy_boy':'\\ud83d\\udc68‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_man_girl':'\\ud83d\\udc68‍\\ud83d\\udc67',\n 'family_man_girl_boy':'\\ud83d\\udc68‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_man_girl_girl':'\\ud83d\\udc68‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'family_man_man_boy':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc66',\n 'family_man_man_boy_boy':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_man_man_girl':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc67',\n 'family_man_man_girl_boy':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_man_man_girl_girl':'\\ud83d\\udc68‍\\ud83d\\udc68‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'family_man_woman_boy_boy':'\\ud83d\\udc68‍\\ud83d\\udc69‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_man_woman_girl':'\\ud83d\\udc68‍\\ud83d\\udc69‍\\ud83d\\udc67',\n 'family_man_woman_girl_boy':'\\ud83d\\udc68‍\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_man_woman_girl_girl':'\\ud83d\\udc68‍\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'family_woman_boy':'\\ud83d\\udc69‍\\ud83d\\udc66',\n 'family_woman_boy_boy':'\\ud83d\\udc69‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_woman_girl':'\\ud83d\\udc69‍\\ud83d\\udc67',\n 'family_woman_girl_boy':'\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_woman_girl_girl':'\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'family_woman_woman_boy':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc66',\n 'family_woman_woman_boy_boy':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc66‍\\ud83d\\udc66',\n 'family_woman_woman_girl':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc67',\n 'family_woman_woman_girl_boy':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc66',\n 'family_woman_woman_girl_girl':'\\ud83d\\udc69‍\\ud83d\\udc69‍\\ud83d\\udc67‍\\ud83d\\udc67',\n 'fast_forward':'\\u23e9',\n 'fax':'\\ud83d\\udce0',\n 'fearful':'\\ud83d\\ude28',\n 'feet':'\\ud83d\\udc3e',\n 'female_detective':'\\ud83d\\udd75\\ufe0f‍\\u2640\\ufe0f',\n 'ferris_wheel':'\\ud83c\\udfa1',\n 'ferry':'\\u26f4',\n 'field_hockey':'\\ud83c\\udfd1',\n 'file_cabinet':'\\ud83d\\uddc4',\n 'file_folder':'\\ud83d\\udcc1',\n 'film_projector':'\\ud83d\\udcfd',\n 'film_strip':'\\ud83c\\udf9e',\n 'fire':'\\ud83d\\udd25',\n 'fire_engine':'\\ud83d\\ude92',\n 'fireworks':'\\ud83c\\udf86',\n 'first_quarter_moon':'\\ud83c\\udf13',\n 'first_quarter_moon_with_face':'\\ud83c\\udf1b',\n 'fish':'\\ud83d\\udc1f',\n 'fish_cake':'\\ud83c\\udf65',\n 'fishing_pole_and_fish':'\\ud83c\\udfa3',\n 'fist_raised':'\\u270a',\n 'fist_left':'\\ud83e\\udd1b',\n 'fist_right':'\\ud83e\\udd1c',\n 'flags':'\\ud83c\\udf8f',\n 'flashlight':'\\ud83d\\udd26',\n 'fleur_de_lis':'\\u269c\\ufe0f',\n 'flight_arrival':'\\ud83d\\udeec',\n 'flight_departure':'\\ud83d\\udeeb',\n 'floppy_disk':'\\ud83d\\udcbe',\n 'flower_playing_cards':'\\ud83c\\udfb4',\n 'flushed':'\\ud83d\\ude33',\n 'fog':'\\ud83c\\udf2b',\n 'foggy':'\\ud83c\\udf01',\n 'football':'\\ud83c\\udfc8',\n 'footprints':'\\ud83d\\udc63',\n 'fork_and_knife':'\\ud83c\\udf74',\n 'fountain':'\\u26f2\\ufe0f',\n 'fountain_pen':'\\ud83d\\udd8b',\n 'four_leaf_clover':'\\ud83c\\udf40',\n 'fox_face':'\\ud83e\\udd8a',\n 'framed_picture':'\\ud83d\\uddbc',\n 'free':'\\ud83c\\udd93',\n 'fried_egg':'\\ud83c\\udf73',\n 'fried_shrimp':'\\ud83c\\udf64',\n 'fries':'\\ud83c\\udf5f',\n 'frog':'\\ud83d\\udc38',\n 'frowning':'\\ud83d\\ude26',\n 'frowning_face':'\\u2639\\ufe0f',\n 'frowning_man':'\\ud83d\\ude4d‍\\u2642\\ufe0f',\n 'frowning_woman':'\\ud83d\\ude4d',\n 'middle_finger':'\\ud83d\\udd95',\n 'fuelpump':'\\u26fd\\ufe0f',\n 'full_moon':'\\ud83c\\udf15',\n 'full_moon_with_face':'\\ud83c\\udf1d',\n 'funeral_urn':'\\u26b1\\ufe0f',\n 'game_die':'\\ud83c\\udfb2',\n 'gear':'\\u2699\\ufe0f',\n 'gem':'\\ud83d\\udc8e',\n 'gemini':'\\u264a\\ufe0f',\n 'ghost':'\\ud83d\\udc7b',\n 'gift':'\\ud83c\\udf81',\n 'gift_heart':'\\ud83d\\udc9d',\n 'girl':'\\ud83d\\udc67',\n 'globe_with_meridians':'\\ud83c\\udf10',\n 'goal_net':'\\ud83e\\udd45',\n 'goat':'\\ud83d\\udc10',\n 'golf':'\\u26f3\\ufe0f',\n 'golfing_man':'\\ud83c\\udfcc\\ufe0f',\n 'golfing_woman':'\\ud83c\\udfcc\\ufe0f‍\\u2640\\ufe0f',\n 'gorilla':'\\ud83e\\udd8d',\n 'grapes':'\\ud83c\\udf47',\n 'green_apple':'\\ud83c\\udf4f',\n 'green_book':'\\ud83d\\udcd7',\n 'green_heart':'\\ud83d\\udc9a',\n 'green_salad':'\\ud83e\\udd57',\n 'grey_exclamation':'\\u2755',\n 'grey_question':'\\u2754',\n 'grimacing':'\\ud83d\\ude2c',\n 'grin':'\\ud83d\\ude01',\n 'grinning':'\\ud83d\\ude00',\n 'guardsman':'\\ud83d\\udc82',\n 'guardswoman':'\\ud83d\\udc82‍\\u2640\\ufe0f',\n 'guitar':'\\ud83c\\udfb8',\n 'gun':'\\ud83d\\udd2b',\n 'haircut_woman':'\\ud83d\\udc87',\n 'haircut_man':'\\ud83d\\udc87‍\\u2642\\ufe0f',\n 'hamburger':'\\ud83c\\udf54',\n 'hammer':'\\ud83d\\udd28',\n 'hammer_and_pick':'\\u2692',\n 'hammer_and_wrench':'\\ud83d\\udee0',\n 'hamster':'\\ud83d\\udc39',\n 'hand':'\\u270b',\n 'handbag':'\\ud83d\\udc5c',\n 'handshake':'\\ud83e\\udd1d',\n 'hankey':'\\ud83d\\udca9',\n 'hatched_chick':'\\ud83d\\udc25',\n 'hatching_chick':'\\ud83d\\udc23',\n 'headphones':'\\ud83c\\udfa7',\n 'hear_no_evil':'\\ud83d\\ude49',\n 'heart':'\\u2764\\ufe0f',\n 'heart_decoration':'\\ud83d\\udc9f',\n 'heart_eyes':'\\ud83d\\ude0d',\n 'heart_eyes_cat':'\\ud83d\\ude3b',\n 'heartbeat':'\\ud83d\\udc93',\n 'heartpulse':'\\ud83d\\udc97',\n 'hearts':'\\u2665\\ufe0f',\n 'heavy_check_mark':'\\u2714\\ufe0f',\n 'heavy_division_sign':'\\u2797',\n 'heavy_dollar_sign':'\\ud83d\\udcb2',\n 'heavy_heart_exclamation':'\\u2763\\ufe0f',\n 'heavy_minus_sign':'\\u2796',\n 'heavy_multiplication_x':'\\u2716\\ufe0f',\n 'heavy_plus_sign':'\\u2795',\n 'helicopter':'\\ud83d\\ude81',\n 'herb':'\\ud83c\\udf3f',\n 'hibiscus':'\\ud83c\\udf3a',\n 'high_brightness':'\\ud83d\\udd06',\n 'high_heel':'\\ud83d\\udc60',\n 'hocho':'\\ud83d\\udd2a',\n 'hole':'\\ud83d\\udd73',\n 'honey_pot':'\\ud83c\\udf6f',\n 'horse':'\\ud83d\\udc34',\n 'horse_racing':'\\ud83c\\udfc7',\n 'hospital':'\\ud83c\\udfe5',\n 'hot_pepper':'\\ud83c\\udf36',\n 'hotdog':'\\ud83c\\udf2d',\n 'hotel':'\\ud83c\\udfe8',\n 'hotsprings':'\\u2668\\ufe0f',\n 'hourglass':'\\u231b\\ufe0f',\n 'hourglass_flowing_sand':'\\u23f3',\n 'house':'\\ud83c\\udfe0',\n 'house_with_garden':'\\ud83c\\udfe1',\n 'houses':'\\ud83c\\udfd8',\n 'hugs':'\\ud83e\\udd17',\n 'hushed':'\\ud83d\\ude2f',\n 'ice_cream':'\\ud83c\\udf68',\n 'ice_hockey':'\\ud83c\\udfd2',\n 'ice_skate':'\\u26f8',\n 'icecream':'\\ud83c\\udf66',\n 'id':'\\ud83c\\udd94',\n 'ideograph_advantage':'\\ud83c\\ude50',\n 'imp':'\\ud83d\\udc7f',\n 'inbox_tray':'\\ud83d\\udce5',\n 'incoming_envelope':'\\ud83d\\udce8',\n 'tipping_hand_woman':'\\ud83d\\udc81',\n 'information_source':'\\u2139\\ufe0f',\n 'innocent':'\\ud83d\\ude07',\n 'interrobang':'\\u2049\\ufe0f',\n 'iphone':'\\ud83d\\udcf1',\n 'izakaya_lantern':'\\ud83c\\udfee',\n 'jack_o_lantern':'\\ud83c\\udf83',\n 'japan':'\\ud83d\\uddfe',\n 'japanese_castle':'\\ud83c\\udfef',\n 'japanese_goblin':'\\ud83d\\udc7a',\n 'japanese_ogre':'\\ud83d\\udc79',\n 'jeans':'\\ud83d\\udc56',\n 'joy':'\\ud83d\\ude02',\n 'joy_cat':'\\ud83d\\ude39',\n 'joystick':'\\ud83d\\udd79',\n 'kaaba':'\\ud83d\\udd4b',\n 'key':'\\ud83d\\udd11',\n 'keyboard':'\\u2328\\ufe0f',\n 'keycap_ten':'\\ud83d\\udd1f',\n 'kick_scooter':'\\ud83d\\udef4',\n 'kimono':'\\ud83d\\udc58',\n 'kiss':'\\ud83d\\udc8b',\n 'kissing':'\\ud83d\\ude17',\n 'kissing_cat':'\\ud83d\\ude3d',\n 'kissing_closed_eyes':'\\ud83d\\ude1a',\n 'kissing_heart':'\\ud83d\\ude18',\n 'kissing_smiling_eyes':'\\ud83d\\ude19',\n 'kiwi_fruit':'\\ud83e\\udd5d',\n 'koala':'\\ud83d\\udc28',\n 'koko':'\\ud83c\\ude01',\n 'label':'\\ud83c\\udff7',\n 'large_blue_circle':'\\ud83d\\udd35',\n 'large_blue_diamond':'\\ud83d\\udd37',\n 'large_orange_diamond':'\\ud83d\\udd36',\n 'last_quarter_moon':'\\ud83c\\udf17',\n 'last_quarter_moon_with_face':'\\ud83c\\udf1c',\n 'latin_cross':'\\u271d\\ufe0f',\n 'laughing':'\\ud83d\\ude06',\n 'leaves':'\\ud83c\\udf43',\n 'ledger':'\\ud83d\\udcd2',\n 'left_luggage':'\\ud83d\\udec5',\n 'left_right_arrow':'\\u2194\\ufe0f',\n 'leftwards_arrow_with_hook':'\\u21a9\\ufe0f',\n 'lemon':'\\ud83c\\udf4b',\n 'leo':'\\u264c\\ufe0f',\n 'leopard':'\\ud83d\\udc06',\n 'level_slider':'\\ud83c\\udf9a',\n 'libra':'\\u264e\\ufe0f',\n 'light_rail':'\\ud83d\\ude88',\n 'link':'\\ud83d\\udd17',\n 'lion':'\\ud83e\\udd81',\n 'lips':'\\ud83d\\udc44',\n 'lipstick':'\\ud83d\\udc84',\n 'lizard':'\\ud83e\\udd8e',\n 'lock':'\\ud83d\\udd12',\n 'lock_with_ink_pen':'\\ud83d\\udd0f',\n 'lollipop':'\\ud83c\\udf6d',\n 'loop':'\\u27bf',\n 'loud_sound':'\\ud83d\\udd0a',\n 'loudspeaker':'\\ud83d\\udce2',\n 'love_hotel':'\\ud83c\\udfe9',\n 'love_letter':'\\ud83d\\udc8c',\n 'low_brightness':'\\ud83d\\udd05',\n 'lying_face':'\\ud83e\\udd25',\n 'm':'\\u24c2\\ufe0f',\n 'mag':'\\ud83d\\udd0d',\n 'mag_right':'\\ud83d\\udd0e',\n 'mahjong':'\\ud83c\\udc04\\ufe0f',\n 'mailbox':'\\ud83d\\udceb',\n 'mailbox_closed':'\\ud83d\\udcea',\n 'mailbox_with_mail':'\\ud83d\\udcec',\n 'mailbox_with_no_mail':'\\ud83d\\udced',\n 'man':'\\ud83d\\udc68',\n 'man_artist':'\\ud83d\\udc68‍\\ud83c\\udfa8',\n 'man_astronaut':'\\ud83d\\udc68‍\\ud83d\\ude80',\n 'man_cartwheeling':'\\ud83e\\udd38‍\\u2642\\ufe0f',\n 'man_cook':'\\ud83d\\udc68‍\\ud83c\\udf73',\n 'man_dancing':'\\ud83d\\udd7a',\n 'man_facepalming':'\\ud83e\\udd26‍\\u2642\\ufe0f',\n 'man_factory_worker':'\\ud83d\\udc68‍\\ud83c\\udfed',\n 'man_farmer':'\\ud83d\\udc68‍\\ud83c\\udf3e',\n 'man_firefighter':'\\ud83d\\udc68‍\\ud83d\\ude92',\n 'man_health_worker':'\\ud83d\\udc68‍\\u2695\\ufe0f',\n 'man_in_tuxedo':'\\ud83e\\udd35',\n 'man_judge':'\\ud83d\\udc68‍\\u2696\\ufe0f',\n 'man_juggling':'\\ud83e\\udd39‍\\u2642\\ufe0f',\n 'man_mechanic':'\\ud83d\\udc68‍\\ud83d\\udd27',\n 'man_office_worker':'\\ud83d\\udc68‍\\ud83d\\udcbc',\n 'man_pilot':'\\ud83d\\udc68‍\\u2708\\ufe0f',\n 'man_playing_handball':'\\ud83e\\udd3e‍\\u2642\\ufe0f',\n 'man_playing_water_polo':'\\ud83e\\udd3d‍\\u2642\\ufe0f',\n 'man_scientist':'\\ud83d\\udc68‍\\ud83d\\udd2c',\n 'man_shrugging':'\\ud83e\\udd37‍\\u2642\\ufe0f',\n 'man_singer':'\\ud83d\\udc68‍\\ud83c\\udfa4',\n 'man_student':'\\ud83d\\udc68‍\\ud83c\\udf93',\n 'man_teacher':'\\ud83d\\udc68‍\\ud83c\\udfeb',\n 'man_technologist':'\\ud83d\\udc68‍\\ud83d\\udcbb',\n 'man_with_gua_pi_mao':'\\ud83d\\udc72',\n 'man_with_turban':'\\ud83d\\udc73',\n 'tangerine':'\\ud83c\\udf4a',\n 'mans_shoe':'\\ud83d\\udc5e',\n 'mantelpiece_clock':'\\ud83d\\udd70',\n 'maple_leaf':'\\ud83c\\udf41',\n 'martial_arts_uniform':'\\ud83e\\udd4b',\n 'mask':'\\ud83d\\ude37',\n 'massage_woman':'\\ud83d\\udc86',\n 'massage_man':'\\ud83d\\udc86‍\\u2642\\ufe0f',\n 'meat_on_bone':'\\ud83c\\udf56',\n 'medal_military':'\\ud83c\\udf96',\n 'medal_sports':'\\ud83c\\udfc5',\n 'mega':'\\ud83d\\udce3',\n 'melon':'\\ud83c\\udf48',\n 'memo':'\\ud83d\\udcdd',\n 'men_wrestling':'\\ud83e\\udd3c‍\\u2642\\ufe0f',\n 'menorah':'\\ud83d\\udd4e',\n 'mens':'\\ud83d\\udeb9',\n 'metal':'\\ud83e\\udd18',\n 'metro':'\\ud83d\\ude87',\n 'microphone':'\\ud83c\\udfa4',\n 'microscope':'\\ud83d\\udd2c',\n 'milk_glass':'\\ud83e\\udd5b',\n 'milky_way':'\\ud83c\\udf0c',\n 'minibus':'\\ud83d\\ude90',\n 'minidisc':'\\ud83d\\udcbd',\n 'mobile_phone_off':'\\ud83d\\udcf4',\n 'money_mouth_face':'\\ud83e\\udd11',\n 'money_with_wings':'\\ud83d\\udcb8',\n 'moneybag':'\\ud83d\\udcb0',\n 'monkey':'\\ud83d\\udc12',\n 'monkey_face':'\\ud83d\\udc35',\n 'monorail':'\\ud83d\\ude9d',\n 'moon':'\\ud83c\\udf14',\n 'mortar_board':'\\ud83c\\udf93',\n 'mosque':'\\ud83d\\udd4c',\n 'motor_boat':'\\ud83d\\udee5',\n 'motor_scooter':'\\ud83d\\udef5',\n 'motorcycle':'\\ud83c\\udfcd',\n 'motorway':'\\ud83d\\udee3',\n 'mount_fuji':'\\ud83d\\uddfb',\n 'mountain':'\\u26f0',\n 'mountain_biking_man':'\\ud83d\\udeb5',\n 'mountain_biking_woman':'\\ud83d\\udeb5‍\\u2640\\ufe0f',\n 'mountain_cableway':'\\ud83d\\udea0',\n 'mountain_railway':'\\ud83d\\ude9e',\n 'mountain_snow':'\\ud83c\\udfd4',\n 'mouse':'\\ud83d\\udc2d',\n 'mouse2':'\\ud83d\\udc01',\n 'movie_camera':'\\ud83c\\udfa5',\n 'moyai':'\\ud83d\\uddff',\n 'mrs_claus':'\\ud83e\\udd36',\n 'muscle':'\\ud83d\\udcaa',\n 'mushroom':'\\ud83c\\udf44',\n 'musical_keyboard':'\\ud83c\\udfb9',\n 'musical_note':'\\ud83c\\udfb5',\n 'musical_score':'\\ud83c\\udfbc',\n 'mute':'\\ud83d\\udd07',\n 'nail_care':'\\ud83d\\udc85',\n 'name_badge':'\\ud83d\\udcdb',\n 'national_park':'\\ud83c\\udfde',\n 'nauseated_face':'\\ud83e\\udd22',\n 'necktie':'\\ud83d\\udc54',\n 'negative_squared_cross_mark':'\\u274e',\n 'nerd_face':'\\ud83e\\udd13',\n 'neutral_face':'\\ud83d\\ude10',\n 'new':'\\ud83c\\udd95',\n 'new_moon':'\\ud83c\\udf11',\n 'new_moon_with_face':'\\ud83c\\udf1a',\n 'newspaper':'\\ud83d\\udcf0',\n 'newspaper_roll':'\\ud83d\\uddde',\n 'next_track_button':'\\u23ed',\n 'ng':'\\ud83c\\udd96',\n 'no_good_man':'\\ud83d\\ude45‍\\u2642\\ufe0f',\n 'no_good_woman':'\\ud83d\\ude45',\n 'night_with_stars':'\\ud83c\\udf03',\n 'no_bell':'\\ud83d\\udd15',\n 'no_bicycles':'\\ud83d\\udeb3',\n 'no_entry':'\\u26d4\\ufe0f',\n 'no_entry_sign':'\\ud83d\\udeab',\n 'no_mobile_phones':'\\ud83d\\udcf5',\n 'no_mouth':'\\ud83d\\ude36',\n 'no_pedestrians':'\\ud83d\\udeb7',\n 'no_smoking':'\\ud83d\\udead',\n 'non-potable_water':'\\ud83d\\udeb1',\n 'nose':'\\ud83d\\udc43',\n 'notebook':'\\ud83d\\udcd3',\n 'notebook_with_decorative_cover':'\\ud83d\\udcd4',\n 'notes':'\\ud83c\\udfb6',\n 'nut_and_bolt':'\\ud83d\\udd29',\n 'o':'\\u2b55\\ufe0f',\n 'o2':'\\ud83c\\udd7e\\ufe0f',\n 'ocean':'\\ud83c\\udf0a',\n 'octopus':'\\ud83d\\udc19',\n 'oden':'\\ud83c\\udf62',\n 'office':'\\ud83c\\udfe2',\n 'oil_drum':'\\ud83d\\udee2',\n 'ok':'\\ud83c\\udd97',\n 'ok_hand':'\\ud83d\\udc4c',\n 'ok_man':'\\ud83d\\ude46‍\\u2642\\ufe0f',\n 'ok_woman':'\\ud83d\\ude46',\n 'old_key':'\\ud83d\\udddd',\n 'older_man':'\\ud83d\\udc74',\n 'older_woman':'\\ud83d\\udc75',\n 'om':'\\ud83d\\udd49',\n 'on':'\\ud83d\\udd1b',\n 'oncoming_automobile':'\\ud83d\\ude98',\n 'oncoming_bus':'\\ud83d\\ude8d',\n 'oncoming_police_car':'\\ud83d\\ude94',\n 'oncoming_taxi':'\\ud83d\\ude96',\n 'open_file_folder':'\\ud83d\\udcc2',\n 'open_hands':'\\ud83d\\udc50',\n 'open_mouth':'\\ud83d\\ude2e',\n 'open_umbrella':'\\u2602\\ufe0f',\n 'ophiuchus':'\\u26ce',\n 'orange_book':'\\ud83d\\udcd9',\n 'orthodox_cross':'\\u2626\\ufe0f',\n 'outbox_tray':'\\ud83d\\udce4',\n 'owl':'\\ud83e\\udd89',\n 'ox':'\\ud83d\\udc02',\n 'package':'\\ud83d\\udce6',\n 'page_facing_up':'\\ud83d\\udcc4',\n 'page_with_curl':'\\ud83d\\udcc3',\n 'pager':'\\ud83d\\udcdf',\n 'paintbrush':'\\ud83d\\udd8c',\n 'palm_tree':'\\ud83c\\udf34',\n 'pancakes':'\\ud83e\\udd5e',\n 'panda_face':'\\ud83d\\udc3c',\n 'paperclip':'\\ud83d\\udcce',\n 'paperclips':'\\ud83d\\udd87',\n 'parasol_on_ground':'\\u26f1',\n 'parking':'\\ud83c\\udd7f\\ufe0f',\n 'part_alternation_mark':'\\u303d\\ufe0f',\n 'partly_sunny':'\\u26c5\\ufe0f',\n 'passenger_ship':'\\ud83d\\udef3',\n 'passport_control':'\\ud83d\\udec2',\n 'pause_button':'\\u23f8',\n 'peace_symbol':'\\u262e\\ufe0f',\n 'peach':'\\ud83c\\udf51',\n 'peanuts':'\\ud83e\\udd5c',\n 'pear':'\\ud83c\\udf50',\n 'pen':'\\ud83d\\udd8a',\n 'pencil2':'\\u270f\\ufe0f',\n 'penguin':'\\ud83d\\udc27',\n 'pensive':'\\ud83d\\ude14',\n 'performing_arts':'\\ud83c\\udfad',\n 'persevere':'\\ud83d\\ude23',\n 'person_fencing':'\\ud83e\\udd3a',\n 'pouting_woman':'\\ud83d\\ude4e',\n 'phone':'\\u260e\\ufe0f',\n 'pick':'\\u26cf',\n 'pig':'\\ud83d\\udc37',\n 'pig2':'\\ud83d\\udc16',\n 'pig_nose':'\\ud83d\\udc3d',\n 'pill':'\\ud83d\\udc8a',\n 'pineapple':'\\ud83c\\udf4d',\n 'ping_pong':'\\ud83c\\udfd3',\n 'pisces':'\\u2653\\ufe0f',\n 'pizza':'\\ud83c\\udf55',\n 'place_of_worship':'\\ud83d\\uded0',\n 'plate_with_cutlery':'\\ud83c\\udf7d',\n 'play_or_pause_button':'\\u23ef',\n 'point_down':'\\ud83d\\udc47',\n 'point_left':'\\ud83d\\udc48',\n 'point_right':'\\ud83d\\udc49',\n 'point_up':'\\u261d\\ufe0f',\n 'point_up_2':'\\ud83d\\udc46',\n 'police_car':'\\ud83d\\ude93',\n 'policewoman':'\\ud83d\\udc6e‍\\u2640\\ufe0f',\n 'poodle':'\\ud83d\\udc29',\n 'popcorn':'\\ud83c\\udf7f',\n 'post_office':'\\ud83c\\udfe3',\n 'postal_horn':'\\ud83d\\udcef',\n 'postbox':'\\ud83d\\udcee',\n 'potable_water':'\\ud83d\\udeb0',\n 'potato':'\\ud83e\\udd54',\n 'pouch':'\\ud83d\\udc5d',\n 'poultry_leg':'\\ud83c\\udf57',\n 'pound':'\\ud83d\\udcb7',\n 'rage':'\\ud83d\\ude21',\n 'pouting_cat':'\\ud83d\\ude3e',\n 'pouting_man':'\\ud83d\\ude4e‍\\u2642\\ufe0f',\n 'pray':'\\ud83d\\ude4f',\n 'prayer_beads':'\\ud83d\\udcff',\n 'pregnant_woman':'\\ud83e\\udd30',\n 'previous_track_button':'\\u23ee',\n 'prince':'\\ud83e\\udd34',\n 'princess':'\\ud83d\\udc78',\n 'printer':'\\ud83d\\udda8',\n 'purple_heart':'\\ud83d\\udc9c',\n 'purse':'\\ud83d\\udc5b',\n 'pushpin':'\\ud83d\\udccc',\n 'put_litter_in_its_place':'\\ud83d\\udeae',\n 'question':'\\u2753',\n 'rabbit':'\\ud83d\\udc30',\n 'rabbit2':'\\ud83d\\udc07',\n 'racehorse':'\\ud83d\\udc0e',\n 'racing_car':'\\ud83c\\udfce',\n 'radio':'\\ud83d\\udcfb',\n 'radio_button':'\\ud83d\\udd18',\n 'radioactive':'\\u2622\\ufe0f',\n 'railway_car':'\\ud83d\\ude83',\n 'railway_track':'\\ud83d\\udee4',\n 'rainbow':'\\ud83c\\udf08',\n 'rainbow_flag':'\\ud83c\\udff3\\ufe0f‍\\ud83c\\udf08',\n 'raised_back_of_hand':'\\ud83e\\udd1a',\n 'raised_hand_with_fingers_splayed':'\\ud83d\\udd90',\n 'raised_hands':'\\ud83d\\ude4c',\n 'raising_hand_woman':'\\ud83d\\ude4b',\n 'raising_hand_man':'\\ud83d\\ude4b‍\\u2642\\ufe0f',\n 'ram':'\\ud83d\\udc0f',\n 'ramen':'\\ud83c\\udf5c',\n 'rat':'\\ud83d\\udc00',\n 'record_button':'\\u23fa',\n 'recycle':'\\u267b\\ufe0f',\n 'red_circle':'\\ud83d\\udd34',\n 'registered':'\\u00ae\\ufe0f',\n 'relaxed':'\\u263a\\ufe0f',\n 'relieved':'\\ud83d\\ude0c',\n 'reminder_ribbon':'\\ud83c\\udf97',\n 'repeat':'\\ud83d\\udd01',\n 'repeat_one':'\\ud83d\\udd02',\n 'rescue_worker_helmet':'\\u26d1',\n 'restroom':'\\ud83d\\udebb',\n 'revolving_hearts':'\\ud83d\\udc9e',\n 'rewind':'\\u23ea',\n 'rhinoceros':'\\ud83e\\udd8f',\n 'ribbon':'\\ud83c\\udf80',\n 'rice':'\\ud83c\\udf5a',\n 'rice_ball':'\\ud83c\\udf59',\n 'rice_cracker':'\\ud83c\\udf58',\n 'rice_scene':'\\ud83c\\udf91',\n 'right_anger_bubble':'\\ud83d\\uddef',\n 'ring':'\\ud83d\\udc8d',\n 'robot':'\\ud83e\\udd16',\n 'rocket':'\\ud83d\\ude80',\n 'rofl':'\\ud83e\\udd23',\n 'roll_eyes':'\\ud83d\\ude44',\n 'roller_coaster':'\\ud83c\\udfa2',\n 'rooster':'\\ud83d\\udc13',\n 'rose':'\\ud83c\\udf39',\n 'rosette':'\\ud83c\\udff5',\n 'rotating_light':'\\ud83d\\udea8',\n 'round_pushpin':'\\ud83d\\udccd',\n 'rowing_man':'\\ud83d\\udea3',\n 'rowing_woman':'\\ud83d\\udea3‍\\u2640\\ufe0f',\n 'rugby_football':'\\ud83c\\udfc9',\n 'running_man':'\\ud83c\\udfc3',\n 'running_shirt_with_sash':'\\ud83c\\udfbd',\n 'running_woman':'\\ud83c\\udfc3‍\\u2640\\ufe0f',\n 'sa':'\\ud83c\\ude02\\ufe0f',\n 'sagittarius':'\\u2650\\ufe0f',\n 'sake':'\\ud83c\\udf76',\n 'sandal':'\\ud83d\\udc61',\n 'santa':'\\ud83c\\udf85',\n 'satellite':'\\ud83d\\udce1',\n 'saxophone':'\\ud83c\\udfb7',\n 'school':'\\ud83c\\udfeb',\n 'school_satchel':'\\ud83c\\udf92',\n 'scissors':'\\u2702\\ufe0f',\n 'scorpion':'\\ud83e\\udd82',\n 'scorpius':'\\u264f\\ufe0f',\n 'scream':'\\ud83d\\ude31',\n 'scream_cat':'\\ud83d\\ude40',\n 'scroll':'\\ud83d\\udcdc',\n 'seat':'\\ud83d\\udcba',\n 'secret':'\\u3299\\ufe0f',\n 'see_no_evil':'\\ud83d\\ude48',\n 'seedling':'\\ud83c\\udf31',\n 'selfie':'\\ud83e\\udd33',\n 'shallow_pan_of_food':'\\ud83e\\udd58',\n 'shamrock':'\\u2618\\ufe0f',\n 'shark':'\\ud83e\\udd88',\n 'shaved_ice':'\\ud83c\\udf67',\n 'sheep':'\\ud83d\\udc11',\n 'shell':'\\ud83d\\udc1a',\n 'shield':'\\ud83d\\udee1',\n 'shinto_shrine':'\\u26e9',\n 'ship':'\\ud83d\\udea2',\n 'shirt':'\\ud83d\\udc55',\n 'shopping':'\\ud83d\\udecd',\n 'shopping_cart':'\\ud83d\\uded2',\n 'shower':'\\ud83d\\udebf',\n 'shrimp':'\\ud83e\\udd90',\n 'signal_strength':'\\ud83d\\udcf6',\n 'six_pointed_star':'\\ud83d\\udd2f',\n 'ski':'\\ud83c\\udfbf',\n 'skier':'\\u26f7',\n 'skull':'\\ud83d\\udc80',\n 'skull_and_crossbones':'\\u2620\\ufe0f',\n 'sleeping':'\\ud83d\\ude34',\n 'sleeping_bed':'\\ud83d\\udecc',\n 'sleepy':'\\ud83d\\ude2a',\n 'slightly_frowning_face':'\\ud83d\\ude41',\n 'slightly_smiling_face':'\\ud83d\\ude42',\n 'slot_machine':'\\ud83c\\udfb0',\n 'small_airplane':'\\ud83d\\udee9',\n 'small_blue_diamond':'\\ud83d\\udd39',\n 'small_orange_diamond':'\\ud83d\\udd38',\n 'small_red_triangle':'\\ud83d\\udd3a',\n 'small_red_triangle_down':'\\ud83d\\udd3b',\n 'smile':'\\ud83d\\ude04',\n 'smile_cat':'\\ud83d\\ude38',\n 'smiley':'\\ud83d\\ude03',\n 'smiley_cat':'\\ud83d\\ude3a',\n 'smiling_imp':'\\ud83d\\ude08',\n 'smirk':'\\ud83d\\ude0f',\n 'smirk_cat':'\\ud83d\\ude3c',\n 'smoking':'\\ud83d\\udeac',\n 'snail':'\\ud83d\\udc0c',\n 'snake':'\\ud83d\\udc0d',\n 'sneezing_face':'\\ud83e\\udd27',\n 'snowboarder':'\\ud83c\\udfc2',\n 'snowflake':'\\u2744\\ufe0f',\n 'snowman':'\\u26c4\\ufe0f',\n 'snowman_with_snow':'\\u2603\\ufe0f',\n 'sob':'\\ud83d\\ude2d',\n 'soccer':'\\u26bd\\ufe0f',\n 'soon':'\\ud83d\\udd1c',\n 'sos':'\\ud83c\\udd98',\n 'sound':'\\ud83d\\udd09',\n 'space_invader':'\\ud83d\\udc7e',\n 'spades':'\\u2660\\ufe0f',\n 'spaghetti':'\\ud83c\\udf5d',\n 'sparkle':'\\u2747\\ufe0f',\n 'sparkler':'\\ud83c\\udf87',\n 'sparkles':'\\u2728',\n 'sparkling_heart':'\\ud83d\\udc96',\n 'speak_no_evil':'\\ud83d\\ude4a',\n 'speaker':'\\ud83d\\udd08',\n 'speaking_head':'\\ud83d\\udde3',\n 'speech_balloon':'\\ud83d\\udcac',\n 'speedboat':'\\ud83d\\udea4',\n 'spider':'\\ud83d\\udd77',\n 'spider_web':'\\ud83d\\udd78',\n 'spiral_calendar':'\\ud83d\\uddd3',\n 'spiral_notepad':'\\ud83d\\uddd2',\n 'spoon':'\\ud83e\\udd44',\n 'squid':'\\ud83e\\udd91',\n 'stadium':'\\ud83c\\udfdf',\n 'star':'\\u2b50\\ufe0f',\n 'star2':'\\ud83c\\udf1f',\n 'star_and_crescent':'\\u262a\\ufe0f',\n 'star_of_david':'\\u2721\\ufe0f',\n 'stars':'\\ud83c\\udf20',\n 'station':'\\ud83d\\ude89',\n 'statue_of_liberty':'\\ud83d\\uddfd',\n 'steam_locomotive':'\\ud83d\\ude82',\n 'stew':'\\ud83c\\udf72',\n 'stop_button':'\\u23f9',\n 'stop_sign':'\\ud83d\\uded1',\n 'stopwatch':'\\u23f1',\n 'straight_ruler':'\\ud83d\\udccf',\n 'strawberry':'\\ud83c\\udf53',\n 'stuck_out_tongue':'\\ud83d\\ude1b',\n 'stuck_out_tongue_closed_eyes':'\\ud83d\\ude1d',\n 'stuck_out_tongue_winking_eye':'\\ud83d\\ude1c',\n 'studio_microphone':'\\ud83c\\udf99',\n 'stuffed_flatbread':'\\ud83e\\udd59',\n 'sun_behind_large_cloud':'\\ud83c\\udf25',\n 'sun_behind_rain_cloud':'\\ud83c\\udf26',\n 'sun_behind_small_cloud':'\\ud83c\\udf24',\n 'sun_with_face':'\\ud83c\\udf1e',\n 'sunflower':'\\ud83c\\udf3b',\n 'sunglasses':'\\ud83d\\ude0e',\n 'sunny':'\\u2600\\ufe0f',\n 'sunrise':'\\ud83c\\udf05',\n 'sunrise_over_mountains':'\\ud83c\\udf04',\n 'surfing_man':'\\ud83c\\udfc4',\n 'surfing_woman':'\\ud83c\\udfc4‍\\u2640\\ufe0f',\n 'sushi':'\\ud83c\\udf63',\n 'suspension_railway':'\\ud83d\\ude9f',\n 'sweat':'\\ud83d\\ude13',\n 'sweat_drops':'\\ud83d\\udca6',\n 'sweat_smile':'\\ud83d\\ude05',\n 'sweet_potato':'\\ud83c\\udf60',\n 'swimming_man':'\\ud83c\\udfca',\n 'swimming_woman':'\\ud83c\\udfca‍\\u2640\\ufe0f',\n 'symbols':'\\ud83d\\udd23',\n 'synagogue':'\\ud83d\\udd4d',\n 'syringe':'\\ud83d\\udc89',\n 'taco':'\\ud83c\\udf2e',\n 'tada':'\\ud83c\\udf89',\n 'tanabata_tree':'\\ud83c\\udf8b',\n 'taurus':'\\u2649\\ufe0f',\n 'taxi':'\\ud83d\\ude95',\n 'tea':'\\ud83c\\udf75',\n 'telephone_receiver':'\\ud83d\\udcde',\n 'telescope':'\\ud83d\\udd2d',\n 'tennis':'\\ud83c\\udfbe',\n 'tent':'\\u26fa\\ufe0f',\n 'thermometer':'\\ud83c\\udf21',\n 'thinking':'\\ud83e\\udd14',\n 'thought_balloon':'\\ud83d\\udcad',\n 'ticket':'\\ud83c\\udfab',\n 'tickets':'\\ud83c\\udf9f',\n 'tiger':'\\ud83d\\udc2f',\n 'tiger2':'\\ud83d\\udc05',\n 'timer_clock':'\\u23f2',\n 'tipping_hand_man':'\\ud83d\\udc81‍\\u2642\\ufe0f',\n 'tired_face':'\\ud83d\\ude2b',\n 'tm':'\\u2122\\ufe0f',\n 'toilet':'\\ud83d\\udebd',\n 'tokyo_tower':'\\ud83d\\uddfc',\n 'tomato':'\\ud83c\\udf45',\n 'tongue':'\\ud83d\\udc45',\n 'top':'\\ud83d\\udd1d',\n 'tophat':'\\ud83c\\udfa9',\n 'tornado':'\\ud83c\\udf2a',\n 'trackball':'\\ud83d\\uddb2',\n 'tractor':'\\ud83d\\ude9c',\n 'traffic_light':'\\ud83d\\udea5',\n 'train':'\\ud83d\\ude8b',\n 'train2':'\\ud83d\\ude86',\n 'tram':'\\ud83d\\ude8a',\n 'triangular_flag_on_post':'\\ud83d\\udea9',\n 'triangular_ruler':'\\ud83d\\udcd0',\n 'trident':'\\ud83d\\udd31',\n 'triumph':'\\ud83d\\ude24',\n 'trolleybus':'\\ud83d\\ude8e',\n 'trophy':'\\ud83c\\udfc6',\n 'tropical_drink':'\\ud83c\\udf79',\n 'tropical_fish':'\\ud83d\\udc20',\n 'truck':'\\ud83d\\ude9a',\n 'trumpet':'\\ud83c\\udfba',\n 'tulip':'\\ud83c\\udf37',\n 'tumbler_glass':'\\ud83e\\udd43',\n 'turkey':'\\ud83e\\udd83',\n 'turtle':'\\ud83d\\udc22',\n 'tv':'\\ud83d\\udcfa',\n 'twisted_rightwards_arrows':'\\ud83d\\udd00',\n 'two_hearts':'\\ud83d\\udc95',\n 'two_men_holding_hands':'\\ud83d\\udc6c',\n 'two_women_holding_hands':'\\ud83d\\udc6d',\n 'u5272':'\\ud83c\\ude39',\n 'u5408':'\\ud83c\\ude34',\n 'u55b6':'\\ud83c\\ude3a',\n 'u6307':'\\ud83c\\ude2f\\ufe0f',\n 'u6708':'\\ud83c\\ude37\\ufe0f',\n 'u6709':'\\ud83c\\ude36',\n 'u6e80':'\\ud83c\\ude35',\n 'u7121':'\\ud83c\\ude1a\\ufe0f',\n 'u7533':'\\ud83c\\ude38',\n 'u7981':'\\ud83c\\ude32',\n 'u7a7a':'\\ud83c\\ude33',\n 'umbrella':'\\u2614\\ufe0f',\n 'unamused':'\\ud83d\\ude12',\n 'underage':'\\ud83d\\udd1e',\n 'unicorn':'\\ud83e\\udd84',\n 'unlock':'\\ud83d\\udd13',\n 'up':'\\ud83c\\udd99',\n 'upside_down_face':'\\ud83d\\ude43',\n 'v':'\\u270c\\ufe0f',\n 'vertical_traffic_light':'\\ud83d\\udea6',\n 'vhs':'\\ud83d\\udcfc',\n 'vibration_mode':'\\ud83d\\udcf3',\n 'video_camera':'\\ud83d\\udcf9',\n 'video_game':'\\ud83c\\udfae',\n 'violin':'\\ud83c\\udfbb',\n 'virgo':'\\u264d\\ufe0f',\n 'volcano':'\\ud83c\\udf0b',\n 'volleyball':'\\ud83c\\udfd0',\n 'vs':'\\ud83c\\udd9a',\n 'vulcan_salute':'\\ud83d\\udd96',\n 'walking_man':'\\ud83d\\udeb6',\n 'walking_woman':'\\ud83d\\udeb6‍\\u2640\\ufe0f',\n 'waning_crescent_moon':'\\ud83c\\udf18',\n 'waning_gibbous_moon':'\\ud83c\\udf16',\n 'warning':'\\u26a0\\ufe0f',\n 'wastebasket':'\\ud83d\\uddd1',\n 'watch':'\\u231a\\ufe0f',\n 'water_buffalo':'\\ud83d\\udc03',\n 'watermelon':'\\ud83c\\udf49',\n 'wave':'\\ud83d\\udc4b',\n 'wavy_dash':'\\u3030\\ufe0f',\n 'waxing_crescent_moon':'\\ud83c\\udf12',\n 'wc':'\\ud83d\\udebe',\n 'weary':'\\ud83d\\ude29',\n 'wedding':'\\ud83d\\udc92',\n 'weight_lifting_man':'\\ud83c\\udfcb\\ufe0f',\n 'weight_lifting_woman':'\\ud83c\\udfcb\\ufe0f‍\\u2640\\ufe0f',\n 'whale':'\\ud83d\\udc33',\n 'whale2':'\\ud83d\\udc0b',\n 'wheel_of_dharma':'\\u2638\\ufe0f',\n 'wheelchair':'\\u267f\\ufe0f',\n 'white_check_mark':'\\u2705',\n 'white_circle':'\\u26aa\\ufe0f',\n 'white_flag':'\\ud83c\\udff3\\ufe0f',\n 'white_flower':'\\ud83d\\udcae',\n 'white_large_square':'\\u2b1c\\ufe0f',\n 'white_medium_small_square':'\\u25fd\\ufe0f',\n 'white_medium_square':'\\u25fb\\ufe0f',\n 'white_small_square':'\\u25ab\\ufe0f',\n 'white_square_button':'\\ud83d\\udd33',\n 'wilted_flower':'\\ud83e\\udd40',\n 'wind_chime':'\\ud83c\\udf90',\n 'wind_face':'\\ud83c\\udf2c',\n 'wine_glass':'\\ud83c\\udf77',\n 'wink':'\\ud83d\\ude09',\n 'wolf':'\\ud83d\\udc3a',\n 'woman':'\\ud83d\\udc69',\n 'woman_artist':'\\ud83d\\udc69‍\\ud83c\\udfa8',\n 'woman_astronaut':'\\ud83d\\udc69‍\\ud83d\\ude80',\n 'woman_cartwheeling':'\\ud83e\\udd38‍\\u2640\\ufe0f',\n 'woman_cook':'\\ud83d\\udc69‍\\ud83c\\udf73',\n 'woman_facepalming':'\\ud83e\\udd26‍\\u2640\\ufe0f',\n 'woman_factory_worker':'\\ud83d\\udc69‍\\ud83c\\udfed',\n 'woman_farmer':'\\ud83d\\udc69‍\\ud83c\\udf3e',\n 'woman_firefighter':'\\ud83d\\udc69‍\\ud83d\\ude92',\n 'woman_health_worker':'\\ud83d\\udc69‍\\u2695\\ufe0f',\n 'woman_judge':'\\ud83d\\udc69‍\\u2696\\ufe0f',\n 'woman_juggling':'\\ud83e\\udd39‍\\u2640\\ufe0f',\n 'woman_mechanic':'\\ud83d\\udc69‍\\ud83d\\udd27',\n 'woman_office_worker':'\\ud83d\\udc69‍\\ud83d\\udcbc',\n 'woman_pilot':'\\ud83d\\udc69‍\\u2708\\ufe0f',\n 'woman_playing_handball':'\\ud83e\\udd3e‍\\u2640\\ufe0f',\n 'woman_playing_water_polo':'\\ud83e\\udd3d‍\\u2640\\ufe0f',\n 'woman_scientist':'\\ud83d\\udc69‍\\ud83d\\udd2c',\n 'woman_shrugging':'\\ud83e\\udd37‍\\u2640\\ufe0f',\n 'woman_singer':'\\ud83d\\udc69‍\\ud83c\\udfa4',\n 'woman_student':'\\ud83d\\udc69‍\\ud83c\\udf93',\n 'woman_teacher':'\\ud83d\\udc69‍\\ud83c\\udfeb',\n 'woman_technologist':'\\ud83d\\udc69‍\\ud83d\\udcbb',\n 'woman_with_turban':'\\ud83d\\udc73‍\\u2640\\ufe0f',\n 'womans_clothes':'\\ud83d\\udc5a',\n 'womans_hat':'\\ud83d\\udc52',\n 'women_wrestling':'\\ud83e\\udd3c‍\\u2640\\ufe0f',\n 'womens':'\\ud83d\\udeba',\n 'world_map':'\\ud83d\\uddfa',\n 'worried':'\\ud83d\\ude1f',\n 'wrench':'\\ud83d\\udd27',\n 'writing_hand':'\\u270d\\ufe0f',\n 'x':'\\u274c',\n 'yellow_heart':'\\ud83d\\udc9b',\n 'yen':'\\ud83d\\udcb4',\n 'yin_yang':'\\u262f\\ufe0f',\n 'yum':'\\ud83d\\ude0b',\n 'zap':'\\u26a1\\ufe0f',\n 'zipper_mouth_face':'\\ud83e\\udd10',\n 'zzz':'\\ud83d\\udca4',\n\n /* special emojis :P */\n 'octocat': '\":octocat:\"',\n 'showdown': 'S'\n};\n", "/**\n * Created by Estevao on 31-05-2015.\n */\n\n/**\n * Showdown Converter class\n * @class\n * @param {object} [converterOptions]\n * @returns {Converter}\n */\nshowdown.Converter = function (converterOptions) {\n 'use strict';\n\n var\n /**\n * Options used by this converter\n * @private\n * @type {{}}\n */\n options = {},\n\n /**\n * Language extensions used by this converter\n * @private\n * @type {Array}\n */\n langExtensions = [],\n\n /**\n * Output modifiers extensions used by this converter\n * @private\n * @type {Array}\n */\n outputModifiers = [],\n\n /**\n * Event listeners\n * @private\n * @type {{}}\n */\n listeners = {},\n\n /**\n * The flavor set in this converter\n */\n setConvFlavor = setFlavor,\n\n /**\n * Metadata of the document\n * @type {{parsed: {}, raw: string, format: string}}\n */\n metadata = {\n parsed: {},\n raw: '',\n format: ''\n };\n\n _constructor();\n\n /**\n * Converter constructor\n * @private\n */\n function _constructor () {\n converterOptions = converterOptions || {};\n\n for (var gOpt in globalOptions) {\n if (globalOptions.hasOwnProperty(gOpt)) {\n options[gOpt] = globalOptions[gOpt];\n }\n }\n\n // Merge options\n if (typeof converterOptions === 'object') {\n for (var opt in converterOptions) {\n if (converterOptions.hasOwnProperty(opt)) {\n options[opt] = converterOptions[opt];\n }\n }\n } else {\n throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +\n ' was passed instead.');\n }\n\n if (options.extensions) {\n showdown.helper.forEach(options.extensions, _parseExtension);\n }\n }\n\n /**\n * Parse extension\n * @param {*} ext\n * @param {string} [name='']\n * @private\n */\n function _parseExtension (ext, name) {\n\n name = name || null;\n // If it's a string, the extension was previously loaded\n if (showdown.helper.isString(ext)) {\n ext = showdown.helper.stdExtName(ext);\n name = ext;\n\n // LEGACY_SUPPORT CODE\n if (showdown.extensions[ext]) {\n console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +\n 'Please inform the developer that the extension should be updated!');\n legacyExtensionLoading(showdown.extensions[ext], ext);\n return;\n // END LEGACY SUPPORT CODE\n\n } else if (!showdown.helper.isUndefined(extensions[ext])) {\n ext = extensions[ext];\n\n } else {\n throw Error('Extension \"' + ext + '\" could not be loaded. It was either not found or is not a valid extension.');\n }\n }\n\n if (typeof ext === 'function') {\n ext = ext();\n }\n\n if (!showdown.helper.isArray(ext)) {\n ext = [ext];\n }\n\n var validExt = validate(ext, name);\n if (!validExt.valid) {\n throw Error(validExt.error);\n }\n\n for (var i = 0; i < ext.length; ++i) {\n switch (ext[i].type) {\n\n case 'lang':\n langExtensions.push(ext[i]);\n break;\n\n case 'output':\n outputModifiers.push(ext[i]);\n break;\n }\n if (ext[i].hasOwnProperty('listeners')) {\n for (var ln in ext[i].listeners) {\n if (ext[i].listeners.hasOwnProperty(ln)) {\n listen(ln, ext[i].listeners[ln]);\n }\n }\n }\n }\n\n }\n\n /**\n * LEGACY_SUPPORT\n * @param {*} ext\n * @param {string} name\n */\n function legacyExtensionLoading (ext, name) {\n if (typeof ext === 'function') {\n ext = ext(new showdown.Converter());\n }\n if (!showdown.helper.isArray(ext)) {\n ext = [ext];\n }\n var valid = validate(ext, name);\n\n if (!valid.valid) {\n throw Error(valid.error);\n }\n\n for (var i = 0; i < ext.length; ++i) {\n switch (ext[i].type) {\n case 'lang':\n langExtensions.push(ext[i]);\n break;\n case 'output':\n outputModifiers.push(ext[i]);\n break;\n default:// should never reach here\n throw Error('Extension loader error: Type unrecognized!!!');\n }\n }\n }\n\n /**\n * Listen to an event\n * @param {string} name\n * @param {function} callback\n */\n function listen (name, callback) {\n if (!showdown.helper.isString(name)) {\n throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');\n }\n\n if (typeof callback !== 'function') {\n throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');\n }\n\n if (!listeners.hasOwnProperty(name)) {\n listeners[name] = [];\n }\n listeners[name].push(callback);\n }\n\n function rTrimInputText (text) {\n var rsp = text.match(/^\\s*/)[0].length,\n rgx = new RegExp('^\\\\s{0,' + rsp + '}', 'gm');\n return text.replace(rgx, '');\n }\n\n /**\n * Dispatch an event\n * @private\n * @param {string} evtName Event name\n * @param {string} text Text\n * @param {{}} options Converter Options\n * @param {{}} globals\n * @returns {string}\n */\n this._dispatch = function dispatch (evtName, text, options, globals) {\n if (listeners.hasOwnProperty(evtName)) {\n for (var ei = 0; ei < listeners[evtName].length; ++ei) {\n var nText = listeners[evtName][ei](evtName, text, this, options, globals);\n if (nText && typeof nText !== 'undefined') {\n text = nText;\n }\n }\n }\n return text;\n };\n\n /**\n * Listen to an event\n * @param {string} name\n * @param {function} callback\n * @returns {showdown.Converter}\n */\n this.listen = function (name, callback) {\n listen(name, callback);\n return this;\n };\n\n /**\n * Converts a markdown string into HTML\n * @param {string} text\n * @returns {*}\n */\n this.makeHtml = function (text) {\n //check if text is not falsy\n if (!text) {\n return text;\n }\n\n var globals = {\n gHtmlBlocks: [],\n gHtmlMdBlocks: [],\n gHtmlSpans: [],\n gUrls: {},\n gTitles: {},\n gDimensions: {},\n gListLevel: 0,\n hashLinkCounts: {},\n langExtensions: langExtensions,\n outputModifiers: outputModifiers,\n converter: this,\n ghCodeBlocks: [],\n metadata: {\n parsed: {},\n raw: '',\n format: ''\n }\n };\n\n // This lets us use ¨ trema as an escape char to avoid md5 hashes\n // The choice of character is arbitrary; anything that isn't\n // magic in Markdown will work.\n text = text.replace(/¨/g, '¨T');\n\n // Replace $ with ¨D\n // RegExp interprets $ as a special character\n // when it's in a replacement string\n text = text.replace(/\\$/g, '¨D');\n\n // Standardize line endings\n text = text.replace(/\\r\\n/g, '\\n'); // DOS to Unix\n text = text.replace(/\\r/g, '\\n'); // Mac to Unix\n\n // Stardardize line spaces\n text = text.replace(/\\u00A0/g, ' ');\n\n if (options.smartIndentationFix) {\n text = rTrimInputText(text);\n }\n\n // Make sure text begins and ends with a couple of newlines:\n text = '\\n\\n' + text + '\\n\\n';\n\n // detab\n text = showdown.subParser('detab')(text, options, globals);\n\n /**\n * Strip any lines consisting only of spaces and tabs.\n * This makes subsequent regexs easier to write, because we can\n * match consecutive blank lines with /\\n+/ instead of something\n * contorted like /[ \\t]*\\n+/\n */\n text = text.replace(/^[ \\t]+$/mg, '');\n\n //run languageExtensions\n showdown.helper.forEach(langExtensions, function (ext) {\n text = showdown.subParser('runExtension')(ext, text, options, globals);\n });\n\n // run the sub parsers\n text = showdown.subParser('metadata')(text, options, globals);\n text = showdown.subParser('hashPreCodeTags')(text, options, globals);\n text = showdown.subParser('githubCodeBlocks')(text, options, globals);\n text = showdown.subParser('hashHTMLBlocks')(text, options, globals);\n text = showdown.subParser('hashCodeTags')(text, options, globals);\n text = showdown.subParser('stripLinkDefinitions')(text, options, globals);\n text = showdown.subParser('blockGamut')(text, options, globals);\n text = showdown.subParser('unhashHTMLSpans')(text, options, globals);\n text = showdown.subParser('unescapeSpecialChars')(text, options, globals);\n\n // attacklab: Restore dollar signs\n text = text.replace(/¨D/g, '$$');\n\n // attacklab: Restore tremas\n text = text.replace(/¨T/g, '¨');\n\n // render a complete html document instead of a partial if the option is enabled\n text = showdown.subParser('completeHTMLDocument')(text, options, globals);\n\n // Run output modifiers\n showdown.helper.forEach(outputModifiers, function (ext) {\n text = showdown.subParser('runExtension')(ext, text, options, globals);\n });\n\n // update metadata\n metadata = globals.metadata;\n return text;\n };\n\n /**\n * Converts an HTML string into a markdown string\n * @param src\n * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used.\n * @returns {string}\n */\n this.makeMarkdown = this.makeMd = function (src, HTMLParser) {\n\n // replace \\r\\n with \\n\n src = src.replace(/\\r\\n/g, '\\n');\n src = src.replace(/\\r/g, '\\n'); // old macs\n\n // due to an edge case, we need to find this: > <\n // to prevent removing of non silent white spaces\n // ex: this is sparta\n src = src.replace(/>[ \\t]+¨NBSP;<');\n\n if (!HTMLParser) {\n if (window && window.document) {\n HTMLParser = window.document;\n } else {\n throw new Error('HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM');\n }\n }\n\n var doc = HTMLParser.createElement('div');\n doc.innerHTML = src;\n\n var globals = {\n preList: substitutePreCodeTags(doc)\n };\n\n // remove all newlines and collapse spaces\n clean(doc);\n\n // some stuff, like accidental reference links must now be escaped\n // TODO\n // doc.innerHTML = doc.innerHTML.replace(/\\[[\\S\\t ]]/);\n\n var nodes = doc.childNodes,\n mdDoc = '';\n\n for (var i = 0; i < nodes.length; i++) {\n mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals);\n }\n\n function clean (node) {\n for (var n = 0; n < node.childNodes.length; ++n) {\n var child = node.childNodes[n];\n if (child.nodeType === 3) {\n if (!/\\S/.test(child.nodeValue) && !/^[ ]+$/.test(child.nodeValue)) {\n node.removeChild(child);\n --n;\n } else {\n child.nodeValue = child.nodeValue.split('\\n').join(' ');\n child.nodeValue = child.nodeValue.replace(/(\\s)+/g, '$1');\n }\n } else if (child.nodeType === 1) {\n clean(child);\n }\n }\n }\n\n // find all pre tags and replace contents with placeholder\n // we need this so that we can remove all indentation from html\n // to ease up parsing\n function substitutePreCodeTags (doc) {\n\n var pres = doc.querySelectorAll('pre'),\n presPH = [];\n\n for (var i = 0; i < pres.length; ++i) {\n\n if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {\n var content = pres[i].firstChild.innerHTML.trim(),\n language = pres[i].firstChild.getAttribute('data-language') || '';\n\n // if data-language attribute is not defined, then we look for class language-*\n if (language === '') {\n var classes = pres[i].firstChild.className.split(' ');\n for (var c = 0; c < classes.length; ++c) {\n var matches = classes[c].match(/^language-(.+)$/);\n if (matches !== null) {\n language = matches[1];\n break;\n }\n }\n }\n\n // unescape html entities in content\n content = showdown.helper.unescapeHTMLEntities(content);\n\n presPH.push(content);\n pres[i].outerHTML = '';\n } else {\n presPH.push(pres[i].innerHTML);\n pres[i].innerHTML = '';\n pres[i].setAttribute('prenum', i.toString());\n }\n }\n return presPH;\n }\n\n return mdDoc;\n };\n\n /**\n * Set an option of this Converter instance\n * @param {string} key\n * @param {*} value\n */\n this.setOption = function (key, value) {\n options[key] = value;\n };\n\n /**\n * Get the option of this Converter instance\n * @param {string} key\n * @returns {*}\n */\n this.getOption = function (key) {\n return options[key];\n };\n\n /**\n * Get the options of this Converter instance\n * @returns {{}}\n */\n this.getOptions = function () {\n return options;\n };\n\n /**\n * Add extension to THIS converter\n * @param {{}} extension\n * @param {string} [name=null]\n */\n this.addExtension = function (extension, name) {\n name = name || null;\n _parseExtension(extension, name);\n };\n\n /**\n * Use a global registered extension with THIS converter\n * @param {string} extensionName Name of the previously registered extension\n */\n this.useExtension = function (extensionName) {\n _parseExtension(extensionName);\n };\n\n /**\n * Set the flavor THIS converter should use\n * @param {string} name\n */\n this.setFlavor = function (name) {\n if (!flavor.hasOwnProperty(name)) {\n throw Error(name + ' flavor was not found');\n }\n var preset = flavor[name];\n setConvFlavor = name;\n for (var option in preset) {\n if (preset.hasOwnProperty(option)) {\n options[option] = preset[option];\n }\n }\n };\n\n /**\n * Get the currently set flavor of this converter\n * @returns {string}\n */\n this.getFlavor = function () {\n return setConvFlavor;\n };\n\n /**\n * Remove an extension from THIS converter.\n * Note: This is a costly operation. It's better to initialize a new converter\n * and specify the extensions you wish to use\n * @param {Array} extension\n */\n this.removeExtension = function (extension) {\n if (!showdown.helper.isArray(extension)) {\n extension = [extension];\n }\n for (var a = 0; a < extension.length; ++a) {\n var ext = extension[a];\n for (var i = 0; i < langExtensions.length; ++i) {\n if (langExtensions[i] === ext) {\n langExtensions.splice(i, 1);\n }\n }\n for (var ii = 0; ii < outputModifiers.length; ++ii) {\n if (outputModifiers[ii] === ext) {\n outputModifiers.splice(ii, 1);\n }\n }\n }\n };\n\n /**\n * Get all extension of THIS converter\n * @returns {{language: Array, output: Array}}\n */\n this.getAllExtensions = function () {\n return {\n language: langExtensions,\n output: outputModifiers\n };\n };\n\n /**\n * Get the metadata of the previously parsed document\n * @param raw\n * @returns {string|{}}\n */\n this.getMetadata = function (raw) {\n if (raw) {\n return metadata.raw;\n } else {\n return metadata.parsed;\n }\n };\n\n /**\n * Get the metadata format of the previously parsed document\n * @returns {string}\n */\n this.getMetadataFormat = function () {\n return metadata.format;\n };\n\n /**\n * Private: set a single key, value metadata pair\n * @param {string} key\n * @param {string} value\n */\n this._setMetadataPair = function (key, value) {\n metadata.parsed[key] = value;\n };\n\n /**\n * Private: set metadata format\n * @param {string} format\n */\n this._setMetadataFormat = function (format) {\n metadata.format = format;\n };\n\n /**\n * Private: set metadata raw text\n * @param {string} raw\n */\n this._setMetadataRaw = function (raw) {\n metadata.raw = raw;\n };\n};\n", "/**\n * Turn Markdown link shortcuts into XHTML tags.\n */\nshowdown.subParser('anchors', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('anchors.before', text, options, globals);\n\n var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) {\n if (showdown.helper.isUndefined(title)) {\n title = '';\n }\n linkId = linkId.toLowerCase();\n\n // Special case for explicit empty url\n if (wholeMatch.search(/\\(? ?(['\"].*['\"])?\\)$/m) > -1) {\n url = '';\n } else if (!url) {\n if (!linkId) {\n // lower-case and turn embedded newlines into spaces\n linkId = linkText.toLowerCase().replace(/ ?\\n/g, ' ');\n }\n url = '#' + linkId;\n\n if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {\n url = globals.gUrls[linkId];\n if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {\n title = globals.gTitles[linkId];\n }\n } else {\n return wholeMatch;\n }\n }\n\n //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance\n url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);\n\n var result = '';\n\n return result;\n };\n\n // First, handle reference-style links: [link text] [id]\n text = text.replace(/\\[((?:\\[[^\\]]*]|[^\\[\\]])*)] ?(?:\\n *)?\\[(.*?)]()()()()/g, writeAnchorTag);\n\n // Next, inline-style links: [link text](url \"optional title\")\n // cases with crazy urls like ./image/cat1).png\n text = text.replace(/\\[((?:\\[[^\\]]*]|[^\\[\\]])*)]()[ \\t]*\\([ \\t]?<([^>]*)>(?:[ \\t]*(([\"'])([^\"]*?)\\5))?[ \\t]?\\)/g,\n writeAnchorTag);\n\n // normal cases\n text = text.replace(/\\[((?:\\[[^\\]]*]|[^\\[\\]])*)]()[ \\t]*\\([ \\t]??(?:[ \\t]*(([\"'])([^\"]*?)\\5))?[ \\t]?\\)/g,\n writeAnchorTag);\n\n // handle reference-style shortcuts: [link text]\n // These must come last in case you've also got [link test][1]\n // or [link test](/foo)\n text = text.replace(/\\[([^\\[\\]]+)]()()()()()/g, writeAnchorTag);\n\n // Lastly handle GithubMentions if option is enabled\n if (options.ghMentions) {\n text = text.replace(/(^|\\s)(\\\\)?(@([a-z\\d]+(?:[a-z\\d.-]+?[a-z\\d]+)*))/gmi, function (wm, st, escape, mentions, username) {\n if (escape === '\\\\') {\n return st + mentions;\n }\n\n //check if options.ghMentionsLink is a string\n if (!showdown.helper.isString(options.ghMentionsLink)) {\n throw new Error('ghMentionsLink option must be a string');\n }\n var lnk = options.ghMentionsLink.replace(/\\{u}/g, username),\n target = '';\n if (options.openLinksInNewWindow) {\n target = ' rel=\"noopener noreferrer\" target=\"¨E95Eblank\"';\n }\n return st + '' + mentions + '';\n });\n }\n\n text = globals.converter._dispatch('anchors.after', text, options, globals);\n return text;\n});\n", "// url allowed chars [a-z\\d_.~:/?#[]@!$&'()*+,;=-]\n\nvar simpleURLRegex = /([*~_]+|\\b)(((https?|ftp|dict):\\/\\/|www\\.)[^'\">\\s]+?\\.[^'\">\\s]+?)()(\\1)?(?=\\s|$)(?![\"<>])/gi,\n simpleURLRegex2 = /([*~_]+|\\b)(((https?|ftp|dict):\\/\\/|www\\.)[^'\">\\s]+\\.[^'\">\\s]+?)([.!?,()\\[\\]])?(\\1)?(?=\\s|$)(?![\"<>])/gi,\n delimUrlRegex = /()<(((https?|ftp|dict):\\/\\/|www\\.)[^'\">\\s]+)()>()/gi,\n simpleMailRegex = /(^|\\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)(?=$|\\s)/gmi,\n delimMailRegex = /<()(?:mailto:)?([-.\\w]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)>/gi,\n\n replaceLink = function (options) {\n 'use strict';\n return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {\n link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);\n var lnkTxt = link,\n append = '',\n target = '',\n lmc = leadingMagicChars || '',\n tmc = trailingMagicChars || '';\n if (/^www\\./i.test(link)) {\n link = link.replace(/^www\\./i, 'http://www.');\n }\n if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {\n append = trailingPunctuation;\n }\n if (options.openLinksInNewWindow) {\n target = ' rel=\"noopener noreferrer\" target=\"¨E95Eblank\"';\n }\n return lmc + '' + lnkTxt + '' + append + tmc;\n };\n },\n\n replaceMail = function (options, globals) {\n 'use strict';\n return function (wholeMatch, b, mail) {\n var href = 'mailto:';\n b = b || '';\n mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals);\n if (options.encodeEmails) {\n href = showdown.helper.encodeEmailAddress(href + mail);\n mail = showdown.helper.encodeEmailAddress(mail);\n } else {\n href = href + mail;\n }\n return b + '' + mail + '';\n };\n };\n\nshowdown.subParser('autoLinks', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('autoLinks.before', text, options, globals);\n\n text = text.replace(delimUrlRegex, replaceLink(options));\n text = text.replace(delimMailRegex, replaceMail(options, globals));\n\n text = globals.converter._dispatch('autoLinks.after', text, options, globals);\n\n return text;\n});\n\nshowdown.subParser('simplifiedAutoLinks', function (text, options, globals) {\n 'use strict';\n\n if (!options.simplifiedAutoLink) {\n return text;\n }\n\n text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals);\n\n if (options.excludeTrailingPunctuationFromURLs) {\n text = text.replace(simpleURLRegex2, replaceLink(options));\n } else {\n text = text.replace(simpleURLRegex, replaceLink(options));\n }\n text = text.replace(simpleMailRegex, replaceMail(options, globals));\n\n text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals);\n\n return text;\n});\n", "/**\n * These are all the transformations that form block-level\n * tags like paragraphs, headers, and list items.\n */\nshowdown.subParser('blockGamut', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('blockGamut.before', text, options, globals);\n\n // we parse blockquotes first so that we can have headings and hrs\n // inside blockquotes\n text = showdown.subParser('blockQuotes')(text, options, globals);\n text = showdown.subParser('headers')(text, options, globals);\n\n // Do Horizontal Rules:\n text = showdown.subParser('horizontalRule')(text, options, globals);\n\n text = showdown.subParser('lists')(text, options, globals);\n text = showdown.subParser('codeBlocks')(text, options, globals);\n text = showdown.subParser('tables')(text, options, globals);\n\n // We already ran _HashHTMLBlocks() before, in Markdown(), but that\n // was to escape raw HTML in the original Markdown source. This time,\n // we're escaping the markup we've just created, so that we don't wrap\n //

    tags around block-level tags.\n text = showdown.subParser('hashHTMLBlocks')(text, options, globals);\n text = showdown.subParser('paragraphs')(text, options, globals);\n\n text = globals.converter._dispatch('blockGamut.after', text, options, globals);\n\n return text;\n});\n", "showdown.subParser('blockQuotes', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('blockQuotes.before', text, options, globals);\n\n // add a couple extra lines after the text and endtext mark\n text = text + '\\n\\n';\n\n var rgx = /(^ {0,3}>[ \\t]?.+\\n(.+\\n)*\\n*)+/gm;\n\n if (options.splitAdjacentBlockquotes) {\n rgx = /^ {0,3}>[\\s\\S]*?(?:\\n\\n)/gm;\n }\n\n text = text.replace(rgx, function (bq) {\n // attacklab: hack around Konqueror 3.5.4 bug:\n // \"----------bug\".replace(/^-/g,\"\") == \"bug\"\n bq = bq.replace(/^[ \\t]*>[ \\t]?/gm, ''); // trim one level of quoting\n\n // attacklab: clean up hack\n bq = bq.replace(/¨0/g, '');\n\n bq = bq.replace(/^[ \\t]+$/gm, ''); // trim whitespace-only lines\n bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);\n bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse\n\n bq = bq.replace(/(^|\\n)/g, '$1 ');\n // These leading spaces screw with

     content, so we need to fix that:\n    bq = bq.replace(/(\\s*
    [^\\r]+?<\\/pre>)/gm, function (wholeMatch, m1) {\n      var pre = m1;\n      // attacklab: hack around Konqueror 3.5.4 bug:\n      pre = pre.replace(/^  /mg, '¨0');\n      pre = pre.replace(/¨0/g, '');\n      return pre;\n    });\n\n    return showdown.subParser('hashBlock')('
    \\n' + bq + '\\n
    ', options, globals);\n });\n\n text = globals.converter._dispatch('blockQuotes.after', text, options, globals);\n return text;\n});\n", "/**\n * Process Markdown `
    ` blocks.\n */\nshowdown.subParser('codeBlocks', function (text, options, globals) {\n  'use strict';\n\n  text = globals.converter._dispatch('codeBlocks.before', text, options, globals);\n\n  // sentinel workarounds for lack of \\A and \\Z, safari\\khtml bug\n  text += '¨0';\n\n  var pattern = /(?:\\n\\n|^)((?:(?:[ ]{4}|\\t).*\\n+)+)(\\n*[ ]{0,3}[^ \\t\\n]|(?=¨0))/g;\n  text = text.replace(pattern, function (wholeMatch, m1, m2) {\n    var codeblock = m1,\n        nextChar = m2,\n        end = '\\n';\n\n    codeblock = showdown.subParser('outdent')(codeblock, options, globals);\n    codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);\n    codeblock = showdown.subParser('detab')(codeblock, options, globals);\n    codeblock = codeblock.replace(/^\\n+/g, ''); // trim leading newlines\n    codeblock = codeblock.replace(/\\n+$/g, ''); // trim trailing newlines\n\n    if (options.omitExtraWLInCodeBlocks) {\n      end = '';\n    }\n\n    codeblock = '
    ' + codeblock + end + '
    ';\n\n return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;\n });\n\n // strip sentinel\n text = text.replace(/¨0/, '');\n\n text = globals.converter._dispatch('codeBlocks.after', text, options, globals);\n return text;\n});\n", "/**\n *\n * * Backtick quotes are used for spans.\n *\n * * You can use multiple backticks as the delimiters if you want to\n * include literal backticks in the code span. So, this input:\n *\n * Just type ``foo `bar` baz`` at the prompt.\n *\n * Will translate to:\n *\n *

    Just type foo `bar` baz at the prompt.

    \n *\n * There's no arbitrary limit to the number of backticks you\n * can use as delimters. If you need three consecutive backticks\n * in your code, use four for delimiters, etc.\n *\n * * You can use spaces to get literal backticks at the edges:\n *\n * ... type `` `bar` `` ...\n *\n * Turns to:\n *\n * ... type `bar` ...\n */\nshowdown.subParser('codeSpans', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('codeSpans.before', text, options, globals);\n\n if (typeof (text) === 'undefined') {\n text = '';\n }\n text = text.replace(/(^|[^\\\\])(`+)([^\\r]*?[^`])\\2(?!`)/gm,\n function (wholeMatch, m1, m2, m3) {\n var c = m3;\n c = c.replace(/^([ \\t]*)/g, '');\t// leading whitespace\n c = c.replace(/[ \\t]*$/g, '');\t// trailing whitespace\n c = showdown.subParser('encodeCode')(c, options, globals);\n c = m1 + '' + c + '';\n c = showdown.subParser('hashHTMLSpans')(c, options, globals);\n return c;\n }\n );\n\n text = globals.converter._dispatch('codeSpans.after', text, options, globals);\n return text;\n});\n", "/**\n * Create a full HTML document from the processed markdown\n */\nshowdown.subParser('completeHTMLDocument', function (text, options, globals) {\n 'use strict';\n\n if (!options.completeHTMLDocument) {\n return text;\n }\n\n text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals);\n\n var doctype = 'html',\n doctypeParsed = '\\n',\n title = '',\n charset = '\\n',\n lang = '',\n metadata = '';\n\n if (typeof globals.metadata.parsed.doctype !== 'undefined') {\n doctypeParsed = '\\n';\n doctype = globals.metadata.parsed.doctype.toString().toLowerCase();\n if (doctype === 'html' || doctype === 'html5') {\n charset = '';\n }\n }\n\n for (var meta in globals.metadata.parsed) {\n if (globals.metadata.parsed.hasOwnProperty(meta)) {\n switch (meta.toLowerCase()) {\n case 'doctype':\n break;\n\n case 'title':\n title = '' + globals.metadata.parsed.title + '\\n';\n break;\n\n case 'charset':\n if (doctype === 'html' || doctype === 'html5') {\n charset = '\\n';\n } else {\n charset = '\\n';\n }\n break;\n\n case 'language':\n case 'lang':\n lang = ' lang=\"' + globals.metadata.parsed[meta] + '\"';\n metadata += '\\n';\n break;\n\n default:\n metadata += '\\n';\n }\n }\n }\n\n text = doctypeParsed + '\\n\\n' + title + charset + metadata + '\\n\\n' + text.trim() + '\\n\\n';\n\n text = globals.converter._dispatch('completeHTMLDocument.after', text, options, globals);\n return text;\n});\n", "/**\n * Convert all tabs to spaces\n */\nshowdown.subParser('detab', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('detab.before', text, options, globals);\n\n // expand first n-1 tabs\n text = text.replace(/\\t(?=\\t)/g, ' '); // g_tab_width\n\n // replace the nth with two sentinels\n text = text.replace(/\\t/g, '¨A¨B');\n\n // use the sentinel to anchor our regex so it doesn't explode\n text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) {\n var leadingText = m1,\n numSpaces = 4 - leadingText.length % 4; // g_tab_width\n\n // there *must* be a better way to do this:\n for (var i = 0; i < numSpaces; i++) {\n leadingText += ' ';\n }\n\n return leadingText;\n });\n\n // clean up sentinels\n text = text.replace(/¨A/g, ' '); // g_tab_width\n text = text.replace(/¨B/g, '');\n\n text = globals.converter._dispatch('detab.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('ellipsis', function (text, options, globals) {\n 'use strict';\n\n if (!options.ellipsis) {\n return text;\n }\n\n text = globals.converter._dispatch('ellipsis.before', text, options, globals);\n\n text = text.replace(/\\.\\.\\./g, '…');\n\n text = globals.converter._dispatch('ellipsis.after', text, options, globals);\n\n return text;\n});\n", "/**\n * Turn emoji codes into emojis\n *\n * List of supported emojis: https://github.com/showdownjs/showdown/wiki/Emojis\n */\nshowdown.subParser('emoji', function (text, options, globals) {\n 'use strict';\n\n if (!options.emoji) {\n return text;\n }\n\n text = globals.converter._dispatch('emoji.before', text, options, globals);\n\n var emojiRgx = /:([\\S]+?):/g;\n\n text = text.replace(emojiRgx, function (wm, emojiCode) {\n if (showdown.helper.emojis.hasOwnProperty(emojiCode)) {\n return showdown.helper.emojis[emojiCode];\n }\n return wm;\n });\n\n text = globals.converter._dispatch('emoji.after', text, options, globals);\n\n return text;\n});\n", "/**\n * Smart processing for ampersands and angle brackets that need to be encoded.\n */\nshowdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals);\n\n // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:\n // http://bumppo.net/projects/amputator/\n text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\\w+);)/g, '&');\n\n // Encode naked <'s\n text = text.replace(/<(?![a-z\\/?$!])/gi, '<');\n\n // Encode <\n text = text.replace(/\n text = text.replace(/>/g, '>');\n\n text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);\n return text;\n});\n", "/**\n * Returns the string, with after processing the following backslash escape sequences.\n *\n * attacklab: The polite way to do this is with the new escapeCharacters() function:\n *\n * text = escapeCharacters(text,\"\\\\\",true);\n * text = escapeCharacters(text,\"`*_{}[]()>#+-.!\",true);\n *\n * ...but we're sidestepping its use of the (slow) RegExp constructor\n * as an optimization for Firefox. This function gets called a LOT.\n */\nshowdown.subParser('encodeBackslashEscapes', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);\n\n text = text.replace(/\\\\(\\\\)/g, showdown.helper.escapeCharactersCallback);\n text = text.replace(/\\\\([`*_{}\\[\\]()>#+.!~=|:-])/g, showdown.helper.escapeCharactersCallback);\n\n text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);\n return text;\n});\n", "/**\n * Encode/escape certain characters inside Markdown code runs.\n * The point is that in code, these characters are literals,\n * and lose their special Markdown meanings.\n */\nshowdown.subParser('encodeCode', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('encodeCode.before', text, options, globals);\n\n // Encode all ampersands; HTML entities are not\n // entities within a Markdown code span.\n text = text\n .replace(/&/g, '&')\n // Do the angle bracket song and dance:\n .replace(//g, '>')\n // Now, escape characters that are magic in Markdown:\n .replace(/([*_{}\\[\\]\\\\=~-])/g, showdown.helper.escapeCharactersCallback);\n\n text = globals.converter._dispatch('encodeCode.after', text, options, globals);\n return text;\n});\n", "/**\n * Within tags -- meaning between < and > -- encode [\\ ` * _ ~ =] so they\n * don't conflict with their use in Markdown for code, italics and strong.\n */\nshowdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals);\n\n // Build a regex to find HTML tags.\n var tags = /<\\/?[a-z\\d_:-]+(?:[\\s]+[\\s\\S]+?)?>/gi,\n comments = /-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;\n\n text = text.replace(tags, function (wholeMatch) {\n return wholeMatch\n .replace(/(.)<\\/?code>(?=.)/g, '$1`')\n .replace(/([\\\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);\n });\n\n text = text.replace(comments, function (wholeMatch) {\n return wholeMatch\n .replace(/([\\\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);\n });\n\n text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);\n return text;\n});\n", "/**\n * Handle github codeblocks prior to running HashHTML so that\n * HTML contained within the codeblock gets escaped properly\n * Example:\n * ```ruby\n * def hello_world(x)\n * puts \"Hello, #{x}\"\n * end\n * ```\n */\nshowdown.subParser('githubCodeBlocks', function (text, options, globals) {\n 'use strict';\n\n // early exit if option is not enabled\n if (!options.ghCodeBlocks) {\n return text;\n }\n\n text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);\n\n text += '¨0';\n\n text = text.replace(/(?:^|\\n)(?: {0,3})(```+|~~~+)(?: *)([^\\s`~]*)\\n([\\s\\S]*?)\\n(?: {0,3})\\1/g, function (wholeMatch, delim, language, codeblock) {\n var end = (options.omitExtraWLInCodeBlocks) ? '' : '\\n';\n\n // First parse the github code block\n codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);\n codeblock = showdown.subParser('detab')(codeblock, options, globals);\n codeblock = codeblock.replace(/^\\n+/g, ''); // trim leading newlines\n codeblock = codeblock.replace(/\\n+$/g, ''); // trim trailing whitespace\n\n codeblock = '
    ' + codeblock + end + '
    ';\n\n codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);\n\n // Since GHCodeblocks can be false positives, we need to\n // store the primitive text and the parsed text in a global var,\n // and then return a token\n return '\\n\\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\\n\\n';\n });\n\n // attacklab: strip sentinel\n text = text.replace(/¨0/, '');\n\n return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);\n});\n", "showdown.subParser('hashBlock', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('hashBlock.before', text, options, globals);\n text = text.replace(/(^\\n+|\\n+$)/g, '');\n text = '\\n\\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\\n\\n';\n text = globals.converter._dispatch('hashBlock.after', text, options, globals);\n return text;\n});\n", "/**\n * Hash and escape elements that should not be parsed as markdown\n */\nshowdown.subParser('hashCodeTags', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('hashCodeTags.before', text, options, globals);\n\n var repFunc = function (wholeMatch, match, left, right) {\n var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;\n return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';\n };\n\n // Hash naked \n text = showdown.helper.replaceRecursiveRegExp(text, repFunc, ']*>', '', 'gim');\n\n text = globals.converter._dispatch('hashCodeTags.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('hashElement', function (text, options, globals) {\n 'use strict';\n\n return function (wholeMatch, m1) {\n var blockText = m1;\n\n // Undo double lines\n blockText = blockText.replace(/\\n\\n/g, '\\n');\n blockText = blockText.replace(/^\\n/, '');\n\n // strip trailing blank lines\n blockText = blockText.replace(/\\n+$/g, '');\n\n // Replace the element text with a marker (\"¨KxK\" where x is its key)\n blockText = '\\n\\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\\n\\n';\n\n return blockText;\n };\n});\n", "showdown.subParser('hashHTMLBlocks', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals);\n\n var blockTags = [\n 'pre',\n 'div',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'blockquote',\n 'table',\n 'dl',\n 'ol',\n 'ul',\n 'script',\n 'noscript',\n 'form',\n 'fieldset',\n 'iframe',\n 'math',\n 'style',\n 'section',\n 'header',\n 'footer',\n 'nav',\n 'article',\n 'aside',\n 'address',\n 'audio',\n 'canvas',\n 'figure',\n 'hgroup',\n 'output',\n 'video',\n 'p'\n ],\n repFunc = function (wholeMatch, match, left, right) {\n var txt = wholeMatch;\n // check if this html element is marked as markdown\n // if so, it's contents should be parsed as markdown\n if (left.search(/\\bmarkdown\\b/) !== -1) {\n txt = left + globals.converter.makeHtml(match) + right;\n }\n return '\\n\\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\\n\\n';\n };\n\n if (options.backslashEscapesHTMLTags) {\n // encode backslash escaped HTML tags\n text = text.replace(/\\\\<(\\/?[^>]+?)>/g, function (wm, inside) {\n return '<' + inside + '>';\n });\n }\n\n // hash HTML Blocks\n for (var i = 0; i < blockTags.length; ++i) {\n\n var opTagPos,\n rgx1 = new RegExp('^ {0,3}(<' + blockTags[i] + '\\\\b[^>]*>)', 'im'),\n patLeft = '<' + blockTags[i] + '\\\\b[^>]*>',\n patRight = '';\n // 1. Look for the first position of the first opening HTML tag in the text\n while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {\n\n // if the HTML tag is \\ escaped, we need to escape it and break\n\n\n //2. Split the text in that position\n var subTexts = showdown.helper.splitAtIndex(text, opTagPos),\n //3. Match recursively\n newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');\n\n // prevent an infinite loop\n if (newSubText1 === subTexts[1]) {\n break;\n }\n text = subTexts[0].concat(newSubText1);\n }\n }\n // HR SPECIAL CASE\n text = text.replace(/(\\n {0,3}(<(hr)\\b([^<>])*?\\/?>)[ \\t]*(?=\\n{2,}))/g,\n showdown.subParser('hashElement')(text, options, globals));\n\n // Special case for standalone HTML comments\n text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {\n return '\\n\\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\\n\\n';\n }, '^ {0,3}', 'gm');\n\n // PHP and ASP-style processor instructions ( and <%...%>)\n text = text.replace(/(?:\\n\\n)( {0,3}(?:<([?%])[^\\r]*?\\2>)[ \\t]*(?=\\n{2,}))/g,\n showdown.subParser('hashElement')(text, options, globals));\n\n text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals);\n return text;\n});\n", "/**\n * Hash span elements that should not be parsed as markdown\n */\nshowdown.subParser('hashHTMLSpans', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals);\n\n function hashHTMLSpan (html) {\n return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C';\n }\n\n // Hash Self Closing tags\n text = text.replace(/<[^>]+?\\/>/gi, function (wm) {\n return hashHTMLSpan(wm);\n });\n\n // Hash tags without properties\n text = text.replace(/<([^>]+?)>[\\s\\S]*?<\\/\\1>/g, function (wm) {\n return hashHTMLSpan(wm);\n });\n\n // Hash tags with properties\n text = text.replace(/<([^>]+?)\\s[^>]+?>[\\s\\S]*?<\\/\\1>/g, function (wm) {\n return hashHTMLSpan(wm);\n });\n\n // Hash self closing tags without />\n text = text.replace(/<[^>]+?>/gi, function (wm) {\n return hashHTMLSpan(wm);\n });\n\n /*showdown.helper.matchRecursiveRegExp(text, ']*>', '', 'gi');*/\n\n text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals);\n return text;\n});\n\n/**\n * Unhash HTML spans\n */\nshowdown.subParser('unhashHTMLSpans', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals);\n\n for (var i = 0; i < globals.gHtmlSpans.length; ++i) {\n var repText = globals.gHtmlSpans[i],\n // limiter to prevent infinite loop (assume 10 as limit for recurse)\n limit = 0;\n\n while (/¨C(\\d+)C/.test(repText)) {\n var num = RegExp.$1;\n repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);\n if (limit === 10) {\n console.error('maximum nesting of 10 spans reached!!!');\n break;\n }\n ++limit;\n }\n text = text.replace('¨C' + i + 'C', repText);\n }\n\n text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals);\n return text;\n});\n", "/**\n * Hash and escape
     elements that should not be parsed as markdown\n */\nshowdown.subParser('hashPreCodeTags', function (text, options, globals) {\n  'use strict';\n  text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals);\n\n  var repFunc = function (wholeMatch, match, left, right) {\n    // encode html entities\n    var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;\n    return '\\n\\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\\n\\n';\n  };\n\n  // Hash 
    \n  text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}]*>\\\\s*]*>', '^ {0,3}\\\\s*
    ', 'gim');\n\n text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('headers', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('headers.before', text, options, globals);\n\n var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),\n\n // Set text-style headers:\n //\tHeader 1\n //\t========\n //\n //\tHeader 2\n //\t--------\n //\n setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \\t]*\\n={2,}[ \\t]*\\n+/gm : /^(.+)[ \\t]*\\n=+[ \\t]*\\n+/gm,\n setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \\t]*\\n-{2,}[ \\t]*\\n+/gm : /^(.+)[ \\t]*\\n-+[ \\t]*\\n+/gm;\n\n text = text.replace(setextRegexH1, function (wholeMatch, m1) {\n\n var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),\n hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m1) + '\"',\n hLevel = headerLevelStart,\n hashBlock = '' + spanGamut + '';\n return showdown.subParser('hashBlock')(hashBlock, options, globals);\n });\n\n text = text.replace(setextRegexH2, function (matchFound, m1) {\n var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),\n hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m1) + '\"',\n hLevel = headerLevelStart + 1,\n hashBlock = '' + spanGamut + '';\n return showdown.subParser('hashBlock')(hashBlock, options, globals);\n });\n\n // atx-style headers:\n // # Header 1\n // ## Header 2\n // ## Header 2 with closing hashes ##\n // ...\n // ###### Header 6\n //\n var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \\t]+(.+?)[ \\t]*#*\\n+/gm : /^(#{1,6})[ \\t]*(.+?)[ \\t]*#*\\n+/gm;\n\n text = text.replace(atxStyle, function (wholeMatch, m1, m2) {\n var hText = m2;\n if (options.customizedHeaderId) {\n hText = m2.replace(/\\s?\\{([^{]+?)}\\s*$/, '');\n }\n\n var span = showdown.subParser('spanGamut')(hText, options, globals),\n hID = (options.noHeaderId) ? '' : ' id=\"' + headerId(m2) + '\"',\n hLevel = headerLevelStart - 1 + m1.length,\n header = '' + span + '';\n\n return showdown.subParser('hashBlock')(header, options, globals);\n });\n\n function headerId (m) {\n var title,\n prefix;\n\n // It is separate from other options to allow combining prefix and customized\n if (options.customizedHeaderId) {\n var match = m.match(/\\{([^{]+?)}\\s*$/);\n if (match && match[1]) {\n m = match[1];\n }\n }\n\n title = m;\n\n // Prefix id to prevent causing inadvertent pre-existing style matches.\n if (showdown.helper.isString(options.prefixHeaderId)) {\n prefix = options.prefixHeaderId;\n } else if (options.prefixHeaderId === true) {\n prefix = 'section-';\n } else {\n prefix = '';\n }\n\n if (!options.rawPrefixHeaderId) {\n title = prefix + title;\n }\n\n if (options.ghCompatibleHeaderId) {\n title = title\n .replace(/ /g, '-')\n // replace previously escaped chars (&, ¨ and $)\n .replace(/&/g, '')\n .replace(/¨T/g, '')\n .replace(/¨D/g, '')\n // replace rest of the chars (&~$ are repeated as they might have been escaped)\n // borrowed from github's redcarpet (some they should produce similar results)\n .replace(/[&+$,\\/:;=?@\"#{}|^¨~\\[\\]`\\\\*)(%.!'<>]/g, '')\n .toLowerCase();\n } else if (options.rawHeaderId) {\n title = title\n .replace(/ /g, '-')\n // replace previously escaped chars (&, ¨ and $)\n .replace(/&/g, '&')\n .replace(/¨T/g, '¨')\n .replace(/¨D/g, '$')\n // replace \" and '\n .replace(/[\"']/g, '-')\n .toLowerCase();\n } else {\n title = title\n .replace(/[^\\w]/g, '')\n .toLowerCase();\n }\n\n if (options.rawPrefixHeaderId) {\n title = prefix + title;\n }\n\n if (globals.hashLinkCounts[title]) {\n title = title + '-' + (globals.hashLinkCounts[title]++);\n } else {\n globals.hashLinkCounts[title] = 1;\n }\n return title;\n }\n\n text = globals.converter._dispatch('headers.after', text, options, globals);\n return text;\n});\n", "/**\n * Turn Markdown link shortcuts into XHTML tags.\n */\nshowdown.subParser('horizontalRule', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('horizontalRule.before', text, options, globals);\n\n var key = showdown.subParser('hashBlock')('
    ', options, globals);\n text = text.replace(/^ {0,2}( ?-){3,}[ \\t]*$/gm, key);\n text = text.replace(/^ {0,2}( ?\\*){3,}[ \\t]*$/gm, key);\n text = text.replace(/^ {0,2}( ?_){3,}[ \\t]*$/gm, key);\n\n text = globals.converter._dispatch('horizontalRule.after', text, options, globals);\n return text;\n});\n", "/**\n * Turn Markdown image shortcuts into tags.\n */\nshowdown.subParser('images', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('images.before', text, options, globals);\n\n var inlineRegExp = /!\\[([^\\]]*?)][ \\t]*()\\([ \\t]??(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*(?:([\"'])([^\"]*?)\\6)?[ \\t]?\\)/g,\n crazyRegExp = /!\\[([^\\]]*?)][ \\t]*()\\([ \\t]?<([^>]*)>(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*(?:(?:([\"'])([^\"]*?)\\6))?[ \\t]?\\)/g,\n base64RegExp = /!\\[([^\\]]*?)][ \\t]*()\\([ \\t]??(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*(?:([\"'])([^\"]*?)\\6)?[ \\t]?\\)/g,\n referenceRegExp = /!\\[([^\\]]*?)] ?(?:\\n *)?\\[([\\s\\S]*?)]()()()()()/g,\n refShortcutRegExp = /!\\[([^\\[\\]]+)]()()()()()/g;\n\n function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {\n url = url.replace(/\\s/g, '');\n return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);\n }\n\n function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {\n\n var gUrls = globals.gUrls,\n gTitles = globals.gTitles,\n gDims = globals.gDimensions;\n\n linkId = linkId.toLowerCase();\n\n if (!title) {\n title = '';\n }\n // Special case for explicit empty url\n if (wholeMatch.search(/\\(? ?(['\"].*['\"])?\\)$/m) > -1) {\n url = '';\n\n } else if (url === '' || url === null) {\n if (linkId === '' || linkId === null) {\n // lower-case and turn embedded newlines into spaces\n linkId = altText.toLowerCase().replace(/ ?\\n/g, ' ');\n }\n url = '#' + linkId;\n\n if (!showdown.helper.isUndefined(gUrls[linkId])) {\n url = gUrls[linkId];\n if (!showdown.helper.isUndefined(gTitles[linkId])) {\n title = gTitles[linkId];\n }\n if (!showdown.helper.isUndefined(gDims[linkId])) {\n width = gDims[linkId].width;\n height = gDims[linkId].height;\n }\n } else {\n return wholeMatch;\n }\n }\n\n altText = altText\n .replace(/\"/g, '"')\n //altText = showdown.helper.escapeCharacters(altText, '*_', false);\n .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);\n //url = showdown.helper.escapeCharacters(url, '*_', false);\n url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);\n var result = '\"'x \"optional title\")\n\n // base64 encoded images\n text = text.replace(base64RegExp, writeImageTagBase64);\n\n // cases with crazy urls like ./image/cat1).png\n text = text.replace(crazyRegExp, writeImageTag);\n\n // normal cases\n text = text.replace(inlineRegExp, writeImageTag);\n\n // handle reference-style shortcuts: ![img text]\n text = text.replace(refShortcutRegExp, writeImageTag);\n\n text = globals.converter._dispatch('images.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('italicsAndBold', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);\n\n // it's faster to have 3 separate regexes for each case than have just one\n // because of backtracing, in some cases, it could lead to an exponential effect\n // called \"catastrophic backtrace\". Ominous!\n\n function parseInside (txt, left, right) {\n /*\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n */\n return left + txt + right;\n }\n\n // Parse underscores\n if (options.literalMidWordUnderscores) {\n text = text.replace(/\\b___(\\S[\\s\\S]*?)___\\b/g, function (wm, txt) {\n return parseInside (txt, '', '');\n });\n text = text.replace(/\\b__(\\S[\\s\\S]*?)__\\b/g, function (wm, txt) {\n return parseInside (txt, '', '');\n });\n text = text.replace(/\\b_(\\S[\\s\\S]*?)_\\b/g, function (wm, txt) {\n return parseInside (txt, '', '');\n });\n } else {\n text = text.replace(/___(\\S[\\s\\S]*?)___/g, function (wm, m) {\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n text = text.replace(/__(\\S[\\s\\S]*?)__/g, function (wm, m) {\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n text = text.replace(/_([^\\s_][\\s\\S]*?)_/g, function (wm, m) {\n // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it)\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n }\n\n // Now parse asterisks\n if (options.literalMidWordAsterisks) {\n text = text.replace(/([^*]|^)\\B\\*\\*\\*(\\S[\\s\\S]*?)\\*\\*\\*\\B(?!\\*)/g, function (wm, lead, txt) {\n return parseInside (txt, lead + '', '');\n });\n text = text.replace(/([^*]|^)\\B\\*\\*(\\S[\\s\\S]*?)\\*\\*\\B(?!\\*)/g, function (wm, lead, txt) {\n return parseInside (txt, lead + '', '');\n });\n text = text.replace(/([^*]|^)\\B\\*(\\S[\\s\\S]*?)\\*\\B(?!\\*)/g, function (wm, lead, txt) {\n return parseInside (txt, lead + '', '');\n });\n } else {\n text = text.replace(/\\*\\*\\*(\\S[\\s\\S]*?)\\*\\*\\*/g, function (wm, m) {\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n text = text.replace(/\\*\\*(\\S[\\s\\S]*?)\\*\\*/g, function (wm, m) {\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n text = text.replace(/\\*([^\\s*][\\s\\S]*?)\\*/g, function (wm, m) {\n // !/^\\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it)\n return (/\\S$/.test(m)) ? parseInside (m, '', '') : wm;\n });\n }\n\n\n text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);\n return text;\n});\n", "/**\n * Form HTML ordered (numbered) and unordered (bulleted) lists.\n */\nshowdown.subParser('lists', function (text, options, globals) {\n 'use strict';\n\n /**\n * Process the contents of a single ordered or unordered list, splitting it\n * into individual list items.\n * @param {string} listStr\n * @param {boolean} trimTrailing\n * @returns {string}\n */\n function processListItems (listStr, trimTrailing) {\n // The $g_list_level global keeps track of when we're inside a list.\n // Each time we enter a list, we increment it; when we leave a list,\n // we decrement. If it's zero, we're not in a list anymore.\n //\n // We do this because when we're not inside a list, we want to treat\n // something like this:\n //\n // I recommend upgrading to version\n // 8. Oops, now this line is treated\n // as a sub-list.\n //\n // As a single paragraph, despite the fact that the second line starts\n // with a digit-period-space sequence.\n //\n // Whereas when we're inside a list (or sub-list), that line will be\n // treated as the start of a sub-list. What a kludge, huh? This is\n // an aspect of Markdown's syntax that's hard to parse perfectly\n // without resorting to mind-reading. Perhaps the solution is to\n // change the syntax rules such that sub-lists must start with a\n // starting cardinal number; e.g. \"1.\" or \"a.\".\n globals.gListLevel++;\n\n // trim trailing blank lines:\n listStr = listStr.replace(/\\n{2,}$/, '\\n');\n\n // attacklab: add sentinel to emulate \\z\n listStr += '¨0';\n\n var rgx = /(\\n)?(^ {0,3})([*+-]|\\d+[.])[ \\t]+((\\[(x|X| )?])?[ \\t]*[^\\r]+?(\\n{1,2}))(?=\\n*(¨0| {0,3}([*+-]|\\d+[.])[ \\t]+))/gm,\n isParagraphed = (/\\n[ \\t]*\\n(?!¨0)/.test(listStr));\n\n // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation,\n // which is a syntax breaking change\n // activating this option reverts to old behavior\n if (options.disableForced4SpacesIndentedSublists) {\n rgx = /(\\n)?(^ {0,3})([*+-]|\\d+[.])[ \\t]+((\\[(x|X| )?])?[ \\t]*[^\\r]+?(\\n{1,2}))(?=\\n*(¨0|\\2([*+-]|\\d+[.])[ \\t]+))/gm;\n }\n\n listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {\n checked = (checked && checked.trim() !== '');\n\n var item = showdown.subParser('outdent')(m4, options, globals),\n bulletStyle = '';\n\n // Support for github tasklists\n if (taskbtn && options.tasklists) {\n bulletStyle = ' class=\"task-list-item\" style=\"list-style-type: none;\"';\n item = item.replace(/^[ \\t]*\\[(x|X| )?]/m, function () {\n var otp = '
  • a
  • \n // instead of:\n //
    • - - a
    \n // So, to prevent it, we will put a marker (¨A)in the beginning of the line\n // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser\n item = item.replace(/^([-*+]|\\d\\.)[ \\t]+[\\S\\n ]*/g, function (wm2) {\n return '¨A' + wm2;\n });\n\n // m1 - Leading line or\n // Has a double return (multi paragraph) or\n // Has sublist\n if (m1 || (item.search(/\\n{2,}/) > -1)) {\n item = showdown.subParser('githubCodeBlocks')(item, options, globals);\n item = showdown.subParser('blockGamut')(item, options, globals);\n } else {\n // Recursion for sub-lists:\n item = showdown.subParser('lists')(item, options, globals);\n item = item.replace(/\\n$/, ''); // chomp(item)\n item = showdown.subParser('hashHTMLBlocks')(item, options, globals);\n\n // Colapse double linebreaks\n item = item.replace(/\\n\\n+/g, '\\n\\n');\n if (isParagraphed) {\n item = showdown.subParser('paragraphs')(item, options, globals);\n } else {\n item = showdown.subParser('spanGamut')(item, options, globals);\n }\n }\n\n // now we need to remove the marker (¨A)\n item = item.replace('¨A', '');\n // we can finally wrap the line in list item tags\n item = '' + item + '\\n';\n\n return item;\n });\n\n // attacklab: strip sentinel\n listStr = listStr.replace(/¨0/g, '');\n\n globals.gListLevel--;\n\n if (trimTrailing) {\n listStr = listStr.replace(/\\s+$/, '');\n }\n\n return listStr;\n }\n\n function styleStartNumber (list, listType) {\n // check if ol and starts by a number different than 1\n if (listType === 'ol') {\n var res = list.match(/^ *(\\d+)\\./);\n if (res && res[1] !== '1') {\n return ' start=\"' + res[1] + '\"';\n }\n }\n return '';\n }\n\n /**\n * Check and parse consecutive lists (better fix for issue #142)\n * @param {string} list\n * @param {string} listType\n * @param {boolean} trimTrailing\n * @returns {string}\n */\n function parseConsecutiveLists (list, listType, trimTrailing) {\n // check if we caught 2 or more consecutive lists by mistake\n // we use the counterRgx, meaning if listType is UL we look for OL and vice versa\n var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\\d+\\.[ \\t]/gm : /^ {0,3}\\d+\\.[ \\t]/gm,\n ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \\t]/gm : /^ {0,3}[*+-][ \\t]/gm,\n counterRxg = (listType === 'ul') ? olRgx : ulRgx,\n result = '';\n\n if (list.search(counterRxg) !== -1) {\n (function parseCL (txt) {\n var pos = txt.search(counterRxg),\n style = styleStartNumber(list, listType);\n if (pos !== -1) {\n // slice\n result += '\\n\\n<' + listType + style + '>\\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '\\n';\n\n // invert counterType and listType\n listType = (listType === 'ul') ? 'ol' : 'ul';\n counterRxg = (listType === 'ul') ? olRgx : ulRgx;\n\n //recurse\n parseCL(txt.slice(pos));\n } else {\n result += '\\n\\n<' + listType + style + '>\\n' + processListItems(txt, !!trimTrailing) + '\\n';\n }\n })(list);\n } else {\n var style = styleStartNumber(list, listType);\n result = '\\n\\n<' + listType + style + '>\\n' + processListItems(list, !!trimTrailing) + '\\n';\n }\n\n return result;\n }\n\n /** Start of list parsing **/\n text = globals.converter._dispatch('lists.before', text, options, globals);\n // add sentinel to hack around khtml/safari bug:\n // http://bugs.webkit.org/show_bug.cgi?id=11231\n text += '¨0';\n\n if (globals.gListLevel) {\n text = text.replace(/^(( {0,3}([*+-]|\\d+[.])[ \\t]+)[^\\r]+?(¨0|\\n{2,}(?=\\S)(?![ \\t]*(?:[*+-]|\\d+[.])[ \\t]+)))/gm,\n function (wholeMatch, list, m2) {\n var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';\n return parseConsecutiveLists(list, listType, true);\n }\n );\n } else {\n text = text.replace(/(\\n\\n|^\\n?)(( {0,3}([*+-]|\\d+[.])[ \\t]+)[^\\r]+?(¨0|\\n{2,}(?=\\S)(?![ \\t]*(?:[*+-]|\\d+[.])[ \\t]+)))/gm,\n function (wholeMatch, m1, list, m3) {\n var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';\n return parseConsecutiveLists(list, listType, false);\n }\n );\n }\n\n // strip sentinel\n text = text.replace(/¨0/, '');\n text = globals.converter._dispatch('lists.after', text, options, globals);\n return text;\n});\n", "/**\n * Parse metadata at the top of the document\n */\nshowdown.subParser('metadata', function (text, options, globals) {\n 'use strict';\n\n if (!options.metadata) {\n return text;\n }\n\n text = globals.converter._dispatch('metadata.before', text, options, globals);\n\n function parseMetadataContents (content) {\n // raw is raw so it's not changed in any way\n globals.metadata.raw = content;\n\n // escape chars forbidden in html attributes\n // double quotes\n content = content\n // ampersand first\n .replace(/&/g, '&')\n // double quotes\n .replace(/\"/g, '"');\n\n content = content.replace(/\\n {4}/g, ' ');\n content.replace(/^([\\S ]+): +([\\s\\S]+?)$/gm, function (wm, key, value) {\n globals.metadata.parsed[key] = value;\n return '';\n });\n }\n\n text = text.replace(/^\\s*«««+(\\S*?)\\n([\\s\\S]+?)\\n»»»+\\n/, function (wholematch, format, content) {\n parseMetadataContents(content);\n return '¨M';\n });\n\n text = text.replace(/^\\s*---+(\\S*?)\\n([\\s\\S]+?)\\n---+\\n/, function (wholematch, format, content) {\n if (format) {\n globals.metadata.format = format;\n }\n parseMetadataContents(content);\n return '¨M';\n });\n\n text = text.replace(/¨M/g, '');\n\n text = globals.converter._dispatch('metadata.after', text, options, globals);\n return text;\n});\n", "/**\n * Remove one level of line-leading tabs or spaces\n */\nshowdown.subParser('outdent', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('outdent.before', text, options, globals);\n\n // attacklab: hack around Konqueror 3.5.4 bug:\n // \"----------bug\".replace(/^-/g,\"\") == \"bug\"\n text = text.replace(/^(\\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width\n\n // attacklab: clean up hack\n text = text.replace(/¨0/g, '');\n\n text = globals.converter._dispatch('outdent.after', text, options, globals);\n return text;\n});\n", "/**\n *\n */\nshowdown.subParser('paragraphs', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('paragraphs.before', text, options, globals);\n // Strip leading and trailing lines:\n text = text.replace(/^\\n+/g, '');\n text = text.replace(/\\n+$/g, '');\n\n var grafs = text.split(/\\n{2,}/g),\n grafsOut = [],\n end = grafs.length; // Wrap

    tags\n\n for (var i = 0; i < end; i++) {\n var str = grafs[i];\n // if this is an HTML marker, copy it\n if (str.search(/¨(K|G)(\\d+)\\1/g) >= 0) {\n grafsOut.push(str);\n\n // test for presence of characters to prevent empty lines being parsed\n // as paragraphs (resulting in undesired extra empty paragraphs)\n } else if (str.search(/\\S/) >= 0) {\n str = showdown.subParser('spanGamut')(str, options, globals);\n str = str.replace(/^([ \\t]*)/g, '

    ');\n str += '

    ';\n grafsOut.push(str);\n }\n }\n\n /** Unhashify HTML blocks */\n end = grafsOut.length;\n for (i = 0; i < end; i++) {\n var blockText = '',\n grafsOutIt = grafsOut[i],\n codeFlag = false;\n // if this is a marker for an html block...\n // use RegExp.test instead of string.search because of QML bug\n while (/¨(K|G)(\\d+)\\1/.test(grafsOutIt)) {\n var delim = RegExp.$1,\n num = RegExp.$2;\n\n if (delim === 'K') {\n blockText = globals.gHtmlBlocks[num];\n } else {\n // we need to check if ghBlock is a false positive\n if (codeFlag) {\n // use encoded version of all text\n blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals);\n } else {\n blockText = globals.ghCodeBlocks[num].codeblock;\n }\n }\n blockText = blockText.replace(/\\$/g, '$$$$'); // Escape any dollar signs\n\n grafsOutIt = grafsOutIt.replace(/(\\n\\n)?¨(K|G)\\d+\\2(\\n\\n)?/, blockText);\n // Check if grafsOutIt is a pre->code\n if (/^]*>\\s*]*>/.test(grafsOutIt)) {\n codeFlag = true;\n }\n }\n grafsOut[i] = grafsOutIt;\n }\n text = grafsOut.join('\\n');\n // Strip leading and trailing lines:\n text = text.replace(/^\\n+/g, '');\n text = text.replace(/\\n+$/g, '');\n return globals.converter._dispatch('paragraphs.after', text, options, globals);\n});\n", "/**\n * Run extension\n */\nshowdown.subParser('runExtension', function (ext, text, options, globals) {\n 'use strict';\n\n if (ext.filter) {\n text = ext.filter(text, globals.converter, options);\n\n } else if (ext.regex) {\n // TODO remove this when old extension loading mechanism is deprecated\n var re = ext.regex;\n if (!(re instanceof RegExp)) {\n re = new RegExp(re, 'g');\n }\n text = text.replace(re, ext.replace);\n }\n\n return text;\n});\n", "/**\n * These are all the transformations that occur *within* block-level\n * tags like paragraphs, headers, and list items.\n */\nshowdown.subParser('spanGamut', function (text, options, globals) {\n 'use strict';\n\n text = globals.converter._dispatch('spanGamut.before', text, options, globals);\n text = showdown.subParser('codeSpans')(text, options, globals);\n text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);\n text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);\n\n // Process anchor and image tags. Images must come first,\n // because ![foo][f] looks like an anchor.\n text = showdown.subParser('images')(text, options, globals);\n text = showdown.subParser('anchors')(text, options, globals);\n\n // Make links out of things like ``\n // Must come after anchors, because you can use < and >\n // delimiters in inline links like [this]().\n text = showdown.subParser('autoLinks')(text, options, globals);\n text = showdown.subParser('simplifiedAutoLinks')(text, options, globals);\n text = showdown.subParser('emoji')(text, options, globals);\n text = showdown.subParser('underline')(text, options, globals);\n text = showdown.subParser('italicsAndBold')(text, options, globals);\n text = showdown.subParser('strikethrough')(text, options, globals);\n text = showdown.subParser('ellipsis')(text, options, globals);\n\n // we need to hash HTML tags inside spans\n text = showdown.subParser('hashHTMLSpans')(text, options, globals);\n\n // now we encode amps and angles\n text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);\n\n // Do hard breaks\n if (options.simpleLineBreaks) {\n // GFM style hard breaks\n // only add line breaks if the text does not contain a block (special case for lists)\n if (!/\\n\\n¨K/.test(text)) {\n text = text.replace(/\\n+/g, '
    \\n');\n }\n } else {\n // Vanilla hard breaks\n text = text.replace(/ +\\n/g, '
    \\n');\n }\n\n text = globals.converter._dispatch('spanGamut.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('strikethrough', function (text, options, globals) {\n 'use strict';\n\n function parseInside (txt) {\n if (options.simplifiedAutoLink) {\n txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);\n }\n return '' + txt + '';\n }\n\n if (options.strikethrough) {\n text = globals.converter._dispatch('strikethrough.before', text, options, globals);\n text = text.replace(/(?:~){2}([\\s\\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); });\n text = globals.converter._dispatch('strikethrough.after', text, options, globals);\n }\n\n return text;\n});\n", "/**\n * Strips link definitions from text, stores the URLs and titles in\n * hash references.\n * Link defs are in the form: ^[id]: url \"optional title\"\n */\nshowdown.subParser('stripLinkDefinitions', function (text, options, globals) {\n 'use strict';\n\n var regex = /^ {0,3}\\[([^\\]]+)]:[ \\t]*\\n?[ \\t]*\\s]+)>?(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*\\n?[ \\t]*(?:(\\n*)[\"|'(](.+?)[\"|')][ \\t]*)?(?:\\n+|(?=¨0))/gm,\n base64Regex = /^ {0,3}\\[([^\\]]+)]:[ \\t]*\\n?[ \\t]*?(?: =([*\\d]+[A-Za-z%]{0,4})x([*\\d]+[A-Za-z%]{0,4}))?[ \\t]*\\n?[ \\t]*(?:(\\n*)[\"|'(](.+?)[\"|')][ \\t]*)?(?:\\n\\n|(?=¨0)|(?=\\n\\[))/gm;\n\n // attacklab: sentinel workarounds for lack of \\A and \\Z, safari\\khtml bug\n text += '¨0';\n\n var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {\n\n // if there aren't two instances of linkId it must not be a reference link so back out\n linkId = linkId.toLowerCase();\n if (text.toLowerCase().split(linkId).length - 1 < 2) {\n return wholeMatch;\n }\n if (url.match(/^data:.+?\\/.+?;base64,/)) {\n // remove newlines\n globals.gUrls[linkId] = url.replace(/\\s/g, '');\n } else {\n globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals); // Link IDs are case-insensitive\n }\n\n if (blankLines) {\n // Oops, found blank lines, so it's not a title.\n // Put back the parenthetical statement we stole.\n return blankLines + title;\n\n } else {\n if (title) {\n globals.gTitles[linkId] = title.replace(/\"|'/g, '"');\n }\n if (options.parseImgDimensions && width && height) {\n globals.gDimensions[linkId] = {\n width: width,\n height: height\n };\n }\n }\n // Completely remove the definition from the text\n return '';\n };\n\n // first we try to find base64 link references\n text = text.replace(base64Regex, replaceFunc);\n\n text = text.replace(regex, replaceFunc);\n\n // attacklab: strip sentinel\n text = text.replace(/¨0/, '');\n\n return text;\n});\n", "showdown.subParser('tables', function (text, options, globals) {\n 'use strict';\n\n if (!options.tables) {\n return text;\n }\n\n var tableRgx = /^ {0,3}\\|?.+\\|.+\\n {0,3}\\|?[ \\t]*:?[ \\t]*(?:[-=]){2,}[ \\t]*:?[ \\t]*\\|[ \\t]*:?[ \\t]*(?:[-=]){2,}[\\s\\S]+?(?:\\n\\n|¨0)/gm,\n //singeColTblRgx = /^ {0,3}\\|.+\\|\\n {0,3}\\|[ \\t]*:?[ \\t]*(?:[-=]){2,}[ \\t]*:?[ \\t]*\\|[ \\t]*\\n(?: {0,3}\\|.+\\|\\n)+(?:\\n\\n|¨0)/gm;\n singeColTblRgx = /^ {0,3}\\|.+\\|[ \\t]*\\n {0,3}\\|[ \\t]*:?[ \\t]*(?:[-=]){2,}[ \\t]*:?[ \\t]*\\|[ \\t]*\\n( {0,3}\\|.+\\|[ \\t]*\\n)*(?:\\n|¨0)/gm;\n\n function parseStyles (sLine) {\n if (/^:[ \\t]*--*$/.test(sLine)) {\n return ' style=\"text-align:left;\"';\n } else if (/^--*[ \\t]*:[ \\t]*$/.test(sLine)) {\n return ' style=\"text-align:right;\"';\n } else if (/^:[ \\t]*--*[ \\t]*:$/.test(sLine)) {\n return ' style=\"text-align:center;\"';\n } else {\n return '';\n }\n }\n\n function parseHeaders (header, style) {\n var id = '';\n header = header.trim();\n // support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility\n if (options.tablesHeaderId || options.tableHeaderId) {\n id = ' id=\"' + header.replace(/ /g, '_').toLowerCase() + '\"';\n }\n header = showdown.subParser('spanGamut')(header, options, globals);\n\n return '' + header + '\\n';\n }\n\n function parseCells (cell, style) {\n var subText = showdown.subParser('spanGamut')(cell, options, globals);\n return '' + subText + '\\n';\n }\n\n function buildTable (headers, cells) {\n var tb = '\\n\\n\\n',\n tblLgn = headers.length;\n\n for (var i = 0; i < tblLgn; ++i) {\n tb += headers[i];\n }\n tb += '\\n\\n\\n';\n\n for (i = 0; i < cells.length; ++i) {\n tb += '\\n';\n for (var ii = 0; ii < tblLgn; ++ii) {\n tb += cells[i][ii];\n }\n tb += '\\n';\n }\n tb += '\\n
    \\n';\n return tb;\n }\n\n function parseTable (rawTable) {\n var i, tableLines = rawTable.split('\\n');\n\n for (i = 0; i < tableLines.length; ++i) {\n // strip wrong first and last column if wrapped tables are used\n if (/^ {0,3}\\|/.test(tableLines[i])) {\n tableLines[i] = tableLines[i].replace(/^ {0,3}\\|/, '');\n }\n if (/\\|[ \\t]*$/.test(tableLines[i])) {\n tableLines[i] = tableLines[i].replace(/\\|[ \\t]*$/, '');\n }\n // parse code spans first, but we only support one line code spans\n tableLines[i] = showdown.subParser('codeSpans')(tableLines[i], options, globals);\n }\n\n var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),\n rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),\n rawCells = [],\n headers = [],\n styles = [],\n cells = [];\n\n tableLines.shift();\n tableLines.shift();\n\n for (i = 0; i < tableLines.length; ++i) {\n if (tableLines[i].trim() === '') {\n continue;\n }\n rawCells.push(\n tableLines[i]\n .split('|')\n .map(function (s) {\n return s.trim();\n })\n );\n }\n\n if (rawHeaders.length < rawStyles.length) {\n return rawTable;\n }\n\n for (i = 0; i < rawStyles.length; ++i) {\n styles.push(parseStyles(rawStyles[i]));\n }\n\n for (i = 0; i < rawHeaders.length; ++i) {\n if (showdown.helper.isUndefined(styles[i])) {\n styles[i] = '';\n }\n headers.push(parseHeaders(rawHeaders[i], styles[i]));\n }\n\n for (i = 0; i < rawCells.length; ++i) {\n var row = [];\n for (var ii = 0; ii < headers.length; ++ii) {\n if (showdown.helper.isUndefined(rawCells[i][ii])) {\n\n }\n row.push(parseCells(rawCells[i][ii], styles[ii]));\n }\n cells.push(row);\n }\n\n return buildTable(headers, cells);\n }\n\n text = globals.converter._dispatch('tables.before', text, options, globals);\n\n // find escaped pipe characters\n text = text.replace(/\\\\(\\|)/g, showdown.helper.escapeCharactersCallback);\n\n // parse multi column tables\n text = text.replace(tableRgx, parseTable);\n\n // parse one column tables\n text = text.replace(singeColTblRgx, parseTable);\n\n text = globals.converter._dispatch('tables.after', text, options, globals);\n\n return text;\n});\n", "showdown.subParser('underline', function (text, options, globals) {\n 'use strict';\n\n if (!options.underline) {\n return text;\n }\n\n text = globals.converter._dispatch('underline.before', text, options, globals);\n\n if (options.literalMidWordUnderscores) {\n text = text.replace(/\\b___(\\S[\\s\\S]*?)___\\b/g, function (wm, txt) {\n return '' + txt + '';\n });\n text = text.replace(/\\b__(\\S[\\s\\S]*?)__\\b/g, function (wm, txt) {\n return '' + txt + '';\n });\n } else {\n text = text.replace(/___(\\S[\\s\\S]*?)___/g, function (wm, m) {\n return (/\\S$/.test(m)) ? '' + m + '' : wm;\n });\n text = text.replace(/__(\\S[\\s\\S]*?)__/g, function (wm, m) {\n return (/\\S$/.test(m)) ? '' + m + '' : wm;\n });\n }\n\n // escape remaining underscores to prevent them being parsed by italic and bold\n text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);\n\n text = globals.converter._dispatch('underline.after', text, options, globals);\n\n return text;\n});\n", "/**\n * Swap back in all the special characters we've hidden.\n */\nshowdown.subParser('unescapeSpecialChars', function (text, options, globals) {\n 'use strict';\n text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);\n\n text = text.replace(/¨E(\\d+)E/g, function (wholeMatch, m1) {\n var charCodeToReplace = parseInt(m1);\n return String.fromCharCode(charCodeToReplace);\n });\n\n text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);\n return text;\n});\n", "showdown.subParser('makeMarkdown.blockquote', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n var children = node.childNodes,\n childrenLength = children.length;\n\n for (var i = 0; i < childrenLength; ++i) {\n var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals);\n\n if (innerTxt === '') {\n continue;\n }\n txt += innerTxt;\n }\n }\n // cleanup\n txt = txt.trim();\n txt = '> ' + txt.split('\\n').join('\\n> ');\n return txt;\n});\n", "showdown.subParser('makeMarkdown.codeBlock', function (node, globals) {\n 'use strict';\n\n var lang = node.getAttribute('language'),\n num = node.getAttribute('precodenum');\n return '```' + lang + '\\n' + globals.preList[num] + '\\n```';\n});\n", "showdown.subParser('makeMarkdown.codeSpan', function (node) {\n 'use strict';\n\n return '`' + node.innerHTML + '`';\n});\n", "showdown.subParser('makeMarkdown.emphasis', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n txt += '*';\n var children = node.childNodes,\n childrenLength = children.length;\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n txt += '*';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) {\n 'use strict';\n\n var headerMark = new Array(headerLevel + 1).join('#'),\n txt = '';\n\n if (node.hasChildNodes()) {\n txt = headerMark + ' ';\n var children = node.childNodes,\n childrenLength = children.length;\n\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.hr', function () {\n 'use strict';\n\n return '---';\n});\n", "showdown.subParser('makeMarkdown.image', function (node) {\n 'use strict';\n\n var txt = '';\n if (node.hasAttribute('src')) {\n txt += '![' + node.getAttribute('alt') + '](';\n txt += '<' + node.getAttribute('src') + '>';\n if (node.hasAttribute('width') && node.hasAttribute('height')) {\n txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height');\n }\n\n if (node.hasAttribute('title')) {\n txt += ' \"' + node.getAttribute('title') + '\"';\n }\n txt += ')';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.links', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes() && node.hasAttribute('href')) {\n var children = node.childNodes,\n childrenLength = children.length;\n txt = '[';\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n txt += '](';\n txt += '<' + node.getAttribute('href') + '>';\n if (node.hasAttribute('title')) {\n txt += ' \"' + node.getAttribute('title') + '\"';\n }\n txt += ')';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.list', function (node, globals, type) {\n 'use strict';\n\n var txt = '';\n if (!node.hasChildNodes()) {\n return '';\n }\n var listItems = node.childNodes,\n listItemsLenght = listItems.length,\n listNum = node.getAttribute('start') || 1;\n\n for (var i = 0; i < listItemsLenght; ++i) {\n if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {\n continue;\n }\n\n // define the bullet to use in list\n var bullet = '';\n if (type === 'ol') {\n bullet = listNum.toString() + '. ';\n } else {\n bullet = '- ';\n }\n\n // parse list item\n txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals);\n ++listNum;\n }\n\n // add comment at the end to prevent consecutive lists to be parsed as one\n txt += '\\n\\n';\n return txt.trim();\n});\n", "showdown.subParser('makeMarkdown.listItem', function (node, globals) {\n 'use strict';\n\n var listItemTxt = '';\n\n var children = node.childNodes,\n childrenLenght = children.length;\n\n for (var i = 0; i < childrenLenght; ++i) {\n listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n // if it's only one liner, we need to add a newline at the end\n if (!/\\n$/.test(listItemTxt)) {\n listItemTxt += '\\n';\n } else {\n // it's multiparagraph, so we need to indent\n listItemTxt = listItemTxt\n .split('\\n')\n .join('\\n ')\n .replace(/^ {4}$/gm, '')\n .replace(/\\n\\n+/g, '\\n\\n');\n }\n\n return listItemTxt;\n});\n", "\n\nshowdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {\n 'use strict';\n\n spansOnly = spansOnly || false;\n\n var txt = '';\n\n // edge case of text without wrapper paragraph\n if (node.nodeType === 3) {\n return showdown.subParser('makeMarkdown.txt')(node, globals);\n }\n\n // HTML comment\n if (node.nodeType === 8) {\n return '\\n\\n';\n }\n\n // process only node elements\n if (node.nodeType !== 1) {\n return '';\n }\n\n var tagName = node.tagName.toLowerCase();\n\n switch (tagName) {\n\n //\n // BLOCKS\n //\n case 'h1':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\\n\\n'; }\n break;\n case 'h2':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\\n\\n'; }\n break;\n case 'h3':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\\n\\n'; }\n break;\n case 'h4':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\\n\\n'; }\n break;\n case 'h5':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\\n\\n'; }\n break;\n case 'h6':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\\n\\n'; }\n break;\n\n case 'p':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\\n\\n'; }\n break;\n\n case 'blockquote':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\\n\\n'; }\n break;\n\n case 'hr':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\\n\\n'; }\n break;\n\n case 'ol':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\\n\\n'; }\n break;\n\n case 'ul':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\\n\\n'; }\n break;\n\n case 'precode':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\\n\\n'; }\n break;\n\n case 'pre':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\\n\\n'; }\n break;\n\n case 'table':\n if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\\n\\n'; }\n break;\n\n //\n // SPANS\n //\n case 'code':\n txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals);\n break;\n\n case 'em':\n case 'i':\n txt = showdown.subParser('makeMarkdown.emphasis')(node, globals);\n break;\n\n case 'strong':\n case 'b':\n txt = showdown.subParser('makeMarkdown.strong')(node, globals);\n break;\n\n case 'del':\n txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals);\n break;\n\n case 'a':\n txt = showdown.subParser('makeMarkdown.links')(node, globals);\n break;\n\n case 'img':\n txt = showdown.subParser('makeMarkdown.image')(node, globals);\n break;\n\n default:\n txt = node.outerHTML + '\\n\\n';\n }\n\n // common normalization\n // TODO eventually\n\n return txt;\n});\n", "showdown.subParser('makeMarkdown.paragraph', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n var children = node.childNodes,\n childrenLength = children.length;\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n }\n\n // some text normalization\n txt = txt.trim();\n\n return txt;\n});\n", "showdown.subParser('makeMarkdown.pre', function (node, globals) {\n 'use strict';\n\n var num = node.getAttribute('prenum');\n return '
    ' + globals.preList[num] + '
    ';\n});\n", "showdown.subParser('makeMarkdown.strikethrough', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n txt += '~~';\n var children = node.childNodes,\n childrenLength = children.length;\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n txt += '~~';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.strong', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (node.hasChildNodes()) {\n txt += '**';\n var children = node.childNodes,\n childrenLength = children.length;\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals);\n }\n txt += '**';\n }\n return txt;\n});\n", "showdown.subParser('makeMarkdown.table', function (node, globals) {\n 'use strict';\n\n var txt = '',\n tableArray = [[], []],\n headings = node.querySelectorAll('thead>tr>th'),\n rows = node.querySelectorAll('tbody>tr'),\n i, ii;\n for (i = 0; i < headings.length; ++i) {\n var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),\n allign = '---';\n\n if (headings[i].hasAttribute('style')) {\n var style = headings[i].getAttribute('style').toLowerCase().replace(/\\s/g, '');\n switch (style) {\n case 'text-align:left;':\n allign = ':---';\n break;\n case 'text-align:right;':\n allign = '---:';\n break;\n case 'text-align:center;':\n allign = ':---:';\n break;\n }\n }\n tableArray[0][i] = headContent.trim();\n tableArray[1][i] = allign;\n }\n\n for (i = 0; i < rows.length; ++i) {\n var r = tableArray.push([]) - 1,\n cols = rows[i].getElementsByTagName('td');\n\n for (ii = 0; ii < headings.length; ++ii) {\n var cellContent = ' ';\n if (typeof cols[ii] !== 'undefined') {\n cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);\n }\n tableArray[r].push(cellContent);\n }\n }\n\n var cellSpacesCount = 3;\n for (i = 0; i < tableArray.length; ++i) {\n for (ii = 0; ii < tableArray[i].length; ++ii) {\n var strLen = tableArray[i][ii].length;\n if (strLen > cellSpacesCount) {\n cellSpacesCount = strLen;\n }\n }\n }\n\n for (i = 0; i < tableArray.length; ++i) {\n for (ii = 0; ii < tableArray[i].length; ++ii) {\n if (i === 1) {\n if (tableArray[i][ii].slice(-1) === ':') {\n tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';\n } else {\n tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');\n }\n } else {\n tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);\n }\n }\n txt += '| ' + tableArray[i].join(' | ') + ' |\\n';\n }\n\n return txt.trim();\n});\n", "showdown.subParser('makeMarkdown.tableCell', function (node, globals) {\n 'use strict';\n\n var txt = '';\n if (!node.hasChildNodes()) {\n return '';\n }\n var children = node.childNodes,\n childrenLength = children.length;\n\n for (var i = 0; i < childrenLength; ++i) {\n txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);\n }\n return txt.trim();\n});\n", "showdown.subParser('makeMarkdown.txt', function (node) {\n 'use strict';\n\n var txt = node.nodeValue;\n\n // multiple spaces are collapsed\n txt = txt.replace(/ +/g, ' ');\n\n // replace the custom ¨NBSP; with a space\n txt = txt.replace(/¨NBSP;/g, ' ');\n\n // \", <, > and & should replace escaped html entities\n txt = showdown.helper.unescapeHTMLEntities(txt);\n\n // escape markdown magic characters\n // emphasis, strong and strikethrough - can appear everywhere\n // we also escape pipe (|) because of tables\n // and escape ` because of code blocks and spans\n txt = txt.replace(/([*_~|`])/g, '\\\\$1');\n\n // escape > because of blockquotes\n txt = txt.replace(/^(\\s*)>/g, '\\\\$1>');\n\n // hash character, only troublesome at the beginning of a line because of headers\n txt = txt.replace(/^#/gm, '\\\\#');\n\n // horizontal rules\n txt = txt.replace(/^(\\s*)([-=]{3,})(\\s*)$/, '$1\\\\$2$3');\n\n // dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer\n txt = txt.replace(/^( {0,3}\\d+)\\./gm, '$1\\\\.');\n\n // +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)\n txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\\\$2');\n\n // images and links, ] followed by ( is problematic, so we escape it\n txt = txt.replace(/]([\\s]*)\\(/g, '\\\\]$1\\\\(');\n\n // reference URIs must also be escaped\n txt = txt.replace(/^ {0,3}\\[([\\S \\t]*?)]:/gm, '\\\\[$1]:');\n\n return txt;\n});\n", "var root = this;\n\n// AMD Loader\nif (typeof define === 'function' && define.amd) {\n define(function () {\n 'use strict';\n return showdown;\n });\n\n// CommonJS/nodeJS Loader\n} else if (typeof module !== 'undefined' && module.exports) {\n module.exports = showdown;\n\n// Regular Browser loader\n} else {\n root.showdown = showdown;\n}\n", "/* jshint browser: true */\n\n(function () {\n\n// We'll copy the properties below into the mirror div.\n// Note that some browsers, such as Firefox, do not concatenate properties\n// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),\n// so we have to list every single property explicitly.\nvar properties = [\n 'direction', // RTL support\n 'boxSizing',\n 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does\n 'height',\n 'overflowX',\n 'overflowY', // copy the scrollbar for IE\n\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderStyle',\n\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n 'fontStyle',\n 'fontVariant',\n 'fontWeight',\n 'fontStretch',\n 'fontSize',\n 'fontSizeAdjust',\n 'lineHeight',\n 'fontFamily',\n\n 'textAlign',\n 'textTransform',\n 'textIndent',\n 'textDecoration', // might not make a difference, but better be safe\n\n 'letterSpacing',\n 'wordSpacing',\n\n 'tabSize',\n 'MozTabSize'\n\n];\n\nvar isBrowser = (typeof window !== 'undefined');\nvar isFirefox = (isBrowser && window.mozInnerScreenX != null);\n\nfunction getCaretCoordinates(element, position, options) {\n if (!isBrowser) {\n throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser');\n }\n\n var debug = options && options.debug || false;\n if (debug) {\n var el = document.querySelector('#input-textarea-caret-position-mirror-div');\n if (el) el.parentNode.removeChild(el);\n }\n\n // The mirror div will replicate the textarea's style\n var div = document.createElement('div');\n div.id = 'input-textarea-caret-position-mirror-div';\n document.body.appendChild(div);\n\n var style = div.style;\n var computed = window.getComputedStyle ? window.getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9\n var isInput = element.nodeName === 'INPUT';\n\n // Default textarea styles\n style.whiteSpace = 'pre-wrap';\n if (!isInput)\n style.wordWrap = 'break-word'; // only for textarea-s\n\n // Position off-screen\n style.position = 'absolute'; // required to return coordinates properly\n if (!debug)\n style.visibility = 'hidden'; // not 'display: none' because we want rendering\n\n // Transfer the element's properties to the div\n properties.forEach(function (prop) {\n if (isInput && prop === 'lineHeight') {\n // Special case for s because text is rendered centered and line height may be != height\n style.lineHeight = computed.height;\n } else {\n style[prop] = computed[prop];\n }\n });\n\n if (isFirefox) {\n // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275\n if (element.scrollHeight > parseInt(computed.height))\n style.overflowY = 'scroll';\n } else {\n style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'\n }\n\n div.textContent = element.value.substring(0, position);\n // The second special handling for input type=\"text\" vs textarea:\n // spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037\n if (isInput)\n div.textContent = div.textContent.replace(/\\s/g, '\\u00a0');\n\n var span = document.createElement('span');\n // Wrapping must be replicated *exactly*, including when a long word gets\n // onto the next line, with whitespace at the end of the line before (#7).\n // The *only* reliable way to do that is to copy the *entire* rest of the\n // textarea's content into the created at the caret position.\n // For inputs, just '.' would be enough, but no need to bother.\n span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all\n div.appendChild(span);\n\n var coordinates = {\n top: span.offsetTop + parseInt(computed['borderTopWidth']),\n left: span.offsetLeft + parseInt(computed['borderLeftWidth']),\n height: parseInt(computed['lineHeight'])\n };\n\n if (debug) {\n span.style.backgroundColor = '#aaa';\n } else {\n document.body.removeChild(div);\n }\n\n return coordinates;\n}\n\nif (typeof module != 'undefined' && typeof module.exports != 'undefined') {\n module.exports = getCaretCoordinates;\n} else if(isBrowser) {\n window.getCaretCoordinates = getCaretCoordinates;\n}\n\n}());\n", "export const isArray = (what: unknown): boolean => Array.isArray(what);\n", "import { isArray } from \"./isArray.ts\";\n\nconst select = (selector) => ({\n el: document.querySelector(selector),\n elements: document.querySelectorAll(selector),\n placeholder(what) {\n this.el.placeholder = what;\n return this;\n },\n getValue() {\n return this.el.value;\n },\n insertAtCaret(text) {\n this.el.setRangeText(\n text,\n this.el.selectionStart,\n this.el.selectionEnd,\n \"end\",\n );\n return this;\n },\n setValue(value) {\n this.el.value = value;\n const event = new Event(\"input\", {\n bubbles: true,\n cancelable: true,\n });\n this.el.dispatchEvent(event);\n return this;\n },\n innerHTML(htmlString) {\n this.el.innerHTML = htmlString;\n return this;\n },\n html(content) {\n this.el.innerHTML = \"\";\n this.append(content);\n return this;\n },\n append(el) {\n const elements = isArray(el) ? el : [el];\n elements.forEach((e) => {\n const newContent = isElement(e) ? e : document.createTextNode(e);\n this.el.appendChild(newContent);\n });\n return this;\n },\n appendListElement(text) {\n const li = document.createElement(\"LI\");\n li.appendChild(document.createTextNode(text));\n this.el.appendChild(li);\n return this;\n },\n removeClass(className) {\n this.el.classList.remove(className);\n return this;\n },\n removeClasses(classes = []) {\n classes.map((className) => this.removeClass(className));\n return this;\n },\n addClass(className) {\n this.el.classList.add(className);\n return this;\n },\n hasClass(cls) {\n return (\" \" + this.el.className + \" \").indexOf(\" \" + cls + \" \") > -1;\n },\n show(shouldShow = true) {\n if (shouldShow) {\n this.removeClass(\"hidden\");\n } else {\n this.hide();\n }\n return this;\n },\n hide() {\n this.addClass(\"hidden\");\n return this;\n },\n toggle(className = \"hidden\") {\n if (this.hasClass(className)) this.removeClass(className);\n else this.addClass(className);\n return this;\n },\n focus() {\n this.el.focus();\n return this;\n },\n listenAll(event, fn) {\n const elements = Array.prototype.slice.call(this.elements);\n elements.map((el) => {\n el.addEventListener(event, (e) => fn(e.srcElement));\n });\n return this;\n },\n listen(event, fn) {\n this.el.addEventListener(event, (e) => fn(e, this));\n return this;\n },\n click() {\n if (this.el) {\n this.el.click();\n }\n },\n checked(value) {\n this.el.checked = !!value;\n return this;\n },\n disable(shouldDisable = true) {\n this.el.disabled = shouldDisable;\n return this;\n },\n});\n\nexport const isElement = (obj) => {\n try {\n return obj instanceof HTMLElement;\n } catch (_e) {\n //Browsers not supporting W3 DOM2 don't have HTMLElement and\n //an exception is thrown and we end up here. Testing some\n //properties that all elements have (works on IE7)\n return (\n typeof obj === \"object\" &&\n obj.nodeType === 1 &&\n typeof obj.style === \"object\" &&\n typeof obj.ownerDocument === \"object\"\n );\n }\n};\n\nexport default select;\n", "import select from \"../../utils/dom.js\";\n\ntype NotificationType = \"info\" | \"success\" | \"error\" | \"warning\";\n\nconst notificationTypes: Record = {\n info: \"info\",\n success: \"success\",\n error: \"error\",\n warning: \"warning\",\n};\n\nconst notification = select(\"#notification\");\n\nconst cleanNotificationClasses = (): void => {\n notification.removeClasses(Object.values(notificationTypes));\n};\n\nnotification.el.onclick = () => cleanNotificationClasses();\n\nconst notificationFactory = () =>\n Object.values(notificationTypes).reduce(\n (acc, notificationType) => ({\n ...acc,\n [notificationType](message: string): void {\n // @ts-ignore fix later\n this.showNotification(message, notificationType);\n },\n }),\n {} as Record void>,\n );\n\ninterface Notification {\n autohideDuration: number;\n timer?: number;\n removeAfter(): void;\n showNotification(message: string, type?: NotificationType): void;\n info(message: string): void;\n success(message: string): void;\n error(message: string): void;\n warning(message: string): void;\n}\n\nconst Notification = (autohideDuration = 5): Notification => ({\n autohideDuration,\n timer: undefined,\n removeAfter() {\n this.timer = self.setTimeout(() => {\n cleanNotificationClasses();\n }, this.autohideDuration * 1000);\n },\n showNotification(message, type = notificationTypes.info) {\n cleanNotificationClasses();\n notification.innerHTML(message).addClass(type);\n clearTimeout(this.timer);\n this.removeAfter();\n },\n ...notificationFactory(),\n});\n\nconst notify = Notification();\nexport default notify;\n", "import notify from \"./notify.ts\";\n\nconst welcomeUser = () => {\n const lastVisit = localStorage.getItem(\"miropad.user\");\n if (lastVisit) {\n notify.info(`\uD83E\uDD17 Happy to see you again from ${lastVisit}`);\n } else {\n notify.info(\n `

    Welcome \uD83D\uDC4B \uD83D\uDE03

    \n

    Use Ctrl+S: to save your note

    \n

    & Ctrl+P: to format a JSON doc

    \n `,\n 100,\n );\n }\n localStorage.setItem(\"miropad.user\", new Date().toLocaleDateString());\n};\n\nexport default welcomeUser;\n", "import notify from \"../components/molecules/notify.ts\";\nimport { isArray } from \"./isArray.ts\";\n\nconst storage = (() => {\n return {\n set: function (key, what) {\n localStorage.setItem(key, what);\n return this;\n },\n update: function (key, attr) {\n const current = JSON.parse(this.get(key));\n localStorage.setItem(\n key,\n JSON.stringify({\n ...current,\n ...attr,\n }),\n );\n return this;\n },\n remove: function (key) {\n localStorage.removeItem(key);\n return this;\n },\n get: function (key) {\n if (isArray(key)) {\n return key.reduce((acc, k) => {\n return {\n ...acc,\n [k]: this.get(k),\n };\n }, {});\n }\n\n return localStorage.getItem(key);\n },\n parse: function (key) {\n const value = this.get(key);\n return JSON.parse(value);\n },\n getDictionary: function () {\n const savedTxt = localStorage.getItem(\"__dictionary__\");\n return savedTxt ? JSON.parse(savedTxt) : [];\n },\n removeFromDictionary: function (word) {\n const currentDictionary = this.getDictionary();\n const newDictionary = currentDictionary.filter((w) => {\n return w !== word;\n });\n\n localStorage.setItem(\"__dictionary__\", JSON.stringify(newDictionary));\n },\n saveToDictionary: async function (what) {\n if (what.length) {\n try {\n const cleanText = what.toLowerCase().replace(/[^a-zA-Z\u03AC-\u03CE\u0391-\u03A9]/g, \" \");\n const current = await this.getDictionary();\n const words = [\n ...cleanText.split(\" \").filter((w) => w.length > 3),\n ...current,\n ];\n const distinctWords = [...new Set(words)];\n localStorage.setItem(\"__dictionary__\", JSON.stringify(distinctWords));\n } catch (e) {\n notify.error(\n `\uD83D\uDE31 Something went wrong while trying to save to local storage ${e}`,\n );\n }\n } else {\n notify.warning(\"\uD83D\uDE15 Nothing to save!\");\n }\n return this;\n },\n };\n})();\n\nexport default storage;\n", "export const configuration = {\n github: {\n client_id: \"70c1955dfe4914c52c10\",\n request_state: \"miro-pad\",\n },\n auth_service: \"https://vercel-api-phi.vercel.app/api/auth\",\n mail_service: {\n api: \"https://vercel-api-phi.vercel.app/api/mail\",\n signature: `Theo Mironidis
    \n Software Engineer
    \n https://teomrd.github.io`,\n },\n file_service: {\n api: \"https://vercel-api-phi.vercel.app/api/upload\",\n },\n} as const;\n", "import storage from \"../localstorage.js\";\nimport {\n getNotes,\n Note,\n} from \"../../components/organisms/noteManager/noteManager.ts\";\nimport notify from \"../../components/molecules/notify.ts\";\nimport { configuration } from \"../../../configuration.ts\";\n\nexport const getGist = (id: string, token = storage.get(\"authToken\")) =>\n fetch(`https://api.github.com/gists/${id}`, {\n headers: {\n Authorization: `token ${token}`,\n },\n }).then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response.json();\n });\n\nexport const getAuthenticatedUsersGists = (token = storage.get(\"authToken\")) =>\n fetch(\"https://api.github.com/gists\", {\n headers: {\n Authorization: `token ${token}`,\n },\n }).then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response.json();\n });\n\nexport const deleteFileOnGist = async (\n fileName: string,\n gistId = storage.get(\"gistId\"),\n token = storage.get(\"authToken\"),\n) => {\n const response = await fetch(`https://api.github.com/gists/${gistId}`, {\n method: \"PATCH\",\n headers: {\n Authorization: `token ${token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n files: {\n [fileName]: null,\n },\n description: \"MiroPad Gist\",\n public: false,\n }),\n });\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n const responseAsJson = await response.json();\n notify.info(`${fileName} deleted on Gist!`);\n return responseAsJson;\n};\n\nexport const updateGist = (\n notes = getNotes(),\n gistId = storage.get(\"gistId\"),\n token = storage.get(\"authToken\"),\n) => {\n if (gistId && token) {\n const noteToFiles = notes.reduce((acc, { id, text, deleted }) => {\n return {\n ...acc,\n [id]: deleted ? null : { content: text },\n };\n }, {});\n return fetch(`https://api.github.com/gists/${gistId}`, {\n method: \"PATCH\",\n headers: {\n Authorization: `token ${token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n files: noteToFiles,\n description: \"MiroPad Gist\",\n public: false,\n }),\n })\n .then((response) => {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response.json();\n })\n .then((responseAsJson) => {\n notes.map(({ id, deleted }) => {\n if (deleted) localStorage.removeItem(id);\n });\n return responseAsJson;\n });\n }\n};\n\nexport const createNewGist = async (token = storage.get(\"authToken\")) => {\n const notes = getNotes();\n const noteToFiles = notes.reduce((acc, note) => {\n return {\n ...acc,\n [note.id]: {\n content: note.text,\n },\n };\n }, {});\n const response = await fetch(\"https://api.github.com/gists\", {\n method: \"POST\",\n headers: {\n Authorization: `token ${token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n files: noteToFiles,\n description: \"MiroPad Gist\",\n public: false,\n }),\n });\n if (!response.ok) {\n throw Error(response.statusText);\n }\n const responseAsJson = await response.json();\n return responseAsJson;\n};\n\nexport const getAuthToken = (code: string, state: string) =>\n fetch(`${configuration.auth_service}?state=${state}&code=${code}`, {\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response.json();\n })\n .then((responseAsJson) => {\n return responseAsJson;\n });\n\nexport const publishGist = async ({\n note,\n token = storage.get(\"authToken\"),\n}: {\n note: Note;\n token?: string;\n}) => {\n const response = await fetch(\"https://api.github.com/gists\", {\n method: \"POST\",\n headers: {\n Authorization: `token ${token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n files: {\n [note.id]: {\n content: note.text,\n },\n },\n description: \"MiroPad Gist\",\n public: true,\n }),\n });\n if (!response.ok) {\n throw Error(response.statusText);\n }\n const responseAsJson = await response.json();\n return responseAsJson;\n};\n", "export const empty = new Uint8Array(0)\n\nexport function toHex (d: Uint8Array): string {\n return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '')\n}\n\nexport function fromHex (hex: string): Uint8Array {\n const hexes = hex.match(/../g)\n return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty\n}\n\nexport function equals (aa: Uint8Array, bb: Uint8Array): boolean {\n if (aa === bb) return true\n if (aa.byteLength !== bb.byteLength) {\n return false\n }\n\n for (let ii = 0; ii < aa.byteLength; ii++) {\n if (aa[ii] !== bb[ii]) {\n return false\n }\n }\n\n return true\n}\n\nexport function coerce (o: ArrayBufferView | ArrayBuffer | Uint8Array): Uint8Array {\n if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o\n if (o instanceof ArrayBuffer) return new Uint8Array(o)\n if (ArrayBuffer.isView(o)) {\n return new Uint8Array(o.buffer, o.byteOffset, o.byteLength)\n }\n throw new Error('Unknown type, must be binary type')\n}\n\nexport function isBinary (o: unknown): o is ArrayBuffer | ArrayBufferView {\n return o instanceof ArrayBuffer || ArrayBuffer.isView(o)\n}\n\nexport function fromString (str: string): Uint8Array {\n return new TextEncoder().encode(str)\n}\n\nexport function toString (b: Uint8Array): string {\n return new TextDecoder().decode(b)\n}\n", "/* eslint-disable */\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\n/**\n * @param {string} ALPHABET\n * @param {any} name\n */\nfunction base (ALPHABET, name) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256);\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i);\n var xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i;\n }\n var BASE = ALPHABET.length;\n var LEADER = ALPHABET.charAt(0);\n var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up\n /**\n * @param {any[] | Iterable} source\n */\n function encode (source) {\n // @ts-ignore\n if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0;\n var length = 0;\n var pbegin = 0;\n var pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;\n var b58 = new Uint8Array(size);\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin];\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0;\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0;\n b58[it1] = (carry % BASE) >>> 0;\n carry = (carry / BASE) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n pbegin++;\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }\n return str\n }\n /**\n * @param {string | string[]} source\n */\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n var psz = 0;\n // Skip leading spaces.\n if (source[psz] === ' ') { return }\n // Skip and count leading '1's.\n var zeroes = 0;\n var length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size);\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)];\n // Invalid character\n if (carry === 255) { return }\n var i = 0;\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0;\n b256[it3] = (carry % 256) >>> 0;\n carry = (carry / 256) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n psz++;\n }\n // Skip trailing spaces.\n if (source[psz] === ' ') { return }\n // Skip leading zeroes in b256.\n var it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n var vch = new Uint8Array(zeroes + (size - it4));\n var j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch\n }\n /**\n * @param {string | string[]} string\n */\n function decode (string) {\n var buffer = decodeUnsafe(string);\n if (buffer) { return buffer }\n throw new Error(`Non-${name} character`)\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nvar src = base;\n\nvar _brrp__multiformats_scope_baseX = src;\n\nexport default _brrp__multiformats_scope_baseX;\n", "import { coerce } from '../bytes.js'\nimport basex from '../vendor/base-x.js'\nimport type { BaseCodec, BaseDecoder, BaseEncoder, CombobaseDecoder, Multibase, MultibaseCodec, MultibaseDecoder, MultibaseEncoder, UnibaseDecoder } from './interface.js'\n\ninterface EncodeFn { (bytes: Uint8Array): string }\ninterface DecodeFn { (text: string): Uint8Array }\n\n/**\n * Class represents both BaseEncoder and MultibaseEncoder meaning it\n * can be used to encode to multibase or base encode without multibase\n * prefix.\n */\nclass Encoder implements MultibaseEncoder, BaseEncoder {\n readonly name: Base\n readonly prefix: Prefix\n readonly baseEncode: EncodeFn\n\n constructor (name: Base, prefix: Prefix, baseEncode: EncodeFn) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n }\n\n encode (bytes: Uint8Array): Multibase {\n if (bytes instanceof Uint8Array) {\n return `${this.prefix}${this.baseEncode(bytes)}`\n } else {\n throw Error('Unknown type, must be binary type')\n }\n }\n}\n\n/**\n * Class represents both BaseDecoder and MultibaseDecoder so it could be used\n * to decode multibases (with matching prefix) or just base decode strings\n * with corresponding base encoding.\n */\nclass Decoder implements MultibaseDecoder, UnibaseDecoder, BaseDecoder {\n readonly name: Base\n readonly prefix: Prefix\n readonly baseDecode: DecodeFn\n private readonly prefixCodePoint: number\n\n constructor (name: Base, prefix: Prefix, baseDecode: DecodeFn) {\n this.name = name\n this.prefix = prefix\n const prefixCodePoint = prefix.codePointAt(0)\n /* c8 ignore next 3 */\n if (prefixCodePoint === undefined) {\n throw new Error('Invalid prefix character')\n }\n this.prefixCodePoint = prefixCodePoint\n this.baseDecode = baseDecode\n }\n\n decode (text: string): Uint8Array {\n if (typeof text === 'string') {\n if (text.codePointAt(0) !== this.prefixCodePoint) {\n throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)\n }\n return this.baseDecode(text.slice(this.prefix.length))\n } else {\n throw Error('Can only multibase decode strings')\n }\n }\n\n or (decoder: UnibaseDecoder | ComposedDecoder): ComposedDecoder {\n return or(this, decoder)\n }\n}\n\ntype Decoders = Record>\n\nclass ComposedDecoder implements MultibaseDecoder, CombobaseDecoder {\n readonly decoders: Decoders\n\n constructor (decoders: Decoders) {\n this.decoders = decoders\n }\n\n or (decoder: UnibaseDecoder | ComposedDecoder): ComposedDecoder {\n return or(this, decoder)\n }\n\n decode (input: string): Uint8Array {\n const prefix = input[0] as Prefix\n const decoder = this.decoders[prefix]\n if (decoder != null) {\n return decoder.decode(input)\n } else {\n throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)\n }\n }\n}\n\nexport function or (left: UnibaseDecoder | CombobaseDecoder, right: UnibaseDecoder | CombobaseDecoder): ComposedDecoder {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n return new ComposedDecoder({\n ...(left.decoders ?? { [(left as UnibaseDecoder).prefix]: left }),\n ...(right.decoders ?? { [(right as UnibaseDecoder).prefix]: right })\n } as Decoders)\n}\n\nexport class Codec implements MultibaseCodec, MultibaseEncoder, MultibaseDecoder, BaseCodec, BaseEncoder, BaseDecoder {\n readonly name: Base\n readonly prefix: Prefix\n readonly baseEncode: EncodeFn\n readonly baseDecode: DecodeFn\n readonly encoder: Encoder\n readonly decoder: Decoder\n\n constructor (name: Base, prefix: Prefix, baseEncode: EncodeFn, baseDecode: DecodeFn) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n this.baseDecode = baseDecode\n this.encoder = new Encoder(name, prefix, baseEncode)\n this.decoder = new Decoder(name, prefix, baseDecode)\n }\n\n encode (input: Uint8Array): string {\n return this.encoder.encode(input)\n }\n\n decode (input: string): Uint8Array {\n return this.decoder.decode(input)\n }\n}\n\nexport function from ({ name, prefix, encode, decode }: { name: Base, prefix: Prefix, encode: EncodeFn, decode: DecodeFn }): Codec {\n return new Codec(name, prefix, encode, decode)\n}\n\nexport function baseX ({ name, prefix, alphabet }: { name: Base, prefix: Prefix, alphabet: string }): Codec {\n const { encode, decode } = basex(alphabet, name)\n return from({\n prefix,\n name,\n encode,\n decode: (text: string): Uint8Array => coerce(decode(text))\n })\n}\n\nfunction decode (string: string, alphabet: string, bitsPerChar: number, name: string): Uint8Array {\n // Build the character lookup table:\n const codes: Record = {}\n for (let i = 0; i < alphabet.length; ++i) {\n codes[alphabet[i]] = i\n }\n\n // Count the padding bytes:\n let end = string.length\n while (string[end - 1] === '=') {\n --end\n }\n\n // Allocate the output:\n const out = new Uint8Array((end * bitsPerChar / 8) | 0)\n\n // Parse the data:\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n let written = 0 // Next byte to write\n for (let i = 0; i < end; ++i) {\n // Read one character from the string:\n const value = codes[string[i]]\n if (value === undefined) {\n throw new SyntaxError(`Non-${name} character`)\n }\n\n // Append the bits to the buffer:\n buffer = (buffer << bitsPerChar) | value\n bits += bitsPerChar\n\n // Write out some bits if the buffer has a byte's worth:\n if (bits >= 8) {\n bits -= 8\n out[written++] = 0xff & (buffer >> bits)\n }\n }\n\n // Verify that we have received just enough bits:\n if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) {\n throw new SyntaxError('Unexpected end of data')\n }\n\n return out\n}\n\nfunction encode (data: Uint8Array, alphabet: string, bitsPerChar: number): string {\n const pad = alphabet[alphabet.length - 1] === '='\n const mask = (1 << bitsPerChar) - 1\n let out = ''\n\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n for (let i = 0; i < data.length; ++i) {\n // Slurp data into the buffer:\n buffer = (buffer << 8) | data[i]\n bits += 8\n\n // Write out as much as we can:\n while (bits > bitsPerChar) {\n bits -= bitsPerChar\n out += alphabet[mask & (buffer >> bits)]\n }\n }\n\n // Partial character:\n if (bits !== 0) {\n out += alphabet[mask & (buffer << (bitsPerChar - bits))]\n }\n\n // Add padding characters until we hit a byte boundary:\n if (pad) {\n while (((out.length * bitsPerChar) & 7) !== 0) {\n out += '='\n }\n }\n\n return out\n}\n\n/**\n * RFC4648 Factory\n */\nexport function rfc4648 ({ name, prefix, bitsPerChar, alphabet }: { name: Base, prefix: Prefix, bitsPerChar: number, alphabet: string }): Codec {\n return from({\n prefix,\n name,\n encode (input: Uint8Array): string {\n return encode(input, alphabet, bitsPerChar)\n },\n decode (input: string): Uint8Array {\n return decode(input, alphabet, bitsPerChar, name)\n }\n })\n}\n", "import { rfc4648 } from './base.js'\n\nexport const base32 = rfc4648({\n prefix: 'b',\n name: 'base32',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567',\n bitsPerChar: 5\n})\n\nexport const base32upper = rfc4648({\n prefix: 'B',\n name: 'base32upper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',\n bitsPerChar: 5\n})\n\nexport const base32pad = rfc4648({\n prefix: 'c',\n name: 'base32pad',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',\n bitsPerChar: 5\n})\n\nexport const base32padupper = rfc4648({\n prefix: 'C',\n name: 'base32padupper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',\n bitsPerChar: 5\n})\n\nexport const base32hex = rfc4648({\n prefix: 'v',\n name: 'base32hex',\n alphabet: '0123456789abcdefghijklmnopqrstuv',\n bitsPerChar: 5\n})\n\nexport const base32hexupper = rfc4648({\n prefix: 'V',\n name: 'base32hexupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',\n bitsPerChar: 5\n})\n\nexport const base32hexpad = rfc4648({\n prefix: 't',\n name: 'base32hexpad',\n alphabet: '0123456789abcdefghijklmnopqrstuv=',\n bitsPerChar: 5\n})\n\nexport const base32hexpadupper = rfc4648({\n prefix: 'T',\n name: 'base32hexpadupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',\n bitsPerChar: 5\n})\n\nexport const base32z = rfc4648({\n prefix: 'h',\n name: 'base32z',\n alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',\n bitsPerChar: 5\n})\n", "import { baseX } from './base.js'\n\nexport const base36 = baseX({\n prefix: 'k',\n name: 'base36',\n alphabet: '0123456789abcdefghijklmnopqrstuvwxyz'\n})\n\nexport const base36upper = baseX({\n prefix: 'K',\n name: 'base36upper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n})\n", "import { baseX } from './base.js'\n\nexport const base58btc = baseX({\n name: 'base58btc',\n prefix: 'z',\n alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n})\n\nexport const base58flickr = baseX({\n name: 'base58flickr',\n prefix: 'Z',\n alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n})\n", "/* eslint-disable */\nvar encode_1 = encode;\n\nvar MSB = 0x80\n , REST = 0x7F\n , MSBALL = ~REST\n , INT = Math.pow(2, 31);\n\n/**\n * @param {number} num\n * @param {number[]} out\n * @param {number} offset\n */\nfunction encode(num, out, offset) {\n out = out || [];\n offset = offset || 0;\n var oldOffset = offset;\n\n while(num >= INT) {\n out[offset++] = (num & 0xFF) | MSB;\n num /= 128;\n }\n while(num & MSBALL) {\n out[offset++] = (num & 0xFF) | MSB;\n num >>>= 7;\n }\n out[offset] = num | 0;\n \n // @ts-ignore\n encode.bytes = offset - oldOffset + 1;\n \n return out\n}\n\nvar decode = read;\n\nvar MSB$1 = 0x80\n , REST$1 = 0x7F;\n\n/**\n * @param {string | any[]} buf\n * @param {number} offset\n */\nfunction read(buf, offset) {\n var res = 0\n , offset = offset || 0\n , shift = 0\n , counter = offset\n , b\n , l = buf.length;\n\n do {\n if (counter >= l) {\n // @ts-ignore\n read.bytes = 0;\n throw new RangeError('Could not decode varint')\n }\n b = buf[counter++];\n res += shift < 28\n ? (b & REST$1) << shift\n : (b & REST$1) * Math.pow(2, shift);\n shift += 7;\n } while (b >= MSB$1)\n\n // @ts-ignore\n read.bytes = counter - offset;\n\n return res\n}\n\nvar N1 = Math.pow(2, 7);\nvar N2 = Math.pow(2, 14);\nvar N3 = Math.pow(2, 21);\nvar N4 = Math.pow(2, 28);\nvar N5 = Math.pow(2, 35);\nvar N6 = Math.pow(2, 42);\nvar N7 = Math.pow(2, 49);\nvar N8 = Math.pow(2, 56);\nvar N9 = Math.pow(2, 63);\n\nvar length = function (/** @type {number} */ value) {\n return (\n value < N1 ? 1\n : value < N2 ? 2\n : value < N3 ? 3\n : value < N4 ? 4\n : value < N5 ? 5\n : value < N6 ? 6\n : value < N7 ? 7\n : value < N8 ? 8\n : value < N9 ? 9\n : 10\n )\n};\n\nvar varint = {\n encode: encode_1\n , decode: decode\n , encodingLength: length\n};\n\nvar _brrp_varint = varint;\n\nexport default _brrp_varint;\n", "import varint from './vendor/varint.js'\n\nexport function decode (data: Uint8Array, offset = 0): [number, number] {\n const code = varint.decode(data, offset)\n return [code, varint.decode.bytes]\n}\n\nexport function encodeTo (int: number, target: Uint8Array, offset = 0): Uint8Array {\n varint.encode(int, target, offset)\n return target\n}\n\nexport function encodingLength (int: number): number {\n return varint.encodingLength(int)\n}\n", "import { coerce, equals as equalBytes } from '../bytes.js'\nimport * as varint from '../varint.js'\nimport type { MultihashDigest } from './interface.js'\n\n/**\n * Creates a multihash digest.\n */\nexport function create (code: Code, digest: Uint8Array): Digest {\n const size = digest.byteLength\n const sizeOffset = varint.encodingLength(code)\n const digestOffset = sizeOffset + varint.encodingLength(size)\n\n const bytes = new Uint8Array(digestOffset + size)\n varint.encodeTo(code, bytes, 0)\n varint.encodeTo(size, bytes, sizeOffset)\n bytes.set(digest, digestOffset)\n\n return new Digest(code, size, digest, bytes)\n}\n\n/**\n * Turns bytes representation of multihash digest into an instance.\n */\nexport function decode (multihash: Uint8Array): MultihashDigest {\n const bytes = coerce(multihash)\n const [code, sizeOffset] = varint.decode(bytes)\n const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset))\n const digest = bytes.subarray(sizeOffset + digestOffset)\n\n if (digest.byteLength !== size) {\n throw new Error('Incorrect length')\n }\n\n return new Digest(code, size, digest, bytes)\n}\n\nexport function equals (a: MultihashDigest, b: unknown): b is MultihashDigest {\n if (a === b) {\n return true\n } else {\n const data = b as { code?: unknown, size?: unknown, bytes?: unknown }\n\n return (\n a.code === data.code &&\n a.size === data.size &&\n data.bytes instanceof Uint8Array &&\n equalBytes(a.bytes, data.bytes)\n )\n }\n}\n\n/**\n * Represents a multihash digest which carries information about the\n * hashing algorithm and an actual hash digest.\n */\nexport class Digest implements MultihashDigest {\n readonly code: Code\n readonly size: Size\n readonly digest: Uint8Array\n readonly bytes: Uint8Array\n\n /**\n * Creates a multihash digest.\n */\n constructor (code: Code, size: Size, digest: Uint8Array, bytes: Uint8Array) {\n this.code = code\n this.size = size\n this.digest = digest\n this.bytes = bytes\n }\n}\n\n/**\n * Used to check that the passed multihash has the passed code\n */\nexport function hasCode (digest: MultihashDigest, code: T): digest is MultihashDigest {\n return digest.code === code\n}\n", "import { base32 } from './bases/base32.js'\nimport { base36 } from './bases/base36.js'\nimport { base58btc } from './bases/base58.js'\nimport { coerce } from './bytes.js'\nimport * as Digest from './hashes/digest.js'\nimport * as varint from './varint.js'\nimport type * as API from './link/interface.js'\n\n// This way TS will also expose all the types from module\nexport * from './link/interface.js'\n\nexport function format , Prefix extends string> (link: T, base?: API.MultibaseEncoder): API.ToString {\n const { bytes, version } = link\n switch (version) {\n case 0:\n return toStringV0(\n bytes,\n baseCache(link),\n base as API.MultibaseEncoder<'z'> ?? base58btc.encoder\n )\n default:\n return toStringV1(\n bytes,\n baseCache(link),\n (base ?? base32.encoder) as API.MultibaseEncoder\n )\n }\n}\n\nexport function toJSON (link: Link): API.LinkJSON {\n return {\n '/': format(link)\n }\n}\n\nexport function fromJSON (json: API.LinkJSON): CID {\n return CID.parse(json['/'])\n}\n\nconst cache = new WeakMap>()\n\nfunction baseCache (cid: API.UnknownLink): Map {\n const baseCache = cache.get(cid)\n if (baseCache == null) {\n const baseCache = new Map()\n cache.set(cid, baseCache)\n return baseCache\n }\n return baseCache\n}\n\nexport class CID implements API.Link {\n readonly code: Format\n readonly version: Version\n readonly multihash: API.MultihashDigest\n readonly bytes: Uint8Array\n readonly '/': Uint8Array\n\n /**\n * @param version - Version of the CID\n * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv\n * @param multihash - (Multi)hash of the of the content.\n */\n constructor (version: Version, code: Format, multihash: API.MultihashDigest, bytes: Uint8Array) {\n this.code = code\n this.version = version\n this.multihash = multihash\n this.bytes = bytes\n\n // flag to serializers that this is a CID and\n // should be treated specially\n this['/'] = bytes\n }\n\n /**\n * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes`\n * please either use `CID.asCID(cid)` or switch to new signalling mechanism\n *\n * @deprecated\n */\n get asCID (): this {\n return this\n }\n\n // ArrayBufferView\n get byteOffset (): number {\n return this.bytes.byteOffset\n }\n\n // ArrayBufferView\n get byteLength (): number {\n return this.bytes.byteLength\n }\n\n toV0 (): CID {\n switch (this.version) {\n case 0: {\n return this as CID\n }\n case 1: {\n const { code, multihash } = this\n\n if (code !== DAG_PB_CODE) {\n throw new Error('Cannot convert a non dag-pb CID to CIDv0')\n }\n\n // sha2-256\n if (multihash.code !== SHA_256_CODE) {\n throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0')\n }\n\n return (\n CID.createV0(\n multihash as API.MultihashDigest\n )\n )\n }\n default: {\n throw Error(\n `Can not convert CID version ${this.version} to version 0. This is a bug please report`\n )\n }\n }\n }\n\n toV1 (): CID {\n switch (this.version) {\n case 0: {\n const { code, digest } = this.multihash\n const multihash = Digest.create(code, digest)\n return (\n CID.createV1(this.code, multihash)\n )\n }\n case 1: {\n return this as CID\n }\n default: {\n throw Error(\n `Can not convert CID version ${this.version} to version 1. This is a bug please report`\n )\n }\n }\n }\n\n equals (other: unknown): other is CID {\n return CID.equals(this, other)\n }\n\n static equals (self: API.Link, other: unknown): other is CID {\n const unknown = other as { code?: unknown, version?: unknown, multihash?: unknown }\n return (\n unknown != null &&\n self.code === unknown.code &&\n self.version === unknown.version &&\n Digest.equals(self.multihash, unknown.multihash)\n )\n }\n\n toString (base?: API.MultibaseEncoder): string {\n return format(this, base)\n }\n\n toJSON (): API.LinkJSON {\n return { '/': format(this) }\n }\n\n link (): this {\n return this\n }\n\n readonly [Symbol.toStringTag] = 'CID';\n\n // Legacy\n\n [Symbol.for('nodejs.util.inspect.custom')] (): string {\n return `CID(${this.toString()})`\n }\n\n /**\n * Takes any input `value` and returns a `CID` instance if it was\n * a `CID` otherwise returns `null`. If `value` is instanceof `CID`\n * it will return value back. If `value` is not instance of this CID\n * class, but is compatible CID it will return new instance of this\n * `CID` class. Otherwise returns null.\n *\n * This allows two different incompatible versions of CID library to\n * co-exist and interop as long as binary interface is compatible.\n */\n static asCID (input: API.Link | U): CID | null {\n if (input == null) {\n return null\n }\n\n const value = input as any\n if (value instanceof CID) {\n // If value is instance of CID then we're all set.\n return value\n } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) {\n // If value isn't instance of this CID class but `this.asCID === this` or\n // `value['/'] === value.bytes` is true it is CID instance coming from a\n // different implementation (diff version or duplicate). In that case we\n // rebase it to this `CID` implementation so caller is guaranteed to get\n // instance with expected API.\n const { version, code, multihash, bytes } = value\n return new CID(\n version,\n code,\n multihash as API.MultihashDigest,\n bytes ?? encodeCID(version, code, multihash.bytes)\n )\n } else if (value[cidSymbol] === true) {\n // If value is a CID from older implementation that used to be tagged via\n // symbol we still rebase it to the this `CID` implementation by\n // delegating that to a constructor.\n const { version, multihash, code } = value\n const digest = Digest.decode(multihash) as API.MultihashDigest\n return CID.create(version, code, digest)\n } else {\n // Otherwise value is not a CID (or an incompatible version of it) in\n // which case we return `null`.\n return null\n }\n }\n\n /**\n * @param version - Version of the CID\n * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv\n * @param digest - (Multi)hash of the of the content.\n */\n static create (version: Version, code: Format, digest: API.MultihashDigest): CID {\n if (typeof code !== 'number') {\n throw new Error('String codecs are no longer supported')\n }\n\n if (!(digest.bytes instanceof Uint8Array)) {\n throw new Error('Invalid digest')\n }\n\n switch (version) {\n case 0: {\n if (code !== DAG_PB_CODE) {\n throw new Error(\n `Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`\n )\n } else {\n return new CID(version, code, digest, digest.bytes)\n }\n }\n case 1: {\n const bytes = encodeCID(version, code, digest.bytes)\n return new CID(version, code, digest, bytes)\n }\n default: {\n throw new Error('Invalid version')\n }\n }\n }\n\n /**\n * Simplified version of `create` for CIDv0.\n */\n static createV0 (digest: API.MultihashDigest): CID {\n return CID.create(0, DAG_PB_CODE, digest)\n }\n\n /**\n * Simplified version of `create` for CIDv1.\n *\n * @param code - Content encoding format code.\n * @param digest - Multihash of the content.\n */\n static createV1 (code: Code, digest: API.MultihashDigest): CID {\n return CID.create(1, code, digest)\n }\n\n /**\n * Decoded a CID from its binary representation. The byte array must contain\n * only the CID with no additional bytes.\n *\n * An error will be thrown if the bytes provided do not contain a valid\n * binary representation of a CID.\n */\n static decode (bytes: API.ByteView>): CID {\n const [cid, remainder] = CID.decodeFirst(bytes)\n if (remainder.length !== 0) {\n throw new Error('Incorrect length')\n }\n return cid\n }\n\n /**\n * Decoded a CID from its binary representation at the beginning of a byte\n * array.\n *\n * Returns an array with the first element containing the CID and the second\n * element containing the remainder of the original byte array. The remainder\n * will be a zero-length byte array if the provided bytes only contained a\n * binary CID representation.\n */\n static decodeFirst (bytes: API.ByteView>): [CID, Uint8Array] {\n const specs = CID.inspectBytes(bytes)\n const prefixSize = specs.size - specs.multihashSize\n const multihashBytes = coerce(\n bytes.subarray(prefixSize, prefixSize + specs.multihashSize)\n )\n if (multihashBytes.byteLength !== specs.multihashSize) {\n throw new Error('Incorrect length')\n }\n const digestBytes = multihashBytes.subarray(\n specs.multihashSize - specs.digestSize\n )\n const digest = new Digest.Digest(\n specs.multihashCode,\n specs.digestSize,\n digestBytes,\n multihashBytes\n )\n const cid =\n specs.version === 0\n ? CID.createV0(digest as API.MultihashDigest)\n : CID.createV1(specs.codec, digest)\n return [cid as CID, bytes.subarray(specs.size)]\n }\n\n /**\n * Inspect the initial bytes of a CID to determine its properties.\n *\n * Involves decoding up to 4 varints. Typically this will require only 4 to 6\n * bytes but for larger multicodec code values and larger multihash digest\n * lengths these varints can be quite large. It is recommended that at least\n * 10 bytes be made available in the `initialBytes` argument for a complete\n * inspection.\n */\n static inspectBytes (initialBytes: API.ByteView>): { version: V, codec: C, multihashCode: A, digestSize: number, multihashSize: number, size: number } {\n let offset = 0\n const next = (): number => {\n const [i, length] = varint.decode(initialBytes.subarray(offset))\n offset += length\n return i\n }\n\n let version = next() as V\n let codec = DAG_PB_CODE as C\n if (version as number === 18) {\n // CIDv0\n version = 0 as V\n offset = 0\n } else {\n codec = next() as C\n }\n\n if (version !== 0 && version !== 1) {\n throw new RangeError(`Invalid CID version ${version}`)\n }\n\n const prefixSize = offset\n const multihashCode = next() as A // multihash code\n const digestSize = next() // multihash length\n const size = offset + digestSize\n const multihashSize = size - prefixSize\n\n return { version, codec, multihashCode, digestSize, multihashSize, size }\n }\n\n /**\n * Takes cid in a string representation and creates an instance. If `base`\n * decoder is not provided will use a default from the configuration. It will\n * throw an error if encoding of the CID is not compatible with supplied (or\n * a default decoder).\n */\n static parse (source: API.ToString, Prefix>, base?: API.MultibaseDecoder): CID {\n const [prefix, bytes] = parseCIDtoBytes(source, base)\n\n const cid = CID.decode(bytes)\n\n if (cid.version === 0 && source[0] !== 'Q') {\n throw Error('Version 0 CID string must not include multibase prefix')\n }\n\n // Cache string representation to avoid computing it on `this.toString()`\n baseCache(cid).set(prefix, source)\n\n return cid\n }\n}\n\nfunction parseCIDtoBytes (source: API.ToString, Prefix>, base?: API.MultibaseDecoder): [Prefix, API.ByteView>] {\n switch (source[0]) {\n // CIDv0 is parsed differently\n case 'Q': {\n const decoder = base ?? base58btc\n return [\n base58btc.prefix as Prefix,\n decoder.decode(`${base58btc.prefix}${source}`)\n ]\n }\n case base58btc.prefix: {\n const decoder = base ?? base58btc\n return [base58btc.prefix as Prefix, decoder.decode(source)]\n }\n case base32.prefix: {\n const decoder = base ?? base32\n return [base32.prefix as Prefix, decoder.decode(source)]\n }\n case base36.prefix: {\n const decoder = base ?? base36\n return [base36.prefix as Prefix, decoder.decode(source)]\n }\n default: {\n if (base == null) {\n throw Error(\n 'To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided'\n )\n }\n return [source[0] as Prefix, base.decode(source)]\n }\n }\n}\n\nfunction toStringV0 (bytes: Uint8Array, cache: Map, base: API.MultibaseEncoder<'z'>): string {\n const { prefix } = base\n if (prefix !== base58btc.prefix) {\n throw Error(`Cannot string encode V0 in ${base.name} encoding`)\n }\n\n const cid = cache.get(prefix)\n if (cid == null) {\n const cid = base.encode(bytes).slice(1)\n cache.set(prefix, cid)\n return cid\n } else {\n return cid\n }\n}\n\nfunction toStringV1 (bytes: Uint8Array, cache: Map, base: API.MultibaseEncoder): string {\n const { prefix } = base\n const cid = cache.get(prefix)\n if (cid == null) {\n const cid = base.encode(bytes)\n cache.set(prefix, cid)\n return cid\n } else {\n return cid\n }\n}\n\nconst DAG_PB_CODE = 0x70\nconst SHA_256_CODE = 0x12\n\nfunction encodeCID (version: API.Version, code: number, multihash: Uint8Array): Uint8Array {\n const codeOffset = varint.encodingLength(version)\n const hashOffset = codeOffset + varint.encodingLength(code)\n const bytes = new Uint8Array(hashOffset + multihash.byteLength)\n varint.encodeTo(version, bytes, 0)\n varint.encodeTo(code, bytes, codeOffset)\n bytes.set(multihash, hashOffset)\n return bytes\n}\n\nconst cidSymbol = Symbol.for('@ipld/js-cid/CID')\n", "import type { ArrayBufferView, ByteView } from './interface.js'\n\nconst textEncoder = new TextEncoder()\nconst textDecoder = new TextDecoder()\n\nexport const name = 'json'\nexport const code = 0x0200\n\nexport function encode (node: T): ByteView {\n return textEncoder.encode(JSON.stringify(node))\n}\n\nexport function decode (data: ByteView | ArrayBufferView): T {\n return JSON.parse(textDecoder.decode(data))\n}\n", "import * as Digest from './digest.js'\nimport type { MultihashHasher } from './interface.js'\n\ntype Await = Promise | T\n\nexport function from ({ name, code, encode }: { name: Name, code: Code, encode(input: Uint8Array): Await }): Hasher {\n return new Hasher(name, code, encode)\n}\n\n/**\n * Hasher represents a hashing algorithm implementation that produces as\n * `MultihashDigest`.\n */\nexport class Hasher implements MultihashHasher {\n readonly name: Name\n readonly code: Code\n readonly encode: (input: Uint8Array) => Await\n\n constructor (name: Name, code: Code, encode: (input: Uint8Array) => Await) {\n this.name = name\n this.code = code\n this.encode = encode\n }\n\n digest (input: Uint8Array): Await> {\n if (input instanceof Uint8Array) {\n const result = this.encode(input)\n return result instanceof Uint8Array\n ? Digest.create(this.code, result)\n /* c8 ignore next 1 */\n : result.then(digest => Digest.create(this.code, digest))\n } else {\n throw Error('Unknown type, must be binary type')\n /* c8 ignore next 1 */\n }\n }\n}\n", "/* global crypto */\n\nimport { from } from './hasher.js'\n\nfunction sha (name: AlgorithmIdentifier): (data: Uint8Array) => Promise {\n return async data => new Uint8Array(await crypto.subtle.digest(name, data))\n}\n\nexport const sha256 = from({\n name: 'sha2-256',\n code: 0x12,\n encode: sha('SHA-256')\n})\n\nexport const sha512 = from({\n name: 'sha2-512',\n code: 0x13,\n encode: sha('SHA-512')\n})\n", "import { CID } from \"multiformats/cid\";\nimport * as json from \"multiformats/codecs/json\";\nimport { sha256 } from \"multiformats/hashes/sha2\";\n\nconst hashBrowser = async (val: string) => {\n const bytes = json.encode(val);\n\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, json.code, hash);\n\n return cid.toString();\n};\n\nexport default hashBrowser;\n", "const isJSON = (str: string) => {\n try {\n JSON.parse(str);\n } catch (_e) {\n return false;\n }\n return true;\n};\n\nexport default isJSON;\n", "import select from \"./dom.js\";\n\nconst _getBasePageTitle = () => {\n const titleSections = document.title.split(\"|\");\n const baseTitle = titleSections[0];\n return baseTitle;\n};\n\nconst setPageTitle = (what) => {\n const baseTitle = _getBasePageTitle();\n document.title = baseTitle.trim() + \" | \" + what.trim();\n select(\".title h3\").html(what.trim());\n};\n\nconst resetPageTitle = () => {\n const baseTitle = _getBasePageTitle();\n document.title = baseTitle;\n select(\"title\").innerHTML(`${TITLE_NAME} ${VERSION}`);\n select(\".title h3\").innerHTML(\n `${TITLE_NAME} ${VERSION}`,\n );\n};\n\nexport { resetPageTitle, setPageTitle };\n", "export const url = {\n baseUrl: `${globalThis.location.origin}${globalThis.location.pathname}`,\n get: function () {\n return globalThis.location.href;\n },\n getPageId: function (url = globalThis.location.href) {\n const URLObject = new URL(url);\n const hash = URLObject.hash.slice(1);\n const hashWithVersion = hash.split(\"?\");\n const pageId = hashWithVersion[0] || null;\n return pageId;\n },\n getSearchParams: function (url = globalThis.location.href) {\n const URLObject = new URL(url);\n const urlParts = URLObject.href.split(\"?\");\n const currentParams = urlParts[1] || \"\";\n const searchParams = new URLSearchParams(currentParams);\n return searchParams;\n },\n getParamsObject: function (\n url = globalThis.location.href,\n ): Record {\n const params = this.getSearchParams(url);\n let parametersObject = {};\n for (const key of params.keys()) {\n parametersObject = {\n ...parametersObject,\n [key]: this.getSearchParam(key, url),\n };\n }\n return parametersObject;\n },\n getSearchParam(param: string, url = globalThis.location.href) {\n const params = this.getSearchParams(url);\n const paramValue = params.get(param);\n return paramValue;\n },\n deleteParam: function (param: string | Array) {\n const searchParams = this.getSearchParams();\n if (Array.isArray(param)) {\n param.forEach((p) => {\n searchParams.delete(p);\n });\n } else {\n searchParams.delete(param);\n }\n const { pathname } = globalThis.location;\n const hash = this.getPageId();\n return globalThis.location.assign(\n `${hash ? `#${hash}` : pathname}${\n searchParams.toString() ? `?${searchParams.toString()}` : \"\"\n }`,\n );\n },\n // @ts-ignore as this is not ideal here along with TS\n set: function (pageId = this.getPageId(), params = this.getParamsObject()) {\n const allParams = {\n ...this.getParamsObject(),\n ...params,\n };\n const newParams = new URLSearchParams(allParams);\n return globalThis.location.assign(`#${pageId}?${newParams.toString()}`);\n },\n};\n", "import select from \"../../utils/dom.js\";\n\nexport const setSavedState = (saved = true) => {\n if (saved) {\n select(\"#save\").removeClass(\"unsaved\");\n select(\"#logo\").removeClass(\"unsaved\");\n } else {\n select(\"#save\").addClass(\"unsaved\");\n select(\"#logo\").addClass(\"unsaved\");\n }\n};\n", "import select from \"../../../utils/dom.js\";\nimport { deleteFileOnGist } from \"../../../utils/github/api.ts\";\nimport hashBrowser from \"../../../utils/hashBrowser.ts\";\nimport isJSON from \"../../../utils/isJSON.ts\";\nimport storage from \"../../../utils/localstorage.js\";\nimport { resetPageTitle, setPageTitle } from \"../../../utils/pageTitle.js\";\nimport { url } from \"../../../utils/urlManager.ts\";\nimport notify from \"../../molecules/notify.ts\";\nimport commander from \"../commander/commander.ts\";\nimport { setSavedState } from \"../../../ui/functions/savedState.ts\";\n\nconst encodeTitle = (title: string) => {\n const encodedTitle = encodeURIComponent(title);\n if (encodedTitle.length === 0) {\n throw new Error(\"You need to start with a valid title for your note!\");\n }\n return encodedTitle;\n};\n\nexport const getDateCreatedFromTitle = (title: string): number => {\n const titleID = getTitleId(title);\n const note = getNote(titleID);\n if (note) {\n const { dateCreated } = note;\n return dateCreated;\n }\n throw new Error(`Note \"${title}\" cannot found!`);\n};\n\nexport const markNoteForDeletion = (id: string) => {\n const note = getNote(id);\n if (note) {\n localStorage.setItem(\n id,\n JSON.stringify({\n title: note.title,\n deleted: true,\n revisions: note.revisions,\n }),\n );\n }\n};\n\nexport type Note = {\n id: string;\n title: string;\n text: string;\n dateCreated: number;\n deleted: boolean;\n lines: Array;\n numberOfRevisions: number;\n disableSync: boolean;\n revisions: {\n [key: string]: {\n text: string;\n dateCreated: number;\n };\n };\n};\n\nexport const getNote = (\n titleID = url.getPageId(),\n revision?: string,\n): Note | null => {\n let doc;\n try {\n doc = JSON.parse(storage.get(titleID));\n if (!doc.revisions) {\n throw new Error(\"This is not a note!\");\n }\n } catch (_e) {\n return null;\n }\n\n const newerNote = doc\n ? Object.values(doc.revisions).reduce(\n // deno-lint-ignore no-explicit-any\n (acc: any, note: any) => note.dateCreated > acc.dateCreated ? note : acc,\n { dateCreated: 0 },\n )\n : {};\n\n const noteToReturn = revision ? doc.revisions[revision] : newerNote;\n\n return titleID\n ? {\n ...doc,\n id: titleID,\n ...(noteToReturn ? noteToReturn : {}),\n numberOfRevisions: doc && doc.revisions\n ? Object.keys(doc.revisions).length\n : undefined,\n title: doc.title,\n }\n : null;\n};\n\nexport const disableSyncOnCurrentNote = (value: boolean) => {\n const note = getNote();\n if (note) {\n storage.update(note.id, {\n disableSync: value,\n });\n notify.info(\n `\"${note.title}\" cloud sync ${value ? \"disabled \uD83D\uDE36\" : \"enabled \u26A1\uFE0F\"}`,\n );\n }\n};\n\nexport const setNoteFromHash = (hash = url.getPageId()) => {\n if (hash) {\n const version = url.getSearchParam(\"v\") || undefined;\n const note = getNote(undefined, version);\n if (note) {\n select(\"#revisions\").html(\n `${note.numberOfRevisions} revision${\n note.numberOfRevisions > 1 ? \"s\" : \"\"\n }`,\n );\n setPageTitle(note.title);\n select(\".terminal\").setValue(note.text);\n }\n\n if (!note) {\n notify.error(\"404 Note not found \uD83E\uDD37\u200D\u2642\uFE0F\");\n }\n }\n};\n\nexport const resetNoteManager = () => {\n location.hash = \"\";\n resetPageTitle();\n select(\"#revisions\").html(\"\");\n select(\".terminal\").setValue(\"\").focus();\n setSavedState();\n};\n\nexport const getTitle = (note = \"\") =>\n note.split(\"\\n\")[0].trim().replace(\"#\", \"\").trim();\n\nexport const getTitleId = (note: string) => {\n const title = getTitle(note);\n return encodeTitle(title);\n};\n\nexport const updateNote = async (what: string) => {\n if (what.length) {\n const titleID = getTitleId(what);\n const title = getTitle(what);\n const existingNote = getNote(titleID);\n if (existingNote === null) {\n // new existingNote\n return saveNote(what);\n }\n const { text } = existingNote;\n const hashOfIncomingNote = await hashBrowser(what);\n const hashOfCurrentNote = await hashBrowser(text);\n\n if (hashOfIncomingNote === hashOfCurrentNote) {\n return;\n }\n\n const currentNote = storage.get(titleID);\n const note = JSON.parse(currentNote);\n storage.set(\n titleID,\n JSON.stringify({\n ...note,\n title,\n revisions: {\n ...((note && note.revisions) || {}),\n [hashOfIncomingNote]: {\n dateCreated: Date.now(),\n text: what,\n },\n },\n }),\n );\n }\n};\n\nexport const saveNote = async (\n what = select(\".terminal\").getValue(),\n) => {\n await storage.saveToDictionary(what);\n if (what.length) {\n const hash = await hashBrowser(what);\n try {\n const title = what.split(\"\\n\")[0].trim().replace(\"#\", \"\").trim();\n\n setPageTitle(title);\n\n const titleID = encodeTitle(title);\n const currentNote = storage.get(titleID);\n const note = JSON.parse(currentNote);\n storage.set(\n titleID,\n JSON.stringify({\n ...note,\n title,\n lines: what.split(\"\\n\"),\n revisions: {\n ...((note && note.revisions) || {}),\n [hash]: {\n dateCreated: Date.now(),\n text: what,\n },\n },\n }),\n );\n url.set(titleID, {\n v: hash,\n });\n storage.set(\"lastLocalUpdate\", new Date());\n notify.success(\"\uD83D\uDC4C Note saved!\");\n setSavedState();\n } catch (e) {\n notify.error(\n `\uD83D\uDE31 Something went wrong while trying to save to local storage ${e}`,\n );\n }\n } else {\n notify.warning(\"\uD83D\uDE15 Nothing to save!\"); // eslint-disable-line\n }\n};\n\nexport const getNotes = ({\n includeDeleted = false,\n}: {\n includeDeleted?: boolean;\n} = {}): Array =>\n Object.entries(localStorage)\n .filter(([, body]) => typeof body === \"string\")\n .filter(([id, body]) => !id.startsWith(\"__\") && isJSON(body))\n .map(([id, body]) => [id, JSON.parse(body)])\n .filter(([, body]) => !!body.title) // check if title exists and therefore is a note\n .reduce((acc, [noteId]) => [...acc, getNote(noteId)], [])\n .filter(({ deleted }) => (includeDeleted ? true : !deleted));\n\nexport const search = (q: string | null = null) => {\n if (!q) {\n return undefined;\n }\n\n const results = getNotes()\n .map(({ id }) => getNote(id))\n .filter((note) => note !== null)\n .filter(({ text }) => {\n return text.toLowerCase().includes(q.toLowerCase());\n });\n\n return results[0];\n};\n\nexport const deleteNote = () => {\n const confirmation = confirm(\"Are you sure you want do that?\");\n if (confirmation) {\n const note = getNote();\n resetNoteManager();\n if (note && note.id) {\n deleteFileOnGist(note.id);\n markNoteForDeletion(note.id);\n }\n }\n commander.hide();\n};\n", "import storage from \"./localstorage.js\";\n\nexport const isUserLoggedIn = () => {\n return !!storage.get(\"authToken\");\n};\n", "import { isElement } from \"../../../utils/dom.js\";\n\nexport const command = (\n { title, secondary, onclick, onSecondaryClick, icon },\n selected = false,\n) => {\n const li = document.createElement(\"LI\");\n li.className = selected ? \"selected\" : \"\";\n if (icon) {\n const iconClone = icon.cloneNode(true);\n li.appendChild(iconClone);\n }\n const liContent = isElement(title) ? title : document.createTextNode(title);\n liContent.onclick = onclick;\n li.appendChild(liContent);\n\n const span = document.createElement(\"span\");\n if (secondary) {\n span.className = \"secondary\";\n const secondaryElement = isElement(secondary)\n ? secondary\n : document.createTextNode(secondary);\n secondaryElement.onclick = onSecondaryClick;\n span.appendChild(secondaryElement);\n }\n li.appendChild(span);\n\n return li;\n};\n", "export const wordParts = (word: string, match: string) => {\n const parts = word.toLowerCase().split(match);\n\n let indexInWord = 0;\n return parts\n // @ts-ignore js-to-ts wider refactoring required\n .reduce((acc, part, i) => {\n return [...acc, ...(i === 0 ? [part] : [match, part])];\n }, [])\n // @ts-ignore js-to-ts wider refactoring required\n .filter((p) => p !== \"\")\n // @ts-ignore js-to-ts wider refactoring required\n .map((syllable) => {\n indexInWord = indexInWord + syllable.length;\n const start = indexInWord - syllable.length;\n const end = start + syllable.length;\n const originalSyllable = word.slice(start, end);\n return originalSyllable;\n });\n};\n", "import { wordParts } from \"./wordParts.ts\";\n\nconst mark = (word) => {\n const markEl = document.createElement(\"mark\");\n markEl.appendChild(document.createTextNode(word));\n return markEl;\n};\n\nexport const div = ({ content = \"\", highlight = \"\" }) => {\n const div = document.createElement(\"div\");\n const words = content.split(\" \");\n const wordsToHighlight = highlight.toLowerCase().split(\" \");\n if (highlight.trim() === \"\") {\n div.appendChild(document.createTextNode(content));\n return div;\n }\n words\n .map((word) => {\n const matches = wordsToHighlight\n .map((wordToHighlight) => {\n return word.toLocaleLowerCase().includes(wordToHighlight)\n ? wordToHighlight\n : undefined;\n })\n .filter((m) => m !== undefined);\n\n return {\n word: word,\n matches: matches,\n };\n })\n .forEach(({ word, matches }) => {\n if (matches.length > 0) {\n const match = matches[0];\n if (word === match) {\n div.appendChild(mark(` ${word}`));\n } else {\n const parts = wordParts(word, match);\n const wordElements = parts.map((syllable) =>\n syllable.toLowerCase() === match\n ? mark(syllable)\n : document.createTextNode(syllable)\n );\n div.appendChild(document.createTextNode(\" \"));\n wordElements.forEach((w) => {\n div.appendChild(w);\n });\n }\n } else {\n div.appendChild(document.createTextNode(` ${word} `));\n }\n });\n return div;\n};\n", "import {\n createNewGist,\n getAuthenticatedUsersGists,\n getAuthToken,\n getGist,\n} from \"./api.ts\";\nimport storage from \"../localstorage.js\";\nimport { url } from \"../urlManager.ts\";\nimport select from \"../dom.js\";\nimport { configuration } from \"../../../configuration.ts\";\nimport { updateNote } from \"../../components/organisms/noteManager/noteManager.ts\";\nimport notify from \"../../components/molecules/notify.ts\";\nimport { command } from \"../../components/molecules/commands/command.js\";\nimport commander from \"../../components/organisms/commander/commander.ts\";\nimport { div } from \"../../components/atoms/div/div.js\";\n\nexport const goAuthenticate = () => {\n notify.info(\"You need to be authenticated!\");\n commander.hide();\n return globalThis.location.replace(\n `https://github.com/login/oauth/authorize?client_id=${configuration.github.client_id}&scope=gist&state=${configuration.github.request_state}`,\n );\n};\n\nexport const setGistToSyncWith = async (token) => {\n notify.info(\"Downloading my Gists!\");\n const gists = await getAuthenticatedUsersGists(token);\n commander.setState({\n mode: commander.getModes().gists,\n });\n\n notify.info(\"Select Gist to sync with\");\n const gistOptions = gists\n .sort(\n (a, b) =>\n new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime(),\n )\n .map(({ description, updated_at, id }) => ({\n title: div({ content: `${description}(${id})` }),\n secondary: updated_at,\n onclick: async () => {\n await storage.set(\"gistId\", id);\n notify.success(`${description}(${id}) selected for synchronization!`);\n syncNotesWithGitHub();\n commander.hide();\n },\n }));\n\n const gistOptionComponents = command([\n {\n title: \"Create a new Gist\",\n onclick: async () => {\n notify.info(\"Syncing your MiroPads to a new Gist\");\n try {\n const { id } = await createNewGist();\n storage.set(\"gistId\", id);\n notify.success(\"MiroPads synced to a new Gist \uD83C\uDF89\");\n } catch (error) {\n notify.error(error.message);\n }\n commander.hide();\n },\n },\n ...gistOptions,\n ]);\n select(\"#commands\").html(\"\");\n select(\"#commands\").append(gistOptionComponents);\n};\n\nexport const syncNotesWithGitHub = async (gistId = storage.get(\"gistId\")) => {\n const authToken = storage.get(\"authToken\");\n if (authToken && gistId) {\n select(\"#logo\").addClass(\"loading\");\n const { files } = await getGist(gistId);\n Object.values(files).forEach(({ content }) => {\n updateNote(content);\n });\n storage.set(\"lastSync\", new Date());\n notify.success(\"\u2B07 MiroPad synced \u2705\");\n select(\"#logo\").removeClass(\"loading\");\n }\n};\n\nexport const setAuthTokenFromCallback = async () => {\n const code = url.getSearchParam(\"code\");\n const state = url.getSearchParam(\"state\");\n if (code && state) {\n select(\"#logo\").addClass(\"loading\");\n notify.info(\"\uD83D\uDD10 Authenticating...\");\n try {\n const { token } = await getAuthToken(code, state);\n storage.set(\"authToken\", token);\n notify.info(\"\u26F3 You have been authenticated!\");\n url.deleteParam([\"code\", \"state\"]);\n } catch (error) {\n notify.error(error.message);\n }\n select(\"#logo\").removeClass(\"loading\");\n }\n};\n", "import notify from \"../../components/molecules/notify.ts\";\n\nconst getNewFileHandle = async (title = \"no-titled\") => {\n const options = {\n suggestedName: `${title}`,\n types: [\n {\n description: \"MiroPad text notes\",\n accept: {\n \"text/plain\": [\".miropad\"],\n },\n },\n ],\n };\n\n // @ts-ignore as this is an experimental browser feature\n // and may need to change https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker\n const handle = await globalThis.showSaveFilePicker(options);\n return handle;\n};\n\nexport const writeFile = async (\n fileHandle: FileSystemFileHandle,\n contents: string,\n) => {\n // Create a FileSystemWritableFileStream to write to.\n const writable = await fileHandle.createWritable();\n // Write the contents of the file to the stream.\n await writable.write(contents);\n // Close the file and write the contents to disk.\n await writable.close();\n};\n\n/**\n * Saves a new file to disk.\n */\nexport const saveFileAs = async (contents: string, title?: string) => {\n try {\n const fileHandle = await getNewFileHandle(title);\n await writeFile(fileHandle, contents);\n } catch (_e) {\n const msg = \"An error occurred trying to save the file.\";\n notify.error(msg);\n return;\n }\n};\n\nexport const saveDataToFile = (() => {\n const a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.setAttribute(\"style\", \"display: none\");\n return (\n data: unknown,\n fileName = `MiroPad-${new Date().toISOString()}.json`,\n ) => {\n const json = JSON.stringify(data),\n blob = new Blob([json], { type: \"octet/stream\" }),\n url = globalThis.URL.createObjectURL(blob);\n a.href = url;\n a.download = fileName;\n a.click();\n globalThis.URL.revokeObjectURL(url);\n };\n})();\n", "import type _Showdown from \"npm:@types/showdown\";\nimport showdown from \"showdown\";\n\nconst converter = new showdown.Converter({\n tasklists: true,\n underline: true,\n emoji: true,\n simplifiedAutoLink: true,\n tables: true,\n openLinksInNewWindow: true,\n});\n\nconverter.setFlavor(\"github\");\n\nexport const convertMarkDownToHtml = (md: string) => converter.makeHtml(md);\n", "import storage from \"./localstorage.js\";\nimport notify from \"../components/molecules/notify.ts\";\nimport { configuration } from \"../../configuration.ts\";\nimport { getTitle } from \"../components/organisms/noteManager/noteManager.ts\";\nimport { convertMarkDownToHtml } from \"../components/organisms/markdown/mdToHtml.ts\";\n\nexport const handleErrorResponse = (response) => {\n const isSuccessfulRequest = response.status.toString().slice(0, 1) === \"2\";\n if (isSuccessfulRequest) return response;\n else throw new Error(response);\n};\n\nconst wrapTemplate = (body = \"\") => {\n return `\n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n\n \n
    \n
    \n `;\n};\n\nconst sendMail = async (body, email, subject = \"MiroPad note\") => {\n if (!body) {\n notify.error(\"\uD83D\uDC7B No message to send, type something and try again! \uD83E\uDD13\");\n return undefined;\n }\n try {\n await fetch(`${configuration.mail_service.api}`, {\n method: \"POST\",\n headers: {\n \"x-secret-token\": storage.get(\"MIROPAD_SECRET_TOKEN\"),\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n },\n body: JSON.stringify({\n to: email,\n subject,\n html: wrapTemplate(body),\n }),\n })\n .then(handleErrorResponse)\n .then((response) => response.json());\n\n notify.success(\"Email sent \uD83D\uDE80\");\n } catch (_e) {\n notify.error(\n \"Error not went through \uD83D\uDCA5! Check your credentials and try again!\",\n );\n }\n};\n\nconst getUserMailingPreferences = () => {\n const savedMail = storage.get(\"mail\");\n if (savedMail) {\n const mailSameAgainQuestion = globalThis.prompt(\n `Mail ${savedMail} again? (y)es/(no)`,\n \"yeap\",\n );\n if (mailSameAgainQuestion === null) {\n return mailSameAgainQuestion;\n }\n if (mailSameAgainQuestion.slice(0, 1).toLowerCase() === \"y\") {\n return savedMail;\n }\n }\n const whoMailing = globalThis.prompt(\"Where do you wanna send the mail to?\");\n const wannaSaveDat = globalThis.prompt(\n \"Do you wanna save that to your preferences for later on? (y)es/(no)\",\n \"yeap\",\n );\n if (wannaSaveDat && wannaSaveDat.slice(0, 1).toLowerCase() === \"y\") {\n storage.set(\"mail\", whoMailing);\n }\n return whoMailing;\n};\n\nconst mailTo = (what) => {\n const email = getUserMailingPreferences();\n if (email === null) {\n notify.info(\"Sending mail cancelled \uD83D\uDE36\");\n return undefined;\n }\n\n notify.info(\"Sending mail... \uD83D\uDE80\");\n const title = getTitle(what);\n const htmlBody = convertMarkDownToHtml(what);\n\n sendMail(htmlBody, email, title);\n};\n\nexport { mailTo };\n", "import notify from \"../components/molecules/notify.ts\";\n\nexport const copyToClipboard = async (\n what: string,\n message = \"\uD83D\uDCCB Copied to clipboard\",\n) => {\n try {\n await navigator.clipboard.writeText(what);\n notify.success(message);\n } catch (error) {\n notify.error((error as Error).message);\n }\n};\n", "import { isArray } from \"../../../utils/isArray.ts\";\n\nexport const button = (els, fn, id) => {\n const elements = isArray(els) ? els : [els];\n const button = document.createElement(\"button\");\n button.setAttribute(\"type\", \"button\");\n if (id) {\n button.setAttribute(\"id\", id);\n }\n elements.forEach((element) => {\n if (typeof element === \"string\") {\n button.appendChild(document.createTextNode(element));\n } else {\n button.appendChild(element);\n }\n });\n button.onclick = (e) => fn(e);\n\n return button;\n};\n", "import select from \"../../../utils/dom.js\";\nimport { url } from \"../../../utils/urlManager.ts\";\nimport { copyToClipboard } from \"../../../utils/copyToClipboard.ts\";\nimport { button } from \"../../atoms/button/button.js\";\nimport { convertMarkDownToHtml } from \"./mdToHtml.ts\";\nimport storage from \"../../../utils/localstorage.js\";\n\nconst markDownViewer = (() => {\n return {\n view: select(\".preview\"),\n init: function () {\n this.update();\n select(\".terminal\").listen(\"input\", () => this.update());\n const isVisible = Boolean(url.getSearchParam(\"md\"));\n if (isVisible) {\n this.view.show();\n } else {\n this.view.hide();\n }\n return this;\n },\n autoLink: function () {\n const autoLinks = storage.parse(\"__auto-links__\");\n // Regular expression to match any words starting with the given patterns\n const replacingPatterns = Object.keys(autoLinks)\n .map((pattern) => `${pattern}\\\\w+`)\n .join(\"|\");\n const regex = new RegExp(`(${replacingPatterns})`, \"g\");\n\n const updatedHTML = this.view.el.innerHTML.replace(regex, (match) => {\n const matchingKey = Object.keys(autoLinks).find((link) =>\n match.startsWith(link)\n );\n const link = autoLinks[matchingKey];\n return link.startsWith(\"http\")\n ? `
    ${match}`\n : `${match}`;\n });\n // Replace each matching text with a link\n this.view.innerHTML(updatedHTML);\n },\n update: function () {\n const md = select(\".terminal\").getValue();\n\n this.view.innerHTML(convertMarkDownToHtml(md));\n\n this.autoLink();\n\n const { elements } = select(\"pre\");\n Array.prototype.slice.call(elements).forEach((el) => {\n const copyBtn = button(\"\uD83D\uDCCB Copy\", async (e) => {\n e.stopPropagation();\n const codeToCopy = e.srcElement.previousSibling.innerHTML;\n await copyToClipboard(codeToCopy, \"\uD83D\uDCCB Code copied to clipboard\");\n });\n el.appendChild(copyBtn);\n });\n\n select(\"code\").listenAll(\"click\", ({ innerHTML }) => {\n const result = eval(innerHTML);\n select(\".console\").show().innerHTML(result);\n });\n select(\".console\").listen(\"click\", async (e) => {\n e.srcElement.classList.add(\"hidden\");\n const codeToCopy = e.srcElement.innerHTML;\n await copyToClipboard(codeToCopy, \"\uD83D\uDCCB Code copied to clipboard\");\n });\n },\n show: function (mode = true) {\n this.view.show();\n url.set(undefined, {\n md: mode,\n });\n },\n hide: function () {\n this.view.hide();\n url.deleteParam(\"md\");\n },\n toggle: function (mode = \"true\") {\n if (url.getSearchParam(\"md\") === mode) {\n this.hide();\n } else {\n this.show(mode);\n }\n return this;\n },\n };\n})();\n\nexport default markDownViewer;\n", "import isJSON from \"./isJSON.ts\";\nimport notify from \"../components/molecules/notify.ts\";\n\nconst prettifyJSON = (selector) => {\n const el = document.querySelector(selector);\n if (isJSON(el.value)) {\n const prettifiedJSON = JSON.stringify(JSON.parse(el.value), null, 2);\n el.value = prettifiedJSON;\n notify.success(\"\uD83D\uDC4D JSON value prettified\");\n } else {\n notify.error(\"\uD83D\uDE27 Value is not in valid JSON format\");\n }\n};\n\nexport default prettifyJSON;\n", "export const sleep = (ms = 1000) =>\n new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n", "export const icon = (svgIcon, altText, className) => {\n const image = document.createElement(\"IMG\");\n\n if (className) image.classList.add(className);\n if (altText) image.setAttribute(\"alt\", altText);\n image.setAttribute(\"src\", svgIcon);\n return image;\n};\n", "import notify from \"../components/molecules/notify.ts\";\nimport { getNote } from \"../components/organisms/noteManager/noteManager.ts\";\nimport { url } from \"./urlManager.ts\";\n\nexport const share = async () => {\n try {\n const note = getNote();\n const currentUrl = url.get();\n await navigator.share({\n title: note ? note.title : TITLE_NAME,\n text: note ? note.text : \"Temporary note keeping app for the browser\",\n url: currentUrl,\n });\n } catch (error) {\n notify.info(`${error.message}`);\n }\n};\n", "import {\n deleteNote,\n getNote,\n getNotes,\n resetNoteManager,\n saveNote,\n} from \"../noteManager/noteManager.ts\";\nimport select from \"../../../utils/dom.js\";\nimport storage from \"../../../utils/localstorage.js\";\nimport { isUserLoggedIn } from \"../../../utils/isUserLoggedIn.js\";\nimport {\n goAuthenticate,\n setGistToSyncWith,\n syncNotesWithGitHub,\n} from \"../../../utils/github/actions.js\";\nimport commander from \"./commander.ts\";\nimport {\n saveDataToFile,\n saveFileAs,\n} from \"../../../utils/fileSystem/fileSystem.ts\";\nimport { url } from \"../../../utils/urlManager.ts\";\nimport { mailTo } from \"../../../utils/mail.js\";\nimport markDownViewer from \"../markdown/markDownViewer.js\";\nimport prettifyJSON from \"../../../utils/prettifyJSON.js\";\nimport notify from \"../../molecules/notify.ts\";\nimport { copyToClipboard } from \"../../../utils/copyToClipboard.ts\";\nimport { sleep } from \"../../../utils/sleep.js\";\nimport { publishGist, updateGist } from \"../../../utils/github/api.ts\";\nimport { icon } from \"../../atoms/icon/icon.js\";\nimport * as ListSVG from \"../../../../assets/svg/list.svg\";\nimport * as TrashSVG from \"../../../../assets/svg/trash.svg\";\nimport * as CheckmarkCircleSVG from \"../../../../assets/svg/checkmark-circle.svg\";\nimport * as CloudSyncSVG from \"../../../../assets/svg/cloud-sync.svg\";\nimport * as LighterSVG from \"../../../../assets/svg/lighter.svg\";\nimport * as EnterDownSVG from \"../../../../assets/svg/enter-down.svg\";\nimport * as DownloadSVG from \"../../../../assets/svg/download.svg\";\nimport * as EnvelopeSVG from \"../../../../assets/svg/envelope.svg\";\nimport * as BugSVG from \"../../../../assets/svg/bug.svg\";\nimport * as PictureSVG from \"../../../../assets/svg/picture.svg\";\nimport * as PrinterSVG from \"../../../../assets/svg/printer.svg\";\nimport * as PageBreakSVG from \"../../../../assets/svg/page-break.svg\";\nimport * as FrameExpandSVG from \"../../../../assets/svg/frame-expand.svg\";\nimport * as ArrowRightCircleSVG from \"../../../../assets/svg/arrow-right-circle.svg\";\nimport * as MagicWandSVG from \"../../../../assets/svg/magic-wand.svg\";\nimport * as RocketSVG from \"../../../../assets/svg/rocket.svg\";\nimport * as SpellCheckSVG from \"../../../../assets/svg/spell-check.svg\";\nimport * as PencilSVG from \"../../../../assets/svg/pencil.svg\";\nimport * as ShareSVG from \"../../../../assets/svg/exit-up.svg\";\nimport * as LeafSVG from \"../../../../assets/svg/leaf.svg\";\nimport { share } from \"../../../utils/webShare.js\";\nimport { setSavedState } from \"../../../ui/functions/savedState.ts\";\n\nconst getSyncTitle = () => {\n const gistId = storage.get(\"gistId\");\n const authToken = storage.get(\"authToken\");\n if (!authToken) {\n return \"Sync: Authorize your GitHub account for synchronisation\";\n }\n if (!gistId) {\n return \"Sync: Pick your Gist to sync with\";\n }\n return \"Sync: Notes with my GitHub Gist\";\n};\n\nconst shareNoteCommand = {\n title: \"Share note\",\n icon: icon(ShareSVG, \"share note\"),\n sortTitle: \"Share\",\n call: share,\n};\n\nconst sharePublicLinkCommand = {\n title: \"Share public link\",\n key: null,\n icon: icon(ShareSVG, \"share public link\"),\n sortTitle: \"Share public link\",\n call: async () => {\n commander.hide();\n await saveNote(select(\".terminal\").getValue());\n const note = getNote();\n if (note) {\n const response = await publishGist({\n note,\n });\n const rawLink = response.history[0].url;\n const gitResponse = await fetch(rawLink).then((response) =>\n response.json()\n );\n const { files } = gitResponse;\n const fileContents = Object.values(files);\n const [gistFile] = fileContents;\n const { raw_url: rawUrl } = gistFile as { raw_url: string };\n const linkToShare = `${url.baseUrl}?raw=${rawUrl}`;\n const successMessage = \"MiroPad public link copied to clipboard \uD83D\uDCCB!\";\n copyToClipboard(linkToShare, successMessage);\n }\n },\n};\n\nexport const commands = () => {\n return [\n {\n title: \"New note\",\n icon: icon(PencilSVG, \"new note\"),\n sortTitle: \"New\",\n key: \"n\",\n call: resetNoteManager,\n },\n {\n title: \"Save\",\n key: \"s\",\n icon: icon(CheckmarkCircleSVG, \"save\"),\n sortTitle: \"Save\",\n call: async () => {\n commander.hide();\n await saveNote(select(\".terminal\").getValue());\n const note = getNote();\n if (note && !note.disableSync) {\n updateGist([note]);\n }\n setSavedState();\n },\n },\n // @ts-ignore ts cannot cope with browser mess\n ...(navigator.share ? [shareNoteCommand] : []),\n {\n title: \"Toggle MarkDown Viewer\",\n icon: icon(PageBreakSVG, \"toggle markdown viewer\", \"rotate90\"),\n sortTitle: \"Split\",\n key: \"m\",\n call: () => {\n markDownViewer.toggle();\n commander.hide();\n },\n },\n {\n title: \"Full MarkDown view\",\n icon: icon(FrameExpandSVG, \"full view\"),\n sortTitle: \"Full view\",\n key: \"shift m\",\n call: () => {\n markDownViewer.toggle(\"full\");\n commander.hide();\n },\n },\n ...(isUserLoggedIn() ? [sharePublicLinkCommand] : []),\n {\n title: \"Zen mode\",\n icon: icon(LeafSVG, \"zen mode\"),\n sortTitle: \"Zen mode\",\n key: \"shift z\",\n call: () => {\n const isZen = Boolean(url.getSearchParam(\"zen\"));\n if (isZen) {\n url.deleteParam(\"zen\");\n } else {\n url.set(undefined, {\n zen: true,\n });\n }\n commander.hide();\n },\n },\n {\n title: \"List saved notes\",\n icon: icon(ListSVG, \"list notes\"),\n sortTitle: \"Notes\",\n key: \"p\",\n call: () => commander.toggle(commander.getModes().notes),\n },\n {\n title: \"Delete note\",\n key: \"shift d\",\n icon: icon(TrashSVG, \"delete note\"),\n sortTitle: \"Delete\",\n call: deleteNote,\n },\n {\n title: getSyncTitle(),\n icon: icon(CloudSyncSVG, \"sync with github\"),\n key: null,\n call: async () => {\n const token = storage.get(\"authToken\");\n if (!token) {\n return goAuthenticate();\n }\n const gistId = storage.get(\"gistId\");\n if (!gistId) {\n return await setGistToSyncWith(token);\n }\n commander.hide();\n await syncNotesWithGitHub();\n },\n },\n {\n title: \"Sync: Reset Gist settings\",\n icon: icon(LighterSVG, \"reset github settings\"),\n key: null,\n call: () => {\n localStorage.removeItem(\"authToken\");\n localStorage.removeItem(\"gistId\");\n localStorage.removeItem(\"lastLocalUpdate\");\n localStorage.removeItem(\"lastSync\");\n notify.info(\"Gist setting have been reset!\");\n commander.hide();\n },\n },\n {\n title: \"Toggle sidebar\",\n experimental: true,\n key: \"shift l\",\n call: () => {\n select(\"aside\").toggle();\n },\n },\n {\n title: \"Save to File System...\",\n experimental: true,\n icon: icon(EnterDownSVG, \"save file\"),\n key: \"shift s\",\n call: () => {\n const note = getNote();\n if (note) {\n const { text, title } = note;\n saveFileAs(text, title);\n commander.hide();\n }\n },\n },\n {\n title: \"Email note to...\",\n experimental: true,\n icon: icon(EnvelopeSVG, \"email\"),\n key: \"e\",\n call: () => {\n const note = select(\".terminal\").getValue();\n mailTo(note);\n commander.hide();\n },\n },\n {\n title: \"Toggle experimental features\",\n experimental: false,\n icon: icon(BugSVG, \"lab\"),\n key: null,\n call: () => {\n const previousStatus = Boolean(storage.get(\"__experimental__\"));\n\n if (previousStatus) {\n storage.remove(\"__experimental__\");\n } else {\n storage.set(\"__experimental__\", true);\n }\n notify.showNotification(\n `Experimental features turned ${previousStatus ? \"off\" : \"on\"}`,\n );\n commander.hide();\n },\n },\n {\n title: \"Toggle Autocompletion\",\n experimental: false,\n icon: icon(ArrowRightCircleSVG, \"autocompletion\"),\n key: null,\n call: () => {\n const previousStatus = Boolean(storage.get(\"__autocomplete__\"));\n\n if (previousStatus) {\n storage.remove(\"__autocomplete__\");\n } else {\n storage.set(\"__autocomplete__\", true);\n }\n notify.showNotification(\n `Autocomplete feature turned ${previousStatus ? \"off\" : \"on\"}`,\n );\n commander.hide();\n select(\".terminal\").focus();\n },\n },\n {\n title: \"Add a cover picture\",\n experimental: true,\n icon: icon(PictureSVG, \"cover picture\"),\n key: null,\n call: async () => {\n const bgImage = prompt(\"Paste the image URL in here...\");\n commander.hide();\n await sleep(200); // need to wait after prompt for some reason before copy\n copyToClipboard(\n `

    `,\n \"\uD83D\uDC4CCopied! Paste the code on the MiroPad editor\",\n );\n select(\".terminal\").focus();\n notify.info(\n \"Paste the cover picture wherever you prefer on the MirPad editor\",\n );\n },\n },\n {\n title: \"Print MarkDown output\",\n experimental: true,\n icon: icon(PrinterSVG, \"print\"),\n key: null,\n call: () => {\n select(\".preview\").show();\n markDownViewer.init();\n globalThis.print();\n commander.hide();\n },\n },\n {\n key: \"j\",\n title: \"Prettify JSON document\",\n icon: icon(MagicWandSVG, \"prettify json\"),\n call: () => {\n prettifyJSON(\".terminal\");\n commander.hide();\n },\n },\n {\n title: \"Toggle command palette\",\n icon: icon(RocketSVG, \"toggle command palette\"),\n key: [\"shift p\", \"k\"],\n call: () => commander.toggle(commander.getModes().commands),\n },\n {\n title: \"Find and Replace...\",\n experimental: true,\n icon: icon(SpellCheckSVG, \"find and replace\"),\n key: \"shift f\",\n call: () => {\n const selectedValue = select(\".terminal\")\n .getValue()\n .slice(\n select(\".terminal\").el.selectionStart,\n select(\".terminal\").el.selectionEnd,\n );\n const valueToFind = prompt(\"What do you wanna find?\", selectedValue);\n if (!valueToFind) {\n return notify.info(\"Value not found\");\n }\n const positionOfFirstChar = select(\".terminal\")\n .getValue()\n .indexOf(valueToFind);\n\n select(\".terminal\").el.setSelectionRange(\n positionOfFirstChar,\n positionOfFirstChar + valueToFind.length,\n );\n const replacementValue = prompt(`Replace ${valueToFind} with...`);\n if (replacementValue) {\n select(\".terminal\").el.setRangeText(replacementValue);\n }\n },\n },\n {\n title: \"Download all notes!\",\n icon: icon(DownloadSVG, \"Download all notes on your local file system\"),\n call: () => {\n const notes = getNotes({\n includeDeleted: true,\n });\n saveDataToFile(notes);\n commander.hide();\n },\n },\n {\n title: \"Permanently delete ALL notes \u2757\",\n icon: icon(TrashSVG, \"delete note\"),\n call: () => {\n const confirmation = confirm(\n \"Are you sure you want do delete ALL your notes?\",\n );\n if (confirmation) {\n const notes = getNotes({\n includeDeleted: true,\n });\n notes.forEach((note) => {\n storage.remove(note.id);\n });\n resetNoteManager();\n }\n commander.hide();\n },\n },\n ] as const;\n};\n", "const keyListener = {\n events: [],\n on(key, fn) {\n if (Array.isArray(key)) {\n key.forEach((k) => {\n const finalKey = k.key || k;\n const functionToCall = k.call || fn;\n this.on(finalKey, functionToCall);\n });\n\n return this;\n }\n\n if (key && typeof key === \"string\" && fn && typeof fn === \"function\") {\n this.events = [\n ...this.events,\n {\n key: key.includes(\"shift\") ? key.replace(\"shift\", \"\").trim() : key,\n shift: key.includes(\"shift\"),\n fn() {\n fn();\n },\n },\n ];\n }\n return this;\n },\n listen() {\n document.addEventListener(\"keydown\", (e) => {\n this.handleEvent(e);\n });\n return this;\n },\n handleEvent(e) {\n this.events.map((event) => {\n if (\n event.key === e.key &&\n (e.ctrlKey === true || e.metaKey === true) &&\n e.shiftKey === event.shift\n ) {\n e.preventDefault();\n event.fn();\n }\n return true;\n });\n },\n};\n\nexport default keyListener;\n", "import { isElement } from \"../../../utils/dom.js\";\n\nexport const link = (textOrNode, url) => {\n const a = document.createElement(\"a\");\n a.href = url;\n a.appendChild(\n isElement(textOrNode) ? textOrNode : document.createTextNode(textOrNode),\n );\n return a;\n};\n", "const isSameYear = (aDate, bDate = new Date()) => {\n const yearA = new Date(aDate).getFullYear();\n const yearB = new Date(bDate).getFullYear();\n\n return yearA === yearB;\n};\n\nconst isSameMonth = (aDate, bDate = new Date()) => {\n const monthA = new Date(aDate).getMonth();\n const monthB = new Date(bDate).getMonth();\n\n return monthA === monthB;\n};\n\nconst isSameDateOfMonth = (aDate, bDate = new Date()) => {\n const dateA = new Date(aDate).getDate();\n const dateB = new Date(bDate).getDate();\n\n return dateA === dateB;\n};\n\nconst isSameDate = (aDate, bDate = new Date()) => {\n return (\n isSameYear(aDate, bDate) &&\n isSameMonth(aDate, bDate) &&\n isSameDateOfMonth(aDate, bDate)\n );\n};\n\nconst monthNames = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst shortMonthNames = monthNames.map((name) => name.slice(0, 3));\n\nconst isYesterday = (date = new Date()) => {\n const theDate = new Date(date);\n const yesterDate = new Date().getDate() - 1;\n return (\n isSameMonth(theDate) &&\n isSameYear(theDate) &&\n theDate.getDate() === yesterDate\n );\n};\n\nexport const relativeDate = (dateCreated) => {\n const date = new Date(dateCreated);\n const month = !isYesterday(dateCreated)\n ? shortMonthNames[date.getMonth()]\n : \"\";\n const year = isSameYear(date) ? \"\" : date.getFullYear();\n const day = isYesterday(date) ? \"Yesterday\" : date.getDate();\n\n return `${isSameDate(date) ? \"\" : `${day} ${month} ${year}`} ${\n isSameDate(date) ? date.toLocaleTimeString() : \"\"\n }`;\n};\n", "export const isArraySorted = (arr: Array) => {\n const someArray = arr.reduce((currentValue, item) => {\n if (currentValue.length === 0) {\n return [item];\n }\n const max = Math.max(...currentValue);\n return [...currentValue, ...(item >= max ? [item] : [])];\n }, [] as Array);\n return someArray.length === arr.length;\n};\n", "import { isArraySorted } from \"../../../utils/isArraySorted.ts\";\n\nexport const smartFilter = (phrase: string, filter: string) => {\n const wordParts = phrase.split(\" \").map((w) => w.toLowerCase());\n const filterParts = filter.split(\" \").map((f) => f.toLowerCase());\n const indexes = filterParts.map((f) => {\n const foundIndexes = wordParts.map((w, i) => {\n return w.includes(f) ? i : -1;\n });\n const firstIndexFound = foundIndexes.reduce((currentValue, fi) => {\n return fi > -1 ? fi : currentValue;\n }, -1);\n return firstIndexFound;\n });\n\n if (indexes.includes(-1)) {\n return false;\n }\n return isArraySorted(indexes);\n};\n", "import storage from \"./utils/localstorage.js\";\n\nexport const requestNotificationPermission = async () => {\n if (!storage.get(\"__notification-permission__\")) {\n const permission = await globalThis.Notification.requestPermission();\n storage.set(\"__notification-permission__\", permission);\n }\n};\n\nexport const registerServiceWorker = () => {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker.register(\n `${globalThis.location.pathname}service-worker.js?v=${VERSION}`,\n );\n }\n};\n", "import {\n getDateCreatedFromTitle,\n getNote,\n getNotes,\n} from \"../noteManager/noteManager.ts\";\nimport { commands } from \"./commands.ts\";\nimport keyListener from \"../../../utils/keyListener.js\";\nimport select from \"../../../utils/dom.js\";\nimport { url } from \"../../../utils/urlManager.ts\";\nimport { command } from \"../../molecules/commands/command.js\";\nimport { link } from \"../../atoms/link/link.js\";\nimport { div } from \"../../atoms/div/div.js\";\nimport { relativeDate } from \"../../../utils/dates.js\";\nimport { smartFilter } from \"./smartFilter.ts\";\nimport { button } from \"../../atoms/button/button.js\";\nimport { requestNotificationPermission } from \"../../../registerServiceWorker.js\";\nimport storage from \"../../../utils/localstorage.js\";\n\nconst getShortcut = (key: string | Array): string => {\n if (Array.isArray(key)) {\n return key.map((k) => getShortcut(k)).join(\", \");\n }\n return key ? `\u2318+${key.toUpperCase()}` : \"\";\n};\n\nconst commander = (() => {\n enum CommanderModes {\n off = \"off\",\n notes = \"notes\",\n revisions = \"revisions\",\n commands = \"commands\",\n gists = \"gists\",\n }\n let state = {\n input: \"\",\n mode: CommanderModes.off,\n options: {\n selected: 0,\n length: 0,\n },\n };\n return {\n getState: function () {\n return state;\n },\n getModes: function () {\n return CommanderModes;\n },\n setState: function (newState: Record) {\n state = {\n ...state,\n ...newState,\n };\n return state;\n },\n show: function (what = CommanderModes.commands) {\n select(\"#commander\").show();\n select(\"#commander input\").focus();\n switch (what) {\n case CommanderModes.commands:\n this.generateCommands();\n select(\"#commander input\").setValue(\"> \");\n this.setState({\n mode: CommanderModes.commands,\n });\n break;\n case CommanderModes.notes:\n this.generateNotes();\n select(\"#commander input\").setValue(\"\");\n this.setState({\n mode: CommanderModes.notes,\n });\n break;\n case CommanderModes.revisions:\n this.generateRevisions();\n select(\"#commander input\").setValue(\"\");\n this.setState({\n mode: CommanderModes.revisions,\n });\n break;\n default:\n // do nothing;\n break;\n }\n return this;\n },\n hide: function () {\n select(\"#commander\").hide();\n state.mode = CommanderModes.off;\n return this;\n },\n toggle: function (mode?: CommanderModes) {\n requestNotificationPermission();\n if (state.mode === CommanderModes.off || state.mode !== mode) {\n this.show(mode);\n } else {\n this.hide();\n }\n return this;\n },\n commands: function () {\n return commands();\n },\n selectOption: function (direction: \"down\" | \"up\" = \"down\") {\n const currentlySelected = state.options.selected;\n const lastOption = state.options.length - 1;\n const isLastOption = currentlySelected === lastOption;\n const isFirstOption = currentlySelected === 0;\n const isDown = direction === \"down\";\n\n const indexToSelect = isDown\n ? isLastOption ? 0 : currentlySelected + 1\n : isFirstOption\n ? lastOption\n : currentlySelected - 1;\n\n state.options = {\n ...state.options,\n selected: indexToSelect,\n };\n },\n initCommander: function () {\n // initialize mobile-dock\n commands()\n .slice(0, 5)\n .map((command) => {\n select(\".mobile-dock\").append(\n button(\n // @ts-ignore js-to-ts wider refactoring required\n [command.icon, document.createTextNode(command.sortTitle)],\n command.call,\n command.title.toLowerCase().replace(/\\s/g, \"-\"),\n ),\n );\n });\n\n select(\"#commander button\").listen(\"click\", () => {\n this.hide();\n });\n\n select(\"#commander input\")\n .listen(\"keydown\", (e: KeyboardEvent) => {\n // arrow down 40\n if (e.keyCode === 40) {\n if (state.mode === CommanderModes.revisions) {\n select(\"#commands li.selected\").click();\n }\n this.selectOption(\"down\");\n }\n // arrow up 38\n if (e.keyCode === 38) {\n if (state.mode === CommanderModes.revisions) {\n select(\"#commands li.selected\").click();\n }\n this.selectOption(\"up\");\n }\n })\n .listen(\"keyup\", (e: KeyboardEvent) => {\n // enter\n if (e.keyCode === 13) {\n if (state.mode === CommanderModes.commands) {\n select(\"#commands li.selected div\").click();\n } else {\n select(\"#commands li.selected a\").click();\n }\n }\n // escape\n if (e.keyCode === 27) {\n select(\".terminal\").focus();\n }\n const el = e.target as HTMLTextAreaElement;\n if (state.input !== el.value) {\n state.options.selected = 0;\n }\n state.input = el.value;\n this.generateOptions(el.value);\n });\n return this;\n },\n init: function () {\n this.initCommander();\n keyListener.listen().on(this.commands());\n select(\".menu\").listen(\"click\", () => this.toggle());\n select(\"#revisions\").listen(\"click\", () => this.generateRevisions());\n return this;\n },\n generateRevisions: function () {\n this.show();\n state.mode = CommanderModes.revisions;\n const note = getNote();\n if (note) {\n const { revisions } = note;\n const indexToSelect = state.options.selected;\n const revisionsOptions = Object.keys(revisions)\n .sort((a, b) => {\n const { dateCreated: aDateCreated } = revisions[a];\n const { dateCreated: bDateCreated } = revisions[b];\n return bDateCreated - aDateCreated;\n })\n .map((id, i) => ({\n title: div({ content: `...${id.slice(-10)}` }),\n secondary: `${relativeDate(revisions[id].dateCreated)}`,\n onclick: () => {\n url.set(undefined, {\n v: id,\n });\n state.options.selected = i;\n this.generateRevisions();\n },\n }))\n // @ts-ignore js-to-ts wider refactoring required\n .map((r, i) => command(r, i === indexToSelect));\n select(\"#commands\").html(revisionsOptions);\n state.options = {\n ...state.options,\n length: revisionsOptions.length,\n };\n }\n\n return this;\n },\n generateOptions: function (value: string) {\n switch (state.mode) {\n case CommanderModes.commands:\n case CommanderModes.notes:\n if (value.slice(0, 1) === \">\") {\n state.mode = CommanderModes.commands;\n this.generateCommands(value.slice(1).trim());\n select(\"#commander input\").placeholder(\"Search for commands...\");\n } else {\n state.mode = CommanderModes.notes;\n this.generateNotes(value);\n }\n return;\n case CommanderModes.revisions:\n return this.generateRevisions();\n case CommanderModes.off:\n break;\n default:\n break;\n }\n },\n generateNotes: function (value = \"\") {\n const indexToSelect = state.options.selected;\n const notes = getNotes()\n .filter(({ title }) => {\n return smartFilter(title, value);\n })\n .filter(({ id, deleted }) => !deleted && id !== url.getPageId())\n .sort((a, b) => {\n const aDateCreated = getDateCreatedFromTitle(a.title);\n const bDateCreated = getDateCreatedFromTitle(b.title);\n return bDateCreated - aDateCreated;\n })\n .map(({ id, title }, i) => {\n const dateCreated = getDateCreatedFromTitle(title);\n const href =\n `${globalThis.location.origin}${globalThis.location.pathname}#${id}`;\n\n const noteLink = link(\n div({ content: title, highlight: value }),\n href,\n );\n\n const noteCommand = command(\n // @ts-ignore until command.js makes it to ts\n {\n title: noteLink,\n secondary: relativeDate(dateCreated),\n onclick: () => {\n this.hide();\n select(\".terminal\").focus();\n },\n },\n i === indexToSelect,\n );\n return noteCommand;\n });\n select(\"#commands\").html(notes);\n select(\"#commander input\").placeholder(\n `Search from ${notes.length} saved notes...`,\n );\n state.options = {\n ...state.options,\n length: notes.length,\n };\n return this;\n },\n generateCommands: function (value = \"\") {\n const indexToSelect = state.options.selected;\n const commandComponents = this.commands()\n .filter(({ title }) => smartFilter(title, value))\n // @ts-ignore js-to-ts wider refactoring required\n .filter(({ experimental = false }) => {\n return storage.get(\"__experimental__\") ? true : !experimental;\n })\n // @ts-ignore js-to-ts wider refactoring required\n .map(({ title, key, call, icon }, i) => {\n const commandComponent = command(\n // @ts-ignore until command.js makes it to ts\n {\n title: div({ content: title, highlight: value }),\n icon: icon,\n secondary: getShortcut(key),\n onclick: call,\n },\n i === indexToSelect,\n );\n return commandComponent;\n });\n select(\"#commands\").html(commandComponents);\n state.options = {\n ...state.options,\n length: commandComponents.length,\n };\n return this;\n },\n };\n})();\n\nexport default commander;\n", "export const urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n", "import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js'\nexport { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << Math.log2(alphabet.length - 1)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nexport let nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n id += scopedUrlAlphabet[bytes[size] & 63]\n }\n return id\n}\n", "import getCaretCoordinates from \"textarea-caret\";\nimport { terminal } from \"../components/organisms/terminal.ts\";\nimport select from \"../utils/dom.js\";\nimport { trieDictionary } from \"../main.js\";\n\nconst getPredictions = (word: string) => {\n const sanitizedWord = word.replace(/[\\r\\n\\t]+/g, \"\").toLowerCase();\n\n return trieDictionary.getMatchingWords(sanitizedWord);\n};\n\nexport const getCurrentlyTypingWord = (\n text: string,\n cursorIndexPosition: number,\n) => {\n let word = \"\";\n let currentIndex = cursorIndexPosition - 1;\n do {\n const character = text[currentIndex] || \"\";\n currentIndex = character.trim() === \"\" ? -1 : currentIndex - 1;\n word = character.trim() !== \"\" ? `${character}${word}` : word;\n } while (currentIndex >= 0);\n return word;\n};\n\nexport const placeSuggestion = (textEl: HTMLTextAreaElement) => {\n const coords = getCaretCoordinates(\n textEl,\n textEl.selectionEnd,\n );\n const { top, left } = coords;\n\n // This does the trick! `main` is getting the same\n // height as the textarea so the suggestion will be placed\n // right!\n // TODO: change that on terminal size change!\n const actualTerminalHeight = select(\".terminal\").el.scrollHeight;\n const main = select(\"main\").el;\n main.style.height = `${actualTerminalHeight}px`;\n\n select(\".suggestion\").el.style.top = `${top}px`;\n select(\".suggestion\").el.style.left = `${left}px`;\n};\n\nexport const isLastCharacterInTheWord = (\n text: string,\n characterIndex: number,\n) => text[characterIndex] === undefined || text[characterIndex].trim() === \"\";\n\nexport const autoComplete = (e: InputEvent) => {\n const cursorIndexPosition = (e.target as HTMLTextAreaElement).selectionEnd;\n const fullText = terminal.el.getValue();\n\n const charTyped = fullText[cursorIndexPosition - 1];\n if (e.inputType === \"deleteContentBackward\" || charTyped === \" \") {\n terminal.setState({\n prediction: null,\n currentWord: null,\n });\n return select(\".suggestion\").hide();\n }\n const word = getCurrentlyTypingWord(fullText, cursorIndexPosition);\n\n const shouldDisplaySuggestion = e.inputType === \"insertText\" &&\n isLastCharacterInTheWord(fullText, cursorIndexPosition) &&\n !word.startsWith(\"#\");\n\n if (shouldDisplaySuggestion) {\n placeSuggestion(e.target as HTMLTextAreaElement);\n const matches = getPredictions(word);\n\n const [firstMatch] = matches;\n const prediction = firstMatch || \"\";\n\n terminal.setState({\n prediction,\n currentWord: word,\n matches: matches.slice(0, 10),\n options: {\n selected: 0,\n length: matches.length,\n },\n });\n const state = terminal.getState();\n if (state.currentWord && state.prediction && state.currentWord.length > 1) {\n terminal.renderInlineSuggestion();\n terminal.renderOptions();\n } else {\n select(\".suggestion\").hide();\n }\n }\n};\n", "export const findCurrentLine = (text: string, caretIndex: number): string => {\n const lines = text.split(\"\\n\");\n type MyAcc = {\n text: string;\n isFound: boolean;\n };\n const line = lines.reduce(\n (acc: MyAcc, line) => {\n const { isFound } = acc;\n if (isFound) return acc;\n const recon = `${acc.text}${line}\\n`;\n const currentLength = recon.length;\n\n if (caretIndex >= currentLength) {\n return {\n text: recon,\n isFound: false,\n };\n }\n\n return {\n text: line,\n isFound: true,\n };\n },\n {\n text: \"\",\n isFound: false,\n },\n );\n\n return line.text;\n};\n", "import select from \"../dom.js\";\nimport { findCurrentLine } from \"./index.ts\";\n\nexport const autoCompleteCheckboxes = (e) => {\n const currentLine = findCurrentLine(e.target.value, e.target.selectionEnd);\n\n const completers = {\n \"* [\": \"\\n* [] \",\n \"* \": \"\\n* \",\n \" * [\": \"\\n * [] \",\n \" * \": \"\\n * \",\n };\n\n for (const [startsWith, compleano] of Object.entries(completers)) {\n if (currentLine.startsWith(startsWith)) {\n e.preventDefault();\n select(\".terminal\").insertAtCaret(compleano);\n break;\n }\n }\n};\n", "import { getNotes } from \"../../components/organisms/noteManager/noteManager.ts\";\nimport { terminal } from \"../../components/organisms/terminal.ts\";\nimport select from \"../../utils/dom.js\";\nimport {\n getCurrentlyTypingWord,\n isLastCharacterInTheWord,\n placeSuggestion,\n} from \"../autoComplete.ts\";\n\nexport const renderInterNotes = (e: InputEvent) => {\n const target = e.target as HTMLTextAreaElement | null;\n if (!target) return;\n const cursorIndexPosition = target.selectionEnd;\n const fullText = terminal.el.getValue();\n const charTyped = fullText[cursorIndexPosition - 1];\n if (e.inputType === \"deleteContentBackward\" || charTyped === \" \") {\n terminal.setState({\n prediction: null,\n currentWord: null,\n });\n return select(\".suggestion\").hide();\n }\n const word = getCurrentlyTypingWord(fullText, cursorIndexPosition);\n if (word.startsWith(\"#\")) {\n const shouldDisplaySuggestion = e.inputType === \"insertText\" &&\n isLastCharacterInTheWord(fullText, cursorIndexPosition);\n\n if (shouldDisplaySuggestion) {\n placeSuggestion(e.target as HTMLTextAreaElement);\n const allNoteIds = getNotes().map((note) => note.id);\n const actualNoteSearch = word.slice(1);\n const matches = allNoteIds.filter((noteId) => {\n return noteId.startsWith(actualNoteSearch);\n });\n const [firstMatch] = matches;\n const prediction = firstMatch;\n const currentWord = actualNoteSearch;\n\n terminal.setState({\n prediction,\n currentWord,\n matches: matches.slice(0, 10),\n options: {\n selected: 0,\n length: matches.length,\n },\n });\n const state = terminal.getState();\n if (\n state.currentWord &&\n state.prediction &&\n state.currentWord.length > 1\n ) {\n terminal.renderInlineSuggestion();\n terminal.renderOptions();\n } else {\n select(\".suggestion\").hide();\n }\n }\n }\n};\n", "import { nanoid } from \"nanoid\";\nimport * as TrashSVG from \"../../../assets/svg/trash.svg\";\nimport { configuration } from \"../../../configuration.ts\";\nimport { autoComplete } from \"../../features/autoComplete.ts\";\nimport { setSavedState } from \"../../ui/functions/savedState.ts\";\nimport select from \"../../utils/dom.js\";\nimport storage from \"../../utils/localstorage.js\";\nimport { handleErrorResponse } from \"../../utils/mail.js\";\nimport { autoCompleteCheckboxes } from \"../../utils/text/autoCompleteCheckboxes.js\";\nimport { div } from \"../atoms/div/div.js\";\nimport { icon } from \"../atoms/icon/icon.js\";\nimport { command } from \"../molecules/commands/command.js\";\nimport notify from \"../molecules/notify.ts\";\nimport commander from \"./commander/commander.ts\";\nimport markDownViewer from \"./markdown/markDownViewer.js\";\nimport { getNote, getTitle } from \"./noteManager/noteManager.ts\";\nimport { trieDictionary } from \"../../main.js\";\nimport { renderInterNotes } from \"../../features/inter-linking/renderInterNotes.ts\";\n\ntype TerminalState = {\n matches: Array;\n currentWord: null | string;\n prediction: null | string;\n options: {\n selected: number;\n length: number;\n };\n};\n\nexport const terminal = (() => {\n const initState = {\n matches: [],\n currentWord: null,\n prediction: null,\n options: {\n selected: 0,\n length: 0,\n },\n } as TerminalState;\n let state = initState;\n return {\n el: select(\".terminal\"),\n getState: function (): TerminalState {\n return state;\n },\n setState: function (newState: Partial) {\n state = {\n ...state,\n ...newState,\n };\n return state;\n },\n resetState: function () {\n terminal.setState(initState);\n },\n selectOption: function (direction: \"down\" | \"up\" = \"down\") {\n const currentlySelected = state.options.selected;\n const lastOption = state.options.length - 1;\n const isLastOption = currentlySelected === lastOption;\n const isFirstOption = currentlySelected === 0;\n const isDown = direction === \"down\";\n\n const indexToSelect = isDown\n ? isLastOption ? 0 : currentlySelected + 1\n : isFirstOption\n ? lastOption\n : currentlySelected - 1;\n\n state.options = {\n ...state.options,\n selected: indexToSelect,\n };\n\n terminal.setState({\n prediction: state.matches[state.options.selected],\n });\n terminal.renderInlineSuggestion();\n terminal.renderOptions();\n },\n acceptCompletion: (word?: string) => {\n const complete = (word: string, currentWord: string) => {\n const completion = word\n .toLowerCase()\n .replace(currentWord.toLowerCase(), \"\");\n if (completion) {\n select(\".terminal\").insertAtCaret(`${completion} `);\n } else {\n select(\".terminal\").insertAtCaret(\" \");\n }\n select(\".suggestion\").hide();\n terminal.resetState();\n };\n\n const { prediction, currentWord } = state;\n\n if (word && currentWord) {\n return complete(word, currentWord);\n }\n\n if (prediction && currentWord) {\n complete(prediction, currentWord);\n // +1 to the score of the word autocompleted\n trieDictionary.insert(prediction);\n }\n },\n renderInlineSuggestion: () => {\n const { prediction, currentWord } = state;\n if (prediction && currentWord) {\n const inlineSuggestion = div({\n content: `${prediction.slice(currentWord.length)}`,\n });\n inlineSuggestion.setAttribute(\"id\", \"inlineSuggestion\");\n select(\".suggestion\").show().html(inlineSuggestion);\n }\n },\n renderOptions: () => {\n const optionsUl = select(\".suggestion .options\");\n if (optionsUl && optionsUl.el) optionsUl.el.remove();\n\n const selectedIndex = state.options.selected;\n const options = state.matches.map((word, i) =>\n command(\n {\n title: div({ content: word }),\n secondary: icon(TrashSVG, \"delete word\"),\n onSecondaryClick: () => {\n storage.removeFromDictionary(word);\n terminal.setState({\n matches: state.matches.filter((m) => m !== word),\n });\n terminal.renderOptions();\n },\n onclick: () => {\n terminal.acceptCompletion(word);\n },\n icon: null,\n },\n i === selectedIndex,\n )\n );\n const optionList = document.createElement(\"ul\");\n optionList.classList.add(\"options\");\n optionList.classList.add(\"frost\");\n options.forEach((el) => optionList.append(el));\n\n select(\".suggestion\").el.append(optionList);\n },\n onFocus: () => {\n commander.hide();\n select(\".note-info\").hide();\n },\n onInput: (e: InputEvent) => {\n const isAutocompleteEnabled = !!storage.get(\"__autocomplete__\");\n if (isAutocompleteEnabled) {\n autoComplete(e);\n }\n renderInterNotes(e);\n },\n onArrowDown: (e: KeyboardEvent) => {\n if (state.matches.length > 0) {\n e.preventDefault();\n terminal.selectOption(\"down\");\n }\n },\n onArrowUp: (e: KeyboardEvent) => {\n if (state.matches.length > 0) {\n e.preventDefault();\n terminal.selectOption(\"up\");\n }\n },\n onEnter: (e: KeyboardEvent) => {\n if (state.matches.length > 0) {\n e.preventDefault();\n terminal.acceptCompletion();\n }\n\n // auto-magically handle checkboxes\n autoCompleteCheckboxes(e);\n },\n onEscape: () => {\n terminal.resetState();\n select(\".suggestion\").hide();\n },\n onTab: (e: KeyboardEvent) => {\n e.preventDefault();\n terminal.acceptCompletion();\n },\n onKeyDown: (e: KeyboardEvent) => {\n // enter\n if (e.keyCode === 13) {\n terminal.onEnter(e);\n }\n // arrow down\n if (e.keyCode === 40) {\n terminal.onArrowDown(e);\n }\n\n // arrow up\n if (e.keyCode === 38) {\n terminal.onArrowUp(e);\n }\n\n if (e.keyCode === 9) {\n terminal.onTab(e);\n }\n\n if (e.keyCode === 32) {\n terminal.setState({\n prediction: \"\",\n });\n }\n\n // escape\n if (e.keyCode === 27) {\n terminal.onEscape();\n }\n },\n onKeyUp: (e: KeyboardEvent) => {\n const currentlySavedNote = getNote();\n const title = getTitle((e.target as HTMLInputElement).value);\n select(\".title h3\").html(title);\n\n const { text = \"\" } = currentlySavedNote || {};\n const isNoteSaved =\n !!(currentlySavedNote && terminal.el.getValue() === text);\n setSavedState(isNoteSaved);\n },\n onPaste: async () => {\n const clipboardItems = await navigator.clipboard.read();\n for (const clipboardItem of clipboardItems) {\n const imageTypes = clipboardItem.types?.filter((type) =>\n type.startsWith(\"image/\")\n );\n for (const imageType of imageTypes) {\n const blob = await clipboardItem.getType(imageType);\n const token = storage.get(\"MIROPAD_SECRET_TOKEN\");\n if (token) {\n const [_image, fileExtension] = imageType.split(\"/\");\n const fileName = `${nanoid()}.${fileExtension}`;\n\n select(\"#logo\").addClass(\"loading\");\n try {\n const { url } = await fetch(\n `${configuration.file_service.api}?fileName=${fileName}`,\n {\n method: \"POST\",\n headers: {\n \"x-secret-token\": token,\n accept: \"application/json\",\n \"content-type\": \"application/octet-stream\",\n },\n body: blob,\n },\n )\n .then(handleErrorResponse)\n .then((response) => response.json());\n select(\".terminal\").insertAtCaret(`![image](${url})`);\n } catch (error) {\n console.error(error);\n notify.error(`Uploading file failed \uD83D\uDCA5!`);\n }\n select(\"#logo\").removeClass(\"loading\");\n } else {\n const imageURI = URL.createObjectURL(blob);\n select(\".terminal\").insertAtCaret(`![image](${imageURI})`);\n }\n markDownViewer.update();\n }\n }\n },\n init: function () {\n this.el\n .listen(\"focus\", this.onFocus)\n .listen(\"input\", this.onInput)\n .listen(\"keydown\", this.onKeyDown)\n .listen(\"keyup\", this.onKeyUp)\n .listen(\"paste\", this.onPaste);\n },\n };\n})();\n", "import storage from \"./utils/localstorage.js\";\n\nexport const isSyncEnabled = () => {\n const { authToken, gistId } = storage.get([\"authToken\", \"gistId\"]);\n return !!(authToken && gistId);\n};\n", "type FrequencyGroups = {\n [key: string]: Array;\n};\n\nconst groupByFrequency = (entries: Dictionary): FrequencyGroups => {\n return Object.entries(entries).reduce((acc, [word, frequency]) => {\n const cc = acc[frequency] || [];\n return {\n ...acc,\n [`${frequency}`]: [word, ...cc],\n };\n }, {} as FrequencyGroups);\n};\n\ntype Dictionary = {\n [key: string]: number;\n};\ntype Node = {\n char: string | null;\n children: {\n [key: string]: Node;\n };\n frequency: number;\n hasChildren: () => boolean;\n isWord: () => boolean;\n contains: (char: string) => boolean;\n getWords: (\n char: string,\n dictionary?: Dictionary,\n ) => Dictionary;\n increaseFrequency: () => void;\n insert: (word: string) => void;\n insertNode: (char: string, isLast?: boolean) => Node;\n};\n\nconst Node = (): Node => ({\n char: null,\n children: {},\n frequency: 0,\n hasChildren: function () {\n return Object.keys(this.children).length > 0;\n },\n isWord: function () {\n return this.frequency > 0;\n },\n contains: function (char: string) {\n return Object.keys(this.children).includes(char);\n },\n getWords: function (prefix, dictionary = {}) {\n const nodeInstance = this as Node;\n if (nodeInstance.isWord()) {\n dictionary = {\n ...dictionary,\n [prefix]: this.frequency,\n };\n }\n\n if (nodeInstance.hasChildren()) {\n for (const node of Object.values(nodeInstance.children)) {\n dictionary = node.getWords(`${prefix}${node.char}`, dictionary);\n }\n }\n\n return dictionary;\n },\n increaseFrequency: function () {\n this.frequency = this.frequency + 1;\n },\n insert: function (word: Array | string) {\n const [firstChar, ...rest] = word;\n if (firstChar) {\n const isLast = rest.length === 0;\n if (this.contains(firstChar)) {\n const node = this.children[firstChar];\n node.char = firstChar;\n if (isLast) node.increaseFrequency();\n\n return node.insert(rest.join(\"\"));\n } else {\n const node = this.insertNode(firstChar, isLast);\n return node.insert(rest.join(\"\"));\n }\n }\n },\n insertNode: function (char, isLast = false) {\n const newNode = Node();\n if (isLast) newNode.increaseFrequency();\n newNode.char = char;\n this.children = {\n ...this.children,\n [char]: newNode,\n };\n return newNode;\n },\n});\n\nexport const Trie = () => {\n const rootNode = Node();\n\n return {\n insert: function (word: string | Array = []) {\n const words = Array.isArray(word) ? word : [word];\n words.forEach((word) => rootNode.insert(word));\n return this;\n },\n search: function (prefix = \"\") {\n let node = rootNode;\n prefix.split(\"\").forEach((character) => {\n if (node) node = node.children[character];\n });\n\n return node ? node.getWords(prefix) : {};\n },\n // get sorted matching words\n // first by frequency\n // and then alphabetically\n getMatchingWords: function (prefix = \"\") {\n const frequencyGroups = groupByFrequency(this.search(prefix));\n return Object.keys(frequencyGroups)\n .sort((a, b) => parseInt(b, 10) - parseInt(a, 10))\n .flatMap((key) => frequencyGroups[key].sort());\n },\n };\n};\n", "import notify from \"../components/molecules/notify.ts\";\n\nconst errorHandler = (error) => {\n const { message = \"Unexpected error occurred!\" } = error;\n notify.error(message);\n};\n\nexport default errorHandler;\n", "import \"github-markdown-css\";\nimport \"../../css/print.css\";\nimport \"../../css/styles.css\";\nimport notify from \"../components/molecules/notify.ts\";\nimport {\n search,\n setNoteFromHash,\n} from \"../components/organisms/noteManager/noteManager.ts\";\nimport select from \"../utils/dom.js\";\nimport { url } from \"../utils/urlManager.ts\";\nimport { getGist } from \"../utils/github/api.ts\";\n\nconst setNoteFromRawUrl = async (rawUrl: string) => {\n if (rawUrl) {\n const response = await fetch(rawUrl).then((response) => {\n if (response.ok) return response.text();\n throw new Error(\n `Remote note could not be retrieved! code: ${response.status}`,\n );\n });\n select(\".terminal\").setValue(response);\n }\n};\n\nconst setNoteFromGist = async (gistId: string) => {\n if (gistId) {\n try {\n const gist = await getGist(gistId);\n const { files } = gist;\n const fileContents = Object.values(files);\n const [gistFile] = fileContents;\n\n // @ts-ignore as gistFile always has content\n const { content } = gistFile;\n select(\".terminal\").setValue(content);\n } catch (_e) {\n notify.error(\"MiroPad note not found! \uD83E\uDD37\u200D\u2642\uFE0F\");\n }\n }\n};\n\nexport const actOnURLStateChange = async (e: HashChangeEvent) => {\n try {\n const { oldURL, newURL } = e;\n const oldPageId = url.getPageId(oldURL);\n const newPageId = url.getPageId(newURL);\n const hasPageIdChanged = oldPageId !== newPageId;\n const { v: oldV } = url.getParamsObject(oldURL);\n const { v: newV } = url.getParamsObject(newURL);\n const hasPageVersionChanged = oldV !== newV;\n const shouldChangeNote = [hasPageIdChanged, hasPageVersionChanged].some(\n (r) => r,\n );\n if (shouldChangeNote) setNoteFromHash();\n\n const { gistId, raw } = url.getParamsObject(newURL);\n await setNoteFromGist(gistId);\n await setNoteFromRawUrl(raw);\n } catch (e: unknown) {\n if (e instanceof Error) {\n notify.error(e.message);\n } else {\n notify.error(\"An unknown error occurred\");\n }\n }\n\n const isANewNote = !url.getPageId();\n select(\"#note-info-button\").show(!isANewNote);\n select(\"#new-note\").disable(isANewNote);\n\n if (url.getSearchParam(\"md\") === \"full\") {\n select(\".terminal\").hide();\n } else {\n select(\".terminal\").show();\n }\n\n if (url.getSearchParam(\"zen\") === \"true\") {\n select(\".header\").hide();\n } else {\n select(\".header\").show();\n }\n\n select(\".note-info\").hide();\n\n const q = url.getSearchParam(\"q\");\n const queryResult = search(q);\n if (queryResult) select(\".terminal\").setValue(queryResult.text);\n};\n", "import select from \"../../../utils/dom.js\";\n\n// This is a feature where you can easily tick on/off\n// checkboxes \u2705 on the Markdown preview.\n// It does NOT persist the state on the data layer,\n// but lives temporarily on the browser's state\n// Useful feature when you are going to the Super market \uD83D\uDE04\n\n// Technically I cloud re-enable the checkboxes that ShowdownJS generates,\n// which are by default disabled, but couldn't figure that out. \u00AF\\_(\u30C4)_/\u00AF\n\nexport const autoMagicallyCheckBoxes = () => {\n select(\".task-list-item\").listenAll(\"click\", (el) => {\n el.firstChild.checked = !el.firstChild.checked;\n });\n};\n", "import \"github-markdown-css\";\nimport \"../css/print.css\";\nimport \"../css/styles.css\";\nimport welcomeUser from \"./components/molecules/welcome.js\";\nimport commander from \"./components/organisms/commander/commander.ts\";\nimport markDownViewer from \"./components/organisms/markdown/markDownViewer.js\";\nimport {\n deleteNote,\n disableSyncOnCurrentNote,\n getNote,\n setNoteFromHash,\n} from \"./components/organisms/noteManager/noteManager.ts\";\nimport { terminal } from \"./components/organisms/terminal.ts\";\nimport { isSyncEnabled } from \"./isSyncEnabled.js\";\nimport { registerServiceWorker } from \"./registerServiceWorker.js\";\nimport { Trie } from \"./utils/Trie/Trie.ts\";\nimport { copyToClipboard } from \"./utils/copyToClipboard.ts\";\nimport { relativeDate } from \"./utils/dates.js\";\nimport select from \"./utils/dom.js\";\nimport errorHandler from \"./utils/errorHandler.js\";\nimport {\n setAuthTokenFromCallback,\n syncNotesWithGitHub,\n} from \"./utils/github/actions.js\";\nimport storage from \"./utils/localstorage.js\";\nimport { resetPageTitle } from \"./utils/pageTitle.js\";\nimport { url } from \"./utils/urlManager.ts\";\nimport { actOnURLStateChange } from \"./listeners/urlChange.ts\";\nimport { autoMagicallyCheckBoxes } from \"./ui/markdown/preview/autoMagicallyCheckBoxes.js\";\n\n// Initialize a Trie tree to be used for the predictions\nexport const trieDictionary = Trie();\n\nconst initInfoPanel = () => {\n select(\"#note-info-close\").listen(\"click\", () => {\n select(\".note-info\").hide();\n });\n select(\"#note-info-button\").listen(\"click\", () => {\n const note = getNote();\n select(\".note-info\").show();\n\n select(\".note-info .details\").innerHTML(\n `

    \n \n ${note.title}\n

    \n

    \n \n ${relativeDate(note.dateCreated)}\n

    \n

    \n \n ${note.numberOfRevisions}\n

    \n `,\n );\n\n const isSyncOn = isSyncEnabled();\n if (isSyncOn && note) {\n const syncEl = (() => {\n const { disableSync } = note;\n const p = document.createElement(\"P\");\n p.innerHTML = `\n \n \n `;\n return p;\n })();\n select(\".note-info .details\").append(syncEl);\n select(\"#sync\").listen(\"click\", (e) => {\n disableSyncOnCurrentNote(!e.target.checked);\n });\n }\n const deleteButton = (() => {\n const p = document.createElement(\"P\");\n p.innerHTML = `\n \n \n \n \n \n \n \n Delete\n \n `;\n return p;\n })();\n select(\".note-info .details\").append(deleteButton);\n select(\"#delete-note\").listen(\"click\", () => {\n deleteNote();\n });\n });\n};\n\nconst main = async () => {\n // Insert all the saved data from dictionary to the Trie tree\n const words = storage.getDictionary();\n trieDictionary.insert(words);\n\n globalThis.addEventListener(\"error\", errorHandler);\n welcomeUser();\n commander.init();\n\n initInfoPanel();\n\n terminal.init();\n resetPageTitle();\n setNoteFromHash(url.getPageId());\n select(\".logo\").listen(\"click\", () => {\n commander.toggle(commander.getModes().notes);\n });\n select(\"#permalink\").listen(\"click\", async () => {\n await copyToClipboard(url.get());\n });\n\n markDownViewer.init();\n\n globalThis.addEventListener(\"hashchange\", actOnURLStateChange);\n actOnURLStateChange();\n\n registerServiceWorker();\n\n autoMagicallyCheckBoxes();\n\n await syncNotesWithGitHub();\n await setAuthTokenFromCallback();\n};\n\nexport default main;\n", "import main from \"./js/main.js\";\n\n(() => {\n main();\n})();\n"], + "mappings": "4vBAIA,SAASA,EAAgBC,EAAQ,CAC/B,aAEA,IAAIC,EAAiB,CACnB,wBAAyB,CACvB,aAAc,GACd,SAAU,wDACV,KAAM,SACR,EACA,WAAY,CACV,aAAc,GACd,SAAU,kCACV,KAAM,SACR,EACA,eAAgB,CACd,aAAc,GACd,SAAU,4JACV,KAAM,QACR,EACA,kBAAmB,CACjB,aAAc,GACd,SAAU,uKACV,KAAM,SACR,EACA,qBAAsB,CACpB,aAAc,GACd,SAAU,oIACV,KAAM,SACR,EACA,YAAa,CACX,aAAc,GACd,SAAU,0JACV,KAAM,SACR,EACA,iBAAkB,CAChB,aAAc,GACd,SAAU,gCACV,KAAM,SACR,EACA,mBAAoB,CAClB,aAAc,GACd,SAAU,sCACV,KAAM,SACR,EACA,mBAAoB,CAClB,aAAc,GACd,SAAU,iCACV,KAAM,SACR,EACA,mCAAoC,CAClC,aAAc,GACd,SAAU,sEACV,KAAM,SACR,EACA,0BAA2B,CACzB,aAAc,GACd,SAAU,mDACV,KAAM,SACR,EACA,wBAAyB,CACvB,aAAc,GACd,SAAU,+CACV,KAAM,SACR,EACA,cAAe,CACb,aAAc,GACd,SAAU,oCACV,KAAM,SACR,EACA,OAAQ,CACN,aAAc,GACd,SAAU,6BACV,KAAM,SACR,EACA,eAAgB,CACd,aAAc,GACd,SAAU,6BACV,KAAM,SACR,EACA,aAAc,CACZ,aAAc,GACd,SAAU,6CACV,KAAM,SACR,EACA,UAAW,CACT,aAAc,GACd,SAAU,mCACV,KAAM,SACR,EACA,kBAAmB,CACjB,aAAc,GACd,SAAU,kEACV,KAAM,SACR,EACA,oBAAqB,CACnB,aAAc,GACd,SAAU,kDACV,KAAM,SACR,EACA,qCAAsC,CACpC,aAAc,GACd,SAAU,oEACV,KAAM,SACR,EACA,iBAAkB,CAChB,aAAc,GACd,SAAU,gDACV,KAAM,SACR,EACA,8BAA+B,CAC7B,aAAc,GACd,SAAU,6EACV,KAAM,SACR,EACA,WAAY,CACV,aAAc,GACd,SAAU,2BACV,KAAM,SACR,EACA,eAAgB,CACd,aAAc,yBACd,SAAU,yFACV,KAAM,QACR,EACA,aAAc,CACZ,aAAc,GACd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AAE,OAAOU,CAAY,EACjDV,EAAO,cAAc,EAAE,OAAO,QAAS,IAAM,CAC3CW,GAAW,CACb,CAAC,CACH,CAAC,CACH,EAEMC,GAAO,SAAY,CAEvB,IAAMC,EAAQC,EAAQ,cAAc,EACpCjB,GAAe,OAAOgB,CAAK,EAE3B,WAAW,iBAAiB,QAASE,EAAY,EACjDC,GAAY,EACZC,EAAU,KAAK,EAEflB,GAAc,EAEdmB,EAAS,KAAK,EACdC,GAAe,EACfC,GAAgBC,EAAI,UAAU,CAAC,EAC/BrB,EAAO,OAAO,EAAE,OAAO,QAAS,IAAM,CACpCiB,EAAU,OAAOA,EAAU,SAAS,EAAE,KAAK,CAC7C,CAAC,EACDjB,EAAO,YAAY,EAAE,OAAO,QAAS,SAAY,CAC/C,MAAMsB,GAAgBD,EAAI,IAAI,CAAC,CACjC,CAAC,EAEDE,GAAe,KAAK,EAEpB,WAAW,iBAAiB,aAAcC,EAAmB,EAC7DA,GAAoB,EAEpBC,GAAsB,EAEtBC,GAAwB,EAExB,MAAMC,GAAoB,EAC1B,MAAMC,GAAyB,CACjC,EAEOC,GAAQjB,GC3IbkB,GAAK", "names": ["getDefaultOpts", "simple", "defaultOptions", "ret", "opt", "allOptionsOn", "options", "showdown", "parsers", "extensions", "globalOptions", "setFlavor", "flavor", "key", "value", "name", "preset", "option", "func", "ext", "validExtension", "validate", "extension", "errMsg", "i", "baseMsg", "type", "ln", "validateExtension", "a", "getType", "obj", "callback", "prop", "s", "escapeCharactersCallback", "wholeMatch", "m1", "charCodeToEscape", "text", "charsToEscape", "afterBackslash", "regexString", "regex", "txt", "rgxFindMatchPos", "str", "left", "right", "flags", "f", "g", "x", "l", "pos", "t", "m", "start", "end", "matchPos", "results", "replacement", "repStr", "finalStr", "lng", "bits", "fromIndex", "indexOf", "index", "mail", "encode", "ch", "r", "targetLength", "padString", "msg", "converterOptions", "langExtensions", "outputModifiers", "listeners", "setConvFlavor", "metadata", "_constructor", "gOpt", "_parseExtension", "legacyExtensionLoading", "validExt", "listen", "valid", "rTrimInputText", "rsp", "rgx", "evtName", "globals", "ei", "nText", "src", "HTMLParser", "doc", "substitutePreCodeTags", "clean", "nodes", "mdDoc", "node", "n", "child", "pres", "presPH", "content", "language", "classes", "c", "matches", "extensionName", "ii", "raw", "format", "writeAnchorTag", "linkText", "linkId", "url", "m5", "m6", "title", "result", "wm", "st", "escape", "mentions", "username", "lnk", "target", "simpleURLRegex", "simpleURLRegex2", "delimUrlRegex", "simpleMailRegex", "delimMailRegex", "replaceLink", "leadingMagicChars", "link", "m2", "m3", "trailingPunctuation", "trailingMagicChars", "lnkTxt", "append", "lmc", "tmc", "replaceMail", "b", "href", "bq", "pre", "pattern", "codeblock", "nextChar", "doctype", "doctypeParsed", "charset", "lang", "meta", "leadingText", "numSpaces", "emojiRgx", "emojiCode", "tags", "comments", "delim", "repFunc", "match", "blockText", "blockTags", "inside", "opTagPos", "rgx1", "patLeft", "patRight", "subTexts", "newSubText1", "hashHTMLSpan", "html", "repText", "limit", "num", "headerLevelStart", "setextRegexH1", "setextRegexH2", "spanGamut", "hID", "headerId", "hLevel", "hashBlock", "matchFound", "atxStyle", "hText", "span", "header", "prefix", "inlineRegExp", "crazyRegExp", "base64RegExp", "referenceRegExp", "refShortcutRegExp", "writeImageTagBase64", "altText", "width", "height", "writeImageTag", "gUrls", "gTitles", "gDims", "parseInside", "lead", "processListItems", "listStr", "trimTrailing", "isParagraphed", "m4", "taskbtn", "checked", "item", "bulletStyle", "otp", "wm2", "styleStartNumber", "list", "listType", "res", "parseConsecutiveLists", "olRgx", "ulRgx", "counterRxg", "parseCL", "style", "parseMetadataContents", "wholematch", "grafs", "grafsOut", "grafsOutIt", "codeFlag", "re", "base64Regex", "replaceFunc", "blankLines", "tableRgx", "singeColTblRgx", "parseStyles", "sLine", "parseHeaders", "id", "parseCells", "cell", "subText", "buildTable", "headers", "cells", "tb", "tblLgn", "parseTable", "rawTable", "tableLines", "rawHeaders", "rawStyles", "rawCells", "styles", "row", "charCodeToReplace", "children", "childrenLength", "innerTxt", "headerLevel", "headerMark", "listItems", "listItemsLenght", "listNum", "bullet", "listItemTxt", "childrenLenght", "spansOnly", "tagName", "tableArray", "headings", "rows", "headContent", "allign", "cols", "cellContent", "cellSpacesCount", "strLen", "root", "module", "require_textarea_caret", "__commonJSMin", "exports", "module", "properties", "isBrowser", "isFirefox", "getCaretCoordinates", "element", "position", "options", "debug", "el", "div", "style", "computed", "isInput", "prop", "span", "coordinates", "isArray", "what", "select", "selector", "what", "text", "value", "event", "htmlString", "content", "el", "isArray", "e", "newContent", "isElement", "li", "className", "classes", "cls", "shouldShow", "fn", "shouldDisable", "obj", "dom_default", "notificationTypes", "notification", "dom_default", "cleanNotificationClasses", "notificationFactory", "acc", "notificationType", "message", "Notification", "autohideDuration", "type", "notify", "notify_default", "welcomeUser", "lastVisit", "notify_default", "welcome_default", "storage", "key", "what", "attr", "current", "isArray", "acc", "k", "value", "savedTxt", "word", "newDictionary", "w", "cleanText", "words", "distinctWords", "e", "notify_default", "localstorage_default", "configuration", "getGist", "id", "token", "localstorage_default", "response", "getAuthenticatedUsersGists", "deleteFileOnGist", "fileName", "gistId", "responseAsJson", "notify_default", "updateGist", "notes", "getNotes", "noteToFiles", "acc", "text", "deleted", "createNewGist", "note", "getAuthToken", "code", "state", "configuration", "publishGist", "empty", "equals", "aa", "bb", "ii", "coerce", "base", "ALPHABET", "name", "BASE_MAP", "j", "i", "x", "xc", "BASE", "LEADER", "FACTOR", "iFACTOR", "encode", "source", "zeroes", "length", "pbegin", "pend", "size", "b58", "carry", "it1", "it2", "str", "decodeUnsafe", "psz", "b256", "it3", "it4", "vch", "decode", "string", "buffer", "src", "_brrp__multiformats_scope_baseX", "base_x_default", "Encoder", "name", "prefix", "baseEncode", "__publicField", "bytes", "Decoder", "baseDecode", "prefixCodePoint", "text", "decoder", "or", "ComposedDecoder", "decoders", "input", "left", "right", "Codec", "from", "encode", "decode", "baseX", "alphabet", "base_x_default", "coerce", "string", "bitsPerChar", "codes", "i", "end", "out", "bits", "buffer", "written", "value", "data", "pad", "mask", "rfc4648", "base32", "rfc4648", "base32upper", "base32pad", "base32padupper", "base32hex", "base32hexupper", "base32hexpad", "base32hexpadupper", "base32z", "base36", "baseX", "base36upper", "base58btc", "baseX", "base58flickr", "encode_1", "encode", "MSB", "REST", "MSBALL", "INT", "num", "out", "offset", "oldOffset", "decode", "read", "MSB$1", "REST$1", "buf", "res", "shift", "counter", "b", "l", "N1", "N2", "N3", "N4", "N5", "N6", "N7", "N8", "N9", "length", "value", "varint", "_brrp_varint", "varint_default", "decode", "data", "offset", "varint_default", "encodeTo", "int", "target", "encodingLength", "create", "code", "digest", "size", "sizeOffset", "encodingLength", "digestOffset", "bytes", "encodeTo", "Digest", "decode", "multihash", "coerce", "equals", "a", "b", "data", "__publicField", "format", "link", "base", "bytes", "version", "toStringV0", "baseCache", "base58btc", "toStringV1", "base32", "cache", "baseCache", "cid", "_a", "CID", "_CID", "version", "code", "multihash", "bytes", "__publicField", "DAG_PB_CODE", "SHA_256_CODE", "digest", "create", "other", "self", "unknown", "equals", "base", "format", "input", "value", "encodeCID", "cidSymbol", "decode", "remainder", "specs", "prefixSize", "multihashBytes", "coerce", "digestBytes", "Digest", "initialBytes", "offset", "next", "i", "length", "codec", "multihashCode", "digestSize", "size", "multihashSize", "source", "prefix", "parseCIDtoBytes", "decoder", "base58btc", "base32", "base36", "toStringV0", "toStringV1", "codeOffset", "encodingLength", "hashOffset", "encodeTo", "textEncoder", "textDecoder", "code", "encode", "node", "textEncoder", "from", "name", "code", "encode", "Hasher", "__publicField", "input", "result", "create", "digest", "sha", "name", "data", "sha256", "from", "sha512", "hashBrowser", "val", "bytes", "encode", "hash", "sha256", "CID", "code", "hashBrowser_default", "isJSON", "str", "isJSON_default", "_getBasePageTitle", "setPageTitle", "what", "baseTitle", "dom_default", "resetPageTitle", "url", "currentParams", "params", "parametersObject", "key", "param", "searchParams", "p", "pathname", "hash", "pageId", "allParams", "newParams", "setSavedState", "saved", "dom_default", "encodeTitle", "title", "encodedTitle", "getDateCreatedFromTitle", "titleID", "getTitleId", "note", "getNote", "dateCreated", "markNoteForDeletion", "id", "url", "revision", "doc", "localstorage_default", "newerNote", "acc", "noteToReturn", "disableSyncOnCurrentNote", "value", "notify_default", "setNoteFromHash", "hash", "version", "dom_default", "setPageTitle", "resetNoteManager", "resetPageTitle", "setSavedState", "getTitle", "updateNote", "what", "existingNote", "saveNote", "text", "hashOfIncomingNote", "hashBrowser_default", "hashOfCurrentNote", "currentNote", "getNotes", "includeDeleted", "body", "isJSON_default", "noteId", "deleted", "search", "q", "deleteNote", "deleteFileOnGist", "commander_default", "isUserLoggedIn", "localstorage_default", "command", "title", "secondary", "onclick", "onSecondaryClick", "icon", "selected", "li", "iconClone", "liContent", "isElement", "span", "secondaryElement", "wordParts", "word", "match", "parts", "indexInWord", "acc", "part", "i", "p", "syllable", "start", "end", "mark", "word", "markEl", "div", "content", "highlight", "words", "wordsToHighlight", "matches", "wordToHighlight", "m", "match", "wordElements", "wordParts", "syllable", "w", "goAuthenticate", "notify_default", "commander_default", "configuration", "setGistToSyncWith", "token", "gists", "getAuthenticatedUsersGists", "gistOptions", "a", "b", "description", "updated_at", "id", "div", "localstorage_default", "syncNotesWithGitHub", "gistOptionComponents", "command", "createNewGist", "error", "dom_default", "gistId", "files", "getGist", "content", "updateNote", "setAuthTokenFromCallback", "code", "url", "state", "getAuthToken", "getNewFileHandle", "title", "options", "writeFile", "fileHandle", "contents", "writable", "saveFileAs", "notify_default", "saveDataToFile", "a", "data", "fileName", "json", "blob", "url", "import_showdown", "converter", "showdown", "convertMarkDownToHtml", "md", "handleErrorResponse", "response", "wrapTemplate", "body", "configuration", "sendMail", "email", "subject", "notify_default", "localstorage_default", "getUserMailingPreferences", "savedMail", "mailSameAgainQuestion", "whoMailing", "wannaSaveDat", "mailTo", "what", "title", "getTitle", "htmlBody", "convertMarkDownToHtml", "copyToClipboard", "what", "message", "notify_default", "error", "button", "els", "fn", "id", "elements", "isArray", "element", "e", "markDownViewer", "dom_default", "url", "autoLinks", "localstorage_default", "replacingPatterns", "pattern", "regex", "updatedHTML", "match", "matchingKey", "link", "convertMarkDownToHtml", "el", "copyBtn", "button", "codeToCopy", "copyToClipboard", "e", "mode", "markDownViewer_default", "prettifyJSON", "selector", "el", "isJSON_default", "prettifiedJSON", "notify_default", "prettifyJSON_default", "sleep", "ms", "resolve", "icon", "svgIcon", "altText", "className", "image", "share", "note", "getNote", "currentUrl", "url", "error", "notify_default", "getSyncTitle", "gistId", "localstorage_default", "shareNoteCommand", "icon", "exit_up_exports", "share", "sharePublicLinkCommand", "commander_default", "saveNote", "dom_default", "note", "getNote", "rawLink", "publishGist", "gitResponse", "response", "files", "fileContents", "gistFile", "rawUrl", "linkToShare", "url", "copyToClipboard", "commands", "pencil_exports", "resetNoteManager", "checkmark_circle_exports", "updateGist", "setSavedState", "page_break_exports", "markDownViewer_default", "frame_expand_exports", "isUserLoggedIn", "leaf_exports", "list_exports", "trash_exports", "deleteNote", "cloud_sync_exports", "token", "goAuthenticate", "setGistToSyncWith", "syncNotesWithGitHub", "lighter_exports", "notify_default", "enter_down_exports", "text", "title", "saveFileAs", "envelope_exports", "mailTo", "bug_exports", "previousStatus", "arrow_right_circle_exports", "picture_exports", "bgImage", "sleep", "printer_exports", "magic_wand_exports", "prettifyJSON_default", "rocket_exports", "spell_check_exports", "selectedValue", "valueToFind", "positionOfFirstChar", "replacementValue", "download_exports", "notes", "getNotes", "saveDataToFile", "keyListener", "key", "fn", "k", "finalKey", "functionToCall", "e", "event", "keyListener_default", "link", "textOrNode", "url", "a", "isElement", "isSameYear", "aDate", "bDate", "yearA", "yearB", "isSameMonth", "monthA", "monthB", "isSameDateOfMonth", "dateA", "dateB", "isSameDate", "monthNames", "shortMonthNames", "name", "isYesterday", "date", "theDate", "yesterDate", "relativeDate", "dateCreated", "month", "year", "day", "isArraySorted", "arr", "currentValue", "item", "max", "smartFilter", "phrase", "filter", "wordParts", "w", "indexes", "f", "i", "currentValue", "fi", "isArraySorted", "requestNotificationPermission", "localstorage_default", "permission", "registerServiceWorker", "getShortcut", "key", "k", "commander", "CommanderModes", "state", "newState", "what", "dom_default", "mode", "requestNotificationPermission", "commands", "direction", "currentlySelected", "lastOption", "indexToSelect", "command", "button", "el", "keyListener_default", "note", "getNote", "revisions", "revisionsOptions", "a", "b", "aDateCreated", "bDateCreated", "id", "i", "div", "relativeDate", "url", "r", "value", "notes", "getNotes", "title", "smartFilter", "deleted", "getDateCreatedFromTitle", "dateCreated", "href", "noteLink", "link", "commandComponents", "experimental", "localstorage_default", "call", "icon", "commander_default", "urlAlphabet", "nanoid", "size", "id", "bytes", "urlAlphabet", "import_textarea_caret", "getPredictions", "word", "sanitizedWord", "trieDictionary", "getCurrentlyTypingWord", "text", "cursorIndexPosition", "currentIndex", "character", "placeSuggestion", "textEl", "coords", "getCaretCoordinates", "top", "left", "actualTerminalHeight", "dom_default", "main", "isLastCharacterInTheWord", "characterIndex", "autoComplete", "e", "fullText", "terminal", "charTyped", "matches", "firstMatch", "prediction", "state", "findCurrentLine", "text", "caretIndex", "acc", "line", "isFound", "recon", "currentLength", "autoCompleteCheckboxes", "e", "currentLine", "findCurrentLine", "completers", "startsWith", "compleano", "dom_default", "renderInterNotes", "e", "target", "cursorIndexPosition", "fullText", "terminal", "charTyped", "dom_default", "word", "getCurrentlyTypingWord", "isLastCharacterInTheWord", "placeSuggestion", "allNoteIds", "getNotes", "note", "actualNoteSearch", "matches", "noteId", "firstMatch", "prediction", "currentWord", "state", "terminal", "initState", "state", "dom_default", "newState", "direction", "currentlySelected", "lastOption", "indexToSelect", "word", "complete", "currentWord", "completion", "prediction", "trieDictionary", "inlineSuggestion", "div", "optionsUl", "selectedIndex", "options", "i", "command", "icon", "trash_exports", "localstorage_default", "m", "optionList", "el", "commander_default", "autoComplete", "renderInterNotes", "autoCompleteCheckboxes", "currentlySavedNote", "getNote", "title", "getTitle", "text", "isNoteSaved", "setSavedState", "_a", "clipboardItems", "clipboardItem", "imageTypes", "type", "imageType", "blob", "token", "_image", "fileExtension", "fileName", "nanoid", "url", "configuration", "handleErrorResponse", "response", "error", "notify_default", "imageURI", "markDownViewer_default", "isSyncEnabled", "authToken", "gistId", "localstorage_default", "groupByFrequency", "entries", "acc", "word", "frequency", "cc", "Node", "char", "prefix", "dictionary", "nodeInstance", "node", "firstChar", "rest", "isLast", "newNode", "Trie", "rootNode", "character", "frequencyGroups", "b", "key", "errorHandler", "error", "message", "notify_default", "errorHandler_default", "setNoteFromRawUrl", "rawUrl", "response", "dom_default", "setNoteFromGist", "gistId", "gist", "getGist", "files", "fileContents", "gistFile", "content", "notify_default", "actOnURLStateChange", "e", "oldURL", "newURL", "oldPageId", "url", "newPageId", "hasPageIdChanged", "oldV", "newV", "r", "setNoteFromHash", "raw", "isANewNote", "q", "queryResult", "search", "autoMagicallyCheckBoxes", "dom_default", "el", "trieDictionary", "Trie", "initInfoPanel", "dom_default", "note", "getNote", "relativeDate", "isSyncEnabled", "syncEl", "disableSync", "p", "e", "disableSyncOnCurrentNote", "deleteButton", "deleteNote", "main", "words", "localstorage_default", "errorHandler_default", "welcome_default", "commander_default", "terminal", "resetPageTitle", "setNoteFromHash", "url", "copyToClipboard", "markDownViewer_default", "actOnURLStateChange", "registerServiceWorker", "autoMagicallyCheckBoxes", "syncNotesWithGitHub", "setAuthTokenFromCallback", "main_default", "main_default"] } diff --git a/service-worker.js b/service-worker.js index 5401987..3077296 100644 --- a/service-worker.js +++ b/service-worker.js @@ -3,7 +3,7 @@ importScripts( ); const { precacheAndRoute } = workbox.precaching; -precacheAndRoute([{"revision":"b9816a8779946abd6884c8d0835aab1a","url":"arrow-right-circle-2Q6EHM2H.svg"},{"revision":"6b352c8234986802e30f57b4a173db65","url":"bug-36UGMUXT.svg"},{"revision":"715ea2f9ed9c32e912d10f1f8cfd1333","url":"checkmark-circle-JQ7ADSUI.svg"},{"revision":"642881591601125261f78f3ad5a52c32","url":"cloud-sync-F3RLGHML.svg"},{"revision":"f8fc1cc37e1226392cc0cc4c6068cf66","url":"download-FVXMIYZ4.svg"},{"revision":"08cc87504b693a32d717aaaf13e414a0","url":"enter-down-6TVO6OFR.svg"},{"revision":"a69f752fafc2a5f161dbc1c851d4f17b","url":"envelope-Z2VRVSLR.svg"},{"revision":"7665092453f7b45c2782db5f16e6ce5c","url":"exit-up-GH6BPN2X.svg"},{"revision":"7cdfed241e2edb7e7ed37eaaf9bae94a","url":"favicon.ico"},{"revision":"fd02fe115943662aa6a6581ab31ce38d","url":"frame-expand-CX6CNP53.svg"},{"revision":"59b2a5f4e0884d7c2d4e2324e3727ecc","url":"images/icons/icon-128x128.png"},{"revision":"77b08750ba54d3a8f21f331d04530637","url":"images/icons/icon-144x144.png"},{"revision":"84cb614c066d965f784c2ed810dc31e1","url":"images/icons/icon-152x152.png"},{"revision":"2f95a518fbfc169e32fd5fb7a5b063fd","url":"images/icons/icon-192x192.png"},{"revision":"87029203db3903aab4be829b030b3514","url":"images/icons/icon-384x384.png"},{"revision":"ad2869f40002d4f268f6b60a0c115136","url":"images/icons/icon-512x512.png"},{"revision":"e70a2704695d7026ab6fe403f4604867","url":"images/icons/icon-72x72.png"},{"revision":"0bfc17b6ea552774646836236d7e5954","url":"images/icons/icon-96x96.png"},{"revision":"79e59607337b1e6a34e0935965ad4d21","url":"images/icons/maskable_icon.png"},{"revision":"ce9a2fd61cb2f8c25e2a20ffceb432d1","url":"index.html"},{"revision":"c1cbcee62186bc366538100a94d61dd7","url":"index.js"},{"revision":"3ce2509712df0cd63aa28b3bedf3ffe6","url":"leaf-CGBE7XAJ.svg"},{"revision":"4e1ab5abca803d8371db0bac365fdf93","url":"lighter-UBEI67LL.svg"},{"revision":"2694687077344bc31a1968ce3329660b","url":"list-LK7OCHR7.svg"},{"revision":"b399e36fdd1b4597c9c5036c6a4869f8","url":"magic-wand-JQJ6EKRO.svg"},{"revision":"5b3ba4abf0df4fc44cd679b1ce903ac6","url":"manifest.json"},{"revision":"126653c706df1e5655be880ddc02e164","url":"page-break-BLVP5QBQ.svg"},{"revision":"d26a9edb2928bbeba1749f454aab95d3","url":"pencil-X3ZMY3QU.svg"},{"revision":"1c74f8e5f212764756b46b728d31a97f","url":"picture-3TDOSVS3.svg"},{"revision":"299ddb01bcee73f853049f4ca36e9dc8","url":"printer-B7RMPYZC.svg"},{"revision":"1eccb57fd8613bb74b8394400b7b1b1f","url":"rocket-AIY2RJJS.svg"},{"revision":"41be43627587fa71a315c9a1d2565283","url":"spell-check-V6QYTGNT.svg"},{"revision":"abef7b4a2eb95c594f45063c3fe372eb","url":"trash-RDL437QG.svg"}]); +precacheAndRoute([{"revision":"b9816a8779946abd6884c8d0835aab1a","url":"arrow-right-circle-2Q6EHM2H.svg"},{"revision":"6b352c8234986802e30f57b4a173db65","url":"bug-36UGMUXT.svg"},{"revision":"715ea2f9ed9c32e912d10f1f8cfd1333","url":"checkmark-circle-JQ7ADSUI.svg"},{"revision":"642881591601125261f78f3ad5a52c32","url":"cloud-sync-F3RLGHML.svg"},{"revision":"f8fc1cc37e1226392cc0cc4c6068cf66","url":"download-FVXMIYZ4.svg"},{"revision":"08cc87504b693a32d717aaaf13e414a0","url":"enter-down-6TVO6OFR.svg"},{"revision":"a69f752fafc2a5f161dbc1c851d4f17b","url":"envelope-Z2VRVSLR.svg"},{"revision":"7665092453f7b45c2782db5f16e6ce5c","url":"exit-up-GH6BPN2X.svg"},{"revision":"7cdfed241e2edb7e7ed37eaaf9bae94a","url":"favicon.ico"},{"revision":"fd02fe115943662aa6a6581ab31ce38d","url":"frame-expand-CX6CNP53.svg"},{"revision":"59b2a5f4e0884d7c2d4e2324e3727ecc","url":"images/icons/icon-128x128.png"},{"revision":"77b08750ba54d3a8f21f331d04530637","url":"images/icons/icon-144x144.png"},{"revision":"84cb614c066d965f784c2ed810dc31e1","url":"images/icons/icon-152x152.png"},{"revision":"2f95a518fbfc169e32fd5fb7a5b063fd","url":"images/icons/icon-192x192.png"},{"revision":"87029203db3903aab4be829b030b3514","url":"images/icons/icon-384x384.png"},{"revision":"ad2869f40002d4f268f6b60a0c115136","url":"images/icons/icon-512x512.png"},{"revision":"e70a2704695d7026ab6fe403f4604867","url":"images/icons/icon-72x72.png"},{"revision":"0bfc17b6ea552774646836236d7e5954","url":"images/icons/icon-96x96.png"},{"revision":"79e59607337b1e6a34e0935965ad4d21","url":"images/icons/maskable_icon.png"},{"revision":"ce9a2fd61cb2f8c25e2a20ffceb432d1","url":"index.html"},{"revision":"b7775fea245a2bca4d3005404e79ae3b","url":"index.js"},{"revision":"3ce2509712df0cd63aa28b3bedf3ffe6","url":"leaf-CGBE7XAJ.svg"},{"revision":"4e1ab5abca803d8371db0bac365fdf93","url":"lighter-UBEI67LL.svg"},{"revision":"2694687077344bc31a1968ce3329660b","url":"list-LK7OCHR7.svg"},{"revision":"b399e36fdd1b4597c9c5036c6a4869f8","url":"magic-wand-JQJ6EKRO.svg"},{"revision":"5b3ba4abf0df4fc44cd679b1ce903ac6","url":"manifest.json"},{"revision":"126653c706df1e5655be880ddc02e164","url":"page-break-BLVP5QBQ.svg"},{"revision":"d26a9edb2928bbeba1749f454aab95d3","url":"pencil-X3ZMY3QU.svg"},{"revision":"1c74f8e5f212764756b46b728d31a97f","url":"picture-3TDOSVS3.svg"},{"revision":"299ddb01bcee73f853049f4ca36e9dc8","url":"printer-B7RMPYZC.svg"},{"revision":"1eccb57fd8613bb74b8394400b7b1b1f","url":"rocket-AIY2RJJS.svg"},{"revision":"41be43627587fa71a315c9a1d2565283","url":"spell-check-V6QYTGNT.svg"},{"revision":"abef7b4a2eb95c594f45063c3fe372eb","url":"trash-RDL437QG.svg"}]); const checkForNewerVersion = (currentVersion) => { const intervalChecker = setInterval(async () => {