(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{17:function(e,t,n){e.exports={poButton:"style_poButton__3x8Ka"}},18:function(e,t,n){e.exports=n(26)},26:function(e,t,n){"use strict";n.r(t);var o=n(8),s=n.n(o),a=n(15),l=n.n(a),r=n(6),i=n(0),c=n(1),u=n(2),p=n(3),d=n(13),y=n(17),m=n.n(y),g=function(e){Object(u.a)(n,e);var t=Object(p.a)(n);function n(){var e;Object(i.a)(this,n);for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return(e=t.call.apply(t,[this].concat(a))).state={ladybugGeometry:"",isPollinationModel:!1,isFocused:!1,syncToken:""},e.render=function(){return s.a.createElement("span",null,s.a.createElement("button",{className:m.a.poButton,onClick:e.onClicked,disabled:e.props.disabled,onFocus:e._onFocus,onBlur:e._onBlur},s.a.createElement("span",null,s.a.createElement("img",{style:{margin:"0px 3px 2px 0px"},src:"./img/pollination.png",alt:"logo"})),"Get ",e.props.args.isPollinationModel?"Pollination Model":"Geometry",e.props.args.syncToken&&" (Sync)"))},e.setStateNow=function(t){e.setState((function(e){return Object(r.a)(Object(r.a)({},e),{},{ladybugGeometry:t.ladybugGeometry,isPollinationModel:t.isPollinationModel,syncToken:t.syncToken})}),(function(){return d.a.setComponentValue(e.state.ladybugGeometry)})),console.log("[POLLINATION-DEBUG]: JSON string sent.")},e.dotNetRun=function(){if("undefined"!=typeof window.parent.chrome){if("undefined"==typeof window.parent.chrome.webview)return console.log("[POLLINATION-DEBUG]: webview not found."),e.state;var t=null;return{ladybugGeometry:null!=(t=e.props.args.isPollinationModel?window.parent.chrome.webview.hostObjects.sync.hbjson.PassPollinationModel():window.parent.chrome.webview.hostObjects.sync.geometry.PassJsonGeometry())?t.Geometry:null,isPollinationModel:e.props.args.isPollinationModel,syncToken:e.props.args.syncToken}}return console.log("[POLLINATION-DEBUG]: chrome not found."),e.state},e.onClicked=function(){var t=e.dotNetRun();e.setStateNow(t)},e._onFocus=function(){e.setState({isFocused:!0})},e._onBlur=function(){e.setState({isFocused:!1})},e}return Object(c.a)(n,[{key:"componentDidUpdate",value:function(){var e=this.props.args.isPollinationModel?"PollinationModel":"GeometryModel";if(this.state.syncToken!==this.props.args.syncToken&&""!==this.state.ladybugGeometry){if(!this.props.args.syncToken.startsWith(e))return;var t=this.dotNetRun();this.setStateNow(t)}console.log("[POLLINATION-DEBUG]: auto-update.")}}]),n}(d.b),b=Object(d.c)(g);l.a.render(s.a.createElement(s.a.StrictMode,null,s.a.createElement(b,null)),document.getElementById("root"))}},[[18,1,2]]]);
//# sourceMappingURL=main.a7c0ac14.chunk.js.map