!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","tslib","react","react-dom","../Task"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=e("tslib"),r=u.__importDefault(e("react"));t.React=r.default;var d=u.__importDefault(e("react-dom")),n=e("../Task");function i(){var i=this.execute;this.execute=function(e,r){var n=this,t=r.ambient.trivia;return this.app=t.app,this.map=t.map,this.site=t.site,this.widget=t.widget,this.FormRenderer=t.FormRenderer,this.completion=r.ambient.completion,this.execute=i,this.createRenderer=function(){var e,t=n.renderer;return void 0===t&&((t=n.renderer=n.FormRenderer.createCustom()).state=r.ambient,e=function(){return t.dispose()},n.completion.then(e,e)),n.renderer||(n.renderer=n.FormRenderer.createCustom())},i.apply(this,arguments)}}(t.AppActivity=i).prototype.createRenderer=function(){return null},i.prototype.applyProps=function(e){var t=this.createRenderer();!function(e,t){var r=!1;if(null!=t)for(var n in t)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}(this.showProps||(this.showProps={}),e)||(e=this.showProps,t.form={defaults:{container:e.container},elements:{header:{type:"Header",section:"header",title:{markdown:e.title},value:e.icon}}},t.invalidate())},i.prototype.show=function(e){return this.applyProps(e),this.createRenderer().show()},i.prototype.spin=function(e){return this.applyProps(e),this.createRenderer().spin()},i.prototype.spinNoBlock=function(e){return this.applyProps(e),this.createRenderer().spinNoBlock()},i.prototype.hide=function(){return this.createRenderer().hide()},i.prototype.render=function(t,p){return u.__awaiter(this,void 0,void 0,function(){var a,s,c;return u.__generator(this,function(e){return a=this.createRenderer().container,"function"==typeof t?(s=this,c=t,[2,new n.Task(function(i,o){return u.__awaiter(this,void 0,void 0,function(){var t,r,n;return u.__generator(this,function(e){switch(e.label){case 0:return(t=i.bind(void 0)).reject=o.bind(void 0),n=(r=d.default).render,[4,c.call(s,t,p)];case 1:return n.apply(r,[e.sent(),a]),[2]}})})})]):r.default.isValidElement(t)?[2,new n.Task(function(e){d.default.render(t,a,e)})]:[2,a]})})}});