(function(d){typeof define=="function"&&define.amd?define(d):d()})(function(){"use strict";function d(r,e,u,i){if(!(r instanceof Error))throw r;if(!(typeof window>"u"&&e||i))throw r.message+=" on line "+u,r;var t,a,c,F;try{i=i||require("fs").readFileSync(e,{encoding:"utf8"}),t=3,a=i.split(`
`),c=Math.max(u-t,0),F=Math.min(a.length,u+t)}catch(n){return r.message+=" - could not read from "+e+" ("+n.message+")",void d(r,null,u)}t=a.slice(c,F).map(function(n,f){var s=f+c+1;return(s==u?"  > ":"    ")+s+"| "+n}).join(`
`),r.path=e;try{r.message=(e||"Pug")+":"+u+`
`+t+`

`+r.message}catch{}throw r}function o(r){var e="",u,i;try{i=1,u="/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug",e=e+'<div class="g-widget-readme">',i=2,u="/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug",e=e+'<div class="g-widget-readme-header">',i=3,u="/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug",e=e+'<i class="icon-doc-text-inv">',i=3,u="/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug",e=e+"README</i></div>",i=4,u="/home/circleci/project/girder/plugins/readme/girder_readme/web_client/templates/readmeWidget.pug",e=e+'<div class="g-widget-readme-content"></div></div>'}catch(t){d(t,u,i)}return e}const w="",g=girder.$,l=girder.views.widgets.HierarchyWidget,{wrap:m}=girder.utilities.PluginUtils,{restRequest:p}=girder.rest,{renderMarkdown:h}=girder.misc;m(l,"render",function(r){if(r.call(this),this.parentModel.resourceName==="folder"){const e=this.parentModel.get("_id");p({url:`folder/${e}/readme`,method:"GET"}).then(u=>(u&&(g(".g-folder-metadata").after(o),h(u,g(".g-widget-readme-content"))),u))}return this})});
