{ "version": 3, "sources": ["../../page/md.js"], "sourcesContent": ["\"use strict\";\n\nimport * as App from '../app/app~fv=cw_byBD8.min.js';\n\n/**\n@typedef {import('../../../pkg/cozejs/typedef.js').Pay} Pay\n@typedef {import('../../../pkg/cozejs/typedef.js').B64} B64\n@typedef {import('../app/paginate.js').PagRec} PagRec\n */\n\n/**\nMarkdown is the main markdown object that holds the rendered md as HTML, and any\nadditional information needed for the page.\n\n- html: Markdown text/file rendered as HTML. This is the only required field.\n This should be the full markdown body for the page.\n- author: The author's uad.\n- author_display_name: The author's display name.\n- subject: Markdown subject, where the markdown body data is coming from. E.g.\n \"comment\" or \"file\".\n- comment_pagrec: The Markdown page's pagination object for comments.\n@typedef {object} Markdown\n@property {HTMLBodyElement} html\n@property {string} [subject]\n@property {PagRec} [comment_pagrec]\n */\n\n/** @type {Markdown} */\nvar MD = {};\n\nApp.AddOnload(MarkdownOnload);\n\n// Onload for the Markdown page.\nasync function MarkdownOnload() {\n\tconsole.debug(\"Executing MarkdownOnload: \", markdown);\n\n\tMD = {\n\t\t...markdown\n\t};\n\n\t/**@type {PagRec} */\n\tvar pagrec = await App.InitPagRec(MD.comment_pagrec);\n\tconsole.debug(pagrec)\n\n\n\tdocument.getElementById('authorLink').href = '/user/id/' + MD.author;\n\tif (isEmpty(MD.updated)) {\n\t\tdocument.getElementById('updatedTime').textContent = 'n/a';\n\t}\n\n\t// TODO remove static id check once disable comment is implemented.\n\t// Comment and reviews.\n\t// Official blog page.\n\t// TODO Sync same ac and main blog czd for prod and dev.\n\tif (MD.id === \"E_CZxGeK6LwbB3grsO8Tz5kO1-ckh4r1Xhw383v194k\") {\n\t\tHide('CommentSection');\n\t\treturn;\n\t}\n\tShow('CommentSection');\n\n\tdocument.getElementById('submitCommentBtn').addEventListener('click', () => {\n\t\tlet comment = {};\n\t\tcomment.text = document.querySelector(\"#commentTextArea\").value;\n\t\tcomment.root = MD.id;\n\t\t// Parent must also be set, and be equal to root for top level comments,\n\t\t// since children are queried by parent, and not root.\n\t\t// comment.parent = MD.id;\n\n\t\t// console.debug(comment);\n\t\tApp.SubmitComment(comment, true);\n\t});\n\n\tif (!isEmpty(MD.comment_pagrec && !isEmpty(MD.comment_pagrec.rec))) {\n\t\tApp.ToggleReviewForm(MD.comment_pagrec.rec);\n\t\tApp.CommentReviewModule(MD.comment_pagrec);\n\t}\n}"], "mappings": "AAEA,UAAYA,MAAS,gCA0BrB,IAAIC,EAAK,CAAC,EAEVD,EAAI,UAAUE,CAAc,EAG5B,eAAeA,GAAiB,CAC/B,QAAQ,MAAM,6BAA8B,QAAQ,EAEpDD,EAAK,CACJ,GAAG,QACJ,EAGA,IAAIE,EAAS,MAAMH,EAAI,WAAWC,EAAG,cAAc,EAanD,GAZA,QAAQ,MAAME,CAAM,EAGpB,SAAS,eAAe,YAAY,EAAE,KAAO,YAAcF,EAAG,OAC1D,QAAQA,EAAG,OAAO,IACrB,SAAS,eAAe,aAAa,EAAE,YAAc,OAOlDA,EAAG,KAAO,8CAA+C,CAC5D,KAAK,gBAAgB,EACrB,MACD,CACA,KAAK,gBAAgB,EAErB,SAAS,eAAe,kBAAkB,EAAE,iBAAiB,QAAS,IAAM,CAC3E,IAAIG,EAAU,CAAC,EACfA,EAAQ,KAAO,SAAS,cAAc,kBAAkB,EAAE,MAC1DA,EAAQ,KAAOH,EAAG,GAMlBD,EAAI,cAAcI,EAAS,EAAI,CAChC,CAAC,EAEI,QAAQH,EAAG,gBAAkB,CAAC,QAAQA,EAAG,eAAe,GAAG,CAAC,IAChED,EAAI,iBAAiBC,EAAG,eAAe,GAAG,EAC1CD,EAAI,oBAAoBC,EAAG,cAAc,EAE3C", "names": ["App", "MD", "MarkdownOnload", "pagrec", "comment"] }