streamlit-nightly 1.42.3.dev20250220__py2.py3-none-any.whl → 1.42.3.dev20250222__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 (76) hide show
  1. streamlit/elements/widgets/button.py +14 -4
  2. streamlit/proto/DownloadButton_pb2.py +2 -2
  3. streamlit/proto/DownloadButton_pb2.pyi +4 -1
  4. streamlit/runtime/credentials.py +15 -16
  5. streamlit/static/index.html +1 -1
  6. streamlit/static/static/js/{FileDownload.esm.CSCu_FQk.js → FileDownload.esm.B1kyp21I.js} +1 -1
  7. streamlit/static/static/js/{FileDropzone.xME_qwl7.js → FileDropzone.uWzTac7M.js} +1 -1
  8. streamlit/static/static/js/{FormClearHelper.D7FpzEHQ.js → FormClearHelper.CEl0YyS3.js} +1 -1
  9. streamlit/static/static/js/{Hooks.Ofd2jLSe.js → Hooks.B_-0sclb.js} +1 -1
  10. streamlit/static/static/js/{InputInstructions.C5AiI5fd.js → InputInstructions.M8GsfWtP.js} +1 -1
  11. streamlit/static/static/js/{ProgressBar.St3jxlFz.js → ProgressBar.DDliFXvs.js} +1 -1
  12. streamlit/static/static/js/{RenderInPortalIfExists.JQTUbdhz.js → RenderInPortalIfExists.DON5no2j.js} +1 -1
  13. streamlit/static/static/js/{Toolbar.mIL79bYR.js → Toolbar.DGwjBtCI.js} +1 -1
  14. streamlit/static/static/js/{base-input.CoahMH6I.js → base-input.Dz6cKnV_.js} +1 -1
  15. streamlit/static/static/js/{createSuper.DJC0972y.js → createSuper.bXxYJzro.js} +1 -1
  16. streamlit/static/static/js/{data-grid-overlay-editor.C9j6qKVt.js → data-grid-overlay-editor.BrHDbHOn.js} +1 -1
  17. streamlit/static/static/js/{downloader.BmN5QG23.js → downloader.BUh1naKp.js} +1 -1
  18. streamlit/static/static/js/{es6.CkTV0_PT.js → es6.C8XVTTHj.js} +2 -2
  19. streamlit/static/static/js/{iframeResizer.contentWindow.GG3aQxlr.js → iframeResizer.contentWindow.DGWt48-l.js} +1 -1
  20. streamlit/static/static/js/{index.od8XlC_e.js → index.6zGrdP7S.js} +118 -118
  21. streamlit/static/static/js/{index.C6YhHXiT.js → index.94WymsOx.js} +1 -1
  22. streamlit/static/static/js/{index.Bhh-YA7-.js → index.B1Y_k9Fh.js} +1 -1
  23. streamlit/static/static/js/{index.C2RhGRpZ.js → index.B66JaJi3.js} +1 -1
  24. streamlit/static/static/js/{index.D6v0tURe.js → index.BBotNZr-.js} +1 -1
  25. streamlit/static/static/js/{index.DX8V4iLG.js → index.BUnE-2Mi.js} +1 -1
  26. streamlit/static/static/js/{index.DMRnVKOx.js → index.BXFE-6NA.js} +1 -1
  27. streamlit/static/static/js/{index.BFMT7m5S.js → index.BhKdTR4z.js} +1 -1
  28. streamlit/static/static/js/{index.BtEGgjQs.js → index.BiCX2JZK.js} +1 -1
  29. streamlit/static/static/js/{index.40cNUDYj.js → index.BrXMfzqp.js} +1 -1
  30. streamlit/static/static/js/{index.GL3uWznV.js → index.BxBwZJQr.js} +1 -1
  31. streamlit/static/static/js/{index.LvS7giIF.js → index.C2VChsA1.js} +1 -1
  32. streamlit/static/static/js/{index.BgviuYiK.js → index.C2skmlN3.js} +1 -1
  33. streamlit/static/static/js/{index.BWRgNHzG.js → index.C5zcxetk.js} +1 -1
  34. streamlit/static/static/js/{index.DtOoKZuY.js → index.C9nK-VoQ.js} +1 -1
  35. streamlit/static/static/js/{index.DgheNneH.js → index.CNDCHhth.js} +1 -1
  36. streamlit/static/static/js/{index.GumFavEm.js → index.CNYNhiEk.js} +1 -1
  37. streamlit/static/static/js/{index.Cu1SST0o.js → index.CUKOkOB2.js} +36 -36
  38. streamlit/static/static/js/{index.DGCNoFUa.js → index.Ceuq3IzZ.js} +1 -1
  39. streamlit/static/static/js/{index.DLmg74_p.js → index.ChSsIvr7.js} +2 -2
  40. streamlit/static/static/js/{index.B0fq3djO.js → index.D-4pSvTG.js} +1 -1
  41. streamlit/static/static/js/{index.D8VHOaj4.js → index.DB9G9YYY.js} +1 -1
  42. streamlit/static/static/js/{index.DpMH9Ich.js → index.DKFH0WYB.js} +1 -1
  43. streamlit/static/static/js/{index.C_y3GDl0.js → index.DO1Rv491.js} +1 -1
  44. streamlit/static/static/js/{index.DlpiXPka.js → index.DQT0NMTW.js} +1 -1
  45. streamlit/static/static/js/{index.BIb_Q_t2.js → index.DU4gaNU_.js} +1 -1
  46. streamlit/static/static/js/{index.CmKQs94B.js → index.D_tVZ0u0.js} +1 -1
  47. streamlit/static/static/js/{index.euIqXpX7.js → index.Da7VTJGp.js} +1 -1
  48. streamlit/static/static/js/{index.DvpzuDf3.js → index.DcA_kXA1.js} +1 -1
  49. streamlit/static/static/js/index.DgCaLwAb.js +1 -0
  50. streamlit/static/static/js/{index.CcxxDrWU.js → index.DiXeiIyQ.js} +1 -1
  51. streamlit/static/static/js/{index.DxseZbLQ.js → index.Dl_RyApM.js} +1 -1
  52. streamlit/static/static/js/{index.F-Swvxpp.js → index.DvUg88R_.js} +1 -1
  53. streamlit/static/static/js/{index.c4SbAEld.js → index.NifETEVc.js} +2 -2
  54. streamlit/static/static/js/{index.BIMiZM1d.js → index.iYzAfcLx.js} +1 -1
  55. streamlit/static/static/js/{index.B6DhU6bS.js → index.jSEMrPEJ.js} +1 -1
  56. streamlit/static/static/js/{index.DGtuJLSc.js → index.lCzpOFcS.js} +2 -2
  57. streamlit/static/static/js/{input.DQUrmNKe.js → input.DqK048_c.js} +1 -1
  58. streamlit/static/static/js/{memory.Bc-1m0Hw.js → memory.BYwXutbg.js} +1 -1
  59. streamlit/static/static/js/{mergeWith.DrVjJq9_.js → mergeWith.CwfhUp-s.js} +1 -1
  60. streamlit/static/static/js/{number-overlay-editor.sGSz7Cjz.js → number-overlay-editor.B-1TJraW.js} +1 -1
  61. streamlit/static/static/js/{possibleConstructorReturn.DB_ioxa8.js → possibleConstructorReturn.CCjgmGB4.js} +1 -1
  62. streamlit/static/static/js/{sandbox.Df3tB-gk.js → sandbox.CzVH3fBX.js} +1 -1
  63. streamlit/static/static/js/{textarea.COkOU68B.js → textarea.D47OO5VD.js} +1 -1
  64. streamlit/static/static/js/{timepicker.DHf9u4bk.js → timepicker.Dq2FqiYO.js} +1 -1
  65. streamlit/static/static/js/{toConsumableArray.B-S6rpdU.js → toConsumableArray.7OyX1dIj.js} +1 -1
  66. streamlit/static/static/js/{uniqueId.BfMGEPML.js → uniqueId.naIyoATl.js} +1 -1
  67. streamlit/static/static/js/{useBasicWidgetState.B8dRKvrk.js → useBasicWidgetState.DH0ClB0l.js} +1 -1
  68. streamlit/static/static/js/{useOnInputChange.Bntao_G6.js → useOnInputChange.3GZT2mEx.js} +1 -1
  69. streamlit/static/static/js/{withFullScreenWrapper.CS8vg4vY.js → withFullScreenWrapper.HzikaPlG.js} +1 -1
  70. {streamlit_nightly-1.42.3.dev20250220.dist-info → streamlit_nightly-1.42.3.dev20250222.dist-info}/METADATA +1 -1
  71. {streamlit_nightly-1.42.3.dev20250220.dist-info → streamlit_nightly-1.42.3.dev20250222.dist-info}/RECORD +75 -75
  72. streamlit/static/static/js/index.zss4f62G.js +0 -1
  73. {streamlit_nightly-1.42.3.dev20250220.data → streamlit_nightly-1.42.3.dev20250222.data}/scripts/streamlit.cmd +0 -0
  74. {streamlit_nightly-1.42.3.dev20250220.dist-info → streamlit_nightly-1.42.3.dev20250222.dist-info}/WHEEL +0 -0
  75. {streamlit_nightly-1.42.3.dev20250220.dist-info → streamlit_nightly-1.42.3.dev20250222.dist-info}/entry_points.txt +0 -0
  76. {streamlit_nightly-1.42.3.dev20250220.dist-info → streamlit_nightly-1.42.3.dev20250222.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{n as P,r as s,bg as U,y as k,cq as g,C as H,j as u,br as L,bE as B,bs as D,b9 as O,bt as j,cr as w}from"./index.od8XlC_e.js";import{u as _}from"./uniqueId.BfMGEPML.js";import{u as q,a as K,b as $}from"./useOnInputChange.Bntao_G6.js";import{a as A}from"./useBasicWidgetState.B8dRKvrk.js";import{I as G}from"./InputInstructions.C5AiI5fd.js";import{I as N}from"./input.DQUrmNKe.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.D7FpzEHQ.js";import"./base-input.CoahMH6I.js";const J=P("div",{target:"e1o1zy6o0"})("position:relative;");function M({disabled:e,element:t,widgetMgr:a,fragmentId:n}){var f;const[r,l]=s.useState(I(a,t)??null),{values:[S],elementRef:y}=U(s.useMemo(()=>["width"],[])),[i,d]=s.useState(!1),W=s.useCallback(()=>{l(t.default??null),d(!0)},[t.default]),[T,c]=A({getStateFromWidgetMgr:I,getDefaultStateFromProto:Q,getCurrStateFromProto:X,updateWidgetMgrState:Y,element:t,widgetMgr:a,fragmentId:n,onFormCleared:W});q(T,r,l,i);const[x,m]=s.useState(!1),o=k(),[h]=s.useState(()=>_("text_input_")),{placeholder:C,formId:b}=t,p=s.useCallback(()=>{d(!1),c({value:r,fromUi:!0})},[r,c]),V=g({formId:b})?a.allowFormEnterToSubmit(b):i,v=x&&S>o.breakpoints.hideWidgetDetails,F=s.useCallback(()=>{i&&p(),m(!1)},[i,p]),E=s.useCallback(()=>{m(!0)},[]),R=K({formId:t.formId,maxChars:t.maxChars,setDirty:d,setUiValue:l,setValueWithSource:c}),z=$(t.formId,p,i,a,n);return H(J,{className:"stTextInput","data-testid":"stTextInput",ref:y,children:[u(j,{label:t.label,disabled:e,labelVisibility:L((f=t.labelVisibility)==null?void 0:f.value),htmlFor:h,children:t.help&&u(B,{children:u(D,{content:t.help,placement:O.TOP_RIGHT})})}),u(N,{value:r??"",placeholder:C,onBlur:F,onFocus:E,onChange:R,onKeyPress:z,"aria-label":t.label,disabled:e,id:h,type:Z(t),autoComplete:t.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth}}}}),v&&u(G,{dirty:i,value:r??"",maxLength:t.maxChars,inForm:g({formId:t.formId}),allowEnterToSubmit:V})]})}function I(e,t){return e.getStringValue(t)??null}function Q(e){return e.default??null}function X(e){return e.value??null}function Y(e,t,a,n){t.setStringValue(e,a.value,{fromUi:a.fromUi},n)}function Z(e){return e.type===w.Type.PASSWORD?"password":"text"}const lt=s.memo(M);export{lt as default};
1
+ import{n as P,r as s,bg as U,y as k,cq as g,C as H,j as u,br as L,bE as B,bs as D,b9 as O,bt as j,cr as w}from"./index.6zGrdP7S.js";import{u as _}from"./uniqueId.naIyoATl.js";import{u as q,a as K,b as $}from"./useOnInputChange.3GZT2mEx.js";import{a as A}from"./useBasicWidgetState.DH0ClB0l.js";import{I as G}from"./InputInstructions.M8GsfWtP.js";import{I as N}from"./input.DqK048_c.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.CEl0YyS3.js";import"./base-input.Dz6cKnV_.js";const J=P("div",{target:"e1o1zy6o0"})("position:relative;");function M({disabled:e,element:t,widgetMgr:a,fragmentId:n}){var f;const[r,l]=s.useState(I(a,t)??null),{values:[S],elementRef:y}=U(s.useMemo(()=>["width"],[])),[i,d]=s.useState(!1),W=s.useCallback(()=>{l(t.default??null),d(!0)},[t.default]),[T,c]=A({getStateFromWidgetMgr:I,getDefaultStateFromProto:Q,getCurrStateFromProto:X,updateWidgetMgrState:Y,element:t,widgetMgr:a,fragmentId:n,onFormCleared:W});q(T,r,l,i);const[x,m]=s.useState(!1),o=k(),[h]=s.useState(()=>_("text_input_")),{placeholder:C,formId:b}=t,p=s.useCallback(()=>{d(!1),c({value:r,fromUi:!0})},[r,c]),V=g({formId:b})?a.allowFormEnterToSubmit(b):i,v=x&&S>o.breakpoints.hideWidgetDetails,F=s.useCallback(()=>{i&&p(),m(!1)},[i,p]),E=s.useCallback(()=>{m(!0)},[]),R=K({formId:t.formId,maxChars:t.maxChars,setDirty:d,setUiValue:l,setValueWithSource:c}),z=$(t.formId,p,i,a,n);return H(J,{className:"stTextInput","data-testid":"stTextInput",ref:y,children:[u(j,{label:t.label,disabled:e,labelVisibility:L((f=t.labelVisibility)==null?void 0:f.value),htmlFor:h,children:t.help&&u(B,{children:u(D,{content:t.help,placement:O.TOP_RIGHT})})}),u(N,{value:r??"",placeholder:C,onBlur:F,onFocus:E,onChange:R,onKeyPress:z,"aria-label":t.label,disabled:e,id:h,type:Z(t),autoComplete:t.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth}}}}),v&&u(G,{dirty:i,value:r??"",maxLength:t.maxChars,inForm:g({formId:t.formId}),allowEnterToSubmit:V})]})}function I(e,t){return e.getStringValue(t)??null}function Q(e){return e.default??null}function X(e){return e.value??null}function Y(e,t,a,n){t.setStringValue(e,a.value,{fromUi:a.fromUi},n)}function Z(e){return e.type===w.Type.PASSWORD?"password":"text"}const lt=s.memo(M);export{lt as default};
@@ -1,4 +1,4 @@
1
- var bk=Object.defineProperty;var xk=(r,e,t)=>e in r?bk(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var $=(r,e,t)=>xk(r,typeof e!="symbol"?e+"":e,t);import{g as Uh,r as Ct,ar as yr,aR as dt,aS as _u,_ as qM,j as Es,C as Fl,aT as wy,F as jT,aU as Ty,aV as wk,aW as HT,aX as Tk,aC as Ek,aY as Sk,n as XM,D as $M,Q as b1,aZ as GT,az as Ck,y as Pk,a_ as Ik,a$ as WT}from"./index.od8XlC_e.js";import{_ as as,a as Mk,C as Rk}from"./toConsumableArray.B-S6rpdU.js";import{a as Fu,b as ku,_ as Kb,c as Fd,d as Jb}from"./possibleConstructorReturn.DB_ioxa8.js";import{a as Bk,T as Ok}from"./Toolbar.mIL79bYR.js";import{u as ZM,E as YM,w as Dk}from"./withFullScreenWrapper.CS8vg4vY.js";import{u as Fk}from"./useBasicWidgetState.B8dRKvrk.js";import{u as kk,s as Lk}from"./threshold.DjX0wlsa.js";import{a as Nk}from"./index.DW_MHI2K.js";import"./FormClearHelper.D7FpzEHQ.js";import"./value.CgPGBV_l.js";function Uk(r,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in r)){const o=Object.getOwnPropertyDescriptor(i,n);o&&Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const hu={};async function zp(r,e,t,i){return i._parse(r,e,t,i)}function An(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const r_=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),qT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);qT&&parseFloat(qT[1]);const U0=globalThis,Lf=globalThis.process||{},zk=globalThis.navigator||{};function KM(r){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 t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function Lu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||KM()}function Vk(r){return Lu()?KM()?"Electron":(zk.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const JM="4.0.7";function jk(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}class Hk{constructor(e,t,i="sessionStorage"){this.storage=jk(i),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function Gk(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function Wk(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var em;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(em||(em={}));const qk=10;function XT(r){return typeof r!="string"?r:(r=r.toUpperCase(),em[r]||em.WHITE)}function Xk(r,e,t){return!Lu&&typeof r=="string"&&(e&&(r=`\x1B[${XT(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${XT(t)+qk}m${r}\x1B[49m`)),r}function $k(r,e=["constructor"]){const t=Object.getPrototypeOf(r),i=Object.getOwnPropertyNames(t),n=r;for(const o of i){const s=n[o];typeof s=="function"&&(e.find(u=>o===u)||(n[o]=s.bind(r)))}}function Qb(r,e){if(!r)throw new Error("Assertion failed")}function Nf(){var e,t,i;let r;if(Lu()&&U0.performance)r=(t=(e=U0==null?void 0:U0.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Lf){const n=(i=Lf==null?void 0:Lf.hrtime)==null?void 0:i.call(Lf);r=n[0]*1e3+n[1]/1e6}else r=Date.now();return r}const Uf={debug:Lu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Zk={enabled:!0,level:0};function zf(){}const $T={},ZT={once:!0};class Kd{constructor({id:e}={id:""}){this.VERSION=JM,this._startTs=Nf(),this._deltaTs=Nf(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new Hk(`__probe-${this.id}__`,Zk),this.timeStamp(`${this.id} started`),$k(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((Nf()-this._startTs).toPrecision(10))}getDelta(){return Number((Nf()-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,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Uf.warn,arguments,ZT)}error(e){return this._getLogFunction(0,e,Uf.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,Uf.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Uf.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,Uf.debug||Uf.info,arguments,ZT)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||zf,i&&[i],{tag:Kk(t)}):zf}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||zf)}group(e,t,i={collapsed:!1}){const n=YT({logLevel:e,message:t,opts:i}),{collapsed:o}=i;return n.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||zf)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=QM(e)}_getLogFunction(e,t,i,n,o){if(this._shouldLog(e)){o=YT({logLevel:e,message:t,args:n,opts:o}),i=i||o.method,Qb(i),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Nf();const s=o.tag||o.message;if(o.once&&s)if(!$T[s])$T[s]=Nf();else return zf;return t=Yk(this.id,o.message,o),i.bind(console,t,...o.args)}return zf}}Kd.VERSION=JM;function QM(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return Qb(Number.isFinite(e)&&e>=0),e}function YT(r){const{logLevel:e,message:t}=r;r.logLevel=QM(e);const i=r.args?Array.from(r.args):[];for(;i.length&&i.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&i.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const n=typeof r.message;return Qb(n==="string"||n==="object"),Object.assign(r,{args:i},r.opts)}function Yk(r,e,t){if(typeof e=="string"){const i=t.time?Wk(Gk(t.total)):"";e=t.time?`${r}: ${i} ${e}`:`${r}: ${e}`,e=Xk(e,t.color,t.background)}return e}function Kk(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}globalThis.probe={};const eR=new Kd({id:"@probe.gl/log"});function tR(r,e){return rR(r||{},e)}function rR(r,e,t=0){if(t>3)return e;const i={...r};for(const[n,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?i[n]=rR(i[n]||{},e[n],t+1):i[n]=e[n];return i}function Jk(r){var e;globalThis.loaders||(globalThis.loaders={}),(e=globalThis.loaders).modules||(e.modules={}),Object.assign(globalThis.loaders.modules,r)}function Qk(r){var t,i;return((i=(t=globalThis.loaders)==null?void 0:t.modules)==null?void 0:i[r])||null}const eL="latest";function tL(){var r;return(r=globalThis._loadersgl_)!=null&&r.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const iR=tL();function Pc(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const va=typeof process!="object"||String(process)!=="[object process]"||process.browser,e2=typeof importScripts=="function",rL=typeof window<"u"&&typeof window.orientation<"u",KT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);KT&&parseFloat(KT[1]);class iL{constructor(e,t){$(this,"name");$(this,"workerThread");$(this,"isRunning",!0);$(this,"result");$(this,"_resolve",()=>{});$(this,"_reject",()=>{});this.name=e,this.workerThread=t,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Pc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Pc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Ey{terminate(){}}const Sy=new Map;function nL(r){Pc(r.source&&!r.url||!r.source&&r.url);let e=Sy.get(r.source||r.url);return e||(r.url&&(e=sL(r.url),Sy.set(r.url,e)),r.source&&(e=nR(r.source),Sy.set(r.source,e))),Pc(e),e}function sL(r){if(!r.startsWith("http"))return r;const e=oL(r);return nR(e)}function nR(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function oL(r){return`try {
1
+ var bk=Object.defineProperty;var xk=(r,e,t)=>e in r?bk(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var $=(r,e,t)=>xk(r,typeof e!="symbol"?e+"":e,t);import{g as Uh,r as Ct,ar as yr,aR as dt,aS as _u,_ as qM,j as Es,C as Fl,aT as wy,F as jT,aU as Ty,aV as wk,aW as HT,aX as Tk,aC as Ek,aY as Sk,n as XM,D as $M,Q as b1,aZ as GT,az as Ck,y as Pk,a_ as Ik,a$ as WT}from"./index.6zGrdP7S.js";import{_ as as,a as Mk,C as Rk}from"./toConsumableArray.7OyX1dIj.js";import{a as Fu,b as ku,_ as Kb,c as Fd,d as Jb}from"./possibleConstructorReturn.CCjgmGB4.js";import{a as Bk,T as Ok}from"./Toolbar.DGwjBtCI.js";import{u as ZM,E as YM,w as Dk}from"./withFullScreenWrapper.HzikaPlG.js";import{u as Fk}from"./useBasicWidgetState.DH0ClB0l.js";import{u as kk,s as Lk}from"./threshold.DjX0wlsa.js";import{a as Nk}from"./index.DW_MHI2K.js";import"./FormClearHelper.CEl0YyS3.js";import"./value.CgPGBV_l.js";function Uk(r,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in r)){const o=Object.getOwnPropertyDescriptor(i,n);o&&Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const hu={};async function zp(r,e,t,i){return i._parse(r,e,t,i)}function An(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const r_=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),qT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);qT&&parseFloat(qT[1]);const U0=globalThis,Lf=globalThis.process||{},zk=globalThis.navigator||{};function KM(r){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 t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function Lu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||KM()}function Vk(r){return Lu()?KM()?"Electron":(zk.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const JM="4.0.7";function jk(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}class Hk{constructor(e,t,i="sessionStorage"){this.storage=jk(i),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function Gk(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function Wk(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var em;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(em||(em={}));const qk=10;function XT(r){return typeof r!="string"?r:(r=r.toUpperCase(),em[r]||em.WHITE)}function Xk(r,e,t){return!Lu&&typeof r=="string"&&(e&&(r=`\x1B[${XT(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${XT(t)+qk}m${r}\x1B[49m`)),r}function $k(r,e=["constructor"]){const t=Object.getPrototypeOf(r),i=Object.getOwnPropertyNames(t),n=r;for(const o of i){const s=n[o];typeof s=="function"&&(e.find(u=>o===u)||(n[o]=s.bind(r)))}}function Qb(r,e){if(!r)throw new Error("Assertion failed")}function Nf(){var e,t,i;let r;if(Lu()&&U0.performance)r=(t=(e=U0==null?void 0:U0.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Lf){const n=(i=Lf==null?void 0:Lf.hrtime)==null?void 0:i.call(Lf);r=n[0]*1e3+n[1]/1e6}else r=Date.now();return r}const Uf={debug:Lu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Zk={enabled:!0,level:0};function zf(){}const $T={},ZT={once:!0};class Kd{constructor({id:e}={id:""}){this.VERSION=JM,this._startTs=Nf(),this._deltaTs=Nf(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new Hk(`__probe-${this.id}__`,Zk),this.timeStamp(`${this.id} started`),$k(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((Nf()-this._startTs).toPrecision(10))}getDelta(){return Number((Nf()-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,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Uf.warn,arguments,ZT)}error(e){return this._getLogFunction(0,e,Uf.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,Uf.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Uf.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,Uf.debug||Uf.info,arguments,ZT)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||zf,i&&[i],{tag:Kk(t)}):zf}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||zf)}group(e,t,i={collapsed:!1}){const n=YT({logLevel:e,message:t,opts:i}),{collapsed:o}=i;return n.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||zf)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=QM(e)}_getLogFunction(e,t,i,n,o){if(this._shouldLog(e)){o=YT({logLevel:e,message:t,args:n,opts:o}),i=i||o.method,Qb(i),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Nf();const s=o.tag||o.message;if(o.once&&s)if(!$T[s])$T[s]=Nf();else return zf;return t=Yk(this.id,o.message,o),i.bind(console,t,...o.args)}return zf}}Kd.VERSION=JM;function QM(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return Qb(Number.isFinite(e)&&e>=0),e}function YT(r){const{logLevel:e,message:t}=r;r.logLevel=QM(e);const i=r.args?Array.from(r.args):[];for(;i.length&&i.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&i.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const n=typeof r.message;return Qb(n==="string"||n==="object"),Object.assign(r,{args:i},r.opts)}function Yk(r,e,t){if(typeof e=="string"){const i=t.time?Wk(Gk(t.total)):"";e=t.time?`${r}: ${i} ${e}`:`${r}: ${e}`,e=Xk(e,t.color,t.background)}return e}function Kk(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}globalThis.probe={};const eR=new Kd({id:"@probe.gl/log"});function tR(r,e){return rR(r||{},e)}function rR(r,e,t=0){if(t>3)return e;const i={...r};for(const[n,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?i[n]=rR(i[n]||{},e[n],t+1):i[n]=e[n];return i}function Jk(r){var e;globalThis.loaders||(globalThis.loaders={}),(e=globalThis.loaders).modules||(e.modules={}),Object.assign(globalThis.loaders.modules,r)}function Qk(r){var t,i;return((i=(t=globalThis.loaders)==null?void 0:t.modules)==null?void 0:i[r])||null}const eL="latest";function tL(){var r;return(r=globalThis._loadersgl_)!=null&&r.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const iR=tL();function Pc(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const va=typeof process!="object"||String(process)!=="[object process]"||process.browser,e2=typeof importScripts=="function",rL=typeof window<"u"&&typeof window.orientation<"u",KT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);KT&&parseFloat(KT[1]);class iL{constructor(e,t){$(this,"name");$(this,"workerThread");$(this,"isRunning",!0);$(this,"result");$(this,"_resolve",()=>{});$(this,"_reject",()=>{});this.name=e,this.workerThread=t,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Pc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Pc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Ey{terminate(){}}const Sy=new Map;function nL(r){Pc(r.source&&!r.url||!r.source&&r.url);let e=Sy.get(r.source||r.url);return e||(r.url&&(e=sL(r.url),Sy.set(r.url,e)),r.source&&(e=nR(r.source),Sy.set(r.source,e))),Pc(e),e}function sL(r){if(!r.startsWith("http"))return r;const e=oL(r);return nR(e)}function nR(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function oL(r){return`try {
2
2
  importScripts('${r}');
3
3
  } catch (error) {
4
4
  console.error(error);
@@ -3862,4 +3862,4 @@ fragColor = outTexture;
3862
3862
  fragColor.g = outTexture.r / max(1.0, outTexture.a);
3863
3863
  }
3864
3864
  `,Dhe=2,m1={format:"rgba8unorm",mipmaps:!1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},FM=[0,0],Fhe={SUM:0,MEAN:1},khe={getPosition:{type:"accessor",value:r=>r.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:sA,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}},Lhe=["float32-renderable-webgl","texture-blend-float-webgl"],Nhe={data:{props:["radiusPixels"]}};class _w extends oA{initializeState(){super.initializeAggregationLayer(Nhe),this.setState({colorDomain:FM}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState(e){super.updateState(e),this._updateHeatmapState(e)}_updateHeatmapState(e){const{props:t,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(),t.colorRange!==i.colorRange&&this._updateColorTexture(e),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:e.context.viewport.zoom})}renderLayers(){const{weightsTexture:e,triPositionBuffer:t,triTexCoordBuffer:i,maxWeightsTexture:n,colorTexture:o,colorDomain:s}=this.state,{updateTriggers:u,intensity:d,threshold:v,aggregation:x}=this.props,C=this.getSubLayerClass("triangle",ND);return new C(this.getSubLayerProps({id:"triangle-layer",updateTriggers:u}),{coordinateSystem:qr.DEFAULT,data:{attributes:{positions:t,texCoords:i}},vertexCount:4,maxTexture:n,colorTexture:o,aggregationMode:Fhe[x]||0,weightsTexture:e,intensity:d,threshold:v,colorDomain:s})}finalizeState(e){super.finalizeState(e);const{weightsTransform:t,weightsTexture:i,maxWeightTransform:n,maxWeightsTexture:o,triPositionBuffer:s,triTexCoordBuffer:u,colorTexture:d,updateTimer:v}=this.state;t==null||t.destroy(),i==null||i.destroy(),n==null||n.destroy(),o==null||o.destroy(),s==null||s.destroy(),u==null||u.destroy(),d==null||d.destroy(),v&&clearTimeout(v)}_getAttributeManager(){return new D2(this.context.device,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(e){const t={},{dimensions:i}=this.state;t.dataChanged=this.isAttributeChanged()&&"attribute changed"||this.isAggregationDirty(e,{compareAll:!0,dimension:i.data})&&"aggregation is dirty",t.viewportChanged=e.changeFlags.viewportChanged;const{zoom:n}=this.state;return(!e.context.viewport||e.context.viewport.zoom!==n)&&(t.viewportZoomChanged=!0),t}_createTextures(){const{textureSize:e,format:t}=this.state;this.setState({weightsTexture:this.context.device.createTexture({...m1,width:e,height:e,format:t}),maxWeightsTexture:this.context.device.createTexture({...m1,width:1,height:1,format:t})})}_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:t}=this.props,i=Math.min(t,e.limits.maxTextureDimension2D),n=Lhe.every(u=>e.features.has(u)),o=n?"rgba32float":"rgba8unorm",s=n?1:1/255;this.setState({textureSize:i,format:o,weightsScale:s}),n||Ur.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)()}_createWeightsTransform(e){let{weightsTransform:t}=this.state;const{weightsTexture:i}=this.state,n=this.getAttributeManager();t==null||t.destroy(),t=new K1(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:t})}_setupResources(){this._createTextures();const{device:e}=this.context,{textureSize:t,weightsTexture:i,maxWeightsTexture:n}=this.state,o=this.getShaders({vs:OM,fs:DM});this._createWeightsTransform(o);const s=this.getShaders({vs:Bhe,fs:Ohe}),u=new K1(e,{id:`${this.id}-max-weights-transform`,bindings:{inTexture:i},uniforms:{textureSize:t},targetTexture:n,...s,vertexCount:t*t,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:u,zoom:null,triPositionBuffer:e.createBuffer({byteLength:48}),triTexCoordBuffer:e.createBuffer({byteLength:48})})}updateShaders(e){this._createWeightsTransform({vs:OM,fs:DM,...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:t}=this.context,i=[t.unproject([0,0]),t.unproject([t.width,0]),t.unproject([t.width,t.height]),t.unproject([0,t.height])].map(u=>u.map(Math.fround)),n=She(i),o={visibleWorldBounds:n,viewportCorners:i};let s=!1;if(e||!this.state.worldBounds||!Che(this.state.worldBounds,n)){const u=this._worldToCommonBounds(n),d=this._commonToWorldBounds(u);this.props.coordinateSystem===qr.LNGLAT&&(d[1]=Math.max(d[1],-85.051129),d[3]=Math.min(d[3],85.051129),d[0]=Math.max(d[0],-360),d[2]=Math.min(d[2],360));const v=this._worldToCommonBounds(d);o.worldBounds=d,o.normalizedCommonBounds=v,s=!0}return this.setState(o),s}_updateTextureRenderingBounds(){const{triPositionBuffer:e,triTexCoordBuffer:t,normalizedCommonBounds:i,viewportCorners:n}=this.state,{viewport:o}=this.context;e.write(BM(n,3));const s=n.map(u=>Ihe(o.projectPosition(u),i));t.write(BM(s,2))}_updateColorTexture(e){const{colorRange:t}=e.props;let{colorTexture:i}=this.state;const n=V_(t,!1,Uint8Array);i&&(i==null?void 0:i.width)===t.length?i.setSubImageData({data:n}):(i==null||i.destroy(),i=this.context.device.createTexture({...m1,data:n,width:t.length,height:1})),this.setState({colorTexture:i})}_updateWeightmap(){const{radiusPixels:e,colorDomain:t,aggregation:i}=this.props,{worldBounds:n,textureSize:o,weightsScale:s}=this.state,u=this.state.weightsTransform;this.state.isWeightMapDirty=!1;const d=this._worldToCommonBounds(n,{useLayerCoordinateSystem:!0});if(t&&i==="SUM"){const{viewport:F}=this.context,N=F.distanceScales.metersPerUnit[2]*(d[2]-d[0])/o;this.state.colorDomain=t.map(V=>V*N*s)}else this.state.colorDomain=t||FM;const x=this.getAttributeManager().getAttributes(),C=this.getModuleSettings(),P={radiusPixels:e,commonBounds:d,textureWidth:o,weightsScale:s};this._setModelAttributes(u.model,x),u.model.setVertexCount(this.getNumInstances()),u.model.setUniforms(P),u.model.updateModuleSettings(C),u.run({parameters:{viewport:[0,0,o,o]},clearColor:[0,0,0,0]}),this._updateMaxWeightValue()}_debouncedUpdateWeightmap(e=!1){let{updateTimer:t}=this.state;const{debounceTimeout:i}=this.props;e?(t=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(t),t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),i)),this.setState({updateTimer:t})}_worldToCommonBounds(e,t={}){const{useLayerCoordinateSystem:i=!1}=t,[n,o,s,u]=e,{viewport:d}=this.context,{textureSize:v}=this.state,{coordinateSystem:x}=this.props,C=i&&(x===qr.LNGLAT_OFFSETS||x===qr.METER_OFFSETS),P=C?d.projectPosition(this.props.coordinateOrigin):[0,0],F=v*Dhe/d.scale;let N,V;return i&&!C?(N=this.projectPosition([n,o,0]),V=this.projectPosition([s,u,0])):(N=d.projectPosition([n,o,0]),V=d.projectPosition([s,u,0])),Phe([N[0]-P[0],N[1]-P[1],V[0]-P[0],V[1]-P[1]],F,F)}_commonToWorldBounds(e){const[t,i,n,o]=e,{viewport:s}=this.context,u=s.unprojectPosition([t,i]),d=s.unprojectPosition([n,o]);return u.slice(0,2).concat(d.slice(0,2))}}_w.layerName="HeatmapLayer";_w.defaultProps=khe;const Uhe=Object.freeze(Object.defineProperty({__proto__:null,AGGREGATION_OPERATION:qn,CPUGridLayer:n0,ContourLayer:pw,GPUGridLayer:s0,GridLayer:mw,HeatmapLayer:_w,HexagonLayer:Aw,ScreenGridLayer:fw,_AggregationLayer:oA,_BinSorter:uw,_CPUAggregator:dw,_GPUGridAggregator:jl},Symbol.toStringTag,{value:"Module"})),zhe={ClusterTileLayer:Zx,H3TileLayer:Kx,HeatmapTileLayer:Qx,PointLabelLayer:ew,QuadbinTileLayer:z_,RasterTileLayer:rw,VectorTileLayer:nw};function $b(r,e=""){if(!r)throw new Error(`JSON conversion error ${e}`)}function Vhe(r,e){const t=Hhe(e);let i=r;for(const n of t)i=jhe(i)?i[n]:void 0;return i}function jhe(r){return r!==null&&typeof r=="object"}const kM={};function Hhe(r){if(typeof r=="string"){let e=kM[r];return e||(e=r.split("."),kM[r]=e),e}return Array.isArray(r)?r:[r]}var Fg={exports:{}},LM;function Ghe(){return LM||(LM=1,function(r,e){(function(t){var i="Compound",n="Identifier",o="MemberExpression",s="Literal",u="ThisExpression",d="CallExpression",v="UnaryExpression",x="BinaryExpression",C="LogicalExpression",P="ConditionalExpression",F="ArrayExpression",N=46,V=44,G=39,U=34,j=40,Z=41,he=91,te=93,ae=63,ve=59,De=58,fe=function(St,it){var lr=new Error(St+" at character "+it);throw lr.index=it,lr.description=St,lr},ge=!0,pe={"-":ge,"!":ge,"~":ge,"+":ge},W={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},J=function(St){var it=0,lr;for(var $t in St)(lr=$t.length)>it&&St.hasOwnProperty($t)&&(it=lr);return it},Te=J(pe),$e=J(W),xe={true:!0,false:!1,null:null},Le="this",Ve=function(St){return W[St]||0},Ke=function(St,it,lr){var $t=St==="||"||St==="&&"?C:x;return{type:$t,operator:St,left:it,right:lr}},rt=function(St){return St>=48&&St<=57},Je=function(St){return St===36||St===95||St>=65&&St<=90||St>=97&&St<=122||St>=128&&!W[String.fromCharCode(St)]},lt=function(St){return St===36||St===95||St>=65&&St<=90||St>=97&&St<=122||St>=48&&St<=57||St>=128&&!W[String.fromCharCode(St)]},mt=function(St){for(var it=0,lr=St.charAt,$t=St.charCodeAt,Wt=function(Ut){return lr.call(St,Ut)},kt=function(Ut){return $t.call(St,Ut)},cr=St.length,ti=function(){for(var Ut=kt(it);Ut===32||Ut===9||Ut===10||Ut===13;)Ut=kt(++it)},Er=function(){var Ut=Pi(),dr,Sr;if(ti(),kt(it)===ae){if(it++,dr=Er(),dr||fe("Expected expression",it),ti(),kt(it)===De)return it++,Sr=Er(),Sr||fe("Expected expression",it),{type:P,test:Ut,consequent:dr,alternate:Sr};fe("Expected :",it)}else return Ut},Ar=function(){ti();for(var Ut=St.substr(it,$e),dr=Ut.length;dr>0;){if(W.hasOwnProperty(Ut)&&(!Je(kt(it))||it+Ut.length<St.length&&!lt(kt(it+Ut.length))))return it+=dr,Ut;Ut=Ut.substr(0,--dr)}return!1},Pi=function(){var Ut,dr,Sr,Kr,cn,Re,Ft,jt,sr;if(Re=fr(),dr=Ar(),!dr)return Re;for(cn={value:dr,prec:Ve(dr)},Ft=fr(),Ft||fe("Expected expression after "+dr,it),Kr=[Re,cn,Ft];(dr=Ar())&&(Sr=Ve(dr),Sr!==0);){for(cn={value:dr,prec:Sr},sr=dr;Kr.length>2&&Sr<=Kr[Kr.length-2].prec;)Ft=Kr.pop(),dr=Kr.pop().value,Re=Kr.pop(),Ut=Ke(dr,Re,Ft),Kr.push(Ut);Ut=fr(),Ut||fe("Expected expression after "+sr,it),Kr.push(cn,Ut)}for(jt=Kr.length-1,Ut=Kr[jt];jt>1;)Ut=Ke(Kr[jt-1].value,Kr[jt-2],Ut),jt-=2;return Ut},fr=function(){var Ut,dr,Sr;if(ti(),Ut=kt(it),rt(Ut)||Ut===N)return pr();if(Ut===G||Ut===U)return ri();if(Ut===he)return Xi();for(dr=St.substr(it,Te),Sr=dr.length;Sr>0;){if(pe.hasOwnProperty(dr)&&(!Je(kt(it))||it+dr.length<St.length&&!lt(kt(it+dr.length))))return it+=Sr,{type:v,operator:dr,argument:fr(),prefix:!0};dr=dr.substr(0,--Sr)}return Je(Ut)||Ut===j?Gi():!1},pr=function(){for(var Ut="",dr,Sr;rt(kt(it));)Ut+=Wt(it++);if(kt(it)===N)for(Ut+=Wt(it++);rt(kt(it));)Ut+=Wt(it++);if(dr=Wt(it),dr==="e"||dr==="E"){for(Ut+=Wt(it++),dr=Wt(it),(dr==="+"||dr==="-")&&(Ut+=Wt(it++));rt(kt(it));)Ut+=Wt(it++);rt(kt(it-1))||fe("Expected exponent ("+Ut+Wt(it)+")",it)}return Sr=kt(it),Je(Sr)?fe("Variable names cannot start with a number ("+Ut+Wt(it)+")",it):Sr===N&&fe("Unexpected period",it),{type:s,value:parseFloat(Ut),raw:Ut}},ri=function(){for(var Ut="",dr=Wt(it++),Sr=!1,Kr;it<cr;)if(Kr=Wt(it++),Kr===dr){Sr=!0;break}else if(Kr==="\\")switch(Kr=Wt(it++),Kr){case"n":Ut+=`
3865
- `;break;case"r":Ut+="\r";break;case"t":Ut+=" ";break;case"b":Ut+="\b";break;case"f":Ut+="\f";break;case"v":Ut+="\v";break;default:Ut+=Kr}else Ut+=Kr;return Sr||fe('Unclosed quote after "'+Ut+'"',it),{type:s,value:Ut,raw:dr+Ut+dr}},Pr=function(){var Ut=kt(it),dr=it,Sr;for(Je(Ut)?it++:fe("Unexpected "+Wt(it),it);it<cr&&(Ut=kt(it),lt(Ut));)it++;return Sr=St.slice(dr,it),xe.hasOwnProperty(Sr)?{type:s,value:xe[Sr],raw:Sr}:Sr===Le?{type:u}:{type:n,name:Sr}},Qi=function(Ut){for(var dr,Sr=[],Kr,cn=!1,Re=0;it<cr;)if(ti(),dr=kt(it),dr===Ut){cn=!0,it++,Ut===Z&&Re&&Re>=Sr.length&&fe("Unexpected token "+String.fromCharCode(Ut),it);break}else if(dr===V){if(it++,Re++,Re!==Sr.length){if(Ut===Z)fe("Unexpected token ,",it);else if(Ut===te)for(var Ft=Sr.length;Ft<Re;Ft++)Sr.push(null)}}else Kr=Er(),(!Kr||Kr.type===i)&&fe("Expected comma",it),Sr.push(Kr);return cn||fe("Expected "+String.fromCharCode(Ut),it),Sr},Gi=function(){var Ut,dr;for(Ut=kt(it),Ut===j?dr=ci():dr=Pr(),ti(),Ut=kt(it);Ut===N||Ut===he||Ut===j;)it++,Ut===N?(ti(),dr={type:o,computed:!1,object:dr,property:Pr()}):Ut===he?(dr={type:o,computed:!0,object:dr,property:Er()},ti(),Ut=kt(it),Ut!==te&&fe("Unclosed [",it),it++):Ut===j&&(dr={type:d,arguments:Qi(Z),callee:dr}),ti(),Ut=kt(it);return dr},ci=function(){it++;var Ut=Er();if(ti(),kt(it)===Z)return it++,Ut;fe("Unclosed (",it)},Xi=function(){return it++,{type:F,elements:Qi(te)}},ki=[],yi,Wi;it<cr;)yi=kt(it),yi===ve||yi===V?it++:(Wi=Er())?ki.push(Wi):it<cr&&fe('Unexpected "'+Wt(it)+'"',it);return ki.length===1?ki[0]:{type:i,body:ki}};mt.version="0.3.5",mt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+mt.version},mt.addUnaryOp=function(St){return Te=Math.max(St.length,Te),pe[St]=ge,this},mt.addBinaryOp=function(St,it){return $e=Math.max(St.length,$e),W[St]=it,this},mt.addLiteral=function(St,it){return xe[St]=it,this},mt.removeUnaryOp=function(St){return delete pe[St],St.length===Te&&(Te=J(pe)),this},mt.removeAllUnaryOps=function(){return pe={},Te=0,this},mt.removeBinaryOp=function(St){return delete W[St],St.length===$e&&($e=J(W)),this},mt.removeAllBinaryOps=function(){return W={},$e=0,this},mt.removeLiteral=function(St){return delete xe[St],this},mt.removeAllLiterals=function(){return xe={},this},r.exports?e=r.exports=mt:e.parse=mt})()}(Fg,Fg.exports)),Fg.exports}var Whe=Ghe();const qhe=Uh(Whe),NM={"||":(r,e)=>r||e,"&&":(r,e)=>r&&e,"|":(r,e)=>r|e,"^":(r,e)=>r^e,"&":(r,e)=>r&e,"==":(r,e)=>r==e,"!=":(r,e)=>r!=e,"===":(r,e)=>r===e,"!==":(r,e)=>r!==e,"<":(r,e)=>r<e,">":(r,e)=>r>e,"<=":(r,e)=>r<=e,">=":(r,e)=>r>=e,"<<":(r,e)=>r<<e,">>":(r,e)=>r>>e,">>>":(r,e)=>r>>>e,"+":(r,e)=>r+e,"-":(r,e)=>r-e,"*":(r,e)=>r*e,"/":(r,e)=>r/e,"%":(r,e)=>r%e},Xhe={"-":r=>-r,"+":r=>+r,"~":r=>~r,"!":r=>!r};function UM(r,e){return r.map(function(t){return Ns(t,e)})}function zM(r,e){const t=Ns(r.object,e);let i;if(r.computed?i=Ns(r.property,e):i=r.property.name,/^__proto__|prototype|constructor$/.test(i))throw Error(`Access to member "${i}" disallowed.`);return[t,t[i]]}function Ns(r,e){const t=r;switch(t.type){case"ArrayExpression":return UM(t.elements,e);case"BinaryExpression":return NM[t.operator](Ns(t.left,e),Ns(t.right,e));case"CallExpression":let i,n,o;return t.callee.type==="MemberExpression"?(o=zM(t.callee,e),i=o[0],n=o[1]):n=Ns(t.callee,e),typeof n!="function"?void 0:n.apply(i,UM(t.arguments,e));case"ConditionalExpression":return Ns(t.test,e)?Ns(t.consequent,e):Ns(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return t.operator==="||"?Ns(t.left,e)||Ns(t.right,e):t.operator==="&&"?Ns(t.left,e)&&Ns(t.right,e):NM[t.operator](Ns(t.left,e),Ns(t.right,e));case"MemberExpression":return zM(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return Xhe[t.operator](Ns(t.argument,e));default:return}}const _1={"-":r=>r};function UD(r,e){if(r in _1)return _1[r];let t;const i=qhe(r);return i.type==="Identifier"?t=n=>Vhe(n,r):(Zb(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),t=n=>Ns(i,n)),_1[r]=t,t}function Zb(r,e){if(Array.isArray(r))r.forEach(t=>Zb(t,e));else if(r&&typeof r=="object"){r.type&&e(r);for(const t in r)Zb(r[t],e)}}const zm="@@=",VM="@@#",$he="@@type",zD="@@function",jM=r=>r&&typeof r=="object";class Yb{constructor(...e){this.typeKey=$he,this.functionKey=zD,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=UD,this.preProcessClassProps=(t,i)=>i,this.postProcessConvertedJson=t=>t;for(const t of e)this.merge(t)}merge(e){for(const t in e)switch(t){case"layers":case"views":Object.assign(this.classes,e[t]);break;default:if(t in this){const i=e[t];this[t]=jM(this[t])?Object.assign(this[t],i):i}}}validate(e){return $b(!this.typeKey||typeof this.typeKey=="string"),$b(jM(this.classes)),!0}}function Zhe(r){return typeof r=="string"&&r.startsWith(zm)}function Yhe(r){return r.replace(zm,"")}function VD(r,e){const t={};for(const i in r){let n=r[i];Zhe(n)&&(n=Yhe(n),n=UD(n)),t[i]=n}return t}function Khe(r,e,t){const i=t.classes[r],n=t.reactComponents[r];if(!i&&!n){const{log:o}=t;if(o){const s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${r}(${s}...) `)}return null}return i?Jhe(i,e,t):Qhe(n,e,t)}function Jhe(r,e,t){return t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=VD(e),new r(e)}function Qhe(r,e,t){const{React:i}=t,{children:n=[]}=e;return delete e.children,t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=VD(e),i.createElement(r,e,n)}function efe(r,e,t){const i=t.functions[r];if(!i){const{log:n}=t;if(n){const o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${r}(${o}...) `)}return null}return i(e)}function tfe(r){return typeof r=="string"?JSON.parse(r):r}const yw=r=>r&&typeof r=="object";class rfe{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 Yb?e.configuration:new Yb(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 t=tfe(e);let i=ife(t,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}}function ife(r,e){return e=new Yb(e),vw(r,"",e)}function vw(r,e,t){return Array.isArray(r)?r.map((i,n)=>vw(i,String(n),t)):nfe(r,t)?sfe(r,t):yw(r)?zD in r?ofe(r,t):bw(r,t):typeof r=="string"?afe(r,e,t):r}function nfe(r,e){const{typeKey:t}=e;return yw(r)&&!!r[t]}function sfe(r,e){const{typeKey:t}=e,i=r[t];let n={...r};return delete n[t],n=bw(n,e),Khe(i,n,e)}function ofe(r,e){const{functionKey:t}=e,i=r[t];let n={...r};return delete n[t],n=bw(n,e),efe(i,n,e)}function bw(r,e){$b(yw(r));const t={};for(const i in r){const n=r[i];t[i]=vw(n,i,e)}return t}function afe(r,e,t){if(r.startsWith(zm)&&t.convertFunction)return r=r.replace(zm,""),t.convertFunction(r,t);if(r.startsWith(VM)){if(r=r.replace(VM,""),t.constants[r])return t.constants[r];const[i,n]=r.split(".");return t.enumerations[i][n]}return r}const lfe={classes:{...Oee,...Uhe,...mae,...ene,...zhe},functions:{colorBins:Xce,colorCategories:$ce,colorContinuous:Zce}},jD=new rfe({configuration:lfe}),cfe={[F_.layerName]:["getFillColor"],[M_.layerName]:["getFillColor"],[Xl.layerName]:["getFillColor"],[iA.layerName]:["getFillColor"],[T_.layerName]:["getFillColor"],[w_.layerName]:["getFillColor"],[C_.layerName]:["getColor"],[Xp.layerName]:["getTargetColor","getSourceColor"],[kc.layerName]:["getFillColor"],[Lc.layerName]:["getFillColor"],[rA.layerName]:["getColor"],[$p.layerName]:["getColor"],[Wh.layerName]:["getColor"],[Zp.layerName]:["getColor"],[Vu.layerName]:["getFillColor"],[Yp.layerName]:["getFillColor","getColor","getLineColor"],[zu.layerName]:["getFillColor"],[qh.layerName]:["getColor"],[e0.layerName]:["getColor"],[kh.layerName]:["getColor"]},ufe=({object:r,objectInfo:e,originalFillFunction:t})=>{const i=typeof t=="function"?t(r,e):t;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=jD.convert({originalColor:i}).originalColor(r);return[n[0]||0,n[1]||0,n[2]||0,n[3]||255]}return null},HM=({isSelected:r,object:e,objectInfo:t,opacity:i,originalFillFunction:n})=>{const o=ufe({object:e,objectInfo:t,originalFillFunction:n});if(!o)return null;let s=0;return r?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]},hfe=({isSelected:r,object:e,objectInfo:t,originalFillFunction:i,selectedColor:n,selectedOpacity:o=255,unselectedColor:s,unselectedOpacity:u=Math.floor(255*.4)})=>r?HM({opacity:o,isSelected:!0,object:e,objectInfo:t,originalFillFunction:i})||n:HM({opacity:u,isSelected:!1,object:e,objectInfo:t,originalFillFunction:i})||s,Up={selection:{indices:{},objects:{}}},GM=(r,e)=>{const t=e.match(/{(.*?)}/g);return t&&t.forEach(i=>{const n=i.substring(1,i.length-1);r.object.hasOwnProperty(n)?e=e.replace(i,r.object[n]):r.object.hasOwnProperty("properties")&&r.object.properties.hasOwnProperty(n)&&(e=e.replace(i,r.object.properties[n]))}),e};function ffe(r,e){return e.id?r.getElementState(e.id,"selection")??Up:Up}function dfe(r,e){if(!e.id)return Up;const t=r.getStringValue(e);return(t?b1.parse(t):null)??Up}function Afe(r,e,t,i){r.id&&e.setStringValue(r,JSON.stringify(t.value),{fromUi:t.fromUi},i)}const pfe=r=>{var W;const{height:e,width:t,expanded:i}=ZM(YM),{element:n,fragmentId:o,isLightTheme:s,theme:u,widgetMgr:d}=r,{selectionMode:v,tooltip:x,useContainerWidth:C}=n,P=i??!1,[F,N]=Fk({element:n,getDefaultState:ffe,getStateFromWidgetMgr:dfe,updateWidgetMgrState:Afe,widgetMgr:d,fragmentId:o}),[V,G]=Ct.useState({bearing:0,pitch:0,zoom:11}),{height:U,width:j}=OJ({element:n,isFullScreen:P,shouldUseContainerWidth:C,container:{height:e,width:t},heightFallback:((W=V.initialViewState)==null?void 0:W.height)||u.sizes.defaultMapHeight}),[Z,he]=Ct.useState({}),te=v[0],ae=te!==void 0,ve=ae&&Object.keys(F.selection.indices).length>0,De=Ct.useMemo(()=>Object.freeze(b1.parse(n.json)),[P,s,n.json]),fe=Ct.useMemo(()=>{const J={...De};if(J.mapStyle||(J.mapStyle=`mapbox://styles/mapbox/${s?"light":"dark"}-v9`),J.layers){const Te=Object.values(F.selection.indices).some(xe=>xe==null?void 0:xe.length),$e=J.layers.some(xe=>Object.hasOwn(xe,"pickable"));J.layers=J.layers.map(xe=>{var Je,lt;if(!xe||Array.isArray(xe)||!ae)return xe;$e||(xe.pickable=!0);const Le=`${xe.id||null}`,Ve=((lt=(Je=F==null?void 0:F.selection)==null?void 0:Je.indices)==null?void 0:lt[Le])||[],Ke=cfe[xe["@@type"]];if(!Ke)return xe;const rt={...xe};return Ke.forEach(mt=>{var Ar;rt.updateTriggers={[mt]:[...((Ar=rt.updateTriggers)==null?void 0:Ar[mt])||[],Ve,Te]};const St=!Te,it=xe[mt];if(St||!it)return rt;const lr=255,$t=Math.floor(255*.4),Wt=GT(u.colors.primary),kt=[Wt[0],Wt[1],Wt[2],lr],cr=GT(u.colors.gray20),ti=[cr[0],cr[1],cr[2],$t],Er=(Pi,fr)=>hfe({isSelected:Ve.includes(fr.index),object:Pi,objectInfo:fr,originalFillFunction:it,selectedColor:kt,unselectedColor:ti,selectedOpacity:lr,unselectedOpacity:$t});rt[mt]=Er}),rt})}return J==null||delete J.views,jD.convert(J)},[F.selection.indices,s,ae,De,u.colors.gray20,u.colors.primary]);Ct.useEffect(()=>{if(!Ck(fe.initialViewState,Z)){const J=Object.keys(fe.initialViewState).reduce((Te,$e)=>fe.initialViewState[$e]===Z[$e]?Te:{...Te,[$e]:fe.initialViewState[$e]},{});G({...V,...J}),he(fe.initialViewState)}},[fe.initialViewState,Z,V]);const ge=Ct.useCallback(J=>{if(!J||!J.object||!x)return null;const Te=b1.parse(x);return Te.html?Te.html=GM(J,Te.html):Te.text=GM(J,Te.text),Te},[x]),pe=Ct.useCallback(({viewState:J})=>{G(J)},[G]);return{createTooltip:ge,data:F,deck:fe,hasActiveSelection:ve,height:U,isSelectionModeActivated:ae,onViewStateChange:pe,selectionMode:te,setSelection:N,viewState:V,width:j}};Hp([Q2,qd]);const y1=Up.selection,gfe=[],mfe=r=>{const{disabled:e,disableFullscreenMode:t,element:i,fragmentId:n,mapboxToken:o,widgetMgr:s}=r,{mapboxToken:u}=i,d=Pk(),{expanded:v,expand:x,collapse:C}=ZM(YM),{createTooltip:P,data:F,deck:N,hasActiveSelection:V,height:G,isSelectionModeActivated:U,onViewStateChange:j,selectionMode:Z,setSelection:he,viewState:te,width:ae}=pfe({element:i,fragmentId:n,isLightTheme:$M(d),theme:d,widgetMgr:s}),[ve,De]=Ct.useState(!1);Ct.useEffect(()=>{De(!0)},[]);const fe=Ct.useCallback(pe=>{var Ke;if(Z===void 0)return;const{index:W,object:J}=pe,Te=`${((Ke=pe.layer)==null?void 0:Ke.id)||null}`,$e=F,xe=W===-1,Ve=(()=>{var rt;if(xe)return y1;switch(Z){case WT.SelectionMode.SINGLE_OBJECT:return((rt=$e.selection.indices[Te])==null?void 0:rt[0])===W?y1:{indices:{[`${Te}`]:[W]},objects:{[`${Te}`]:[J]}};case WT.SelectionMode.MULTI_OBJECT:{const Je=new Map((()=>{var mt,St;return(((St=(mt=$e==null?void 0:$e.selection)==null?void 0:mt.indices)==null?void 0:St[Te])||[]).map((it,lr)=>{var $t,Wt,kt;return[it,(kt=(Wt=($t=$e.selection)==null?void 0:$t.objects)==null?void 0:Wt[Te])==null?void 0:kt[lr]]})})());if(Je.has(W)?Je.delete(W):Je.set(W,J),Je.size===0){const{[Te]:lt,...mt}=$e.selection.indices,{[Te]:St,...it}=$e.selection.objects;return{indices:mt,objects:it}}return{indices:{...$e.selection.indices,[`${Te}`]:Array.from(Je.keys())},objects:{...$e.selection.objects,[`${Te}`]:Array.from(Je.values())}}}default:throw Ik(Z),new Error("Invalid selection mode")}})();JSON.stringify(Ve)!==JSON.stringify($e.selection)&&he({fromUi:!0,value:{selection:Ve}})},[Z,F,he]),ge=Ct.useCallback(()=>{he({value:{selection:y1},fromUi:!0})},[he]);return Fl(u3,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",height:G,children:[Es(Ok,{isFullScreen:v,disableFullscreenMode:t,onExpand:x,onCollapse:C,target:u3,locked:V&&!e?!0:void 0,children:V&&!e&&Es(Bk,{label:"Clear selection",onClick:ge,icon:Rk})}),Fl(Cq,{viewState:te,onViewStateChange:j,height:G,width:ae,layers:ve?N.layers:gfe,getTooltip:P,ContextProvider:Gh.Provider,controller:!0,onClick:U&&!e?fe:void 0,children:[Es(Fc,{height:G,width:ae,mapStyle:N.mapStyle&&(typeof N.mapStyle=="string"?N.mapStyle:N.mapStyle[0]),mapboxApiAccessToken:u||o}),Es(BJ,{children:Es(aZ,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})},Ufe=Ct.memo(Dk(RJ("st.pydeck_chart")(mfe)));export{Ufe as default};
3865
+ `;break;case"r":Ut+="\r";break;case"t":Ut+=" ";break;case"b":Ut+="\b";break;case"f":Ut+="\f";break;case"v":Ut+="\v";break;default:Ut+=Kr}else Ut+=Kr;return Sr||fe('Unclosed quote after "'+Ut+'"',it),{type:s,value:Ut,raw:dr+Ut+dr}},Pr=function(){var Ut=kt(it),dr=it,Sr;for(Je(Ut)?it++:fe("Unexpected "+Wt(it),it);it<cr&&(Ut=kt(it),lt(Ut));)it++;return Sr=St.slice(dr,it),xe.hasOwnProperty(Sr)?{type:s,value:xe[Sr],raw:Sr}:Sr===Le?{type:u}:{type:n,name:Sr}},Qi=function(Ut){for(var dr,Sr=[],Kr,cn=!1,Re=0;it<cr;)if(ti(),dr=kt(it),dr===Ut){cn=!0,it++,Ut===Z&&Re&&Re>=Sr.length&&fe("Unexpected token "+String.fromCharCode(Ut),it);break}else if(dr===V){if(it++,Re++,Re!==Sr.length){if(Ut===Z)fe("Unexpected token ,",it);else if(Ut===te)for(var Ft=Sr.length;Ft<Re;Ft++)Sr.push(null)}}else Kr=Er(),(!Kr||Kr.type===i)&&fe("Expected comma",it),Sr.push(Kr);return cn||fe("Expected "+String.fromCharCode(Ut),it),Sr},Gi=function(){var Ut,dr;for(Ut=kt(it),Ut===j?dr=ci():dr=Pr(),ti(),Ut=kt(it);Ut===N||Ut===he||Ut===j;)it++,Ut===N?(ti(),dr={type:o,computed:!1,object:dr,property:Pr()}):Ut===he?(dr={type:o,computed:!0,object:dr,property:Er()},ti(),Ut=kt(it),Ut!==te&&fe("Unclosed [",it),it++):Ut===j&&(dr={type:d,arguments:Qi(Z),callee:dr}),ti(),Ut=kt(it);return dr},ci=function(){it++;var Ut=Er();if(ti(),kt(it)===Z)return it++,Ut;fe("Unclosed (",it)},Xi=function(){return it++,{type:F,elements:Qi(te)}},ki=[],yi,Wi;it<cr;)yi=kt(it),yi===ve||yi===V?it++:(Wi=Er())?ki.push(Wi):it<cr&&fe('Unexpected "'+Wt(it)+'"',it);return ki.length===1?ki[0]:{type:i,body:ki}};mt.version="0.3.5",mt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+mt.version},mt.addUnaryOp=function(St){return Te=Math.max(St.length,Te),pe[St]=ge,this},mt.addBinaryOp=function(St,it){return $e=Math.max(St.length,$e),W[St]=it,this},mt.addLiteral=function(St,it){return xe[St]=it,this},mt.removeUnaryOp=function(St){return delete pe[St],St.length===Te&&(Te=J(pe)),this},mt.removeAllUnaryOps=function(){return pe={},Te=0,this},mt.removeBinaryOp=function(St){return delete W[St],St.length===$e&&($e=J(W)),this},mt.removeAllBinaryOps=function(){return W={},$e=0,this},mt.removeLiteral=function(St){return delete xe[St],this},mt.removeAllLiterals=function(){return xe={},this},r.exports?e=r.exports=mt:e.parse=mt})()}(Fg,Fg.exports)),Fg.exports}var Whe=Ghe();const qhe=Uh(Whe),NM={"||":(r,e)=>r||e,"&&":(r,e)=>r&&e,"|":(r,e)=>r|e,"^":(r,e)=>r^e,"&":(r,e)=>r&e,"==":(r,e)=>r==e,"!=":(r,e)=>r!=e,"===":(r,e)=>r===e,"!==":(r,e)=>r!==e,"<":(r,e)=>r<e,">":(r,e)=>r>e,"<=":(r,e)=>r<=e,">=":(r,e)=>r>=e,"<<":(r,e)=>r<<e,">>":(r,e)=>r>>e,">>>":(r,e)=>r>>>e,"+":(r,e)=>r+e,"-":(r,e)=>r-e,"*":(r,e)=>r*e,"/":(r,e)=>r/e,"%":(r,e)=>r%e},Xhe={"-":r=>-r,"+":r=>+r,"~":r=>~r,"!":r=>!r};function UM(r,e){return r.map(function(t){return Ns(t,e)})}function zM(r,e){const t=Ns(r.object,e);let i;if(r.computed?i=Ns(r.property,e):i=r.property.name,/^__proto__|prototype|constructor$/.test(i))throw Error(`Access to member "${i}" disallowed.`);return[t,t[i]]}function Ns(r,e){const t=r;switch(t.type){case"ArrayExpression":return UM(t.elements,e);case"BinaryExpression":return NM[t.operator](Ns(t.left,e),Ns(t.right,e));case"CallExpression":let i,n,o;return t.callee.type==="MemberExpression"?(o=zM(t.callee,e),i=o[0],n=o[1]):n=Ns(t.callee,e),typeof n!="function"?void 0:n.apply(i,UM(t.arguments,e));case"ConditionalExpression":return Ns(t.test,e)?Ns(t.consequent,e):Ns(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return t.operator==="||"?Ns(t.left,e)||Ns(t.right,e):t.operator==="&&"?Ns(t.left,e)&&Ns(t.right,e):NM[t.operator](Ns(t.left,e),Ns(t.right,e));case"MemberExpression":return zM(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return Xhe[t.operator](Ns(t.argument,e));default:return}}const _1={"-":r=>r};function UD(r,e){if(r in _1)return _1[r];let t;const i=qhe(r);return i.type==="Identifier"?t=n=>Vhe(n,r):(Zb(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),t=n=>Ns(i,n)),_1[r]=t,t}function Zb(r,e){if(Array.isArray(r))r.forEach(t=>Zb(t,e));else if(r&&typeof r=="object"){r.type&&e(r);for(const t in r)Zb(r[t],e)}}const zm="@@=",VM="@@#",$he="@@type",zD="@@function",jM=r=>r&&typeof r=="object";class Yb{constructor(...e){this.typeKey=$he,this.functionKey=zD,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=UD,this.preProcessClassProps=(t,i)=>i,this.postProcessConvertedJson=t=>t;for(const t of e)this.merge(t)}merge(e){for(const t in e)switch(t){case"layers":case"views":Object.assign(this.classes,e[t]);break;default:if(t in this){const i=e[t];this[t]=jM(this[t])?Object.assign(this[t],i):i}}}validate(e){return $b(!this.typeKey||typeof this.typeKey=="string"),$b(jM(this.classes)),!0}}function Zhe(r){return typeof r=="string"&&r.startsWith(zm)}function Yhe(r){return r.replace(zm,"")}function VD(r,e){const t={};for(const i in r){let n=r[i];Zhe(n)&&(n=Yhe(n),n=UD(n)),t[i]=n}return t}function Khe(r,e,t){const i=t.classes[r],n=t.reactComponents[r];if(!i&&!n){const{log:o}=t;if(o){const s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${r}(${s}...) `)}return null}return i?Jhe(i,e,t):Qhe(n,e,t)}function Jhe(r,e,t){return t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=VD(e),new r(e)}function Qhe(r,e,t){const{React:i}=t,{children:n=[]}=e;return delete e.children,t.preProcessClassProps&&(e=t.preProcessClassProps(r,e,t)),e=VD(e),i.createElement(r,e,n)}function efe(r,e,t){const i=t.functions[r];if(!i){const{log:n}=t;if(n){const o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${r}(${o}...) `)}return null}return i(e)}function tfe(r){return typeof r=="string"?JSON.parse(r):r}const yw=r=>r&&typeof r=="object";class rfe{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 Yb?e.configuration:new Yb(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 t=tfe(e);let i=ife(t,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}}function ife(r,e){return e=new Yb(e),vw(r,"",e)}function vw(r,e,t){return Array.isArray(r)?r.map((i,n)=>vw(i,String(n),t)):nfe(r,t)?sfe(r,t):yw(r)?zD in r?ofe(r,t):bw(r,t):typeof r=="string"?afe(r,e,t):r}function nfe(r,e){const{typeKey:t}=e;return yw(r)&&!!r[t]}function sfe(r,e){const{typeKey:t}=e,i=r[t];let n={...r};return delete n[t],n=bw(n,e),Khe(i,n,e)}function ofe(r,e){const{functionKey:t}=e,i=r[t];let n={...r};return delete n[t],n=bw(n,e),efe(i,n,e)}function bw(r,e){$b(yw(r));const t={};for(const i in r){const n=r[i];t[i]=vw(n,i,e)}return t}function afe(r,e,t){if(r.startsWith(zm)&&t.convertFunction)return r=r.replace(zm,""),t.convertFunction(r,t);if(r.startsWith(VM)){if(r=r.replace(VM,""),t.constants[r])return t.constants[r];const[i,n]=r.split(".");return t.enumerations[i][n]}return r}const lfe={classes:{...Oee,...Uhe,...mae,...ene,...zhe},functions:{colorBins:Xce,colorCategories:$ce,colorContinuous:Zce}},jD=new rfe({configuration:lfe}),cfe={[F_.layerName]:["getFillColor"],[M_.layerName]:["getFillColor"],[Xl.layerName]:["getFillColor"],[iA.layerName]:["getFillColor"],[T_.layerName]:["getFillColor"],[w_.layerName]:["getFillColor"],[C_.layerName]:["getColor"],[Xp.layerName]:["getTargetColor","getSourceColor"],[kc.layerName]:["getFillColor"],[Lc.layerName]:["getFillColor"],[rA.layerName]:["getColor"],[$p.layerName]:["getColor"],[Wh.layerName]:["getColor"],[Zp.layerName]:["getColor"],[Vu.layerName]:["getFillColor"],[Yp.layerName]:["getFillColor","getColor","getLineColor"],[zu.layerName]:["getFillColor"],[qh.layerName]:["getColor"],[e0.layerName]:["getColor"],[kh.layerName]:["getColor"]},ufe=({object:r,objectInfo:e,originalFillFunction:t})=>{const i=typeof t=="function"?t(r,e):t;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=jD.convert({originalColor:i}).originalColor(r);return[n[0]||0,n[1]||0,n[2]||0,n[3]||255]}return null},HM=({isSelected:r,object:e,objectInfo:t,opacity:i,originalFillFunction:n})=>{const o=ufe({object:e,objectInfo:t,originalFillFunction:n});if(!o)return null;let s=0;return r?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]},hfe=({isSelected:r,object:e,objectInfo:t,originalFillFunction:i,selectedColor:n,selectedOpacity:o=255,unselectedColor:s,unselectedOpacity:u=Math.floor(255*.4)})=>r?HM({opacity:o,isSelected:!0,object:e,objectInfo:t,originalFillFunction:i})||n:HM({opacity:u,isSelected:!1,object:e,objectInfo:t,originalFillFunction:i})||s,Up={selection:{indices:{},objects:{}}},GM=(r,e)=>{const t=e.match(/{(.*?)}/g);return t&&t.forEach(i=>{const n=i.substring(1,i.length-1);r.object.hasOwnProperty(n)?e=e.replace(i,r.object[n]):r.object.hasOwnProperty("properties")&&r.object.properties.hasOwnProperty(n)&&(e=e.replace(i,r.object.properties[n]))}),e};function ffe(r,e){return e.id?r.getElementState(e.id,"selection")??Up:Up}function dfe(r,e){if(!e.id)return Up;const t=r.getStringValue(e);return(t?b1.parse(t):null)??Up}function Afe(r,e,t,i){r.id&&e.setStringValue(r,JSON.stringify(t.value),{fromUi:t.fromUi},i)}const pfe=r=>{var W;const{height:e,width:t,expanded:i}=ZM(YM),{element:n,fragmentId:o,isLightTheme:s,theme:u,widgetMgr:d}=r,{selectionMode:v,tooltip:x,useContainerWidth:C}=n,P=i??!1,[F,N]=Fk({element:n,getDefaultState:ffe,getStateFromWidgetMgr:dfe,updateWidgetMgrState:Afe,widgetMgr:d,fragmentId:o}),[V,G]=Ct.useState({bearing:0,pitch:0,zoom:11}),{height:U,width:j}=OJ({element:n,isFullScreen:P,shouldUseContainerWidth:C,container:{height:e,width:t},heightFallback:((W=V.initialViewState)==null?void 0:W.height)||u.sizes.defaultMapHeight}),[Z,he]=Ct.useState({}),te=v[0],ae=te!==void 0,ve=ae&&Object.keys(F.selection.indices).length>0,De=Ct.useMemo(()=>Object.freeze(b1.parse(n.json)),[P,s,n.json]),fe=Ct.useMemo(()=>{const J={...De};if(J.mapStyle||(J.mapStyle=`mapbox://styles/mapbox/${s?"light":"dark"}-v9`),J.layers){const Te=Object.values(F.selection.indices).some(xe=>xe==null?void 0:xe.length),$e=J.layers.some(xe=>Object.hasOwn(xe,"pickable"));J.layers=J.layers.map(xe=>{var Je,lt;if(!xe||Array.isArray(xe)||!ae)return xe;$e||(xe.pickable=!0);const Le=`${xe.id||null}`,Ve=((lt=(Je=F==null?void 0:F.selection)==null?void 0:Je.indices)==null?void 0:lt[Le])||[],Ke=cfe[xe["@@type"]];if(!Ke)return xe;const rt={...xe};return Ke.forEach(mt=>{var Ar;rt.updateTriggers={[mt]:[...((Ar=rt.updateTriggers)==null?void 0:Ar[mt])||[],Ve,Te]};const St=!Te,it=xe[mt];if(St||!it)return rt;const lr=255,$t=Math.floor(255*.4),Wt=GT(u.colors.primary),kt=[Wt[0],Wt[1],Wt[2],lr],cr=GT(u.colors.gray20),ti=[cr[0],cr[1],cr[2],$t],Er=(Pi,fr)=>hfe({isSelected:Ve.includes(fr.index),object:Pi,objectInfo:fr,originalFillFunction:it,selectedColor:kt,unselectedColor:ti,selectedOpacity:lr,unselectedOpacity:$t});rt[mt]=Er}),rt})}return J==null||delete J.views,jD.convert(J)},[F.selection.indices,s,ae,De,u.colors.gray20,u.colors.primary]);Ct.useEffect(()=>{if(!Ck(fe.initialViewState,Z)){const J=Object.keys(fe.initialViewState).reduce((Te,$e)=>fe.initialViewState[$e]===Z[$e]?Te:{...Te,[$e]:fe.initialViewState[$e]},{});G({...V,...J}),he(fe.initialViewState)}},[fe.initialViewState,Z,V]);const ge=Ct.useCallback(J=>{if(!J||!J.object||!x)return null;const Te=b1.parse(x);return Te.html?Te.html=GM(J,Te.html):Te.text=GM(J,Te.text),Te},[x]),pe=Ct.useCallback(({viewState:J})=>{G(J)},[G]);return{createTooltip:ge,data:F,deck:fe,hasActiveSelection:ve,height:U,isSelectionModeActivated:ae,onViewStateChange:pe,selectionMode:te,setSelection:N,viewState:V,width:j}};Hp([Q2,qd]);const y1=Up.selection,gfe=[],mfe=r=>{const{disabled:e,disableFullscreenMode:t,element:i,fragmentId:n,mapboxToken:o,widgetMgr:s}=r,{mapboxToken:u}=i,d=Pk(),{expanded:v,expand:x,collapse:C}=ZM(YM),{createTooltip:P,data:F,deck:N,hasActiveSelection:V,height:G,isSelectionModeActivated:U,onViewStateChange:j,selectionMode:Z,setSelection:he,viewState:te,width:ae}=pfe({element:i,fragmentId:n,isLightTheme:$M(d),theme:d,widgetMgr:s}),[ve,De]=Ct.useState(!1);Ct.useEffect(()=>{De(!0)},[]);const fe=Ct.useCallback(pe=>{var Ke;if(Z===void 0)return;const{index:W,object:J}=pe,Te=`${((Ke=pe.layer)==null?void 0:Ke.id)||null}`,$e=F,xe=W===-1,Ve=(()=>{var rt;if(xe)return y1;switch(Z){case WT.SelectionMode.SINGLE_OBJECT:return((rt=$e.selection.indices[Te])==null?void 0:rt[0])===W?y1:{indices:{[`${Te}`]:[W]},objects:{[`${Te}`]:[J]}};case WT.SelectionMode.MULTI_OBJECT:{const Je=new Map((()=>{var mt,St;return(((St=(mt=$e==null?void 0:$e.selection)==null?void 0:mt.indices)==null?void 0:St[Te])||[]).map((it,lr)=>{var $t,Wt,kt;return[it,(kt=(Wt=($t=$e.selection)==null?void 0:$t.objects)==null?void 0:Wt[Te])==null?void 0:kt[lr]]})})());if(Je.has(W)?Je.delete(W):Je.set(W,J),Je.size===0){const{[Te]:lt,...mt}=$e.selection.indices,{[Te]:St,...it}=$e.selection.objects;return{indices:mt,objects:it}}return{indices:{...$e.selection.indices,[`${Te}`]:Array.from(Je.keys())},objects:{...$e.selection.objects,[`${Te}`]:Array.from(Je.values())}}}default:throw Ik(Z),new Error("Invalid selection mode")}})();JSON.stringify(Ve)!==JSON.stringify($e.selection)&&he({fromUi:!0,value:{selection:Ve}})},[Z,F,he]),ge=Ct.useCallback(()=>{he({value:{selection:y1},fromUi:!0})},[he]);return Fl(u3,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",height:G,children:[Es(Ok,{isFullScreen:v,disableFullscreenMode:t,onExpand:x,onCollapse:C,target:u3,locked:V&&!e?!0:void 0,children:V&&!e&&Es(Bk,{label:"Clear selection",onClick:ge,icon:Rk})}),Fl(Cq,{viewState:te,onViewStateChange:j,height:G,width:ae,layers:ve?N.layers:gfe,getTooltip:P,ContextProvider:Gh.Provider,controller:!0,onClick:U&&!e?fe:void 0,children:[Es(Fc,{height:G,width:ae,mapStyle:N.mapStyle&&(typeof N.mapStyle=="string"?N.mapStyle:N.mapStyle[0]),mapboxApiAccessToken:u||o}),Es(BJ,{children:Es(aZ,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})},_fe=Dk(RJ("st.pydeck_chart")(mfe)),zfe=Ct.memo(_fe);export{zfe as default};
@@ -1 +1 @@
1
- import{n as f,r,j as c}from"./index.od8XlC_e.js";const E=f("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=f("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0}));function A({element:t,endpoints:l,elementMgr:o}){const n=r.useRef(null),{startTime:a,endTime:d,loop:u,autoplay:p}=t,m=r.useMemo(()=>{if(!t.id)return!0;const e=o.getElementState(t.id,"preventAutoplay");return e||o.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,o]);r.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),r.useEffect(()=>{const e=n.current,i=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",i),()=>{e&&e.removeEventListener("loadedmetadata",i)}},[t]),r.useEffect(()=>{const e=n.current;if(!e)return;let i=!1;const s=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=a||0,e.play()):i||(i=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",s),()=>{e&&d>0&&e.removeEventListener("timeupdate",s)}},[d,u,a]),r.useEffect(()=>{const e=n.current;if(!e)return;const i=()=>{u&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",i),()=>{e&&e.removeEventListener("ended",i)}},[u,a]);const v=l.buildMediaURL(t.url);return c(E,{children:c(y,{className:"stAudio","data-testid":"stAudio",ref:n,controls:!0,autoPlay:p&&!m,src:v})})}const h=r.memo(A);export{h as default};
1
+ import{n as f,r,j as c}from"./index.6zGrdP7S.js";const E=f("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=f("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0}));function A({element:t,endpoints:l,elementMgr:o}){const n=r.useRef(null),{startTime:a,endTime:d,loop:u,autoplay:p}=t,m=r.useMemo(()=>{if(!t.id)return!0;const e=o.getElementState(t.id,"preventAutoplay");return e||o.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,o]);r.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),r.useEffect(()=>{const e=n.current,i=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",i),()=>{e&&e.removeEventListener("loadedmetadata",i)}},[t]),r.useEffect(()=>{const e=n.current;if(!e)return;let i=!1;const s=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=a||0,e.play()):i||(i=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",s),()=>{e&&d>0&&e.removeEventListener("timeupdate",s)}},[d,u,a]),r.useEffect(()=>{const e=n.current;if(!e)return;const i=()=>{u&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",i),()=>{e&&e.removeEventListener("ended",i)}},[u,a]);const v=l.buildMediaURL(t.url);return c(E,{children:c(y,{className:"stAudio","data-testid":"stAudio",ref:n,controls:!0,autoPlay:p&&!m,src:v})})}const h=r.memo(A);export{h as default};
@@ -1 +1 @@
1
- import{n as o,r as h,C as c,j as i,aB as S}from"./index.od8XlC_e.js";import{w as y,u as b,E as M}from"./withFullScreenWrapper.CS8vg4vY.js";import{S as g,T as W}from"./Toolbar.mIL79bYR.js";const E=o("div",{target:"evl31sl0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg,maxWidth:"100%",width:"fit-content"})),L=o("div",{target:"evl31sl1"})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:t.radii.default}})),O=o("div",{target:"evl31sl2"})(({theme:t})=>({textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:t.spacing.threeXS}));var p;(function(t){t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t[t.MinImageOrContainer=-4]="MinImageOrContainer",t[t.MaxImageOrContainer=-5]="MaxImageOrContainer"})(p||(p={}));function T({element:t,endpoints:u,disableFullscreenMode:x}){const{expanded:r,width:f,height:s,expand:w,collapse:C}=b(M),d=f||0;let n;const a=t.width;if([-1,-3,-4].includes(a))n=void 0;else if([-2,-5].includes(a))n=d;else if(a>0)n=a;else throw Error(`Invalid image width: ${a}`);const e={};return s&&r?(e.maxHeight=s,e.objectFit="contain"):(e.width=n,e.maxWidth="100%"),c(g,{width:d,height:s,useContainerWidth:r,topCentered:!0,children:[i(W,{target:g,isFullScreen:r,onExpand:w,onCollapse:C,disableFullscreenMode:x}),i(E,{className:"stImage","data-testid":"stImage",children:t.imgs.map((I,m)=>{const l=I;return c(L,{"data-testid":"stImageContainer",children:[i("img",{style:e,src:u.buildMediaURL(l.url),alt:m.toString()}),l.caption&&i(O,{"data-testid":"stImageCaption",style:e,children:i(S,{source:l.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},m)})})]})}const R=h.memo(y(T));export{R as default};
1
+ import{n as o,r as h,C as m,j as i,aB as S}from"./index.6zGrdP7S.js";import{w as y,u as W,E as b}from"./withFullScreenWrapper.HzikaPlG.js";import{S as g,T as L}from"./Toolbar.DGwjBtCI.js";const M=o("div",{target:"evl31sl0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg,maxWidth:"100%",width:"fit-content"})),E=o("div",{target:"evl31sl1"})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:t.radii.default}})),O=o("div",{target:"evl31sl2"})(({theme:t})=>({textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:t.spacing.threeXS}));var p;(function(t){t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t[t.MinImageOrContainer=-4]="MinImageOrContainer",t[t.MaxImageOrContainer=-5]="MaxImageOrContainer"})(p||(p={}));function F({element:t,endpoints:u,disableFullscreenMode:x}){const{expanded:r,width:f,height:s,expand:w,collapse:C}=W(b),d=f||0;let n;const a=t.width;if([-1,-3,-4].includes(a))n=void 0;else if([-2,-5].includes(a))n=d;else if(a>0)n=a;else throw Error(`Invalid image width: ${a}`);const e={};return s&&r?(e.maxHeight=s,e.objectFit="contain"):(e.width=n,e.maxWidth="100%"),m(g,{width:d,height:s,useContainerWidth:r,topCentered:!0,children:[i(L,{target:g,isFullScreen:r,onExpand:w,onCollapse:C,disableFullscreenMode:x}),i(M,{className:"stImage","data-testid":"stImage",children:t.imgs.map((I,c)=>{const l=I;return m(E,{"data-testid":"stImageContainer",children:[i("img",{style:e,src:u.buildMediaURL(l.url),alt:c.toString()}),l.caption&&i(O,{"data-testid":"stImageCaption",style:e,children:i(S,{source:l.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},c)})})]})}const T=y(F),k=h.memo(T);export{k as default};
@@ -1 +1 @@
1
- import{r as p,E as V,_ as z,n as I,C as u,j as r,b4 as U,bo as g,co as E,bp as y,cp as L,aY as B,F as k,bh as W,R as N,az as T,bj as D,K as h,bl as H,bk as A,br as R,bE as $,bs as O,b9 as X,bt as _}from"./index.od8XlC_e.js";import{a as S}from"./index.DW_MHI2K.js";import{F as K}from"./FormClearHelper.D7FpzEHQ.js";import{S as x,I as j,b as q,c as G,d as Y,C as J,e as Q,f as Z,h as ee,i as te,g as b,F as f,j as se,k as ie,l as le,s as ae,m as re,n as ne}from"./FileDropzone.xME_qwl7.js";import{S as oe,P as de}from"./ProgressBar.St3jxlFz.js";import{u as ce}from"./Hooks.Ofd2jLSe.js";import{U as m}from"./UploadFileInfo.C-jY39rj.js";var C=p.forwardRef(function(l,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(V,z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},l,{ref:o}),p.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});C.displayName="Error";const pe=I("div",{target:"egc9vxm0"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:l.spacing.twoXS,marginBottom:l.spacing.twoXS})),ue=I("div",{target:"egc9vxm1"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"center",color:l.colors.fadedText40})),he=({currentPage:l,totalPages:o,onNext:e,onPrevious:t})=>u(pe,{"data-testid":"stFileUploaderPagination",children:[r(x,{children:`Showing page ${l} of ${o}`}),u(ue,{children:[r(y,{onClick:t,kind:U.MINIMAL,children:r(g,{content:E,size:"xl"})}),r(y,{onClick:e,kind:U.MINIMAL,children:r(g,{content:L,size:"xl"})})]})]}),w=(l,o)=>Math.ceil(l.length/o),ge=l=>B(({pageSize:e,items:t,resetOnAdd:s,...a})=>{const[i,n]=p.useState(0),[d,F]=p.useState(w(t,e)),c=ce(t);p.useEffect(()=>{c&&c.length!==t.length&&F(w(t,e)),c&&c.length<t.length?s&&n(0):i+1>=d&&n(d-1)},[t,i,e,c,s,d]);const v=()=>{n(Math.min(i+1,d-1))},M=()=>{n(Math.max(0,i-1))},P=t.slice(i*e,i*e+e);return u(k,{children:[r(l,{items:P,...a}),t.length>e?r(he,{pageSize:e,totalPages:d,currentPage:i+1,onNext:v,onPrevious:M}):null]})},l),me=({fileInfo:l})=>l.status.type==="uploading"?r(de,{value:l.status.progress,size:oe.SMALL}):l.status.type==="error"?u(te,{children:[r(Z,{"data-testid":"stFileUploaderFileErrorMessage",children:l.status.errorMessage}),r(ee,{children:r(g,{content:C,size:"lg"})})]}):l.status.type==="uploaded"?r(x,{children:b(l.size,f.Byte)}):null,fe=({fileInfo:l,onDelete:o})=>u(Q,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[r(q,{children:r(g,{content:j,size:"twoXL"})}),u(G,{className:"stFileUploaderFileData",children:[r(Y,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:l.name,children:l.name}),r(me,{fileInfo:l})]}),r("div",{"data-testid":"stFileUploaderDeleteBtn",children:r(y,{onClick:()=>o(l.id),kind:U.MINIMAL,children:r(g,{content:J,size:"lg"})})})]}),Fe=({items:l,onDelete:o})=>r(le,{children:l.map(e=>r(ie,{children:r(fe,{fileInfo:e,onDelete:o})},e.id))}),Ue=ge(Fe),ye=l=>r(se,{children:r(Ue,{...l})});class Se extends N.PureComponent{constructor(o){super(o),this.formClearHelper=new K,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:a}=this.props,i=s.getFileUploaderStateValue(t);T(e,i)||s.setFileUploaderStateValue(t,e,{fromUi:!0},a)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(e,t)=>{const{element:s}=this.props,{multipleFiles:a}=s;if(!a&&e.length===0&&t.length>1){const i=t.findIndex(n=>n.errors.length===1&&n.errors[0].code==="too-many-files");i>=0&&(e.push(t[i].file),t.splice(i,1))}if(this.props.uploadClient.fetchFileURLs(e).then(i=>{if(!a&&e.length>0){const n=this.state.files.find(d=>d.status.type!=="error");n&&(this.forceUpdatingStatus=!0,this.deleteFile(n.id),this.forceUpdatingStatus=!1)}D(i,e).forEach(([n,d])=>{this.uploadFile(n,d)})}).catch(i=>{this.addFiles(e.map(n=>new m(n.name,n.size,this.nextLocalFileId(),{type:"error",errorMessage:i})))}),t.length>0){const i=t.map(n=>{const{file:d}=n;return new m(d.name,d.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(n.errors[0].code,n.file)})});this.addFiles(i)}},this.uploadFile=(e,t)=>{const s=S.CancelToken.source(),a=new m(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,i=>this.onUploadProgress(i,a.id),s.token).then(()=>this.onUploadComplete(a.id,e)).catch(i=>{S.isCancel(i)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:i?i.toString():"Unknown error"}))})},this.onUploadComplete=(e,t)=>{const s=this.getFile(e);h(s)||s.status.type!=="uploading"||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.getErrorMessage=(e,t)=>{switch(e){case"file-too-large":return`File must be ${b(this.maxUploadSizeInBytes,f.Byte)} or smaller.`;case"file-invalid-type":return`${t.type} files are not allowed.`;case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=e=>{const t=this.getFile(e);h(t)||(t.status.type==="uploading"&&t.status.cancelToken.cancel(),t.status.type==="uploaded"&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(t=>({files:[...t.files,e]}))},this.addFiles=e=>{this.setState(t=>({files:[...t.files,...e]}))},this.removeFile=e=>{this.setState(t=>({files:t.files.filter(s=>s.id!==e)}))},this.getFile=e=>this.state.files.find(t=>t.id===e),this.updateFile=(e,t)=>{this.setState(s=>({files:s.files.map(a=>a.id===e?t:a)}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(h(s)||s.status.type!=="uploading")return;const a=Math.round(e.loaded*100/e.total);s.status.progress!==a&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:a}))},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(h(e))return;const{widgetMgr:t,element:s,fragmentId:a}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},a)})},this.state=this.initialValue}get initialValue(){const o={files:[],newestServerFileId:0},{widgetMgr:e,element:t}=this.props,s=e.getFileUploaderStateValue(t);if(h(s))return o;const{uploadedFileInfo:a}=s;return h(a)||a.length===0?o:{files:a.map(i=>{const n=i.name,d=i.size,F=i.fileId,c=i.fileUrls;return new m(n,d,this.nextLocalFileId(),{type:"uploaded",fileId:F,fileUrls:c})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const o=this.props.element.maxUploadSizeMb;return ae(o,f.Megabyte,f.Byte)}get status(){const o=e=>e.status.type==="uploading";return this.state.files.some(o)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const o=this.createWidgetValue(),{element:e,widgetMgr:t,fragmentId:s}=this.props;t.getFileUploaderStateValue(e)===void 0&&t.setFileUploaderStateValue(e,o,{fromUi:!1},s)}createWidgetValue(){const o=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:t,size:s,status:a}=e,{fileId:i,fileUrls:n}=a;return new H({fileId:i,fileUrls:n,name:t,size:s})});return new A({uploadedFileInfo:o})}render(){var d;const{files:o}=this.state,{element:e,disabled:t,widgetMgr:s,width:a}=this.props,i=e.type;this.formClearHelper.manageFormClearListener(s,e.formId,this.onFormCleared);const n=o.slice().reverse();return u(ne,{className:"stFileUploader","data-testid":"stFileUploader",width:a,children:[r(_,{label:e.label,disabled:t,labelVisibility:R((d=e.labelVisibility)==null?void 0:d.value),children:e.help&&r($,{children:r(O,{content:e.help,placement:X.TOP_RIGHT})})}),r(re,{onDrop:this.dropHandler,multiple:e.multipleFiles,acceptedExtensions:i,maxSizeBytes:this.maxUploadSizeInBytes,label:e.label,disabled:t}),n.length>0&&r(ye,{items:n,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Pe=W(p.memo(Se));export{Pe as default};
1
+ import{r as p,E as V,_ as z,n as I,C as u,j as r,b4 as U,bo as g,co as E,bp as y,cp as L,aY as B,F as k,bh as W,R as N,az as T,bj as D,K as h,bl as H,bk as A,br as R,bE as $,bs as O,b9 as X,bt as _}from"./index.6zGrdP7S.js";import{a as S}from"./index.DW_MHI2K.js";import{F as K}from"./FormClearHelper.CEl0YyS3.js";import{S as x,I as j,b as q,c as G,d as Y,C as J,e as Q,f as Z,h as ee,i as te,g as b,F as f,j as se,k as ie,l as le,s as ae,m as re,n as ne}from"./FileDropzone.uWzTac7M.js";import{S as oe,P as de}from"./ProgressBar.DDliFXvs.js";import{u as ce}from"./Hooks.B_-0sclb.js";import{U as m}from"./UploadFileInfo.C-jY39rj.js";var C=p.forwardRef(function(l,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return p.createElement(V,z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},l,{ref:o}),p.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});C.displayName="Error";const pe=I("div",{target:"egc9vxm0"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:l.spacing.twoXS,marginBottom:l.spacing.twoXS})),ue=I("div",{target:"egc9vxm1"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"center",color:l.colors.fadedText40})),he=({currentPage:l,totalPages:o,onNext:e,onPrevious:t})=>u(pe,{"data-testid":"stFileUploaderPagination",children:[r(x,{children:`Showing page ${l} of ${o}`}),u(ue,{children:[r(y,{onClick:t,kind:U.MINIMAL,children:r(g,{content:E,size:"xl"})}),r(y,{onClick:e,kind:U.MINIMAL,children:r(g,{content:L,size:"xl"})})]})]}),w=(l,o)=>Math.ceil(l.length/o),ge=l=>B(({pageSize:e,items:t,resetOnAdd:s,...a})=>{const[i,n]=p.useState(0),[d,F]=p.useState(w(t,e)),c=ce(t);p.useEffect(()=>{c&&c.length!==t.length&&F(w(t,e)),c&&c.length<t.length?s&&n(0):i+1>=d&&n(d-1)},[t,i,e,c,s,d]);const v=()=>{n(Math.min(i+1,d-1))},M=()=>{n(Math.max(0,i-1))},P=t.slice(i*e,i*e+e);return u(k,{children:[r(l,{items:P,...a}),t.length>e?r(he,{pageSize:e,totalPages:d,currentPage:i+1,onNext:v,onPrevious:M}):null]})},l),me=({fileInfo:l})=>l.status.type==="uploading"?r(de,{value:l.status.progress,size:oe.SMALL}):l.status.type==="error"?u(te,{children:[r(Z,{"data-testid":"stFileUploaderFileErrorMessage",children:l.status.errorMessage}),r(ee,{children:r(g,{content:C,size:"lg"})})]}):l.status.type==="uploaded"?r(x,{children:b(l.size,f.Byte)}):null,fe=({fileInfo:l,onDelete:o})=>u(Q,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[r(q,{children:r(g,{content:j,size:"twoXL"})}),u(G,{className:"stFileUploaderFileData",children:[r(Y,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:l.name,children:l.name}),r(me,{fileInfo:l})]}),r("div",{"data-testid":"stFileUploaderDeleteBtn",children:r(y,{onClick:()=>o(l.id),kind:U.MINIMAL,children:r(g,{content:J,size:"lg"})})})]}),Fe=({items:l,onDelete:o})=>r(le,{children:l.map(e=>r(ie,{children:r(fe,{fileInfo:e,onDelete:o})},e.id))}),Ue=ge(Fe),ye=l=>r(se,{children:r(Ue,{...l})});class Se extends N.PureComponent{constructor(o){super(o),this.formClearHelper=new K,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:a}=this.props,i=s.getFileUploaderStateValue(t);T(e,i)||s.setFileUploaderStateValue(t,e,{fromUi:!0},a)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(e,t)=>{const{element:s}=this.props,{multipleFiles:a}=s;if(!a&&e.length===0&&t.length>1){const i=t.findIndex(n=>n.errors.length===1&&n.errors[0].code==="too-many-files");i>=0&&(e.push(t[i].file),t.splice(i,1))}if(this.props.uploadClient.fetchFileURLs(e).then(i=>{if(!a&&e.length>0){const n=this.state.files.find(d=>d.status.type!=="error");n&&(this.forceUpdatingStatus=!0,this.deleteFile(n.id),this.forceUpdatingStatus=!1)}D(i,e).forEach(([n,d])=>{this.uploadFile(n,d)})}).catch(i=>{this.addFiles(e.map(n=>new m(n.name,n.size,this.nextLocalFileId(),{type:"error",errorMessage:i})))}),t.length>0){const i=t.map(n=>{const{file:d}=n;return new m(d.name,d.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(n.errors[0].code,n.file)})});this.addFiles(i)}},this.uploadFile=(e,t)=>{const s=S.CancelToken.source(),a=new m(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,i=>this.onUploadProgress(i,a.id),s.token).then(()=>this.onUploadComplete(a.id,e)).catch(i=>{S.isCancel(i)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:i?i.toString():"Unknown error"}))})},this.onUploadComplete=(e,t)=>{const s=this.getFile(e);h(s)||s.status.type!=="uploading"||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.getErrorMessage=(e,t)=>{switch(e){case"file-too-large":return`File must be ${b(this.maxUploadSizeInBytes,f.Byte)} or smaller.`;case"file-invalid-type":return`${t.type} files are not allowed.`;case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=e=>{const t=this.getFile(e);h(t)||(t.status.type==="uploading"&&t.status.cancelToken.cancel(),t.status.type==="uploaded"&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(t=>({files:[...t.files,e]}))},this.addFiles=e=>{this.setState(t=>({files:[...t.files,...e]}))},this.removeFile=e=>{this.setState(t=>({files:t.files.filter(s=>s.id!==e)}))},this.getFile=e=>this.state.files.find(t=>t.id===e),this.updateFile=(e,t)=>{this.setState(s=>({files:s.files.map(a=>a.id===e?t:a)}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(h(s)||s.status.type!=="uploading")return;const a=Math.round(e.loaded*100/e.total);s.status.progress!==a&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:a}))},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(h(e))return;const{widgetMgr:t,element:s,fragmentId:a}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},a)})},this.state=this.initialValue}get initialValue(){const o={files:[],newestServerFileId:0},{widgetMgr:e,element:t}=this.props,s=e.getFileUploaderStateValue(t);if(h(s))return o;const{uploadedFileInfo:a}=s;return h(a)||a.length===0?o:{files:a.map(i=>{const n=i.name,d=i.size,F=i.fileId,c=i.fileUrls;return new m(n,d,this.nextLocalFileId(),{type:"uploaded",fileId:F,fileUrls:c})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const o=this.props.element.maxUploadSizeMb;return ae(o,f.Megabyte,f.Byte)}get status(){const o=e=>e.status.type==="uploading";return this.state.files.some(o)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const o=this.createWidgetValue(),{element:e,widgetMgr:t,fragmentId:s}=this.props;t.getFileUploaderStateValue(e)===void 0&&t.setFileUploaderStateValue(e,o,{fromUi:!1},s)}createWidgetValue(){const o=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:t,size:s,status:a}=e,{fileId:i,fileUrls:n}=a;return new H({fileId:i,fileUrls:n,name:t,size:s})});return new A({uploadedFileInfo:o})}render(){var d;const{files:o}=this.state,{element:e,disabled:t,widgetMgr:s,width:a}=this.props,i=e.type;this.formClearHelper.manageFormClearListener(s,e.formId,this.onFormCleared);const n=o.slice().reverse();return u(ne,{className:"stFileUploader","data-testid":"stFileUploader",width:a,children:[r(_,{label:e.label,disabled:t,labelVisibility:R((d=e.labelVisibility)==null?void 0:d.value),children:e.help&&r($,{children:r(O,{content:e.help,placement:X.TOP_RIGHT})})}),r(re,{onDrop:this.dropHandler,multiple:e.multipleFiles,acceptedExtensions:i,maxSizeBytes:this.maxUploadSizeInBytes,label:e.label,disabled:t}),n.length>0&&r(ye,{items:n,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Pe=W(p.memo(Se));export{Pe as default};
@@ -1,2 +1,2 @@
1
- import{r as J,j as ct,F as Vt}from"./index.od8XlC_e.js";/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:At,setPrototypeOf:ft,isFrozen:$t,getPrototypeOf:qt,getOwnPropertyDescriptor:Kt}=Object;let{freeze:S,seal:y,create:ht}=Object,{apply:xe,construct:Pe}=typeof Reflect<"u"&&Reflect;S||(S=function(n){return n});y||(y=function(n){return n});xe||(xe=function(n,l,r){return n.apply(l,r)});Pe||(Pe=function(n,l){return new n(...l)});const le=R(Array.prototype.forEach),Zt=R(Array.prototype.lastIndexOf),ut=R(Array.prototype.pop),V=R(Array.prototype.push),Jt=R(Array.prototype.splice),fe=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),mt=R(String.prototype.match),$=R(String.prototype.replace),Qt=R(String.prototype.indexOf),en=R(String.prototype.trim),b=R(Object.prototype.hasOwnProperty),h=R(RegExp.prototype.test),q=tn(TypeError);function R(a){return function(n){for(var l=arguments.length,r=new Array(l>1?l-1:0),f=1;f<l;f++)r[f-1]=arguments[f];return xe(a,n,r)}}function tn(a){return function(){for(var n=arguments.length,l=new Array(n),r=0;r<n;r++)l[r]=arguments[r];return Pe(a,l)}}function s(a,n){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fe;ft&&ft(a,null);let r=n.length;for(;r--;){let f=n[r];if(typeof f=="string"){const L=l(f);L!==f&&($t(n)||(n[r]=L),f=L)}a[f]=!0}return a}function nn(a){for(let n=0;n<a.length;n++)b(a,n)||(a[n]=null);return a}function x(a){const n=ht(null);for(const[l,r]of At(a))b(a,l)&&(Array.isArray(r)?n[l]=nn(r):r&&typeof r=="object"&&r.constructor===Object?n[l]=x(r):n[l]=r);return n}function K(a,n){for(;a!==null;){const r=Kt(a,n);if(r){if(r.get)return R(r.get);if(typeof r.value=="function")return R(r.value)}a=qt(a)}function l(){return null}return l}const pt=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),De=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ie=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),on=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Me=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),an=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dt=S(["#text"]),Tt=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ce=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Et=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ce=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rn=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sn=y(/<%[\w\W]*|[\w\W]*%>/gm),ln=y(/\$\{[\w\W]*/gm),cn=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),fn=y(/^aria-[\-\w]+$/),St=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),un=y(/^(?:\w+script|data):/i),mn=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=y(/^html$/i),pn=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var _t=Object.freeze({__proto__:null,ARIA_ATTR:fn,ATTR_WHITESPACE:mn,CUSTOM_ELEMENT:pn,DATA_ATTR:cn,DOCTYPE_NAME:Rt,ERB_EXPR:sn,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:un,MUSTACHE_EXPR:rn,TMPLIT_EXPR:ln});const Z={element:1,text:3,progressingInstruction:7,comment:8,document:9},dn=function(){return typeof window>"u"?null:window},Tn=function(n,l){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let r=null;const f="data-tt-policy-suffix";l&&l.hasAttribute(f)&&(r=l.getAttribute(f));const L="dompurify"+(r?"#"+r:"");try{return n.createPolicy(L,{createHTML(I){return I},createScriptURL(I){return I}})}catch{return console.warn("TrustedTypes policy "+L+" could not be created."),null}},gt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ot(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dn();const n=i=>Ot(i);if(n.version="3.2.4",n.removed=[],!a||!a.document||a.document.nodeType!==Z.document||!a.Element)return n.isSupported=!1,n;let{document:l}=a;const r=l,f=r.currentScript,{DocumentFragment:L,HTMLTemplateElement:I,Node:ue,Element:Ue,NodeFilter:z,NamedNodeMap:Lt=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:yt,DOMParser:bt,trustedTypes:Q}=a,G=Ue.prototype,Nt=K(G,"cloneNode"),Dt=K(G,"remove"),It=K(G,"nextSibling"),Mt=K(G,"childNodes"),ee=K(G,"parentNode");if(typeof I=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let _,W="";const{implementation:me,createNodeIterator:Ct,createDocumentFragment:wt,getElementsByTagName:xt}=l,{importNode:Pt}=r;let g=gt();n.isSupported=typeof At=="function"&&typeof ee=="function"&&me&&me.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pe,ERB_EXPR:de,TMPLIT_EXPR:Te,DATA_ATTR:kt,ARIA_ATTR:vt,IS_SCRIPT_OR_DATA:Ut,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:Ft}=_t;let{IS_ALLOWED_URI:He}=_t,m=null;const ze=s({},[...pt,...De,...Ie,...Me,...dt]);let d=null;const Ge=s({},[...Tt,...Ce,...Et,...ce]);let u=Object.seal(ht(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,Ee=null,We=!0,_e=!0,Be=!1,Ye=!0,P=!1,ge=!0,w=!1,Ae=!1,he=!1,k=!1,te=!1,ne=!1,Xe=!0,je=!1;const Ht="user-content-";let Se=!0,Y=!1,v={},U=null;const Ve=s({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const qe=s({},["audio","video","img","source","image","track"]);let Re=null;const Ke=s({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),oe="http://www.w3.org/1998/Math/MathML",ie="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let F=M,Oe=!1,Le=null;const zt=s({},[oe,ie,M],Ne);let ae=s({},["mi","mo","mn","ms","mtext"]),re=s({},["annotation-xml"]);const Gt=s({},["title","style","font","a","script"]);let X=null;const Wt=["application/xhtml+xml","text/html"],Bt="text/html";let p=null,H=null;const Yt=l.createElement("form"),Ze=function(e){return e instanceof RegExp||e instanceof Function},ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=x(e),X=Wt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Bt:e.PARSER_MEDIA_TYPE,p=X==="application/xhtml+xml"?Ne:fe,m=b(e,"ALLOWED_TAGS")?s({},e.ALLOWED_TAGS,p):ze,d=b(e,"ALLOWED_ATTR")?s({},e.ALLOWED_ATTR,p):Ge,Le=b(e,"ALLOWED_NAMESPACES")?s({},e.ALLOWED_NAMESPACES,Ne):zt,Re=b(e,"ADD_URI_SAFE_ATTR")?s(x(Ke),e.ADD_URI_SAFE_ATTR,p):Ke,$e=b(e,"ADD_DATA_URI_TAGS")?s(x(qe),e.ADD_DATA_URI_TAGS,p):qe,U=b(e,"FORBID_CONTENTS")?s({},e.FORBID_CONTENTS,p):Ve,B=b(e,"FORBID_TAGS")?s({},e.FORBID_TAGS,p):{},Ee=b(e,"FORBID_ATTR")?s({},e.FORBID_ATTR,p):{},v=b(e,"USE_PROFILES")?e.USE_PROFILES:!1,We=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,Be=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,ge=e.SAFE_FOR_XML!==!1,w=e.WHOLE_DOCUMENT||!1,k=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Xe=e.SANITIZE_DOM!==!1,je=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,Y=e.IN_PLACE||!1,He=e.ALLOWED_URI_REGEXP||St,F=e.NAMESPACE||M,ae=e.MATHML_TEXT_INTEGRATION_POINTS||ae,re=e.HTML_INTEGRATION_POINTS||re,u=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),te&&(k=!0),v&&(m=s({},dt),d=[],v.html===!0&&(s(m,pt),s(d,Tt)),v.svg===!0&&(s(m,De),s(d,Ce),s(d,ce)),v.svgFilters===!0&&(s(m,Ie),s(d,Ce),s(d,ce)),v.mathMl===!0&&(s(m,Me),s(d,Et),s(d,ce))),e.ADD_TAGS&&(m===ze&&(m=x(m)),s(m,e.ADD_TAGS,p)),e.ADD_ATTR&&(d===Ge&&(d=x(d)),s(d,e.ADD_ATTR,p)),e.ADD_URI_SAFE_ATTR&&s(Re,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(U===Ve&&(U=x(U)),s(U,e.FORBID_CONTENTS,p)),Se&&(m["#text"]=!0),w&&s(m,["html","head","body"]),m.table&&(s(m,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=e.TRUSTED_TYPES_POLICY,W=_.createHTML("")}else _===void 0&&(_=Tn(Q,f)),_!==null&&typeof W=="string"&&(W=_.createHTML(""));S&&S(e),H=e}},Je=s({},[...De,...Ie,...on]),Qe=s({},[...Me,...an]),Xt=function(e){let t=ee(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const o=fe(e.tagName),c=fe(t.tagName);return Le[e.namespaceURI]?e.namespaceURI===ie?t.namespaceURI===M?o==="svg":t.namespaceURI===oe?o==="svg"&&(c==="annotation-xml"||ae[c]):!!Je[o]:e.namespaceURI===oe?t.namespaceURI===M?o==="math":t.namespaceURI===ie?o==="math"&&re[c]:!!Qe[o]:e.namespaceURI===M?t.namespaceURI===ie&&!re[c]||t.namespaceURI===oe&&!ae[c]?!1:!Qe[o]&&(Gt[o]||!Je[o]):!!(X==="application/xhtml+xml"&&Le[e.namespaceURI]):!1},N=function(e){V(n.removed,{element:e});try{ee(e).removeChild(e)}catch{Dt(e)}},se=function(e,t){try{V(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(k||te)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},et=function(e){let t=null,o=null;if(he)e="<remove></remove>"+e;else{const T=mt(e,/^[\r\n\t ]+/);o=T&&T[0]}X==="application/xhtml+xml"&&F===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=_?_.createHTML(e):e;if(F===M)try{t=new bt().parseFromString(c,X)}catch{}if(!t||!t.documentElement){t=me.createDocument(F,"template",null);try{t.documentElement.innerHTML=Oe?W:c}catch{}}const E=t.body||t.documentElement;return e&&o&&E.insertBefore(l.createTextNode(o),E.childNodes[0]||null),F===M?xt.call(t,w?"html":"body")[0]:w?t.documentElement:E},tt=function(e){return Ct.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},be=function(e){return e instanceof yt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Lt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},nt=function(e){return typeof ue=="function"&&e instanceof ue};function C(i,e,t){le(i,o=>{o.call(n,e,t,H)})}const ot=function(e){let t=null;if(C(g.beforeSanitizeElements,e,null),be(e))return N(e),!0;const o=p(e.nodeName);if(C(g.uponSanitizeElement,e,{tagName:o,allowedTags:m}),e.hasChildNodes()&&!nt(e.firstElementChild)&&h(/<[/\w]/g,e.innerHTML)&&h(/<[/\w]/g,e.textContent)||e.nodeType===Z.progressingInstruction||ge&&e.nodeType===Z.comment&&h(/<[/\w]/g,e.data))return N(e),!0;if(!m[o]||B[o]){if(!B[o]&&at(o)&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,o)||u.tagNameCheck instanceof Function&&u.tagNameCheck(o)))return!1;if(Se&&!U[o]){const c=ee(e)||e.parentNode,E=Mt(e)||e.childNodes;if(E&&c){const T=E.length;for(let O=T-1;O>=0;--O){const D=Nt(E[O],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,It(e))}}}return N(e),!0}return e instanceof Ue&&!Xt(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&h(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(P&&e.nodeType===Z.text&&(t=e.textContent,le([pe,de,Te],c=>{t=$(t,c," ")}),e.textContent!==t&&(V(n.removed,{element:e.cloneNode()}),e.textContent=t)),C(g.afterSanitizeElements,e,null),!1)},it=function(e,t,o){if(Xe&&(t==="id"||t==="name")&&(o in l||o in Yt))return!1;if(!(_e&&!Ee[t]&&h(kt,t))){if(!(We&&h(vt,t))){if(!d[t]||Ee[t]){if(!(at(e)&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&h(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,o)||u.tagNameCheck instanceof Function&&u.tagNameCheck(o))))return!1}else if(!Re[t]){if(!h(He,$(o,Fe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Qt(o,"data:")===0&&$e[e])){if(!(Be&&!h(Ut,$(o,Fe,"")))){if(o)return!1}}}}}}return!0},at=function(e){return e!=="annotation-xml"&&mt(e,Ft)},rt=function(e){C(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||be(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d,forceKeepAttr:void 0};let c=t.length;for(;c--;){const E=t[c],{name:T,namespaceURI:O,value:D}=E,j=p(T);let A=T==="value"?D:en(D);if(o.attrName=j,o.attrValue=A,o.keepAttr=!0,o.forceKeepAttr=void 0,C(g.uponSanitizeAttribute,e,o),A=o.attrValue,je&&(j==="id"||j==="name")&&(se(T,e),A=Ht+A),ge&&h(/((--!?|])>)|<\/(style|title)/i,A)){se(T,e);continue}if(o.forceKeepAttr||(se(T,e),!o.keepAttr))continue;if(!Ye&&h(/\/>/i,A)){se(T,e);continue}P&&le([pe,de,Te],lt=>{A=$(A,lt," ")});const st=p(e.nodeName);if(it(st,j,A)){if(_&&typeof Q=="object"&&typeof Q.getAttributeType=="function"&&!O)switch(Q.getAttributeType(st,j)){case"TrustedHTML":{A=_.createHTML(A);break}case"TrustedScriptURL":{A=_.createScriptURL(A);break}}try{O?e.setAttributeNS(O,T,A):e.setAttribute(T,A),be(e)?N(e):ut(n.removed)}catch{}}}C(g.afterSanitizeAttributes,e,null)},jt=function i(e){let t=null;const o=tt(e);for(C(g.beforeSanitizeShadowDOM,e,null);t=o.nextNode();)C(g.uponSanitizeShadowNode,t,null),ot(t),rt(t),t.content instanceof L&&i(t.content);C(g.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,o=null,c=null,E=null;if(Oe=!i,Oe&&(i="<!-->"),typeof i!="string"&&!nt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw q("dirty is not a string, aborting")}else throw q("toString is not a function");if(!n.isSupported)return i;if(Ae||ye(e),n.removed=[],typeof i=="string"&&(Y=!1),Y){if(i.nodeName){const D=p(i.nodeName);if(!m[D]||B[D])throw q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof ue)t=et("<!---->"),o=t.ownerDocument.importNode(i,!0),o.nodeType===Z.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?t=o:t.appendChild(o);else{if(!k&&!P&&!w&&i.indexOf("<")===-1)return _&&ne?_.createHTML(i):i;if(t=et(i),!t)return k?null:ne?W:""}t&&he&&N(t.firstChild);const T=tt(Y?i:t);for(;c=T.nextNode();)ot(c),rt(c),c.content instanceof L&&jt(c.content);if(Y)return i;if(k){if(te)for(E=wt.call(t.ownerDocument);t.firstChild;)E.appendChild(t.firstChild);else E=t;return(d.shadowroot||d.shadowrootmode)&&(E=Pt.call(r,E,!0)),E}let O=w?t.outerHTML:t.innerHTML;return w&&m["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&h(Rt,t.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
1
+ import{r as J,j as ct,F as Vt}from"./index.6zGrdP7S.js";/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:At,setPrototypeOf:ft,isFrozen:$t,getPrototypeOf:qt,getOwnPropertyDescriptor:Kt}=Object;let{freeze:S,seal:y,create:ht}=Object,{apply:xe,construct:Pe}=typeof Reflect<"u"&&Reflect;S||(S=function(n){return n});y||(y=function(n){return n});xe||(xe=function(n,l,r){return n.apply(l,r)});Pe||(Pe=function(n,l){return new n(...l)});const le=R(Array.prototype.forEach),Zt=R(Array.prototype.lastIndexOf),ut=R(Array.prototype.pop),V=R(Array.prototype.push),Jt=R(Array.prototype.splice),fe=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),mt=R(String.prototype.match),$=R(String.prototype.replace),Qt=R(String.prototype.indexOf),en=R(String.prototype.trim),b=R(Object.prototype.hasOwnProperty),h=R(RegExp.prototype.test),q=tn(TypeError);function R(a){return function(n){for(var l=arguments.length,r=new Array(l>1?l-1:0),f=1;f<l;f++)r[f-1]=arguments[f];return xe(a,n,r)}}function tn(a){return function(){for(var n=arguments.length,l=new Array(n),r=0;r<n;r++)l[r]=arguments[r];return Pe(a,l)}}function s(a,n){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fe;ft&&ft(a,null);let r=n.length;for(;r--;){let f=n[r];if(typeof f=="string"){const L=l(f);L!==f&&($t(n)||(n[r]=L),f=L)}a[f]=!0}return a}function nn(a){for(let n=0;n<a.length;n++)b(a,n)||(a[n]=null);return a}function x(a){const n=ht(null);for(const[l,r]of At(a))b(a,l)&&(Array.isArray(r)?n[l]=nn(r):r&&typeof r=="object"&&r.constructor===Object?n[l]=x(r):n[l]=r);return n}function K(a,n){for(;a!==null;){const r=Kt(a,n);if(r){if(r.get)return R(r.get);if(typeof r.value=="function")return R(r.value)}a=qt(a)}function l(){return null}return l}const pt=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),De=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ie=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),on=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Me=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),an=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dt=S(["#text"]),Tt=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ce=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Et=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ce=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rn=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sn=y(/<%[\w\W]*|[\w\W]*%>/gm),ln=y(/\$\{[\w\W]*/gm),cn=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),fn=y(/^aria-[\-\w]+$/),St=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),un=y(/^(?:\w+script|data):/i),mn=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=y(/^html$/i),pn=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var _t=Object.freeze({__proto__:null,ARIA_ATTR:fn,ATTR_WHITESPACE:mn,CUSTOM_ELEMENT:pn,DATA_ATTR:cn,DOCTYPE_NAME:Rt,ERB_EXPR:sn,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:un,MUSTACHE_EXPR:rn,TMPLIT_EXPR:ln});const Z={element:1,text:3,progressingInstruction:7,comment:8,document:9},dn=function(){return typeof window>"u"?null:window},Tn=function(n,l){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let r=null;const f="data-tt-policy-suffix";l&&l.hasAttribute(f)&&(r=l.getAttribute(f));const L="dompurify"+(r?"#"+r:"");try{return n.createPolicy(L,{createHTML(I){return I},createScriptURL(I){return I}})}catch{return console.warn("TrustedTypes policy "+L+" could not be created."),null}},gt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ot(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dn();const n=i=>Ot(i);if(n.version="3.2.4",n.removed=[],!a||!a.document||a.document.nodeType!==Z.document||!a.Element)return n.isSupported=!1,n;let{document:l}=a;const r=l,f=r.currentScript,{DocumentFragment:L,HTMLTemplateElement:I,Node:ue,Element:Ue,NodeFilter:z,NamedNodeMap:Lt=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:yt,DOMParser:bt,trustedTypes:Q}=a,G=Ue.prototype,Nt=K(G,"cloneNode"),Dt=K(G,"remove"),It=K(G,"nextSibling"),Mt=K(G,"childNodes"),ee=K(G,"parentNode");if(typeof I=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let _,W="";const{implementation:me,createNodeIterator:Ct,createDocumentFragment:wt,getElementsByTagName:xt}=l,{importNode:Pt}=r;let g=gt();n.isSupported=typeof At=="function"&&typeof ee=="function"&&me&&me.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pe,ERB_EXPR:de,TMPLIT_EXPR:Te,DATA_ATTR:kt,ARIA_ATTR:vt,IS_SCRIPT_OR_DATA:Ut,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:Ft}=_t;let{IS_ALLOWED_URI:He}=_t,m=null;const ze=s({},[...pt,...De,...Ie,...Me,...dt]);let d=null;const Ge=s({},[...Tt,...Ce,...Et,...ce]);let u=Object.seal(ht(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,Ee=null,We=!0,_e=!0,Be=!1,Ye=!0,P=!1,ge=!0,w=!1,Ae=!1,he=!1,k=!1,te=!1,ne=!1,Xe=!0,je=!1;const Ht="user-content-";let Se=!0,Y=!1,v={},U=null;const Ve=s({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const qe=s({},["audio","video","img","source","image","track"]);let Re=null;const Ke=s({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),oe="http://www.w3.org/1998/Math/MathML",ie="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let F=M,Oe=!1,Le=null;const zt=s({},[oe,ie,M],Ne);let ae=s({},["mi","mo","mn","ms","mtext"]),re=s({},["annotation-xml"]);const Gt=s({},["title","style","font","a","script"]);let X=null;const Wt=["application/xhtml+xml","text/html"],Bt="text/html";let p=null,H=null;const Yt=l.createElement("form"),Ze=function(e){return e instanceof RegExp||e instanceof Function},ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=x(e),X=Wt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Bt:e.PARSER_MEDIA_TYPE,p=X==="application/xhtml+xml"?Ne:fe,m=b(e,"ALLOWED_TAGS")?s({},e.ALLOWED_TAGS,p):ze,d=b(e,"ALLOWED_ATTR")?s({},e.ALLOWED_ATTR,p):Ge,Le=b(e,"ALLOWED_NAMESPACES")?s({},e.ALLOWED_NAMESPACES,Ne):zt,Re=b(e,"ADD_URI_SAFE_ATTR")?s(x(Ke),e.ADD_URI_SAFE_ATTR,p):Ke,$e=b(e,"ADD_DATA_URI_TAGS")?s(x(qe),e.ADD_DATA_URI_TAGS,p):qe,U=b(e,"FORBID_CONTENTS")?s({},e.FORBID_CONTENTS,p):Ve,B=b(e,"FORBID_TAGS")?s({},e.FORBID_TAGS,p):{},Ee=b(e,"FORBID_ATTR")?s({},e.FORBID_ATTR,p):{},v=b(e,"USE_PROFILES")?e.USE_PROFILES:!1,We=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,Be=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,ge=e.SAFE_FOR_XML!==!1,w=e.WHOLE_DOCUMENT||!1,k=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Xe=e.SANITIZE_DOM!==!1,je=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,Y=e.IN_PLACE||!1,He=e.ALLOWED_URI_REGEXP||St,F=e.NAMESPACE||M,ae=e.MATHML_TEXT_INTEGRATION_POINTS||ae,re=e.HTML_INTEGRATION_POINTS||re,u=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),te&&(k=!0),v&&(m=s({},dt),d=[],v.html===!0&&(s(m,pt),s(d,Tt)),v.svg===!0&&(s(m,De),s(d,Ce),s(d,ce)),v.svgFilters===!0&&(s(m,Ie),s(d,Ce),s(d,ce)),v.mathMl===!0&&(s(m,Me),s(d,Et),s(d,ce))),e.ADD_TAGS&&(m===ze&&(m=x(m)),s(m,e.ADD_TAGS,p)),e.ADD_ATTR&&(d===Ge&&(d=x(d)),s(d,e.ADD_ATTR,p)),e.ADD_URI_SAFE_ATTR&&s(Re,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(U===Ve&&(U=x(U)),s(U,e.FORBID_CONTENTS,p)),Se&&(m["#text"]=!0),w&&s(m,["html","head","body"]),m.table&&(s(m,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=e.TRUSTED_TYPES_POLICY,W=_.createHTML("")}else _===void 0&&(_=Tn(Q,f)),_!==null&&typeof W=="string"&&(W=_.createHTML(""));S&&S(e),H=e}},Je=s({},[...De,...Ie,...on]),Qe=s({},[...Me,...an]),Xt=function(e){let t=ee(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const o=fe(e.tagName),c=fe(t.tagName);return Le[e.namespaceURI]?e.namespaceURI===ie?t.namespaceURI===M?o==="svg":t.namespaceURI===oe?o==="svg"&&(c==="annotation-xml"||ae[c]):!!Je[o]:e.namespaceURI===oe?t.namespaceURI===M?o==="math":t.namespaceURI===ie?o==="math"&&re[c]:!!Qe[o]:e.namespaceURI===M?t.namespaceURI===ie&&!re[c]||t.namespaceURI===oe&&!ae[c]?!1:!Qe[o]&&(Gt[o]||!Je[o]):!!(X==="application/xhtml+xml"&&Le[e.namespaceURI]):!1},N=function(e){V(n.removed,{element:e});try{ee(e).removeChild(e)}catch{Dt(e)}},se=function(e,t){try{V(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(k||te)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},et=function(e){let t=null,o=null;if(he)e="<remove></remove>"+e;else{const T=mt(e,/^[\r\n\t ]+/);o=T&&T[0]}X==="application/xhtml+xml"&&F===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=_?_.createHTML(e):e;if(F===M)try{t=new bt().parseFromString(c,X)}catch{}if(!t||!t.documentElement){t=me.createDocument(F,"template",null);try{t.documentElement.innerHTML=Oe?W:c}catch{}}const E=t.body||t.documentElement;return e&&o&&E.insertBefore(l.createTextNode(o),E.childNodes[0]||null),F===M?xt.call(t,w?"html":"body")[0]:w?t.documentElement:E},tt=function(e){return Ct.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},be=function(e){return e instanceof yt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Lt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},nt=function(e){return typeof ue=="function"&&e instanceof ue};function C(i,e,t){le(i,o=>{o.call(n,e,t,H)})}const ot=function(e){let t=null;if(C(g.beforeSanitizeElements,e,null),be(e))return N(e),!0;const o=p(e.nodeName);if(C(g.uponSanitizeElement,e,{tagName:o,allowedTags:m}),e.hasChildNodes()&&!nt(e.firstElementChild)&&h(/<[/\w]/g,e.innerHTML)&&h(/<[/\w]/g,e.textContent)||e.nodeType===Z.progressingInstruction||ge&&e.nodeType===Z.comment&&h(/<[/\w]/g,e.data))return N(e),!0;if(!m[o]||B[o]){if(!B[o]&&at(o)&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,o)||u.tagNameCheck instanceof Function&&u.tagNameCheck(o)))return!1;if(Se&&!U[o]){const c=ee(e)||e.parentNode,E=Mt(e)||e.childNodes;if(E&&c){const T=E.length;for(let O=T-1;O>=0;--O){const D=Nt(E[O],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,It(e))}}}return N(e),!0}return e instanceof Ue&&!Xt(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&h(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(P&&e.nodeType===Z.text&&(t=e.textContent,le([pe,de,Te],c=>{t=$(t,c," ")}),e.textContent!==t&&(V(n.removed,{element:e.cloneNode()}),e.textContent=t)),C(g.afterSanitizeElements,e,null),!1)},it=function(e,t,o){if(Xe&&(t==="id"||t==="name")&&(o in l||o in Yt))return!1;if(!(_e&&!Ee[t]&&h(kt,t))){if(!(We&&h(vt,t))){if(!d[t]||Ee[t]){if(!(at(e)&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&h(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,o)||u.tagNameCheck instanceof Function&&u.tagNameCheck(o))))return!1}else if(!Re[t]){if(!h(He,$(o,Fe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Qt(o,"data:")===0&&$e[e])){if(!(Be&&!h(Ut,$(o,Fe,"")))){if(o)return!1}}}}}}return!0},at=function(e){return e!=="annotation-xml"&&mt(e,Ft)},rt=function(e){C(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||be(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d,forceKeepAttr:void 0};let c=t.length;for(;c--;){const E=t[c],{name:T,namespaceURI:O,value:D}=E,j=p(T);let A=T==="value"?D:en(D);if(o.attrName=j,o.attrValue=A,o.keepAttr=!0,o.forceKeepAttr=void 0,C(g.uponSanitizeAttribute,e,o),A=o.attrValue,je&&(j==="id"||j==="name")&&(se(T,e),A=Ht+A),ge&&h(/((--!?|])>)|<\/(style|title)/i,A)){se(T,e);continue}if(o.forceKeepAttr||(se(T,e),!o.keepAttr))continue;if(!Ye&&h(/\/>/i,A)){se(T,e);continue}P&&le([pe,de,Te],lt=>{A=$(A,lt," ")});const st=p(e.nodeName);if(it(st,j,A)){if(_&&typeof Q=="object"&&typeof Q.getAttributeType=="function"&&!O)switch(Q.getAttributeType(st,j)){case"TrustedHTML":{A=_.createHTML(A);break}case"TrustedScriptURL":{A=_.createScriptURL(A);break}}try{O?e.setAttributeNS(O,T,A):e.setAttribute(T,A),be(e)?N(e):ut(n.removed)}catch{}}}C(g.afterSanitizeAttributes,e,null)},jt=function i(e){let t=null;const o=tt(e);for(C(g.beforeSanitizeShadowDOM,e,null);t=o.nextNode();)C(g.uponSanitizeShadowNode,t,null),ot(t),rt(t),t.content instanceof L&&i(t.content);C(g.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,o=null,c=null,E=null;if(Oe=!i,Oe&&(i="<!-->"),typeof i!="string"&&!nt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw q("dirty is not a string, aborting")}else throw q("toString is not a function");if(!n.isSupported)return i;if(Ae||ye(e),n.removed=[],typeof i=="string"&&(Y=!1),Y){if(i.nodeName){const D=p(i.nodeName);if(!m[D]||B[D])throw q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof ue)t=et("<!---->"),o=t.ownerDocument.importNode(i,!0),o.nodeType===Z.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?t=o:t.appendChild(o);else{if(!k&&!P&&!w&&i.indexOf("<")===-1)return _&&ne?_.createHTML(i):i;if(t=et(i),!t)return k?null:ne?W:""}t&&he&&N(t.firstChild);const T=tt(Y?i:t);for(;c=T.nextNode();)ot(c),rt(c),c.content instanceof L&&jt(c.content);if(Y)return i;if(k){if(te)for(E=wt.call(t.ownerDocument);t.firstChild;)E.appendChild(t.firstChild);else E=t;return(d.shadowroot||d.shadowrootmode)&&(E=Pt.call(r,E,!0)),E}let O=w?t.outerHTML:t.innerHTML;return w&&m["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&h(Rt,t.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
2
2
  `+O),P&&le([pe,de,Te],D=>{O=$(O,D," ")}),_&&ne?_.createHTML(O):O},n.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ye(i),Ae=!0},n.clearConfig=function(){H=null,Ae=!1},n.isValidAttribute=function(i,e,t){H||ye({});const o=p(i),c=p(e);return it(o,c,t)},n.addHook=function(i,e){typeof e=="function"&&V(g[i],e)},n.removeHook=function(i,e){if(e!==void 0){const t=Zt(g[i],e);return t===-1?void 0:Jt(g[i],t,1)[0]}return ut(g[i])},n.removeHooks=function(i){g[i]=[]},n.removeAllHooks=function(){g=gt()},n}var ve=Ot();const ke="data-temp-href-target";ve.addHook("beforeSanitizeAttributes",function(a){a instanceof HTMLElement&&a.hasAttribute("target")&&a.getAttribute("target")==="_blank"&&a.setAttribute(ke,"_blank")});ve.addHook("afterSanitizeAttributes",function(a){a instanceof HTMLElement&&a.hasAttribute(ke)&&(a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer"),a.removeAttribute(ke))});const we=a=>{const n={USE_PROFILES:{html:!0},FORCE_BODY:!0};return ve.sanitize(a,n)};function En({element:a}){const{body:n}=a,[l,r]=J.useState(we(n)),f=J.useRef(null);return J.useEffect(()=>{we(n)!==l&&r(we(n))},[n]),J.useEffect(()=>{var L,I;((L=f.current)==null?void 0:L.clientHeight)===0&&((I=f.current.parentElement)==null?void 0:I.childElementCount)===1&&f.current.parentElement.classList.add("stHtml-empty")}),ct(Vt,{children:l&&ct("div",{className:"stHtml","data-testid":"stHtml",ref:f,dangerouslySetInnerHTML:{__html:l}})})}const gn=J.memo(En);export{gn as default};
@@ -1 +1 @@
1
- import{r as s,E as N,_ as $,n as u,D as ht,y as Y,j as n,b9 as J,bu as ft,C as S,bp as Q,b4 as Z,bo as U,a_ as mt,bF as yt,bj as vt,bG as I,bs as wt,F as tt,bg as Ct,bH as It,K as B,bl as bt,bk as xt}from"./index.od8XlC_e.js";import{g as St,F as zt,C as Ft,I as Et,E as Ut,u as Ht,a as Tt}from"./FileDropzone.xME_qwl7.js";import{I as Dt}from"./InputInstructions.C5AiI5fd.js";import{i as kt}from"./inputUtils.CQWz5UKz.js";import{a as G}from"./index.DW_MHI2K.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Bt}from"./textarea.COkOU68B.js";import"./base-input.CoahMH6I.js";var et=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});et.displayName="AttachFile";var ot=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});ot.displayName="ErrorOutline";var nt=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});nt.displayName="Send";const Rt=u("div",{target:"e1djkbjp0"})("border:none;position:relative;display:flex;"),Lt=u("div",{target:"e1djkbjp1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Mt=u("button",{target:"e1djkbjp2"})(({theme:t,disabled:e,extended:l})=>{const d=ht(t),[f,g]=d?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.chatInput,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?f:g,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray,cursor:"not-allowed"}}}),Vt=u("div",{target:"e1djkbjp3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Nt=u("div",{target:"e1djkbjp4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),$t=u("div",{target:"ewqvugz0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),At=u("div",{target:"ewqvugz1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Wt=u("div",{target:"ewqvugz2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),qt=u("div",{target:"ewqvugz3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),Pt=u("div",{target:"ewqvugz4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),jt=u("div",{target:"ewqvugz5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Kt=u("div",{target:"ewqvugz6"})(({})=>({display:"flex"})),Ot=u("div",{target:"ewqvugz7"})(({})=>({flex:"0 0 auto"})),_t=u("div",{target:"ewqvugz8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Xt=u("div",{target:"ewqvugz9"})(({theme:t})=>({color:t.colors.fadedText60})),Gt=u("div",{target:"ewqvugz10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Yt=u("div",{target:"ewqvugz11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Jt=u("small",{target:"ewqvugz12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Qt({children:t,content:e}){const l=Y();return n(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${l.sizes.minElementHeight}`}}},children:t})}const Zt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return n(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(Qt,{content:t.status.errorMessage,children:n(U,{content:ot,size:"lg"})});case"uploaded":return n(U,{content:Et,size:"lg"});default:return mt(e),null}},te=({fileInfo:t,onDelete:e})=>S(_t,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(Xt,{children:n(Zt,{fileInfo:t})}),n(Gt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(Yt,{children:St(t.size,zt.Byte)}),n(Jt,{"data-testid":"stChatInputDeleteBtn",children:n(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:n(U,{content:Ft,size:"lg"})})})]}),ee=({items:t,onDelete:e})=>n(jt,{"data-testid":"stChatUploadedFiles",children:n(Kt,{children:t.map(l=>n(Ot,{children:n(te,{fileInfo:l,onDelete:e})},l.id))})}),oe=({getNextLocalFileId:t,addFiles:e,updateFile:l,uploadClient:d,element:f,onUploadProgress:g,onUploadComplete:m})=>(v,h)=>{const y=G.CancelToken.source(),c=new V(h.name,h.size,t(),{type:"uploading",cancelToken:y,progress:1});e([c]),d.uploadFile({formId:"",...f},v.uploadUrl,h,p=>g(p,c.id),y.token).then(()=>m(c.id,v)).catch(p=>{G.isCancel(p)||l(c.id,c.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},ne=({acceptMultipleFiles:t,uploadClient:e,uploadFile:l,addFiles:d,getNextLocalFileId:f,deleteExistingFiles:g,onUploadComplete:m})=>(v,h)=>{if(!t&&v.length===0&&h.length>1){const y=h.findIndex(c=>{var p;return((p=c.errors)==null?void 0:p[0].code)===Ut.TooManyFiles});y>=0&&(v.push(h[y].file),h.splice(y,1))}if(!t&&v.length>0&&g(),e.fetchFileURLs(v).then(y=>{vt(y,v).forEach(([c,p])=>{l(c,p)})}).catch(y=>{d(v.map(c=>new V(c.name,c.size,f(),{type:"error",errorMessage:y})))}),h.length>0){const y=h.map(c=>new V(c.file.name,c.file.size,f(),{type:"error",errorMessage:c.errors.map(p=>p.message).filter(p=>!!p).join(", ")}));d(y)}m()},re=({getRootProps:t,getInputProps:e,acceptFile:l,disabled:d,theme:f})=>S(Wt,{disabled:d,children:[S(qt,{"data-testid":"stChatInputFileUploadButton",disabled:d,...t(),children:[n("input",{...e()}),n(wt,{content:`Upload or drag and drop ${l===I.Multiple?"files":"a file"}`,placement:J.TOP,onMouseEnterDelay:500,children:n(Q,{kind:Z.MINIMAL,disabled:d,children:n(U,{content:et,size:"lg",color:d?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(Pt,{})]}),ae=({getRootProps:t,getInputProps:e,acceptFile:l,inputHeight:d})=>S(tt,{children:[n($t,{height:d,...t(),children:n("input",{...e()})}),n(At,{height:d,children:`Drag and drop ${l===I.Multiple?"files":"a file"} here`})]}),ie=6.5,R=1,L=(t,e,l)=>l.map(d=>d.id===t?e:d),M=(t,e)=>e.find(l=>l.id===t);function se({disabled:t,element:e,widgetMgr:l,fragmentId:d,uploadClient:f}){const g=Y(),m=s.useRef(null),v=s.useRef(0),h=s.useRef({minHeight:0,maxHeight:0}),{values:[y],elementRef:c}=Ct(s.useMemo(()=>["width"],[])),[p,T]=s.useState(!1),[z,D]=s.useState(e.default),[F,A]=s.useState(0),[H,rt]=s.useState(!1),[b,x]=s.useState([]),[E,k]=s.useState(!1),C=It(e.acceptFile),W=s.useCallback(o=>x(r=>[...r,...o]),[]),q=s.useCallback(o=>{x(r=>{const i=M(o,r);return B(i)?r:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&f.deleteFile(i.status.fileUrls.deleteUrl),r.filter(a=>a.id!==o))})},[f]),at=()=>{const o=b.filter(r=>r.status.type==="uploaded").map(r=>{const{name:i,size:a,status:w}=r,{fileId:ut,fileUrls:gt}=w;return new bt({fileId:ut,fileUrls:gt,name:i,size:a})});return new xt({uploadedFileInfo:o})},P=()=>v.current++,it=ne({acceptMultipleFiles:C===I.Multiple,uploadClient:f,uploadFile:oe({getNextLocalFileId:P,addFiles:W,updateFile:(o,r)=>{x(i=>L(o,r,i))},uploadClient:f,element:e,onUploadProgress:(o,r)=>{x(i=>{const a=M(r,i);if(B(a)||a.status.type!=="uploading")return i;const w=Math.round(o.loaded*100/o.total);return a.status.progress===w?i:L(r,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:w}),i)})},onUploadComplete:(o,r)=>{x(i=>{const a=M(o,i);return B(a)||a.status.type!=="uploading"?i:L(a.id,a.setStatus({type:"uploaded",fileId:r.fileId,fileUrls:r}),i)})}}),addFiles:W,getNextLocalFileId:P,deleteExistingFiles:()=>b.forEach(o=>q(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:j,getInputProps:K}=Ht({onDrop:it,multiple:C===I.Multiple,accept:Tt(e.fileType)}),st=()=>{let o=0;const{current:r}=m;if(r){const i=r.placeholder;r.placeholder="",r.style.height="auto",o=r.scrollHeight,r.placeholder=i,r.style.height=""}return o},O=()=>{if(m.current&&m.current.focus(),!p||t)return;const o={data:z,fileUploaderState:at()};l.setChatInputValue(e,o,{fromUi:!0},d),T(!1),x([]),D(""),A(0)},lt=o=>{const{metaKey:r,ctrlKey:i,shiftKey:a}=o;kt(o)&&!a&&!i&&!r&&(o.preventDefault(),O())},dt=o=>{const{value:r}=o.target,{maxChars:i}=e;i!==0&&r.length>i||(D(r),A(st()))};s.useEffect(()=>b.some(o=>o.status.type==="uploading")?T(!1):T(z!==""||b.length>0),[b,z]),s.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";D(o)}},[e]),s.useEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*ie}},[m]),s.useEffect(()=>{const o=a=>{var w;a.preventDefault(),a.stopPropagation(),!E&&((w=a.dataTransfer)!=null&&w.types.includes("Files"))&&k(!0)},r=a=>{a.preventDefault(),a.stopPropagation(),E&&(a.clientX<=0&&a.clientY<=0||a.clientX>=window.innerWidth&&a.clientY>=window.innerHeight)&&k(!1)},i=a=>{a.preventDefault(),a.stopPropagation(),E&&k(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",r),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",r)}},[E]),s.useEffect(()=>{const{minHeight:o}=h.current;rt(F>0&&m.current?Math.abs(F-o)>R:!1)},[F]);const{placeholder:_,maxChars:ct}=e,{maxHeight:X}=h.current,pt=C!==I.None&&E;return S(tt,{children:[C===I.None?null:n(ee,{items:[...b],onDelete:q}),n(Rt,{className:"stChatInput","data-testid":"stChatInput",ref:c,children:pt?n(ae,{getRootProps:j,getInputProps:K,acceptFile:C,inputHeight:H?`${F+R}px`:g.sizes.minElementHeight}):S(Lt,{extended:H,children:[C===I.None?null:n(re,{getRootProps:j,getInputProps:K,acceptFile:C,disabled:t,theme:g}),n(Bt,{inputRef:m,value:z,placeholder:_,onChange:dt,onKeyDown:lt,"aria-label":_,disabled:t,rows:1,overrides:{Root:{style:{minHeight:g.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:g.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${F+R}px`:"auto",maxHeight:X?`${X}px`:"none",paddingLeft:g.spacing.none,paddingBottom:g.spacing.sm,paddingTop:g.spacing.sm,paddingRight:`calc(${g.iconSizes.xl} + 2 * ${g.spacing.sm} + ${g.spacing.sm})`}}}}),y>g.breakpoints.hideWidgetDetails&&n(Nt,{children:n(Dt,{dirty:p,value:z,maxLength:ct,type:"chat",inForm:!1})}),n(Vt,{children:n(Mt,{onClick:O,disabled:!p||t,extended:H,"data-testid":"stChatInputSubmitButton",children:n(U,{content:nt,size:"xl",color:"inherit"})})})]})})]})}const me=s.memo(se);export{me as default};
1
+ import{r as s,E as N,_ as $,n as u,D as ht,y as Y,j as n,b9 as J,bu as ft,C as S,bp as Q,b4 as Z,bo as U,a_ as mt,bF as yt,bj as vt,bG as I,bs as wt,F as tt,bg as Ct,bH as It,K as B,bl as bt,bk as xt}from"./index.6zGrdP7S.js";import{g as St,F as zt,C as Ft,I as Et,E as Ut,u as Ht,a as Tt}from"./FileDropzone.uWzTac7M.js";import{I as Dt}from"./InputInstructions.M8GsfWtP.js";import{i as kt}from"./inputUtils.CQWz5UKz.js";import{a as G}from"./index.DW_MHI2K.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Bt}from"./textarea.D47OO5VD.js";import"./base-input.Dz6cKnV_.js";var et=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});et.displayName="AttachFile";var ot=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});ot.displayName="ErrorOutline";var nt=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(N,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});nt.displayName="Send";const Rt=u("div",{target:"e1djkbjp0"})("border:none;position:relative;display:flex;"),Lt=u("div",{target:"e1djkbjp1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Mt=u("button",{target:"e1djkbjp2"})(({theme:t,disabled:e,extended:l})=>{const d=ht(t),[f,g]=d?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.chatInput,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?f:g,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray,cursor:"not-allowed"}}}),Vt=u("div",{target:"e1djkbjp3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),Nt=u("div",{target:"e1djkbjp4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),$t=u("div",{target:"ewqvugz0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),At=u("div",{target:"ewqvugz1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Wt=u("div",{target:"ewqvugz2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),qt=u("div",{target:"ewqvugz3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),Pt=u("div",{target:"ewqvugz4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),jt=u("div",{target:"ewqvugz5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Kt=u("div",{target:"ewqvugz6"})(({})=>({display:"flex"})),Ot=u("div",{target:"ewqvugz7"})(({})=>({flex:"0 0 auto"})),_t=u("div",{target:"ewqvugz8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Xt=u("div",{target:"ewqvugz9"})(({theme:t})=>({color:t.colors.fadedText60})),Gt=u("div",{target:"ewqvugz10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Yt=u("div",{target:"ewqvugz11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Jt=u("small",{target:"ewqvugz12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Qt({children:t,content:e}){const l=Y();return n(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${l.sizes.minElementHeight}`}}},children:t})}const Zt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return n(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(Qt,{content:t.status.errorMessage,children:n(U,{content:ot,size:"lg"})});case"uploaded":return n(U,{content:Et,size:"lg"});default:return mt(e),null}},te=({fileInfo:t,onDelete:e})=>S(_t,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(Xt,{children:n(Zt,{fileInfo:t})}),n(Gt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(Yt,{children:St(t.size,zt.Byte)}),n(Jt,{"data-testid":"stChatInputDeleteBtn",children:n(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:n(U,{content:Ft,size:"lg"})})})]}),ee=({items:t,onDelete:e})=>n(jt,{"data-testid":"stChatUploadedFiles",children:n(Kt,{children:t.map(l=>n(Ot,{children:n(te,{fileInfo:l,onDelete:e})},l.id))})}),oe=({getNextLocalFileId:t,addFiles:e,updateFile:l,uploadClient:d,element:f,onUploadProgress:g,onUploadComplete:m})=>(v,h)=>{const y=G.CancelToken.source(),c=new V(h.name,h.size,t(),{type:"uploading",cancelToken:y,progress:1});e([c]),d.uploadFile({formId:"",...f},v.uploadUrl,h,p=>g(p,c.id),y.token).then(()=>m(c.id,v)).catch(p=>{G.isCancel(p)||l(c.id,c.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},ne=({acceptMultipleFiles:t,uploadClient:e,uploadFile:l,addFiles:d,getNextLocalFileId:f,deleteExistingFiles:g,onUploadComplete:m})=>(v,h)=>{if(!t&&v.length===0&&h.length>1){const y=h.findIndex(c=>{var p;return((p=c.errors)==null?void 0:p[0].code)===Ut.TooManyFiles});y>=0&&(v.push(h[y].file),h.splice(y,1))}if(!t&&v.length>0&&g(),e.fetchFileURLs(v).then(y=>{vt(y,v).forEach(([c,p])=>{l(c,p)})}).catch(y=>{d(v.map(c=>new V(c.name,c.size,f(),{type:"error",errorMessage:y})))}),h.length>0){const y=h.map(c=>new V(c.file.name,c.file.size,f(),{type:"error",errorMessage:c.errors.map(p=>p.message).filter(p=>!!p).join(", ")}));d(y)}m()},re=({getRootProps:t,getInputProps:e,acceptFile:l,disabled:d,theme:f})=>S(Wt,{disabled:d,children:[S(qt,{"data-testid":"stChatInputFileUploadButton",disabled:d,...t(),children:[n("input",{...e()}),n(wt,{content:`Upload or drag and drop ${l===I.Multiple?"files":"a file"}`,placement:J.TOP,onMouseEnterDelay:500,children:n(Q,{kind:Z.MINIMAL,disabled:d,children:n(U,{content:et,size:"lg",color:d?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(Pt,{})]}),ae=({getRootProps:t,getInputProps:e,acceptFile:l,inputHeight:d})=>S(tt,{children:[n($t,{height:d,...t(),children:n("input",{...e()})}),n(At,{height:d,children:`Drag and drop ${l===I.Multiple?"files":"a file"} here`})]}),ie=6.5,R=1,L=(t,e,l)=>l.map(d=>d.id===t?e:d),M=(t,e)=>e.find(l=>l.id===t);function se({disabled:t,element:e,widgetMgr:l,fragmentId:d,uploadClient:f}){const g=Y(),m=s.useRef(null),v=s.useRef(0),h=s.useRef({minHeight:0,maxHeight:0}),{values:[y],elementRef:c}=Ct(s.useMemo(()=>["width"],[])),[p,T]=s.useState(!1),[z,D]=s.useState(e.default),[F,A]=s.useState(0),[H,rt]=s.useState(!1),[b,x]=s.useState([]),[E,k]=s.useState(!1),C=It(e.acceptFile),W=s.useCallback(o=>x(r=>[...r,...o]),[]),q=s.useCallback(o=>{x(r=>{const i=M(o,r);return B(i)?r:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&f.deleteFile(i.status.fileUrls.deleteUrl),r.filter(a=>a.id!==o))})},[f]),at=()=>{const o=b.filter(r=>r.status.type==="uploaded").map(r=>{const{name:i,size:a,status:w}=r,{fileId:ut,fileUrls:gt}=w;return new bt({fileId:ut,fileUrls:gt,name:i,size:a})});return new xt({uploadedFileInfo:o})},P=()=>v.current++,it=ne({acceptMultipleFiles:C===I.Multiple,uploadClient:f,uploadFile:oe({getNextLocalFileId:P,addFiles:W,updateFile:(o,r)=>{x(i=>L(o,r,i))},uploadClient:f,element:e,onUploadProgress:(o,r)=>{x(i=>{const a=M(r,i);if(B(a)||a.status.type!=="uploading")return i;const w=Math.round(o.loaded*100/o.total);return a.status.progress===w?i:L(r,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:w}),i)})},onUploadComplete:(o,r)=>{x(i=>{const a=M(o,i);return B(a)||a.status.type!=="uploading"?i:L(a.id,a.setStatus({type:"uploaded",fileId:r.fileId,fileUrls:r}),i)})}}),addFiles:W,getNextLocalFileId:P,deleteExistingFiles:()=>b.forEach(o=>q(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:j,getInputProps:K}=Ht({onDrop:it,multiple:C===I.Multiple,accept:Tt(e.fileType)}),st=()=>{let o=0;const{current:r}=m;if(r){const i=r.placeholder;r.placeholder="",r.style.height="auto",o=r.scrollHeight,r.placeholder=i,r.style.height=""}return o},O=()=>{if(m.current&&m.current.focus(),!p||t)return;const o={data:z,fileUploaderState:at()};l.setChatInputValue(e,o,{fromUi:!0},d),T(!1),x([]),D(""),A(0)},lt=o=>{const{metaKey:r,ctrlKey:i,shiftKey:a}=o;kt(o)&&!a&&!i&&!r&&(o.preventDefault(),O())},dt=o=>{const{value:r}=o.target,{maxChars:i}=e;i!==0&&r.length>i||(D(r),A(st()))};s.useEffect(()=>b.some(o=>o.status.type==="uploading")?T(!1):T(z!==""||b.length>0),[b,z]),s.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";D(o)}},[e]),s.useEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*ie}},[m]),s.useEffect(()=>{const o=a=>{var w;a.preventDefault(),a.stopPropagation(),!E&&((w=a.dataTransfer)!=null&&w.types.includes("Files"))&&k(!0)},r=a=>{a.preventDefault(),a.stopPropagation(),E&&(a.clientX<=0&&a.clientY<=0||a.clientX>=window.innerWidth&&a.clientY>=window.innerHeight)&&k(!1)},i=a=>{a.preventDefault(),a.stopPropagation(),E&&k(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",r),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",r)}},[E]),s.useEffect(()=>{const{minHeight:o}=h.current;rt(F>0&&m.current?Math.abs(F-o)>R:!1)},[F]);const{placeholder:_,maxChars:ct}=e,{maxHeight:X}=h.current,pt=C!==I.None&&E;return S(tt,{children:[C===I.None?null:n(ee,{items:[...b],onDelete:q}),n(Rt,{className:"stChatInput","data-testid":"stChatInput",ref:c,children:pt?n(ae,{getRootProps:j,getInputProps:K,acceptFile:C,inputHeight:H?`${F+R}px`:g.sizes.minElementHeight}):S(Lt,{extended:H,children:[C===I.None?null:n(re,{getRootProps:j,getInputProps:K,acceptFile:C,disabled:t,theme:g}),n(Bt,{inputRef:m,value:z,placeholder:_,onChange:dt,onKeyDown:lt,"aria-label":_,disabled:t,rows:1,overrides:{Root:{style:{minHeight:g.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:g.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${F+R}px`:"auto",maxHeight:X?`${X}px`:"none",paddingLeft:g.spacing.none,paddingBottom:g.spacing.sm,paddingTop:g.spacing.sm,paddingRight:`calc(${g.iconSizes.xl} + 2 * ${g.spacing.sm} + ${g.spacing.sm})`}}}}),y>g.breakpoints.hideWidgetDetails&&n(Nt,{children:n(Dt,{dirty:p,value:z,maxLength:ct,type:"chat",inForm:!1})}),n(Vt,{children:n(Mt,{onClick:O,disabled:!p||t,extended:H,"data-testid":"stChatInputSubmitButton",children:n(U,{content:nt,size:"xl",color:"inherit"})})})]})})]})}const me=s.memo(se);export{me as default};
@@ -1 +1 @@
1
- import{r as s,K as b,j as S,br as d,c5 as x}from"./index.od8XlC_e.js";import{a as V}from"./useBasicWidgetState.B8dRKvrk.js";import"./FormClearHelper.D7FpzEHQ.js";const v=(t,e)=>t.getIntValue(e),U=t=>t.default??null,h=t=>t.value??null,C=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},F=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:u,help:n,label:c,labelVisibility:r,placeholder:i}=e,[m,l]=V({getStateFromWidgetMgr:v,getDefaultStateFromProto:U,getCurrStateFromProto:h,updateWidgetMgrState:C,element:e,widgetMgr:o,fragmentId:a}),g=s.useCallback(p=>{l({value:p,fromUi:!0})},[l]),f=b(e.default)&&!t;return S(x,{label:c,labelVisibility:d(r==null?void 0:r.value),options:u,disabled:t,onChange:g,value:m,help:n,placeholder:i,clearable:f})},j=s.memo(F);export{j as default};
1
+ import{r as s,K as b,j as S,br as d,c5 as x}from"./index.6zGrdP7S.js";import{a as V}from"./useBasicWidgetState.DH0ClB0l.js";import"./FormClearHelper.CEl0YyS3.js";const v=(t,e)=>t.getIntValue(e),U=t=>t.default??null,h=t=>t.value??null,C=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},F=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:u,help:n,label:c,labelVisibility:r,placeholder:i}=e,[m,l]=V({getStateFromWidgetMgr:v,getDefaultStateFromProto:U,getCurrStateFromProto:h,updateWidgetMgrState:C,element:e,widgetMgr:o,fragmentId:a}),g=s.useCallback(p=>{l({value:p,fromUi:!0})},[l]),f=b(e.default)&&!t;return S(x,{label:c,labelVisibility:d(r==null?void 0:r.value),options:u,disabled:t,onChange:g,value:m,help:n,placeholder:i,clearable:f})},j=s.memo(F);export{j as default};