streamlit-nightly 1.42.1.dev20250209__py2.py3-none-any.whl → 1.42.1.dev20250211__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. streamlit/config.py +9 -0
  2. streamlit/proto/NewSession_pb2.py +16 -16
  3. streamlit/proto/NewSession_pb2.pyi +12 -3
  4. streamlit/static/index.html +1 -1
  5. streamlit/static/static/js/{FileDownload.esm.D9415avj.js → FileDownload.esm.Cynb6pHv.js} +1 -1
  6. streamlit/static/static/js/{FileDropzone.Cd515bsy.js → FileDropzone.CVp7XX9M.js} +1 -1
  7. streamlit/static/static/js/{FormClearHelper.BBpErIGP.js → FormClearHelper.0-LU4kzK.js} +1 -1
  8. streamlit/static/static/js/{Hooks.CeSTXIj2.js → Hooks.CO99RwN4.js} +1 -1
  9. streamlit/static/static/js/{InputInstructions.BU5Td5cJ.js → InputInstructions.BM7jV9sg.js} +1 -1
  10. streamlit/static/static/js/{ProgressBar.J2QhvKtD.js → ProgressBar.B-igBN-q.js} +2 -2
  11. streamlit/static/static/js/{RenderInPortalIfExists.BbbrvJaa.js → RenderInPortalIfExists.BbrAiS4q.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.D-hUr0RX.js → Toolbar.B4UnlLJR.js} +1 -1
  13. streamlit/static/static/js/{base-input.CNkkCv4B.js → base-input.BdySl3Wo.js} +4 -4
  14. streamlit/static/static/js/{createSuper.DHhKMTIx.js → createSuper.CT9j4pwt.js} +1 -1
  15. streamlit/static/static/js/{data-grid-overlay-editor.CRylpesE.js → data-grid-overlay-editor.CTNOILgF.js} +1 -1
  16. streamlit/static/static/js/{downloader.D_08g5mI.js → downloader.BI10Ut1s.js} +1 -1
  17. streamlit/static/static/js/{es6.B-Rq6ajt.js → es6.D57lNoID.js} +2 -2
  18. streamlit/static/static/js/{iframeResizer.contentWindow.CFL3MAVr.js → iframeResizer.contentWindow.Dp7tzCKc.js} +1 -1
  19. streamlit/static/static/js/{index.BlcNB-sY.js → index.2ZU4u6uf.js} +1 -1
  20. streamlit/static/static/js/{index.D9M0iUu5.js → index.6gMd28--.js} +1 -1
  21. streamlit/static/static/js/index.BIbTzsBv.js +1 -0
  22. streamlit/static/static/js/index.BJr-0rbs.js +1 -0
  23. streamlit/static/static/js/index.B_RT9XEh.js +1 -0
  24. streamlit/static/static/js/index.Bd1tyA5C.js +1 -0
  25. streamlit/static/static/js/{index.DwWMkgFE.js → index.BsGCnWXN.js} +1 -1
  26. streamlit/static/static/js/index.Bv9SpIsp.js +1 -0
  27. streamlit/static/static/js/index.BvzG4uRR.js +2 -0
  28. streamlit/static/static/js/index.CMeUNbsd.js +1 -0
  29. streamlit/static/static/js/{index.BCYuLMdi.js → index.CNzGrsa-.js} +3 -3
  30. streamlit/static/static/js/index.CQdVmKGZ.js +1 -0
  31. streamlit/static/static/js/index.CQe0cVuu.js +1 -0
  32. streamlit/static/static/js/{index.BqePTNWb.js → index.CQy70Tuh.js} +2 -2
  33. streamlit/static/static/js/index.Ce593GKt.js +1 -0
  34. streamlit/static/static/js/{index.BVbWPXFU.js → index.CuMSXAh1.js} +1 -1
  35. streamlit/static/static/js/index.Cv4f0quN.js +1 -0
  36. streamlit/static/static/js/index.CxuOpTfE.js +1 -0
  37. streamlit/static/static/js/{index.CEWcZMdD.js → index.D-W0WnPg.js} +2 -2
  38. streamlit/static/static/js/{index.C-_AHUSz.js → index.D6cby_GK.js} +2 -2
  39. streamlit/static/static/js/{index.D94jjl7_.js → index.D7RSv6ey.js} +61 -61
  40. streamlit/static/static/js/{index.B9q8XlSH.js → index.DG8N1agE.js} +2 -2
  41. streamlit/static/static/js/{index.CMcCB4vg.js → index.DHeMuZWt.js} +15 -15
  42. streamlit/static/static/js/{index.BevO9CYu.js → index.DHlZQRJ2.js} +2 -2
  43. streamlit/static/static/js/{index.9wBA4A4f.js → index.DIuYZOo1.js} +19 -19
  44. streamlit/static/static/js/index.DKChIiWS.js +1 -0
  45. streamlit/static/static/js/{index.Bw9RDCaH.js → index.DVQA7678.js} +1 -1
  46. streamlit/static/static/js/{index.CuNiy4LB.js → index.DVZLDFTf.js} +1 -1
  47. streamlit/static/static/js/{index.B0xfT3p4.js → index.DWawEgfs.js} +2 -2
  48. streamlit/static/static/js/index.Do-aY-b0.js +1 -0
  49. streamlit/static/static/js/{index.zzxJWhBg.js → index.E-uCquNT.js} +1 -1
  50. streamlit/static/static/js/{index.JSS70wsq.js → index.EY84KFkO.js} +2 -2
  51. streamlit/static/static/js/{index.DYHaq5Cw.js → index.MyWIyUAB.js} +13 -13
  52. streamlit/static/static/js/{index.B2evntzQ.js → index.NyidZo79.js} +1 -1
  53. streamlit/static/static/js/index.SZrBXA0x.js +1 -0
  54. streamlit/static/static/js/index.fiZSFOKl.js +1 -0
  55. streamlit/static/static/js/{index.-SmXSkUY.js → index.i3_Oogic.js} +1 -1
  56. streamlit/static/static/js/{input.Dbc83Str.js → input.BLlUQSRv.js} +2 -2
  57. streamlit/static/static/js/{memory.BzHgTb9i.js → memory.D5yzKxGm.js} +1 -1
  58. streamlit/static/static/js/{mergeWith.BCa1_PWb.js → mergeWith.BSbf2-C9.js} +1 -1
  59. streamlit/static/static/js/{number-overlay-editor.CtUWknLp.js → number-overlay-editor.DSD8puEB.js} +1 -1
  60. streamlit/static/static/js/{possibleConstructorReturn.DGVrr2j8.js → possibleConstructorReturn.BazPwu8U.js} +1 -1
  61. streamlit/static/static/js/{sandbox.C20zasAf.js → sandbox.EiD3ZISo.js} +1 -1
  62. streamlit/static/static/js/{textarea.BeRVLTOp.js → textarea.Dpen_LA2.js} +2 -2
  63. streamlit/static/static/js/{timepicker.DyU-jgSC.js → timepicker.Bcj6rh3c.js} +1 -1
  64. streamlit/static/static/js/{toConsumableArray.D4FxxWIg.js → toConsumableArray.l-Pgl8gO.js} +1 -1
  65. streamlit/static/static/js/{uniqueId.CAAlIP1-.js → uniqueId.D9pvJLzq.js} +1 -1
  66. streamlit/static/static/js/{useBasicWidgetState.C207Y3_O.js → useBasicWidgetState.BWe8Pksb.js} +1 -1
  67. streamlit/static/static/js/{useOnInputChange.CsqRc0X0.js → useOnInputChange.CcKPFKqO.js} +1 -1
  68. streamlit/static/static/js/{withFullScreenWrapper.DwHjQb3H.js → withFullScreenWrapper.DG7rb1Mv.js} +1 -1
  69. {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/METADATA +1 -1
  70. {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/RECORD +74 -74
  71. streamlit/static/static/js/index.B-4MHYvl.js +0 -1
  72. streamlit/static/static/js/index.BA5ubsQA.js +0 -1
  73. streamlit/static/static/js/index.BNrZwkh1.js +0 -1
  74. streamlit/static/static/js/index.BpmrfDoR.js +0 -2
  75. streamlit/static/static/js/index.CEj-S3PF.js +0 -1
  76. streamlit/static/static/js/index.CFtAnwvU.js +0 -1
  77. streamlit/static/static/js/index.CQ_wmqnz.js +0 -1
  78. streamlit/static/static/js/index.CvADzqCD.js +0 -1
  79. streamlit/static/static/js/index.DPs04g4h.js +0 -1
  80. streamlit/static/static/js/index.DWIf4xZP.js +0 -1
  81. streamlit/static/static/js/index.DfCewjMv.js +0 -1
  82. streamlit/static/static/js/index.DgwklVRJ.js +0 -1
  83. streamlit/static/static/js/index.Yr32ts47.js +0 -1
  84. streamlit/static/static/js/index.i2uLxrqv.js +0 -1
  85. streamlit/static/static/js/index.joQNIDux.js +0 -1
  86. streamlit/static/static/js/index.pzjWTi64.js +0 -1
  87. {streamlit_nightly-1.42.1.dev20250209.data → streamlit_nightly-1.42.1.dev20250211.data}/scripts/streamlit.cmd +0 -0
  88. {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/WHEEL +0 -0
  89. {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/entry_points.txt +0 -0
  90. {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- var xL=Object.defineProperty;var wL=(t,e,r)=>e in t?xL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var U=(t,e,r)=>wL(t,typeof e!="symbol"?e+"":e,r);import{g as oA,r as it,ap as Wt,p as $e,d as VM,aV as yu,_ as jM,j as ms,z as Ll,aW as Gy,F as aE,aX as Wy,aY as lE,aZ as TL,aF as EL,a_ as SL,a$ as CL,n as HM,G as GM,b0 as T1,b1 as cE,aC as PL,y as IL,b2 as ML,b3 as uE}from"./index.9wBA4A4f.js";import{_ as Gn,a as RL,C as BL}from"./toConsumableArray.D4FxxWIg.js";import{b as Fu,a as Lu,_ as l2,c as Gd,d as c2}from"./possibleConstructorReturn.DGVrr2j8.js";import{a as OL,T as DL}from"./Toolbar.D-hUr0RX.js";import{u as WM,E as XM,w as FL}from"./withFullScreenWrapper.DwHjQb3H.js";import{u as LL}from"./useBasicWidgetState.C207Y3_O.js";import{u as kL,s as NL}from"./threshold.B8r8f5kt.js";import{a as UL}from"./axios.upsvKRUO.js";import"./FormClearHelper.BBpErIGP.js";import"./value.iufjd77T.js";function zL(t,e){for(var r=0;r<e.length;r++){const i=e[r];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in t)){const o=Object.getOwnPropertyDescriptor(i,n);o&&Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}async function aA(t,e,r,i){return i._parse(t,e,r,i)}function Ni(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const v_=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),hE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);hE&&parseFloat(hE[1]);const tg=globalThis,Wf=globalThis.process||{},VL=globalThis.navigator||{};function qM(t){var i,n;if(typeof window<"u"&&((i=window.process)==null?void 0:i.type)==="renderer"||typeof process<"u"&&((n=process.versions)!=null&&n.electron))return!0;const r=typeof navigator<"u"&&navigator.userAgent;return!!(r&&r.indexOf("Electron")>=0)}function ku(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||qM()}function jL(t){return ku()?qM()?"Electron":(VL.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const $M="4.0.7";function HL(t){try{const e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}class WL{constructor(e,r,i="sessionStorage"){this.storage=HL(i),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){const r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}}function XL(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function qL(t,e=8){const r=Math.max(e-t.length,0);return`${" ".repeat(r)}${t}`}var mm;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(mm||(mm={}));const $L=10;function fE(t){return typeof t!="string"?t:(t=t.toUpperCase(),mm[t]||mm.WHITE)}function ZL(t,e,r){return!ku&&typeof t=="string"&&(e&&(t=`\x1B[${fE(e)}m${t}\x1B[39m`),r&&(t=`\x1B[${fE(r)+$L}m${t}\x1B[49m`)),t}function KL(t,e=["constructor"]){const r=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(r),n=t;for(const o of i){const s=n[o];typeof s=="function"&&(e.find(f=>o===f)||(n[o]=s.bind(t)))}}function u2(t,e){if(!t)throw new Error("Assertion failed")}function Xf(){var e,r,i;let t;if(ku()&&tg.performance)t=(r=(e=tg==null?void 0:tg.performance)==null?void 0:e.now)==null?void 0:r.call(e);else if("hrtime"in Wf){const n=(i=Wf==null?void 0:Wf.hrtime)==null?void 0:i.call(Wf);t=n[0]*1e3+n[1]/1e6}else t=Date.now();return t}const qf={debug:ku()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},YL={enabled:!0,level:0};function $f(){}const dE={},AE={once:!0};class lA{constructor({id:e}={id:""}){this.VERSION=$M,this._startTs=Xf(),this._deltaTs=Xf(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new WL(`__probe-${this.id}__`,YL),this.timeStamp(`${this.id} started`),KL(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Xf()-this._startTs).toPrecision(10))}getDelta(){return Number((Xf()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){if(!e)throw new Error(r||"Assertion failed")}warn(e){return this._getLogFunction(0,e,qf.warn,arguments,AE)}error(e){return this._getLogFunction(0,e,qf.error,arguments)}deprecated(e,r){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(e,r){return this.error(`\`${e}\` has been removed. Use \`${r}\` instead`)}probe(e,r){return this._getLogFunction(e,r,qf.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,qf.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,qf.debug||qf.info,arguments,AE)}table(e,r,i){return r?this._getLogFunction(e,r,console.table||$f,i&&[i],{tag:QL(r)}):$f}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||$f)}group(e,r,i={collapsed:!1}){const n=pE({logLevel:e,message:r,opts:i}),{collapsed:o}=i;return n.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,r,i={}){return this.group(e,r,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||$f)}withGroup(e,r,i){this.group(e,r)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ZM(e)}_getLogFunction(e,r,i,n,o){if(this._shouldLog(e)){o=pE({logLevel:e,message:r,args:n,opts:o}),i=i||o.method,u2(i),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Xf();const s=o.tag||o.message;if(o.once&&s)if(!dE[s])dE[s]=Xf();else return $f;return r=JL(this.id,o.message,o),i.bind(console,r,...o.args)}return $f}}lA.VERSION=$M;function ZM(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return u2(Number.isFinite(e)&&e>=0),e}function pE(t){const{logLevel:e,message:r}=t;t.logLevel=ZM(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&i.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break}typeof t.message=="function"&&(t.message=t.message());const n=typeof t.message;return u2(n==="string"||n==="object"),Object.assign(t,{args:i},t.opts)}function JL(t,e,r){if(typeof e=="string"){const i=r.time?qL(XL(r.total)):"";e=r.time?`${t}: ${i} ${e}`:`${t}: ${e}`,e=ZL(e,r.color,r.background)}return e}function QL(t){for(const e in t)for(const r in t[e])return r||"untitled";return"empty"}globalThis.probe={};const KM=new lA({id:"@probe.gl/log"});function YM(t,e){return JM(t||{},e)}function JM(t,e,r=0){if(r>3)return e;const i={...t};for(const[n,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?i[n]=JM(i[n]||{},e[n],r+1):i[n]=e[n];return i}function ek(t){var e;globalThis.loaders||(globalThis.loaders={}),(e=globalThis.loaders).modules||(e.modules={}),Object.assign(globalThis.loaders.modules,t)}function tk(t){var r,i;return((i=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:i[t])||null}const rk="latest";function ik(){var t;return(t=globalThis._loadersgl_)!=null&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const QM=ik();function Pc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const Sa=typeof process!="object"||String(process)!=="[object process]"||process.browser,h2=typeof importScripts=="function",nk=typeof window<"u"&&typeof window.orientation<"u",gE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);gE&&parseFloat(gE[1]);class sk{constructor(e,r){U(this,"name");U(this,"workerThread");U(this,"isRunning",!0);U(this,"result");U(this,"_resolve",()=>{});U(this,"_reject",()=>{});this.name=e,this.workerThread=r,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(e,r){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:r})}done(e){Pc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Pc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Xy{terminate(){}}const qy=new Map;function ok(t){Pc(t.source&&!t.url||!t.source&&t.url);let e=qy.get(t.source||t.url);return e||(t.url&&(e=ak(t.url),qy.set(t.url,e)),t.source&&(e=eR(t.source),qy.set(t.source,e))),Pc(e),e}function ak(t){if(!t.startsWith("http"))return t;const e=lk(t);return eR(e)}function eR(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function lk(t){return`try {
1
+ var xL=Object.defineProperty;var wL=(t,e,r)=>e in t?xL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var U=(t,e,r)=>wL(t,typeof e!="symbol"?e+"":e,r);import{g as oA,r as it,ap as Wt,p as $e,d as VM,aU as yu,_ as jM,j as ms,z as Ll,aV as Gy,F as aE,aW as Wy,aX as lE,aY as TL,aF as EL,aZ as SL,a_ as CL,n as HM,G as GM,a$ as T1,b0 as cE,aC as PL,y as IL,b1 as ML,b2 as uE}from"./index.DIuYZOo1.js";import{_ as Gn,a as RL,C as BL}from"./toConsumableArray.l-Pgl8gO.js";import{b as Fu,a as Lu,_ as l2,c as Gd,d as c2}from"./possibleConstructorReturn.BazPwu8U.js";import{a as OL,T as DL}from"./Toolbar.B4UnlLJR.js";import{u as WM,E as XM,w as FL}from"./withFullScreenWrapper.DG7rb1Mv.js";import{u as LL}from"./useBasicWidgetState.BWe8Pksb.js";import{u as kL,s as NL}from"./threshold.B8r8f5kt.js";import{a as UL}from"./axios.upsvKRUO.js";import"./FormClearHelper.0-LU4kzK.js";import"./value.iufjd77T.js";function zL(t,e){for(var r=0;r<e.length;r++){const i=e[r];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in t)){const o=Object.getOwnPropertyDescriptor(i,n);o&&Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}async function aA(t,e,r,i){return i._parse(t,e,r,i)}function Ni(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const v_=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),hE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);hE&&parseFloat(hE[1]);const tg=globalThis,Wf=globalThis.process||{},VL=globalThis.navigator||{};function qM(t){var i,n;if(typeof window<"u"&&((i=window.process)==null?void 0:i.type)==="renderer"||typeof process<"u"&&((n=process.versions)!=null&&n.electron))return!0;const r=typeof navigator<"u"&&navigator.userAgent;return!!(r&&r.indexOf("Electron")>=0)}function ku(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||qM()}function jL(t){return ku()?qM()?"Electron":(VL.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const $M="4.0.7";function HL(t){try{const e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}class WL{constructor(e,r,i="sessionStorage"){this.storage=HL(i),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){const r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}}function XL(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function qL(t,e=8){const r=Math.max(e-t.length,0);return`${" ".repeat(r)}${t}`}var mm;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(mm||(mm={}));const $L=10;function fE(t){return typeof t!="string"?t:(t=t.toUpperCase(),mm[t]||mm.WHITE)}function ZL(t,e,r){return!ku&&typeof t=="string"&&(e&&(t=`\x1B[${fE(e)}m${t}\x1B[39m`),r&&(t=`\x1B[${fE(r)+$L}m${t}\x1B[49m`)),t}function KL(t,e=["constructor"]){const r=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(r),n=t;for(const o of i){const s=n[o];typeof s=="function"&&(e.find(f=>o===f)||(n[o]=s.bind(t)))}}function u2(t,e){if(!t)throw new Error("Assertion failed")}function Xf(){var e,r,i;let t;if(ku()&&tg.performance)t=(r=(e=tg==null?void 0:tg.performance)==null?void 0:e.now)==null?void 0:r.call(e);else if("hrtime"in Wf){const n=(i=Wf==null?void 0:Wf.hrtime)==null?void 0:i.call(Wf);t=n[0]*1e3+n[1]/1e6}else t=Date.now();return t}const qf={debug:ku()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},YL={enabled:!0,level:0};function $f(){}const dE={},AE={once:!0};class lA{constructor({id:e}={id:""}){this.VERSION=$M,this._startTs=Xf(),this._deltaTs=Xf(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new WL(`__probe-${this.id}__`,YL),this.timeStamp(`${this.id} started`),KL(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Xf()-this._startTs).toPrecision(10))}getDelta(){return Number((Xf()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){if(!e)throw new Error(r||"Assertion failed")}warn(e){return this._getLogFunction(0,e,qf.warn,arguments,AE)}error(e){return this._getLogFunction(0,e,qf.error,arguments)}deprecated(e,r){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(e,r){return this.error(`\`${e}\` has been removed. Use \`${r}\` instead`)}probe(e,r){return this._getLogFunction(e,r,qf.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,qf.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,qf.debug||qf.info,arguments,AE)}table(e,r,i){return r?this._getLogFunction(e,r,console.table||$f,i&&[i],{tag:QL(r)}):$f}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||$f)}group(e,r,i={collapsed:!1}){const n=pE({logLevel:e,message:r,opts:i}),{collapsed:o}=i;return n.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,r,i={}){return this.group(e,r,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||$f)}withGroup(e,r,i){this.group(e,r)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ZM(e)}_getLogFunction(e,r,i,n,o){if(this._shouldLog(e)){o=pE({logLevel:e,message:r,args:n,opts:o}),i=i||o.method,u2(i),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Xf();const s=o.tag||o.message;if(o.once&&s)if(!dE[s])dE[s]=Xf();else return $f;return r=JL(this.id,o.message,o),i.bind(console,r,...o.args)}return $f}}lA.VERSION=$M;function ZM(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return u2(Number.isFinite(e)&&e>=0),e}function pE(t){const{logLevel:e,message:r}=t;t.logLevel=ZM(e);const i=t.args?Array.from(t.args):[];for(;i.length&&i.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&i.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break}typeof t.message=="function"&&(t.message=t.message());const n=typeof t.message;return u2(n==="string"||n==="object"),Object.assign(t,{args:i},t.opts)}function JL(t,e,r){if(typeof e=="string"){const i=r.time?qL(XL(r.total)):"";e=r.time?`${t}: ${i} ${e}`:`${t}: ${e}`,e=ZL(e,r.color,r.background)}return e}function QL(t){for(const e in t)for(const r in t[e])return r||"untitled";return"empty"}globalThis.probe={};const KM=new lA({id:"@probe.gl/log"});function YM(t,e){return JM(t||{},e)}function JM(t,e,r=0){if(r>3)return e;const i={...t};for(const[n,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?i[n]=JM(i[n]||{},e[n],r+1):i[n]=e[n];return i}function ek(t){var e;globalThis.loaders||(globalThis.loaders={}),(e=globalThis.loaders).modules||(e.modules={}),Object.assign(globalThis.loaders.modules,t)}function tk(t){var r,i;return((i=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:i[t])||null}const rk="latest";function ik(){var t;return(t=globalThis._loadersgl_)!=null&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const QM=ik();function Pc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const Sa=typeof process!="object"||String(process)!=="[object process]"||process.browser,h2=typeof importScripts=="function",nk=typeof window<"u"&&typeof window.orientation<"u",gE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);gE&&parseFloat(gE[1]);class sk{constructor(e,r){U(this,"name");U(this,"workerThread");U(this,"isRunning",!0);U(this,"result");U(this,"_resolve",()=>{});U(this,"_reject",()=>{});this.name=e,this.workerThread=r,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(e,r){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:r})}done(e){Pc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Pc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Xy{terminate(){}}const qy=new Map;function ok(t){Pc(t.source&&!t.url||!t.source&&t.url);let e=qy.get(t.source||t.url);return e||(t.url&&(e=ak(t.url),qy.set(t.url,e)),t.source&&(e=eR(t.source),qy.set(t.source,e))),Pc(e),e}function ak(t){if(!t.startsWith("http"))return t;const e=lk(t);return eR(e)}function eR(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function lk(t){return`try {
2
2
  importScripts('${t}');
3
3
  } catch (error) {
4
4
  console.error(error);
@@ -3839,4 +3839,4 @@ fragColor = outTexture;
3839
3839
  fragColor.g = outTexture.r / max(1.0, outTexture.a);
3840
3840
  }
3841
3841
  `,Gde=2,v1={format:"rgba8unorm",mipmaps:!1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},RM=[0,0],Wde={SUM:0,MEAN:1},Xde={getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:gA,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},qde=["float32-renderable-webgl","texture-blend-float-webgl"],$de={data:{props:["radiusPixels"]}};class kw extends mA{initializeState(){super.initializeAggregationLayer($de),this.setState({colorDomain:RM}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState(e){super.updateState(e),this._updateHeatmapState(e)}_updateHeatmapState(e){const{props:r,oldProps:i}=e,n=this._getChangeFlags(e);(n.dataChanged||n.viewportChanged)&&(n.boundsChanged=this._updateBounds(n.dataChanged),this._updateTextureRenderingBounds()),n.dataChanged||n.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):n.viewportZoomChanged&&this._debouncedUpdateWeightmap(),r.colorRange!==i.colorRange&&this._updateColorTexture(e),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:e.context.viewport.zoom})}renderLayers(){const{weightsTexture:e,triPositionBuffer:r,triTexCoordBuffer:i,maxWeightsTexture:n,colorTexture:o,colorDomain:s}=this.state,{updateTriggers:f,intensity:A,threshold:v,aggregation:w}=this.props,C=this.getSubLayerClass("triangle",UF);return new C(this.getSubLayerProps({id:"triangle-layer",updateTriggers:f}),{coordinateSystem:br.DEFAULT,data:{attributes:{positions:r,texCoords:i}},vertexCount:4,maxTexture:n,colorTexture:o,aggregationMode:Wde[w]||0,weightsTexture:e,intensity:A,threshold:v,colorDomain:s})}finalizeState(e){super.finalizeState(e);const{weightsTransform:r,weightsTexture:i,maxWeightTransform:n,maxWeightsTexture:o,triPositionBuffer:s,triTexCoordBuffer:f,colorTexture:A,updateTimer:v}=this.state;r==null||r.destroy(),i==null||i.destroy(),n==null||n.destroy(),o==null||o.destroy(),s==null||s.destroy(),f==null||f.destroy(),A==null||A.destroy(),v&&clearTimeout(v)}_getAttributeManager(){return new X2(this.context.device,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(e){const r={},{dimensions:i}=this.state;r.dataChanged=this.isAttributeChanged()&&"attribute changed"||this.isAggregationDirty(e,{compareAll:!0,dimension:i.data})&&"aggregation is dirty",r.viewportChanged=e.changeFlags.viewportChanged;const{zoom:n}=this.state;return(!e.context.viewport||e.context.viewport.zoom!==n)&&(r.viewportZoomChanged=!0),r}_createTextures(){const{textureSize:e,format:r}=this.state;this.setState({weightsTexture:this.context.device.createTexture({...v1,width:e,height:e,format:r}),maxWeightsTexture:this.context.device.createTexture({...v1,width:1,height:1,format:r})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:"float64",accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){const{device:e}=this.context,{weightsTextureSize:r}=this.props,i=Math.min(r,e.limits.maxTextureDimension2D),n=qde.every(f=>e.features.has(f)),o=n?"rgba32float":"rgba8unorm",s=n?1:1/255;this.setState({textureSize:i,format:o,weightsScale:s}),n||fr.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)()}_createWeightsTransform(e){let{weightsTransform:r}=this.state;const{weightsTexture:i}=this.state,n=this.getAttributeManager();r==null||r.destroy(),r=new eb(this.context.device,{id:`${this.id}-weights-transform`,bufferLayout:n.getBufferLayouts(),vertexCount:1,targetTexture:i,parameters:{depthWriteEnabled:!1,blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"},topology:"point-list",...e}),this.setState({weightsTransform:r})}_setupResources(){this._createTextures();const{device:e}=this.context,{textureSize:r,weightsTexture:i,maxWeightsTexture:n}=this.state,o=this.getShaders({vs:IM,fs:MM});this._createWeightsTransform(o);const s=this.getShaders({vs:jde,fs:Hde}),f=new eb(e,{id:`${this.id}-max-weights-transform`,bindings:{inTexture:i},uniforms:{textureSize:r},targetTexture:n,...s,vertexCount:r*r,topology:"point-list",parameters:{depthWriteEnabled:!1,blendColorOperation:"max",blendAlphaOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}});this.setState({weightsTexture:i,maxWeightsTexture:n,maxWeightTransform:f,zoom:null,triPositionBuffer:e.createBuffer({byteLength:48}),triTexCoordBuffer:e.createBuffer({byteLength:48})})}updateShaders(e){this._createWeightsTransform({vs:IM,fs:MM,...e})}_updateMaxWeightValue(){const{maxWeightTransform:e}=this.state;e.run({parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]})}_updateBounds(e=!1){const{viewport:r}=this.context,i=[r.unproject([0,0]),r.unproject([r.width,0]),r.unproject([r.width,r.height]),r.unproject([0,r.height])].map(f=>f.map(Math.fround)),n=Lde(i),o={visibleWorldBounds:n,viewportCorners:i};let s=!1;if(e||!this.state.worldBounds||!kde(this.state.worldBounds,n)){const f=this._worldToCommonBounds(n),A=this._commonToWorldBounds(f);this.props.coordinateSystem===br.LNGLAT&&(A[1]=Math.max(A[1],-85.051129),A[3]=Math.min(A[3],85.051129),A[0]=Math.max(A[0],-360),A[2]=Math.min(A[2],360));const v=this._worldToCommonBounds(A);o.worldBounds=A,o.normalizedCommonBounds=v,s=!0}return this.setState(o),s}_updateTextureRenderingBounds(){const{triPositionBuffer:e,triTexCoordBuffer:r,normalizedCommonBounds:i,viewportCorners:n}=this.state,{viewport:o}=this.context;e.write(PM(n,3));const s=n.map(f=>Ude(o.projectPosition(f),i));r.write(PM(s,2))}_updateColorTexture(e){const{colorRange:r}=e.props;let{colorTexture:i}=this.state;const n=ly(r,!1,Uint8Array);i&&(i==null?void 0:i.width)===r.length?i.setSubImageData({data:n}):(i==null||i.destroy(),i=this.context.device.createTexture({...v1,data:n,width:r.length,height:1})),this.setState({colorTexture:i})}_updateWeightmap(){const{radiusPixels:e,colorDomain:r,aggregation:i}=this.props,{worldBounds:n,textureSize:o,weightsScale:s}=this.state,f=this.state.weightsTransform;this.state.isWeightMapDirty=!1;const A=this._worldToCommonBounds(n,{useLayerCoordinateSystem:!0});if(r&&i==="SUM"){const{viewport:B}=this.context,F=B.distanceScales.metersPerUnit[2]*(A[2]-A[0])/o;this.state.colorDomain=r.map(k=>k*F*s)}else this.state.colorDomain=r||RM;const w=this.getAttributeManager().getAttributes(),C=this.getModuleSettings(),I={radiusPixels:e,commonBounds:A,textureWidth:o,weightsScale:s};this._setModelAttributes(f.model,w),f.model.setVertexCount(this.getNumInstances()),f.model.setUniforms(I),f.model.updateModuleSettings(C),f.run({parameters:{viewport:[0,0,o,o]},clearColor:[0,0,0,0]}),this._updateMaxWeightValue()}_debouncedUpdateWeightmap(e=!1){let{updateTimer:r}=this.state;const{debounceTimeout:i}=this.props;e?(r=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(r),r=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),i)),this.setState({updateTimer:r})}_worldToCommonBounds(e,r={}){const{useLayerCoordinateSystem:i=!1}=r,[n,o,s,f]=e,{viewport:A}=this.context,{textureSize:v}=this.state,{coordinateSystem:w}=this.props,C=i&&(w===br.LNGLAT_OFFSETS||w===br.METER_OFFSETS),I=C?A.projectPosition(this.props.coordinateOrigin):[0,0],B=v*Gde/A.scale;let F,k;return i&&!C?(F=this.projectPosition([n,o,0]),k=this.projectPosition([s,f,0])):(F=A.projectPosition([n,o,0]),k=A.projectPosition([s,f,0])),Nde([F[0]-I[0],F[1]-I[1],k[0]-I[0],k[1]-I[1]],B,B)}_commonToWorldBounds(e){const[r,i,n,o]=e,{viewport:s}=this.context,f=s.unprojectPosition([r,i]),A=s.unprojectPosition([n,o]);return f.slice(0,2).concat(A.slice(0,2))}}kw.layerName="HeatmapLayer";kw.defaultProps=Xde;const Zde=Object.freeze(Object.defineProperty({__proto__:null,AGGREGATION_OPERATION:Pn,CPUGridLayer:v0,ContourLayer:Dw,GPUGridLayer:b0,GridLayer:Lw,HeatmapLayer:kw,HexagonLayer:Ow,ScreenGridLayer:Rw,_AggregationLayer:mA,_BinSorter:Iw,_CPUAggregator:Bw,_GPUGridAggregator:Hl},Symbol.toStringTag,{value:"Module"})),Kde={ClusterTileLayer:Aw,H3TileLayer:gw,HeatmapTileLayer:_w,_PointLabelLayer:yw,QuadbinTileLayer:ay,RasterTileLayer:bw,VectorTileLayer:ww};function n2(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function Yde(t,e){const r=Qde(e);let i=t;for(const n of r)i=Jde(i)?i[n]:void 0;return i}function Jde(t){return t!==null&&typeof t=="object"}const BM={};function Qde(t){if(typeof t=="string"){let e=BM[t];return e||(e=t.split("."),BM[t]=e),e}return Array.isArray(t)?t:[t]}var s2={exports:{}};(function(t,e){(function(r){var i="Compound",n="Identifier",o="MemberExpression",s="Literal",f="ThisExpression",A="CallExpression",v="UnaryExpression",w="BinaryExpression",C="LogicalExpression",I="ConditionalExpression",B="ArrayExpression",F=46,k=44,V=39,G=34,Y=40,Z=41,se=91,ge=93,Ee=63,Ve=59,Fe=58,pe=function(Rt,ut){var Vi=new Error(Rt+" at character "+ut);throw Vi.index=ut,Vi.description=Rt,Vi},Te=!0,Ae={"-":Te,"!":Te,"~":Te,"+":Te},Le={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},ze=function(Rt){var ut=0,Vi;for(var Sr in Rt)(Vi=Sr.length)>ut&&Rt.hasOwnProperty(Sr)&&(ut=Vi);return ut},Xe=ze(Ae),dt=ze(Le),Nt={true:!0,false:!1,null:null},gr="this",mr=function(Rt){return Le[Rt]||0},_r=function(Rt,ut,Vi){var Sr=Rt==="||"||Rt==="&&"?C:w;return{type:Sr,operator:Rt,left:ut,right:Vi}},rr=function(Rt){return Rt>=48&&Rt<=57},Ot=function(Rt){return Rt===36||Rt===95||Rt>=65&&Rt<=90||Rt>=97&&Rt<=122||Rt>=128&&!Le[String.fromCharCode(Rt)]},Qt=function(Rt){return Rt===36||Rt===95||Rt>=65&&Rt<=90||Rt>=97&&Rt<=122||Rt>=48&&Rt<=57||Rt>=128&&!Le[String.fromCharCode(Rt)]},qt=function(Rt){for(var ut=0,Vi=Rt.charAt,Sr=Rt.charCodeAt,Ur=function(vt){return Vi.call(Rt,vt)},Dt=function(vt){return Sr.call(Rt,vt)},$r=Rt.length,Pi=function(){for(var vt=Dt(ut);vt===32||vt===9||vt===10||vt===13;)vt=Dt(++ut)},yi=function(){var vt=gn(),Yt,Mr;if(Pi(),Dt(ut)===Ee){if(ut++,Yt=yi(),Yt||pe("Expected expression",ut),Pi(),Dt(ut)===Fe)return ut++,Mr=yi(),Mr||pe("Expected expression",ut),{type:I,test:vt,consequent:Yt,alternate:Mr};pe("Expected :",ut)}else return vt},dr=function(){Pi();for(var vt=Rt.substr(ut,dt),Yt=vt.length;Yt>0;){if(Le.hasOwnProperty(vt)&&(!Ot(Dt(ut))||ut+vt.length<Rt.length&&!Qt(Dt(ut+vt.length))))return ut+=Yt,vt;vt=vt.substr(0,--Yt)}return!1},gn=function(){var vt,Yt,Mr,qr,kn,Di,mn,Xn,ho;if(Di=oi(),Yt=dr(),!Yt)return Di;for(kn={value:Yt,prec:mr(Yt)},mn=oi(),mn||pe("Expected expression after "+Yt,ut),qr=[Di,kn,mn];(Yt=dr())&&(Mr=mr(Yt),Mr!==0);){for(kn={value:Yt,prec:Mr},ho=Yt;qr.length>2&&Mr<=qr[qr.length-2].prec;)mn=qr.pop(),Yt=qr.pop().value,Di=qr.pop(),vt=_r(Yt,Di,mn),qr.push(vt);vt=oi(),vt||pe("Expected expression after "+ho,ut),qr.push(kn,vt)}for(Xn=qr.length-1,vt=qr[Xn];Xn>1;)vt=_r(qr[Xn-1].value,qr[Xn-2],vt),Xn-=2;return vt},oi=function(){var vt,Yt,Mr;if(Pi(),vt=Dt(ut),rr(vt)||vt===F)return xi();if(vt===V||vt===G)return an();if(vt===se)return Is();for(Yt=Rt.substr(ut,Xe),Mr=Yt.length;Mr>0;){if(Ae.hasOwnProperty(Yt)&&(!Ot(Dt(ut))||ut+Yt.length<Rt.length&&!Qt(Dt(ut+Yt.length))))return ut+=Mr,{type:v,operator:Yt,argument:oi(),prefix:!0};Yt=Yt.substr(0,--Mr)}return Ot(vt)||vt===Y?ln():!1},xi=function(){for(var vt="",Yt,Mr;rr(Dt(ut));)vt+=Ur(ut++);if(Dt(ut)===F)for(vt+=Ur(ut++);rr(Dt(ut));)vt+=Ur(ut++);if(Yt=Ur(ut),Yt==="e"||Yt==="E"){for(vt+=Ur(ut++),Yt=Ur(ut),(Yt==="+"||Yt==="-")&&(vt+=Ur(ut++));rr(Dt(ut));)vt+=Ur(ut++);rr(Dt(ut-1))||pe("Expected exponent ("+vt+Ur(ut)+")",ut)}return Mr=Dt(ut),Ot(Mr)?pe("Variable names cannot start with a number ("+vt+Ur(ut)+")",ut):Mr===F&&pe("Unexpected period",ut),{type:s,value:parseFloat(vt),raw:vt}},an=function(){for(var vt="",Yt=Ur(ut++),Mr=!1,qr;ut<$r;)if(qr=Ur(ut++),qr===Yt){Mr=!0;break}else if(qr==="\\")switch(qr=Ur(ut++),qr){case"n":vt+=`
3842
- `;break;case"r":vt+="\r";break;case"t":vt+=" ";break;case"b":vt+="\b";break;case"f":vt+="\f";break;case"v":vt+="\v";break;default:vt+=qr}else vt+=qr;return Mr||pe('Unclosed quote after "'+vt+'"',ut),{type:s,value:vt,raw:Yt+vt+Yt}},$i=function(){var vt=Dt(ut),Yt=ut,Mr;for(Ot(vt)?ut++:pe("Unexpected "+Ur(ut),ut);ut<$r&&(vt=Dt(ut),Qt(vt));)ut++;return Mr=Rt.slice(Yt,ut),Nt.hasOwnProperty(Mr)?{type:s,value:Nt[Mr],raw:Mr}:Mr===gr?{type:f}:{type:n,name:Mr}},Zs=function(vt){for(var Yt,Mr=[],qr,kn=!1,Di=0;ut<$r;)if(Pi(),Yt=Dt(ut),Yt===vt){kn=!0,ut++,vt===Z&&Di&&Di>=Mr.length&&pe("Unexpected token "+String.fromCharCode(vt),ut);break}else if(Yt===k){if(ut++,Di++,Di!==Mr.length){if(vt===Z)pe("Unexpected token ,",ut);else if(vt===ge)for(var mn=Mr.length;mn<Di;mn++)Mr.push(null)}}else qr=yi(),(!qr||qr.type===i)&&pe("Expected comma",ut),Mr.push(qr);return kn||pe("Expected "+String.fromCharCode(vt),ut),Mr},ln=function(){var vt,Yt;for(vt=Dt(ut),vt===Y?Yt=ni():Yt=$i(),Pi(),vt=Dt(ut);vt===F||vt===se||vt===Y;)ut++,vt===F?(Pi(),Yt={type:o,computed:!1,object:Yt,property:$i()}):vt===se?(Yt={type:o,computed:!0,object:Yt,property:yi()},Pi(),vt=Dt(ut),vt!==ge&&pe("Unclosed [",ut),ut++):vt===Y&&(Yt={type:A,arguments:Zs(Z),callee:Yt}),Pi(),vt=Dt(ut);return Yt},ni=function(){ut++;var vt=yi();if(Pi(),Dt(ut)===Z)return ut++,vt;pe("Unclosed (",ut)},Is=function(){return ut++,{type:B,elements:Zs(ge)}},nn=[],Oi,is;ut<$r;)Oi=Dt(ut),Oi===Ve||Oi===k?ut++:(is=yi())?nn.push(is):ut<$r&&pe('Unexpected "'+Ur(ut)+'"',ut);return nn.length===1?nn[0]:{type:i,body:nn}};qt.version="0.3.5",qt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+qt.version},qt.addUnaryOp=function(Rt){return Xe=Math.max(Rt.length,Xe),Ae[Rt]=Te,this},qt.addBinaryOp=function(Rt,ut){return dt=Math.max(Rt.length,dt),Le[Rt]=ut,this},qt.addLiteral=function(Rt,ut){return Nt[Rt]=ut,this},qt.removeUnaryOp=function(Rt){return delete Ae[Rt],Rt.length===Xe&&(Xe=ze(Ae)),this},qt.removeAllUnaryOps=function(){return Ae={},Xe=0,this},qt.removeBinaryOp=function(Rt){return delete Le[Rt],Rt.length===dt&&(dt=ze(Le)),this},qt.removeAllBinaryOps=function(){return Le={},dt=0,this},qt.removeLiteral=function(Rt){return delete Nt[Rt],this},qt.removeAllLiterals=function(){return Nt={},this},t.exports?e=t.exports=qt:e.parse=qt})()})(s2,s2.exports);var eAe=s2.exports;const tAe=oA(eAe),OM={"||":(t,e)=>t||e,"&&":(t,e)=>t&&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e},rAe={"-":t=>-t,"+":t=>+t,"~":t=>~t,"!":t=>!t};function DM(t,e){return t.map(function(r){return Ss(r,e)})}function FM(t,e){const r=Ss(t.object,e);let i;if(t.computed?i=Ss(t.property,e):i=t.property.name,/^__proto__|prototype|constructor$/.test(i))throw Error(`Access to member "${i}" disallowed.`);return[r,r[i]]}function Ss(t,e){const r=t;switch(r.type){case"ArrayExpression":return DM(r.elements,e);case"BinaryExpression":return OM[r.operator](Ss(r.left,e),Ss(r.right,e));case"CallExpression":let i,n,o;return r.callee.type==="MemberExpression"?(o=FM(r.callee,e),i=o[0],n=o[1]):n=Ss(r.callee,e),typeof n!="function"?void 0:n.apply(i,DM(r.arguments,e));case"ConditionalExpression":return Ss(r.test,e)?Ss(r.consequent,e):Ss(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?Ss(r.left,e)||Ss(r.right,e):r.operator==="&&"?Ss(r.left,e)&&Ss(r.right,e):OM[r.operator](Ss(r.left,e),Ss(r.right,e));case"MemberExpression":return FM(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return rAe[r.operator](Ss(r.argument,e));default:return}}const b1={"-":t=>t};function zF(t,e){if(t in b1)return b1[t];let r;const i=tAe(t);return i.type==="Identifier"?r=n=>Yde(n,t):(o2(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=n=>Ss(i,n)),b1[t]=r,r}function o2(t,e){if(Array.isArray(t))t.forEach(r=>o2(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(const r in t)o2(t[r],e)}}const n_="@@=",LM="@@#",iAe="@@type",VF="@@function",kM=t=>t&&typeof t=="object";class a2{constructor(...e){this.typeKey=iAe,this.functionKey=VF,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=zF,this.preProcessClassProps=(r,i)=>i,this.postProcessConvertedJson=r=>r;for(const r of e)this.merge(r)}merge(e){for(const r in e)switch(r){case"layers":case"views":Object.assign(this.classes,e[r]);break;default:if(r in this){const i=e[r];this[r]=kM(this[r])?Object.assign(this[r],i):i}}}validate(e){return n2(!this.typeKey||typeof this.typeKey=="string"),n2(kM(this.classes)),!0}}function nAe(t){return typeof t=="string"&&t.startsWith(n_)}function sAe(t){return t.replace(n_,"")}function jF(t,e){const r={};for(const i in t){let n=t[i];nAe(n)&&(n=sAe(n),n=zF(n)),r[i]=n}return r}function oAe(t,e,r){const i=r.classes[t],n=r.reactComponents[t];if(!i&&!n){const{log:o}=r;if(o){const s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${t}(${s}...) `)}return null}return i?aAe(i,e,r):lAe(n,e,r)}function aAe(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=jF(e),new t(e)}function lAe(t,e,r){const{React:i}=r,{children:n=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=jF(e),i.createElement(t,e,n)}function cAe(t,e,r){const i=r.functions[t];if(!i){const{log:n}=r;if(n){const o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return i(e)}function uAe(t){return typeof t=="string"?JSON.parse(t):t}const Nw=t=>t&&typeof t=="object";class hAe{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof a2?e.configuration:new a2(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;const r=uAe(e);let i=fAe(r,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}}function fAe(t,e){return e=new a2(e),Uw(t,"",e)}function Uw(t,e,r){return Array.isArray(t)?t.map((i,n)=>Uw(i,String(n),r)):dAe(t,r)?AAe(t,r):Nw(t)?VF in t?pAe(t,r):zw(t,r):typeof t=="string"?gAe(t,e,r):t}function dAe(t,e){const{typeKey:r}=e;return Nw(t)&&!!t[r]}function AAe(t,e){const{typeKey:r}=e,i=t[r];let n={...t};return delete n[r],n=zw(n,e),oAe(i,n,e)}function pAe(t,e){const{functionKey:r}=e,i=t[r];let n={...t};return delete n[r],n=zw(n,e),cAe(i,n,e)}function zw(t,e){n2(Nw(t));const r={};for(const i in t){const n=t[i];r[i]=Uw(n,i,e)}return r}function gAe(t,e,r){if(t.startsWith(n_)&&r.convertFunction)return t=t.replace(n_,""),r.convertFunction(t,r);if(t.startsWith(LM)){if(t=t.replace(LM,""),r.constants[t])return r.constants[t];const[i,n]=t.split(".");return r.enumerations[i][n]}return t}const mAe={classes:{...ste,...Zde,...Vce,...Mse,...Kde},functions:{colorBins:ife,colorCategories:nfe,colorContinuous:sfe}},HF=new hAe({configuration:mAe}),_Ae={[iy.layerName]:["getFillColor"],[J_.layerName]:["getFillColor"],[$l.layerName]:["getFillColor"],[AA.layerName]:["getFillColor"],[X_.layerName]:["getFillColor"],[W_.layerName]:["getFillColor"],[Z_.layerName]:["getColor"],[c0.layerName]:["getTargetColor","getSourceColor"],[Lc.layerName]:["getFillColor"],[kc.layerName]:["getFillColor"],[dA.layerName]:["getColor"],[u0.layerName]:["getColor"],[$h.layerName]:["getColor"],[h0.layerName]:["getColor"],[Vu.layerName]:["getFillColor"],[f0.layerName]:["getFillColor","getColor","getLineColor"],[zu.layerName]:["getFillColor"],[Zh.layerName]:["getColor"],[g0.layerName]:["getColor"],[zh.layerName]:["getColor"]},yAe=({object:t,objectInfo:e,originalFillFunction:r})=>{const i=typeof r=="function"?r(t,e):r;if(Array.isArray(i))return[i[0]||0,i[1]||0,i[2]||0,i[3]||255];if(typeof i=="string"&&i.startsWith("@@=")){const n=HF.convert({originalColor:i}).originalColor(t);return[n[0]||0,n[1]||0,n[2]||0,n[3]||255]}return null},NM=({isSelected:t,object:e,objectInfo:r,opacity:i,originalFillFunction:n})=>{const o=yAe({object:e,objectInfo:r,originalFillFunction:n});if(!o)return null;let s=0;return t?s=Math.max(typeof o[3]=="number"?o[3]:i,i):s=Math.min(typeof o[3]=="number"?o[3]:i,i),[o[0]||0,o[1]||0,o[2]||0,s]},vAe=({isSelected:t,object:e,objectInfo:r,originalFillFunction:i,selectedColor:n,selectedOpacity:o=255,unselectedColor:s,unselectedOpacity:f=Math.floor(255*.4)})=>t?NM({opacity:o,isSelected:!0,object:e,objectInfo:r,originalFillFunction:i})||n:NM({opacity:f,isSelected:!1,object:e,objectInfo:r,originalFillFunction:i})||s,r0={selection:{indices:{},objects:{}}},UM=(t,e)=>{const r=e.match(/{(.*?)}/g);return r&&r.forEach(i=>{const n=i.substring(1,i.length-1);t.object.hasOwnProperty(n)?e=e.replace(i,t.object[n]):t.object.hasOwnProperty("properties")&&t.object.properties.hasOwnProperty(n)&&(e=e.replace(i,t.object.properties[n]))}),e};function bAe(t,e){return e.id?t.getElementState(e.id,"selection")??r0:r0}function xAe(t,e){if(!e.id)return r0;const r=t.getStringValue(e);return(r?T1.parse(r):null)??r0}function wAe(t,e,r,i){t.id&&e.setStringValue(t,JSON.stringify(r.value),{fromUi:r.fromUi},i)}const TAe=t=>{var Le;const{height:e,width:r,expanded:i}=WM(XM),{element:n,fragmentId:o,isLightTheme:s,theme:f,widgetMgr:A}=t,{selectionMode:v,tooltip:w,useContainerWidth:C}=n,I=i??!1,[B,F]=LL({element:n,getDefaultState:bAe,getStateFromWidgetMgr:xAe,updateWidgetMgrState:wAe,widgetMgr:A,fragmentId:o}),[k,V]=it.useState({bearing:0,pitch:0,zoom:11}),{height:G,width:Y}=MJ({element:n,isFullScreen:I,shouldUseContainerWidth:C,container:{height:e,width:r},heightFallback:((Le=k.initialViewState)==null?void 0:Le.height)||f.sizes.defaultMapHeight}),[Z,se]=it.useState({}),ge=v[0],Ee=ge!==void 0,Ve=Ee&&Object.keys(B.selection.indices).length>0,Fe=it.useMemo(()=>Object.freeze(T1.parse(n.json)),[I,s,n.json]),pe=it.useMemo(()=>{const ze={...Fe};if(ze.mapStyle||(ze.mapStyle=`mapbox://styles/mapbox/${s?"light":"dark"}-v9`),ze.layers){const Xe=Object.values(B.selection.indices).some(Nt=>Nt==null?void 0:Nt.length),dt=ze.layers.some(Nt=>Object.hasOwn(Nt,"pickable"));ze.layers=ze.layers.map(Nt=>{var Ot,Qt;if(!Nt||Array.isArray(Nt)||!Ee)return Nt;dt||(Nt.pickable=!0);const gr=`${Nt.id||null}`,mr=((Qt=(Ot=B==null?void 0:B.selection)==null?void 0:Ot.indices)==null?void 0:Qt[gr])||[],_r=_Ae[Nt["@@type"]];if(!_r)return Nt;const rr={...Nt};return _r.forEach(qt=>{var dr;rr.updateTriggers={[qt]:[...((dr=rr.updateTriggers)==null?void 0:dr[qt])||[],mr,Xe]};const Rt=!Xe,ut=Nt[qt];if(Rt||!ut)return rr;const Vi=255,Sr=Math.floor(255*.4),Ur=cE(f.colors.primary),Dt=[Ur[0],Ur[1],Ur[2],Vi],$r=cE(f.colors.gray20),Pi=[$r[0],$r[1],$r[2],Sr],yi=(gn,oi)=>vAe({isSelected:mr.includes(oi.index),object:gn,objectInfo:oi,originalFillFunction:ut,selectedColor:Dt,unselectedColor:Pi,selectedOpacity:Vi,unselectedOpacity:Sr});rr[qt]=yi}),rr})}return ze==null||delete ze.views,HF.convert(ze)},[B.selection.indices,s,Ee,Fe,f.colors.gray20,f.colors.primary]);it.useEffect(()=>{if(!PL(pe.initialViewState,Z)){const ze=Object.keys(pe.initialViewState).reduce((Xe,dt)=>pe.initialViewState[dt]===Z[dt]?Xe:{...Xe,[dt]:pe.initialViewState[dt]},{});V({...k,...ze}),se(pe.initialViewState)}},[pe.initialViewState,Z,k]);const Te=it.useCallback(ze=>{if(!ze||!ze.object||!w)return null;const Xe=T1.parse(w);return Xe.html?Xe.html=UM(ze,Xe.html):Xe.text=UM(ze,Xe.text),Xe},[w]),Ae=it.useCallback(({viewState:ze})=>{V(ze)},[V]);return{createTooltip:Te,data:B,deck:pe,hasActiveSelection:Ve,height:G,isSelectionModeActivated:Ee,onViewStateChange:Ae,selectionMode:ge,setSelection:F,viewState:k,width:Y}};s0([hx,tA]);const x1=r0.selection,EAe=[],SAe=t=>{const{disabled:e,disableFullscreenMode:r,element:i,fragmentId:n,mapboxToken:o,widgetMgr:s}=t,{mapboxToken:f}=i,A=IL(),{expanded:v,expand:w,collapse:C}=WM(XM),{createTooltip:I,data:B,deck:F,hasActiveSelection:k,height:V,isSelectionModeActivated:G,onViewStateChange:Y,selectionMode:Z,setSelection:se,viewState:ge,width:Ee}=TAe({element:i,fragmentId:n,isLightTheme:GM(A),theme:A,widgetMgr:s}),[Ve,Fe]=it.useState(!1);it.useEffect(()=>{Fe(!0)},[]);const pe=it.useCallback(Ae=>{var _r;if(Z===void 0)return;const{index:Le,object:ze}=Ae,Xe=`${((_r=Ae.layer)==null?void 0:_r.id)||null}`,dt=B,Nt=Le===-1,mr=(()=>{var rr;if(Nt)return x1;switch(Z){case uE.SelectionMode.SINGLE_OBJECT:return((rr=dt.selection.indices[Xe])==null?void 0:rr[0])===Le?x1:{indices:{[`${Xe}`]:[Le]},objects:{[`${Xe}`]:[ze]}};case uE.SelectionMode.MULTI_OBJECT:{const Ot=new Map((()=>{var qt,Rt;return(((Rt=(qt=dt==null?void 0:dt.selection)==null?void 0:qt.indices)==null?void 0:Rt[Xe])||[]).map((ut,Vi)=>{var Sr,Ur,Dt;return[ut,(Dt=(Ur=(Sr=dt.selection)==null?void 0:Sr.objects)==null?void 0:Ur[Xe])==null?void 0:Dt[Vi]]})})());if(Ot.has(Le)?Ot.delete(Le):Ot.set(Le,ze),Ot.size===0){const{[Xe]:Qt,...qt}=dt.selection.indices,{[Xe]:Rt,...ut}=dt.selection.objects;return{indices:qt,objects:ut}}return{indices:{...dt.selection.indices,[`${Xe}`]:Array.from(Ot.keys())},objects:{...dt.selection.objects,[`${Xe}`]:Array.from(Ot.values())}}}default:throw ML(Z),new Error("Invalid selection mode")}})();JSON.stringify(mr)!==JSON.stringify(dt.selection)&&se({fromUi:!0,value:{selection:mr}})},[Z,B,se]),Te=it.useCallback(()=>{se({value:{selection:x1},fromUi:!0})},[se]);return Ll(E3,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",width:Ee,height:V,children:[ms(DL,{isFullScreen:v,disableFullscreenMode:r,onExpand:w,onCollapse:C,target:E3,locked:k&&!e?!0:void 0,children:k&&!e&&ms(OL,{label:"Clear selection",onClick:Te,icon:BL})}),Ll(SX,{viewState:ge,onViewStateChange:Y,height:V,width:Ee,layers:Ve?F.layers:EAe,getTooltip:I,ContextProvider:qh.Provider,controller:!0,onClick:G&&!e?pe:void 0,children:[ms(Fc,{height:V,width:Ee,mapStyle:F.mapStyle&&(typeof F.mapStyle=="string"?F.mapStyle:F.mapStyle[0]),mapboxApiAccessToken:f||o}),ms(IJ,{children:ms(nZ,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})},JAe=FL(PJ("st.pydeck_chart")(SAe));export{JAe as default};
3842
+ `;break;case"r":vt+="\r";break;case"t":vt+=" ";break;case"b":vt+="\b";break;case"f":vt+="\f";break;case"v":vt+="\v";break;default:vt+=qr}else vt+=qr;return Mr||pe('Unclosed quote after "'+vt+'"',ut),{type:s,value:vt,raw:Yt+vt+Yt}},$i=function(){var vt=Dt(ut),Yt=ut,Mr;for(Ot(vt)?ut++:pe("Unexpected "+Ur(ut),ut);ut<$r&&(vt=Dt(ut),Qt(vt));)ut++;return Mr=Rt.slice(Yt,ut),Nt.hasOwnProperty(Mr)?{type:s,value:Nt[Mr],raw:Mr}:Mr===gr?{type:f}:{type:n,name:Mr}},Zs=function(vt){for(var Yt,Mr=[],qr,kn=!1,Di=0;ut<$r;)if(Pi(),Yt=Dt(ut),Yt===vt){kn=!0,ut++,vt===Z&&Di&&Di>=Mr.length&&pe("Unexpected token "+String.fromCharCode(vt),ut);break}else if(Yt===k){if(ut++,Di++,Di!==Mr.length){if(vt===Z)pe("Unexpected token ,",ut);else if(vt===ge)for(var mn=Mr.length;mn<Di;mn++)Mr.push(null)}}else qr=yi(),(!qr||qr.type===i)&&pe("Expected comma",ut),Mr.push(qr);return kn||pe("Expected "+String.fromCharCode(vt),ut),Mr},ln=function(){var vt,Yt;for(vt=Dt(ut),vt===Y?Yt=ni():Yt=$i(),Pi(),vt=Dt(ut);vt===F||vt===se||vt===Y;)ut++,vt===F?(Pi(),Yt={type:o,computed:!1,object:Yt,property:$i()}):vt===se?(Yt={type:o,computed:!0,object:Yt,property:yi()},Pi(),vt=Dt(ut),vt!==ge&&pe("Unclosed [",ut),ut++):vt===Y&&(Yt={type:A,arguments:Zs(Z),callee:Yt}),Pi(),vt=Dt(ut);return Yt},ni=function(){ut++;var vt=yi();if(Pi(),Dt(ut)===Z)return ut++,vt;pe("Unclosed (",ut)},Is=function(){return ut++,{type:B,elements:Zs(ge)}},nn=[],Oi,is;ut<$r;)Oi=Dt(ut),Oi===Ve||Oi===k?ut++:(is=yi())?nn.push(is):ut<$r&&pe('Unexpected "'+Ur(ut)+'"',ut);return nn.length===1?nn[0]:{type:i,body:nn}};qt.version="0.3.5",qt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+qt.version},qt.addUnaryOp=function(Rt){return Xe=Math.max(Rt.length,Xe),Ae[Rt]=Te,this},qt.addBinaryOp=function(Rt,ut){return dt=Math.max(Rt.length,dt),Le[Rt]=ut,this},qt.addLiteral=function(Rt,ut){return Nt[Rt]=ut,this},qt.removeUnaryOp=function(Rt){return delete Ae[Rt],Rt.length===Xe&&(Xe=ze(Ae)),this},qt.removeAllUnaryOps=function(){return Ae={},Xe=0,this},qt.removeBinaryOp=function(Rt){return delete Le[Rt],Rt.length===dt&&(dt=ze(Le)),this},qt.removeAllBinaryOps=function(){return Le={},dt=0,this},qt.removeLiteral=function(Rt){return delete Nt[Rt],this},qt.removeAllLiterals=function(){return Nt={},this},t.exports?e=t.exports=qt:e.parse=qt})()})(s2,s2.exports);var eAe=s2.exports;const tAe=oA(eAe),OM={"||":(t,e)=>t||e,"&&":(t,e)=>t&&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e},rAe={"-":t=>-t,"+":t=>+t,"~":t=>~t,"!":t=>!t};function DM(t,e){return t.map(function(r){return Ss(r,e)})}function FM(t,e){const r=Ss(t.object,e);let i;if(t.computed?i=Ss(t.property,e):i=t.property.name,/^__proto__|prototype|constructor$/.test(i))throw Error(`Access to member "${i}" disallowed.`);return[r,r[i]]}function Ss(t,e){const r=t;switch(r.type){case"ArrayExpression":return DM(r.elements,e);case"BinaryExpression":return OM[r.operator](Ss(r.left,e),Ss(r.right,e));case"CallExpression":let i,n,o;return r.callee.type==="MemberExpression"?(o=FM(r.callee,e),i=o[0],n=o[1]):n=Ss(r.callee,e),typeof n!="function"?void 0:n.apply(i,DM(r.arguments,e));case"ConditionalExpression":return Ss(r.test,e)?Ss(r.consequent,e):Ss(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?Ss(r.left,e)||Ss(r.right,e):r.operator==="&&"?Ss(r.left,e)&&Ss(r.right,e):OM[r.operator](Ss(r.left,e),Ss(r.right,e));case"MemberExpression":return FM(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return rAe[r.operator](Ss(r.argument,e));default:return}}const b1={"-":t=>t};function zF(t,e){if(t in b1)return b1[t];let r;const i=tAe(t);return i.type==="Identifier"?r=n=>Yde(n,t):(o2(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=n=>Ss(i,n)),b1[t]=r,r}function o2(t,e){if(Array.isArray(t))t.forEach(r=>o2(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(const r in t)o2(t[r],e)}}const n_="@@=",LM="@@#",iAe="@@type",VF="@@function",kM=t=>t&&typeof t=="object";class a2{constructor(...e){this.typeKey=iAe,this.functionKey=VF,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=zF,this.preProcessClassProps=(r,i)=>i,this.postProcessConvertedJson=r=>r;for(const r of e)this.merge(r)}merge(e){for(const r in e)switch(r){case"layers":case"views":Object.assign(this.classes,e[r]);break;default:if(r in this){const i=e[r];this[r]=kM(this[r])?Object.assign(this[r],i):i}}}validate(e){return n2(!this.typeKey||typeof this.typeKey=="string"),n2(kM(this.classes)),!0}}function nAe(t){return typeof t=="string"&&t.startsWith(n_)}function sAe(t){return t.replace(n_,"")}function jF(t,e){const r={};for(const i in t){let n=t[i];nAe(n)&&(n=sAe(n),n=zF(n)),r[i]=n}return r}function oAe(t,e,r){const i=r.classes[t],n=r.reactComponents[t];if(!i&&!n){const{log:o}=r;if(o){const s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${t}(${s}...) `)}return null}return i?aAe(i,e,r):lAe(n,e,r)}function aAe(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=jF(e),new t(e)}function lAe(t,e,r){const{React:i}=r,{children:n=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=jF(e),i.createElement(t,e,n)}function cAe(t,e,r){const i=r.functions[t];if(!i){const{log:n}=r;if(n){const o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return i(e)}function uAe(t){return typeof t=="string"?JSON.parse(t):t}const Nw=t=>t&&typeof t=="object";class hAe{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof a2?e.configuration:new a2(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;const r=uAe(e);let i=fAe(r,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}}function fAe(t,e){return e=new a2(e),Uw(t,"",e)}function Uw(t,e,r){return Array.isArray(t)?t.map((i,n)=>Uw(i,String(n),r)):dAe(t,r)?AAe(t,r):Nw(t)?VF in t?pAe(t,r):zw(t,r):typeof t=="string"?gAe(t,e,r):t}function dAe(t,e){const{typeKey:r}=e;return Nw(t)&&!!t[r]}function AAe(t,e){const{typeKey:r}=e,i=t[r];let n={...t};return delete n[r],n=zw(n,e),oAe(i,n,e)}function pAe(t,e){const{functionKey:r}=e,i=t[r];let n={...t};return delete n[r],n=zw(n,e),cAe(i,n,e)}function zw(t,e){n2(Nw(t));const r={};for(const i in t){const n=t[i];r[i]=Uw(n,i,e)}return r}function gAe(t,e,r){if(t.startsWith(n_)&&r.convertFunction)return t=t.replace(n_,""),r.convertFunction(t,r);if(t.startsWith(LM)){if(t=t.replace(LM,""),r.constants[t])return r.constants[t];const[i,n]=t.split(".");return r.enumerations[i][n]}return t}const mAe={classes:{...ste,...Zde,...Vce,...Mse,...Kde},functions:{colorBins:ife,colorCategories:nfe,colorContinuous:sfe}},HF=new hAe({configuration:mAe}),_Ae={[iy.layerName]:["getFillColor"],[J_.layerName]:["getFillColor"],[$l.layerName]:["getFillColor"],[AA.layerName]:["getFillColor"],[X_.layerName]:["getFillColor"],[W_.layerName]:["getFillColor"],[Z_.layerName]:["getColor"],[c0.layerName]:["getTargetColor","getSourceColor"],[Lc.layerName]:["getFillColor"],[kc.layerName]:["getFillColor"],[dA.layerName]:["getColor"],[u0.layerName]:["getColor"],[$h.layerName]:["getColor"],[h0.layerName]:["getColor"],[Vu.layerName]:["getFillColor"],[f0.layerName]:["getFillColor","getColor","getLineColor"],[zu.layerName]:["getFillColor"],[Zh.layerName]:["getColor"],[g0.layerName]:["getColor"],[zh.layerName]:["getColor"]},yAe=({object:t,objectInfo:e,originalFillFunction:r})=>{const i=typeof r=="function"?r(t,e):r;if(Array.isArray(i))return[i[0]||0,i[1]||0,i[2]||0,i[3]||255];if(typeof i=="string"&&i.startsWith("@@=")){const n=HF.convert({originalColor:i}).originalColor(t);return[n[0]||0,n[1]||0,n[2]||0,n[3]||255]}return null},NM=({isSelected:t,object:e,objectInfo:r,opacity:i,originalFillFunction:n})=>{const o=yAe({object:e,objectInfo:r,originalFillFunction:n});if(!o)return null;let s=0;return t?s=Math.max(typeof o[3]=="number"?o[3]:i,i):s=Math.min(typeof o[3]=="number"?o[3]:i,i),[o[0]||0,o[1]||0,o[2]||0,s]},vAe=({isSelected:t,object:e,objectInfo:r,originalFillFunction:i,selectedColor:n,selectedOpacity:o=255,unselectedColor:s,unselectedOpacity:f=Math.floor(255*.4)})=>t?NM({opacity:o,isSelected:!0,object:e,objectInfo:r,originalFillFunction:i})||n:NM({opacity:f,isSelected:!1,object:e,objectInfo:r,originalFillFunction:i})||s,r0={selection:{indices:{},objects:{}}},UM=(t,e)=>{const r=e.match(/{(.*?)}/g);return r&&r.forEach(i=>{const n=i.substring(1,i.length-1);t.object.hasOwnProperty(n)?e=e.replace(i,t.object[n]):t.object.hasOwnProperty("properties")&&t.object.properties.hasOwnProperty(n)&&(e=e.replace(i,t.object.properties[n]))}),e};function bAe(t,e){return e.id?t.getElementState(e.id,"selection")??r0:r0}function xAe(t,e){if(!e.id)return r0;const r=t.getStringValue(e);return(r?T1.parse(r):null)??r0}function wAe(t,e,r,i){t.id&&e.setStringValue(t,JSON.stringify(r.value),{fromUi:r.fromUi},i)}const TAe=t=>{var Le;const{height:e,width:r,expanded:i}=WM(XM),{element:n,fragmentId:o,isLightTheme:s,theme:f,widgetMgr:A}=t,{selectionMode:v,tooltip:w,useContainerWidth:C}=n,I=i??!1,[B,F]=LL({element:n,getDefaultState:bAe,getStateFromWidgetMgr:xAe,updateWidgetMgrState:wAe,widgetMgr:A,fragmentId:o}),[k,V]=it.useState({bearing:0,pitch:0,zoom:11}),{height:G,width:Y}=MJ({element:n,isFullScreen:I,shouldUseContainerWidth:C,container:{height:e,width:r},heightFallback:((Le=k.initialViewState)==null?void 0:Le.height)||f.sizes.defaultMapHeight}),[Z,se]=it.useState({}),ge=v[0],Ee=ge!==void 0,Ve=Ee&&Object.keys(B.selection.indices).length>0,Fe=it.useMemo(()=>Object.freeze(T1.parse(n.json)),[I,s,n.json]),pe=it.useMemo(()=>{const ze={...Fe};if(ze.mapStyle||(ze.mapStyle=`mapbox://styles/mapbox/${s?"light":"dark"}-v9`),ze.layers){const Xe=Object.values(B.selection.indices).some(Nt=>Nt==null?void 0:Nt.length),dt=ze.layers.some(Nt=>Object.hasOwn(Nt,"pickable"));ze.layers=ze.layers.map(Nt=>{var Ot,Qt;if(!Nt||Array.isArray(Nt)||!Ee)return Nt;dt||(Nt.pickable=!0);const gr=`${Nt.id||null}`,mr=((Qt=(Ot=B==null?void 0:B.selection)==null?void 0:Ot.indices)==null?void 0:Qt[gr])||[],_r=_Ae[Nt["@@type"]];if(!_r)return Nt;const rr={...Nt};return _r.forEach(qt=>{var dr;rr.updateTriggers={[qt]:[...((dr=rr.updateTriggers)==null?void 0:dr[qt])||[],mr,Xe]};const Rt=!Xe,ut=Nt[qt];if(Rt||!ut)return rr;const Vi=255,Sr=Math.floor(255*.4),Ur=cE(f.colors.primary),Dt=[Ur[0],Ur[1],Ur[2],Vi],$r=cE(f.colors.gray20),Pi=[$r[0],$r[1],$r[2],Sr],yi=(gn,oi)=>vAe({isSelected:mr.includes(oi.index),object:gn,objectInfo:oi,originalFillFunction:ut,selectedColor:Dt,unselectedColor:Pi,selectedOpacity:Vi,unselectedOpacity:Sr});rr[qt]=yi}),rr})}return ze==null||delete ze.views,HF.convert(ze)},[B.selection.indices,s,Ee,Fe,f.colors.gray20,f.colors.primary]);it.useEffect(()=>{if(!PL(pe.initialViewState,Z)){const ze=Object.keys(pe.initialViewState).reduce((Xe,dt)=>pe.initialViewState[dt]===Z[dt]?Xe:{...Xe,[dt]:pe.initialViewState[dt]},{});V({...k,...ze}),se(pe.initialViewState)}},[pe.initialViewState,Z,k]);const Te=it.useCallback(ze=>{if(!ze||!ze.object||!w)return null;const Xe=T1.parse(w);return Xe.html?Xe.html=UM(ze,Xe.html):Xe.text=UM(ze,Xe.text),Xe},[w]),Ae=it.useCallback(({viewState:ze})=>{V(ze)},[V]);return{createTooltip:Te,data:B,deck:pe,hasActiveSelection:Ve,height:G,isSelectionModeActivated:Ee,onViewStateChange:Ae,selectionMode:ge,setSelection:F,viewState:k,width:Y}};s0([hx,tA]);const x1=r0.selection,EAe=[],SAe=t=>{const{disabled:e,disableFullscreenMode:r,element:i,fragmentId:n,mapboxToken:o,widgetMgr:s}=t,{mapboxToken:f}=i,A=IL(),{expanded:v,expand:w,collapse:C}=WM(XM),{createTooltip:I,data:B,deck:F,hasActiveSelection:k,height:V,isSelectionModeActivated:G,onViewStateChange:Y,selectionMode:Z,setSelection:se,viewState:ge,width:Ee}=TAe({element:i,fragmentId:n,isLightTheme:GM(A),theme:A,widgetMgr:s}),[Ve,Fe]=it.useState(!1);it.useEffect(()=>{Fe(!0)},[]);const pe=it.useCallback(Ae=>{var _r;if(Z===void 0)return;const{index:Le,object:ze}=Ae,Xe=`${((_r=Ae.layer)==null?void 0:_r.id)||null}`,dt=B,Nt=Le===-1,mr=(()=>{var rr;if(Nt)return x1;switch(Z){case uE.SelectionMode.SINGLE_OBJECT:return((rr=dt.selection.indices[Xe])==null?void 0:rr[0])===Le?x1:{indices:{[`${Xe}`]:[Le]},objects:{[`${Xe}`]:[ze]}};case uE.SelectionMode.MULTI_OBJECT:{const Ot=new Map((()=>{var qt,Rt;return(((Rt=(qt=dt==null?void 0:dt.selection)==null?void 0:qt.indices)==null?void 0:Rt[Xe])||[]).map((ut,Vi)=>{var Sr,Ur,Dt;return[ut,(Dt=(Ur=(Sr=dt.selection)==null?void 0:Sr.objects)==null?void 0:Ur[Xe])==null?void 0:Dt[Vi]]})})());if(Ot.has(Le)?Ot.delete(Le):Ot.set(Le,ze),Ot.size===0){const{[Xe]:Qt,...qt}=dt.selection.indices,{[Xe]:Rt,...ut}=dt.selection.objects;return{indices:qt,objects:ut}}return{indices:{...dt.selection.indices,[`${Xe}`]:Array.from(Ot.keys())},objects:{...dt.selection.objects,[`${Xe}`]:Array.from(Ot.values())}}}default:throw ML(Z),new Error("Invalid selection mode")}})();JSON.stringify(mr)!==JSON.stringify(dt.selection)&&se({fromUi:!0,value:{selection:mr}})},[Z,B,se]),Te=it.useCallback(()=>{se({value:{selection:x1},fromUi:!0})},[se]);return Ll(E3,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",width:Ee,height:V,children:[ms(DL,{isFullScreen:v,disableFullscreenMode:r,onExpand:w,onCollapse:C,target:E3,locked:k&&!e?!0:void 0,children:k&&!e&&ms(OL,{label:"Clear selection",onClick:Te,icon:BL})}),Ll(SX,{viewState:ge,onViewStateChange:Y,height:V,width:Ee,layers:Ve?F.layers:EAe,getTooltip:I,ContextProvider:qh.Provider,controller:!0,onClick:G&&!e?pe:void 0,children:[ms(Fc,{height:V,width:Ee,mapStyle:F.mapStyle&&(typeof F.mapStyle=="string"?F.mapStyle:F.mapStyle[0]),mapboxApiAccessToken:f||o}),ms(IJ,{children:ms(nZ,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})},JAe=it.memo(FL(PJ("st.pydeck_chart")(SAe)));export{JAe as default};