1(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7062],{69341:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return K}});var i=n(64649),r=n(22951),a=n(91976),o=n(67591),s=n(94337),c=n(50189),l=n(66845),h=n(59109),u=n(97365),p=n(62813),d=n.n(p),m=n(3717),f=n(25621),v=n(27466),g=n(43536),w=n(80248),k=n(44948),x=n(12879),b=n(47203),y=n(61355),Z=n(82595),S=n(19754),j=n(62622),T=n(11092),V=n(27791),C=n(36989),F=n(59033),J=n(90434),z=n(45960),E=n.n(z),I=n(63765),L=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n)}((0,J.Z)(Error)),M=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n)}((0,J.Z)(Error)),O=function(){function t(){(0,r.Z)(this,t)}return(0,a.Z)(t,null,[{key:"get",value:function(){var e=(0,V.Z)((0,T.Z)().mark((function e(n){var i,r,a;return(0,T.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.current,r=i.commandLine,a=i.userMapboxToken,t.token&&t.commandLine===r.toLowerCase()){e.next=10;break}if(""===a){e.next=6;break}t.token=a,e.next=9;break;case 6:return e.next=8,this.fetchToken("https://data.streamlit.io/tokens.json","mapbox");case 8:t.token=e.sent;case 9:t.commandLine=r.toLowerCase();case 10:return e.abrupt("return",t.token);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"fetchToken",value:function(){var t=(0,V.Z)((0,T.Z)().mark((function t(e,n){var i,r,a;return(0,T.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,E().get(e);case 3:if(i=t.sent,null!=(r=i.data[n])&&""!==r){t.next=7;break}throw new Error('Missing token "'.concat(n,'"'));case 7:return t.abrupt("return",r);case 10:throw t.prev=10,t.t0=t.catch(0),a=(0,I.b)(t.t0),new M("".concat(a.message," (").concat(e,")"));case 14:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e,n){return t.apply(this,arguments)}}()}]),t}();O.token=void 0,O.commandLine=void 0;var P=n(13005),D=n.n(P),N=n(82309),_=n(40864),A=function(t){var e=t.error,n=t.width,i=t.deltaType;return e instanceof L?(0,_.jsx)(N.Z,{width:n,name:"No Mapbox token provided",message:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("p",{children:["To use ",(0,_.jsxs)("code",{children:["st.",i]})," or ",(0,_.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,_.jsxs)("p",{children:["To get a token, create an account at"," ",(0,_.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,_.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,_.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,_.jsxs)("p",{children:["See"," ",(0,_.jsx)("a",{href:"https://docs.streamlit.io/library/advanced-features/configuration#view-all-configuration-options",children:"our documentation"})," ","for more info on how to set config options."]})]})}):e instanceof M?(0,_.jsx)(N.Z,{width:n,name:"Error fetching Streamlit Mapbox token",message:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("p",{children:"This app requires an internet connection."}),(0,_.jsx)("p",{children:"Please check your connection and try again."}),(0,_.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,_.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,_.jsx)(N.Z,{width:n,name:"Error fetching Streamlit Mapbox token",message:e.message})},B=function(t){return function(e){var n=function(n){(0,o.Z)(l,n);var i=(0,s.Z)(l);function l(n){var a;return(0,r.Z)(this,l),(a=i.call(this,n)).initMapboxToken=(0,V.Z)((0,T.Z)().mark((function t(){var e,n;return(0,T.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,O.get(a.props.sessionInfo);case 3:e=t.sent,a.setState({mapboxToken:e,isFetching:!1}),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),n=(0,I.b)(t.t0),a.setState({mapboxTokenError:n,isFetching:!1});case 11:case"end":return t.stop()}}),t,null,[[0,7]])}))),a.render=function(){var n=a.state,i=n.mapboxToken,r=n.mapboxTokenError,o=n.isFetching,s=a.props.width;return r?(0,_.jsx)(A,{width:s,error:r,deltaType:t}):o?(0,_.jsx)(C.Z,{body:"Loading...",kind:F.h.INFO,width:s}):(0,_.jsx)(e,(0,c.Z)((0,c.Z)({},a.props),{},{mapboxToken:i,width:s}))},a.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0},a.initMapboxToken(),a}return(0,a.Z)(l)}(l.PureComponent);return n.displayName="withMapboxToken(".concat(e.displayName||e.name,")"),D()(n,e)}},G=n(1515),q=(0,G.Z)("div",{target:"e1az0zs51"})((function(t){var e=t.width,n=t.height;return{marginTop:t.theme.spacing.sm,position:"relative",height:n,width:e}}),""),W=(0,G.Z)("div",{target:"e1az0zs50"})((function(t){var e=t.theme;return{position:"absolute",right:"2.625rem",top:e.spacing.md,zIndex:1,"button:not(:disabled)":{background:e.colors.bgColor,"& + button":{borderTopColor:e.colors.secondaryBg},"& span":{filter:(0,v.Iy)(e)?"":"invert(100%)"}}}}),""),X=(n(79259),{classes:(0,c.Z)((0,c.Z)((0,c.Z)((0,c.Z)({},g),x),k),b)});(0,S.fh)([y.w,Z.E]);var $=new w.Z({configuration:X}),H=function(t){(0,o.Z)(n,t);var e=(0,s.Z)(n);function n(){var t;(0,r.Z)(this,n);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return(t=e.call.apply(e,[this].concat(a))).state={viewState:{bearing:0,pitch:0,zoom:11},initialized:!1,initialViewState:{},id:void 0,pydeckJson:void 0,isFullScreen:!1,isLightTheme:(0,v.Iy)(t.props.theme)},t.componentDidMount=function(){t.setState({initialized:!0})},t.createTooltip=function(e){var n=t.props.element;if(!e||!e.object||!n.tooltip)return!1;var i=u.Z.parse(n.tooltip);return i.html?i.html=t.interpolate(e,i.html):i.text=t.interpolate(e,i.text),i},t.interpolate=function(t,e){var n=e.match(/{(.*?)}/g);
1return n&&n.forEach((function(n){var i=n.substring(1,n.length-1);t.object.hasOwnProperty(i)&&(e=e.replace(n,t.object[i]))})),e},t.onViewStateChange=function(e){var n=e.viewState;t.setState({viewState:n})},t}return(0,a.Z)(n,[{key:"render",value:function(){var t=n.getDeckObject(this.props,this.state),e=this.state.viewState;return(0,_.jsx)(q,{className:"stDeckGlJsonChart",width:t.initialViewState.width,height:t.initialViewState.height,"data-testid":"stDeckGlJsonChart",children:(0,_.jsxs)(h.Z,{viewState:e,onViewStateChange:this.onViewStateChange,height:t.initialViewState.height,width:t.initialViewState.width,layers:this.state.initialized?t.layers:[],getTooltip:this.createTooltip,ContextProvider:m.X$.Provider,controller:!0,children:[(0,_.jsx)(m.Z3,{height:t.initialViewState.height,width:t.initialViewState.width,mapStyle:t.mapStyle&&("string"===typeof t.mapStyle?t.mapStyle:t.mapStyle[0]),mapboxApiAccessToken:this.props.mapboxToken}),(0,_.jsx)(W,{children:(0,_.jsx)(m.Pv,{className:"zoomButton",showCompass:!1})})]})})}}],[{key:"getDerivedStateFromProps",value:function(t,e){var r=n.getDeckObject(t,e);if(!d()(r.initialViewState,e.initialViewState)){var a=Object.keys(r.initialViewState).reduce((function(t,n){return r.initialViewState[n]===e.initialViewState[n]?t:(0,c.Z)((0,c.Z)({},t),{},(0,i.Z)({},n,r.initialViewState[n]))}),{});return{viewState:(0,c.Z)((0,c.Z)({},e.viewState),a),initialViewState:r.initialViewState}}return null}}]),n}(l.PureComponent);H.getDeckObject=function(t,e){var n,i,r,a,o,s=t.element,c=t.width,l=t.height,h=t.theme,p=t.isFullScreen,d=null!==p&&void 0!==p&&p;(s.id===e.id&&e.isFullScreen===d&&e.isLightTheme===(0,v.Iy)(h)||(e.pydeckJson=u.Z.parse(s.json),e.id=s.id),null!==(n=e.pydeckJson)&&void 0!==n&&n.mapStyle||(e.pydeckJson.mapStyle="mapbox://styles/mapbox/".concat((0,v.Iy)(h)?"light":"dark","-v9")),p)?Object.assign(null===(r=e.pydeckJson)||void 0===r?void 0:r.initialViewState,{width:c,height:l}):(null!==(a=e.pydeckJson)&&void 0!==a&&null!==(o=a.initialViewState)&&void 0!==o&&o.height||(e.pydeckJson.initialViewState.height=500),s.useContainerWidth&&(e.pydeckJson.initialViewState.width=c));return e.isFullScreen=p,e.isLightTheme=(0,v.Iy)(h),null===(i=e.pydeckJson)||void 0===i||delete i.views,$.convert(e.pydeckJson)};var K=(0,f.b)(B("st.pydeck_chart")((0,j.Z)(H)))},2090:function(){},72709:function(){},20035:function(){},72672:function(){}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.