(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{13:function(e,t,o){e.exports={poCheckboxLabel:"style_poCheckboxLabel__2IHB4",poCheckboxSpan:"style_poCheckboxSpan__ltXcy",poCheckbox:"style_poCheckbox__3Q56z"}},18:function(e,t,o){e.exports=o(26)},26:function(e,t,o){"use strict";o.r(t);var a=o(8),n=o.n(a),s=o(16),c=o.n(s),r=o(6),i=o(0),p=o(1),u=o(2),l=o(3),d=o(14),h=o(13),b=o.n(h),f=function(e){Object(u.a)(o,e);var t=Object(l.a)(o);function o(e){var a;Object(i.a)(this,o),(a=t.call(this,e)).render=function(){return n.a.createElement("label",{className:b.a.poCheckboxLabel},n.a.createElement("input",{className:b.a.poCheckbox,type:"checkbox",defaultChecked:a.state.defaultChecked,onChange:a._onChange,disabled:a.props.disabled,onFocus:a._onFocus,onBlur:a._onBlur}),n.a.createElement("span",{className:b.a.poCheckboxSpan},a.state.label))},a._setStateNow=function(e,t){a.setState((function(o){return Object(r.a)(Object(r.a)({},o),{},{action:e.action,data:e.data,uniqueId:e.uniqueId,options:e.options,isChecked:t})})),console.log("[POLLINATION-DEBUG]: JSON string sent.")},a._sendMessageTo=function(e){if("undefined"!=typeof window.parent.chrome){if("undefined"==typeof window.parent.chrome.webview)return console.log("[POLLINATION-DEBUG]: webview not found."),a.state;var t={action:e,data:a.props.args.data,uniqueId:a.props.args.uniqueId,options:a.props.args.options},o=JSON.stringify(t);return window.parent.chrome.webview.postMessage(o),t}return console.log("[POLLINATION-DEBUG]: chrome not found."),a.state},a._onChange=function(e){var t=e.target.checked,o=t?"DrawGeometry":"DisableDraw",n=a._sendMessageTo(o);a._setStateNow(n,t)},a._onFocus=function(){a.setState({isFocused:!0})},a._onBlur=function(){a.setState({isFocused:!1})};var s=a.props.args.data,c=a.props.args.uniqueId,p=a.props.args.defaultChecked,u={action:"",data:s,uniqueId:c,defaultChecked:p,options:a.props.args.options,label:a.props.args.label,isChecked:!!p};if(a.state=Object(r.a)({},u),p){a._sendMessageTo("DrawGeometry");a.setState({action:"DrawGeometry"})}return a}return Object(p.a)(o,[{key:"componentWillUnmount",value:function(){if(this.state.isChecked){this._sendMessageTo("DisableDraw");console.log("[POLLINATION-DEBUG]: unmount.")}}},{key:"componentDidUpdate",value:function(){if(this.state.isChecked&&this.state.data!=this.props.args.data){var e=this._sendMessageTo("DisableDraw");e=this._sendMessageTo("DrawGeometry"),this._setStateNow(e,!0),console.log("[POLLINATION-DEBUG]: auto-update.")}}}]),o}(d.a),g=Object(d.b)(f);c.a.render(n.a.createElement(n.a.StrictMode,null,n.a.createElement(g,null)),document.getElementById("root"))}},[[18,1,2]]]);
//# sourceMappingURL=main.4c4ce81e.chunk.js.map