(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{13:function(e,t,a){e.exports={poCheckboxLabel:"style_poCheckboxLabel__2IHB4",poCheckboxSpan:"style_poCheckboxSpan__ltXcy",poCheckbox:"style_poCheckbox__3Q56z"}},18:function(e,t,a){e.exports=a(26)},26:function(e,t,a){"use strict";a.r(t);var n=a(8),o=a.n(n),s=a(16),c=a.n(s),r=a(6),i=a(0),d=a(1),l=a(2),u=a(3),p=a(14),h=a(13),f=a.n(h),g=function(e){Object(l.a)(a,e);var t=Object(u.a)(a);function a(e){var n;Object(i.a)(this,a),(n=t.call(this,e)).render=function(){return o.a.createElement("label",{className:f.a.poCheckboxLabel},o.a.createElement("input",{className:f.a.poCheckbox,type:"checkbox",defaultChecked:n.state.defaultChecked,onChange:n._onChange,disabled:n.props.disabled,onFocus:n._onFocus,onBlur:n._onBlur}),o.a.createElement("span",{className:f.a.poCheckboxSpan},"Settings"))},n._isSettingsOptions=function(e){if(!e)return!1;try{return"earth_anchor"in e||"units"in e}catch(t){return!1}},n._sendMessageTo=function(){if("undefined"!=typeof window.parent.chrome){if("undefined"==typeof window.parent.chrome.webview)return console.log("[POLLINATION-DEBUG]: webview not found."),n.state;var e=n.props.args.data,t=!1;if(!e)return{};e instanceof String?t=!1:n._isSettingsOptions(e)&&(t=!0);var a={action:"SetModelSettings",data:e};if(console.log("_sendMessageTo: ".concat(e)),!t&&e.toString().startsWith("SETTINGS")){var o=window.parent.chrome.webview.hostObjects.sync.settings.GetModelSettings();p.a.setComponentValue(JSON.parse(o))}else if(t){var s=JSON.stringify(a);window.parent.chrome.webview.postMessage(s)}return a}return console.log("[POLLINATION-DEBUG]: chrome not found."),n.state},n._setStateNow=function(e,t){n.setState((function(a){return Object(r.a)(Object(r.a)({},a),{},{data:e.data,isChecked:t})})),console.log("[POLLINATION-DEBUG]: JSON string sent.")},n._autoUpdate=function(e){setTimeout((function(){var e=n._sendMessageTo();n._setStateNow(e,!0),console.log("[POLLINATION-DEBUG]: auto-update.")}),e)},n._onChange=function(e){var t=e.target.checked,a=n.props.args.data;n.setState({isChecked:t,data:a}),t&&n.state.data&&(console.log("_onChange: ".concat(a)),n._sendMessageTo())},n._onFocus=function(){n.setState({isFocused:!0})},n._onBlur=function(){n.setState({isFocused:!1})};var s=n.props.args.data,c=n.props.args.defaultChecked,d={data:s,defaultChecked:c,isChecked:!!c,delay:n.props.args.delay};return n.state=Object(r.a)({},d),c&&s&&n._sendMessageTo(),n}return Object(d.a)(a,[{key:"componentDidUpdate",value:function(){this.state.isChecked&&this.state.data&&this.state.data!==this.props.args.data&&this._autoUpdate(this.state.delay)}}]),a}(p.b),b=Object(p.c)(g);c.a.render(o.a.createElement(o.a.StrictMode,null,o.a.createElement(b,null)),document.getElementById("root"))}},[[18,1,2]]]);
//# sourceMappingURL=main.7570af80.chunk.js.map