streamlit-nightly 1.42.1.dev20250205__py2.py3-none-any.whl → 1.42.1.dev20250206__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 (72) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/static/js/{FileDownload.esm.ShSIWsKj.js → FileDownload.esm.DwBO4CPU.js} +1 -1
  3. streamlit/static/static/js/{FileDropzone.BFkJKygp.js → FileDropzone.l_rm_qyP.js} +1 -1
  4. streamlit/static/static/js/{FormClearHelper.Bue0QSIn.js → FormClearHelper.LI0uGKXr.js} +1 -1
  5. streamlit/static/static/js/{Hooks.kV16_k1-.js → Hooks.Dic60qKO.js} +1 -1
  6. streamlit/static/static/js/{InputInstructions.DpG38kbY.js → InputInstructions.BVSrSzyM.js} +1 -1
  7. streamlit/static/static/js/{ProgressBar.B_WJAIyy.js → ProgressBar.CiuIhn-j.js} +1 -1
  8. streamlit/static/static/js/{RenderInPortalIfExists.CGAGPcQq.js → RenderInPortalIfExists.DXoPwgJm.js} +1 -1
  9. streamlit/static/static/js/{Toolbar.DBtrI961.js → Toolbar.Bws727nN.js} +1 -1
  10. streamlit/static/static/js/{base-input.P8VGAZdC.js → base-input.BG3_mR5a.js} +1 -1
  11. streamlit/static/static/js/{createSuper.GYQHnroV.js → createSuper.BF6PuRKW.js} +1 -1
  12. streamlit/static/static/js/{data-grid-overlay-editor.B1sLTR3f.js → data-grid-overlay-editor.Bv759UXp.js} +1 -1
  13. streamlit/static/static/js/{downloader.y-Ssi2d3.js → downloader.CVHmveIJ.js} +1 -1
  14. streamlit/static/static/js/{es6.DpUKmjxe.js → es6.CKbvqIhx.js} +2 -2
  15. streamlit/static/static/js/{iframeResizer.contentWindow.BBjdpeP0.js → iframeResizer.contentWindow.BkEeeo8L.js} +1 -1
  16. streamlit/static/static/js/{index.DHOnt3Rd.js → index.--2AyPrU.js} +1 -1
  17. streamlit/static/static/js/{index.CIkzV9zP.js → index.B5Uxprvt.js} +1 -1
  18. streamlit/static/static/js/{index.CoJayF2l.js → index.BImYg1mO.js} +1 -1
  19. streamlit/static/static/js/{index.BqiT_qyM.js → index.BKVJ1VBu.js} +1 -1
  20. streamlit/static/static/js/{index.C73Hi-mL.js → index.BOWcB5X0.js} +1 -1
  21. streamlit/static/static/js/{index.Cd8_b4vi.js → index.BOaiJM1y.js} +1 -1
  22. streamlit/static/static/js/{index.DNKGONSt.js → index.BkPpT8KL.js} +1 -1
  23. streamlit/static/static/js/{index.BRsob9Jp.js → index.C07oOjJI.js} +1 -1
  24. streamlit/static/static/js/index.C4CvtPIA.js +1 -0
  25. streamlit/static/static/js/{index.C-BkiutF.js → index.C583HQPW.js} +1 -1
  26. streamlit/static/static/js/{index.DdJR-Re7.js → index.C7ShUXWu.js} +1 -1
  27. streamlit/static/static/js/{index.D2i6l9uv.js → index.CIUGbfN-.js} +1 -1
  28. streamlit/static/static/js/{index.B11A7C7I.js → index.CLsR30iv.js} +1 -1
  29. streamlit/static/static/js/{index.2bJmI0Ih.js → index.CYyMatnb.js} +1 -1
  30. streamlit/static/static/js/{index.3k422wEU.js → index.C_i45xvQ.js} +1 -1
  31. streamlit/static/static/js/{index.B7aeIxns.js → index.CfBMTPce.js} +1 -1
  32. streamlit/static/static/js/{index.C8vyFGOc.js → index.Cs3niYHd.js} +1 -1
  33. streamlit/static/static/js/{index.D-Qsohh0.js → index.D0P1HMA1.js} +1 -1
  34. streamlit/static/static/js/{index.GZ99DH1Q.js → index.D4zWkike.js} +5 -5
  35. streamlit/static/static/js/{index.CC_i5fnL.js → index.DC0pyGdw.js} +1 -1
  36. streamlit/static/static/js/{index.OWYUy0bC.js → index.DC2ac6Nk.js} +1 -1
  37. streamlit/static/static/js/{index.USVf5VUT.js → index.DCUW0b-w.js} +1 -1
  38. streamlit/static/static/js/{index.CZFA90VV.js → index.DET-MvNj.js} +1 -1
  39. streamlit/static/static/js/{index.CVIsVMt0.js → index.DI1n7tF5.js} +1 -1
  40. streamlit/static/static/js/{index.D_CViY1G.js → index.DMae4Z-0.js} +1 -1
  41. streamlit/static/static/js/{index.B7AJyWjy.js → index.DRYIN7K5.js} +1 -1
  42. streamlit/static/static/js/{index.D3PlNa4T.js → index.DZhFuLsM.js} +1 -1
  43. streamlit/static/static/js/{index.BW_6EVtw.js → index.DvjJSBT_.js} +1 -1
  44. streamlit/static/static/js/{index.DsOZJLyF.js → index.Gdr5urlE.js} +1 -1
  45. streamlit/static/static/js/{index.CUzW8sZB.js → index.TDbcj-aD.js} +1 -1
  46. streamlit/static/static/js/{index.BVkJfCWM.js → index.UxOzm9KZ.js} +1 -1
  47. streamlit/static/static/js/{index.D7HtU_R4.js → index.VkiSji1p.js} +1 -1
  48. streamlit/static/static/js/{index.Cp60C2LQ.js → index.e9DSvZ6b.js} +1 -1
  49. streamlit/static/static/js/{index.DdaoJ1WZ.js → index.ezIYG9hW.js} +1 -1
  50. streamlit/static/static/js/{index.DuqdUleB.js → index.gthzAzzy.js} +4 -4
  51. streamlit/static/static/js/{index.Bkk4sBLz.js → index.lxFhX6K1.js} +1 -1
  52. streamlit/static/static/js/{index.CAQGqUJ5.js → index.y9PB-mTp.js} +1 -1
  53. streamlit/static/static/js/{input.BANuQoGH.js → input.ekQXAXS2.js} +1 -1
  54. streamlit/static/static/js/{memory.DTxlMbK7.js → memory.CzhWwr8k.js} +1 -1
  55. streamlit/static/static/js/{mergeWith.CfihrnQo.js → mergeWith.CjWtfLVK.js} +1 -1
  56. streamlit/static/static/js/{number-overlay-editor.BHsEp8VL.js → number-overlay-editor.CFFRhwzv.js} +1 -1
  57. streamlit/static/static/js/{possibleConstructorReturn.BErM7qST.js → possibleConstructorReturn.BiMrneUm.js} +1 -1
  58. streamlit/static/static/js/{sandbox.BMuVLu80.js → sandbox.B1Cwdby0.js} +1 -1
  59. streamlit/static/static/js/{textarea.CmSZv6UE.js → textarea.BYQOUi7u.js} +1 -1
  60. streamlit/static/static/js/{timepicker.DsaAj0da.js → timepicker.BbVkXpKf.js} +1 -1
  61. streamlit/static/static/js/{toConsumableArray.DJs7oxRq.js → toConsumableArray.eNZZBqsg.js} +1 -1
  62. streamlit/static/static/js/{uniqueId.CVe3uxKs.js → uniqueId.Ci60uueL.js} +1 -1
  63. streamlit/static/static/js/{useBasicWidgetState.D572sX2t.js → useBasicWidgetState.BJ0FCAzu.js} +1 -1
  64. streamlit/static/static/js/{useOnInputChange.D9rTVyjn.js → useOnInputChange.xhIvlf7z.js} +1 -1
  65. streamlit/static/static/js/{withFullScreenWrapper.4QDrgZxA.js → withFullScreenWrapper.CKNKx70m.js} +1 -1
  66. {streamlit_nightly-1.42.1.dev20250205.dist-info → streamlit_nightly-1.42.1.dev20250206.dist-info}/METADATA +1 -1
  67. {streamlit_nightly-1.42.1.dev20250205.dist-info → streamlit_nightly-1.42.1.dev20250206.dist-info}/RECORD +71 -71
  68. streamlit/static/static/js/index.CIwUls4J.js +0 -1
  69. {streamlit_nightly-1.42.1.dev20250205.data → streamlit_nightly-1.42.1.dev20250206.data}/scripts/streamlit.cmd +0 -0
  70. {streamlit_nightly-1.42.1.dev20250205.dist-info → streamlit_nightly-1.42.1.dev20250206.dist-info}/WHEEL +0 -0
  71. {streamlit_nightly-1.42.1.dev20250205.dist-info → streamlit_nightly-1.42.1.dev20250206.dist-info}/entry_points.txt +0 -0
  72. {streamlit_nightly-1.42.1.dev20250205.dist-info → streamlit_nightly-1.42.1.dev20250206.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{r,b as $}from"./index.DuqdUleB.js";import{s as z,i as w,a as J,b as Q,T as U,C as Z,m as ee}from"./index.GZ99DH1Q.js";import"./FormClearHelper.Bue0QSIn.js";import"./withFullScreenWrapper.4QDrgZxA.js";import"./Toolbar.DBtrI961.js";import"./mergeWith.CfihrnQo.js";import"./sprintf.C-r3gIuM.js";import"./createDownloadLinkElement.DZMwyjvU.js";import"./toConsumableArray.DJs7oxRq.js";import"./possibleConstructorReturn.BErM7qST.js";import"./createSuper.GYQHnroV.js";import"./FileDownload.esm.ShSIWsKj.js";const te=()=>t=>t.targetX,re=()=>t=>t.targetY,ie=()=>t=>t.targetWidth,ne=()=>t=>t.targetHeight,se=()=>t=>t.targetY+10,ae=()=>t=>Math.max(0,(t.targetHeight-28)/2),oe=z("div")({name:"DataGridOverlayEditorStyle",class:"gdg-d19meir1",propsAsIs:!1,vars:{"d19meir1-0":[re(),"px"],"d19meir1-1":[te(),"px"],"d19meir1-2":[ie(),"px"],"d19meir1-3":[ne(),"px"],"d19meir1-4":[se(),"px"],"d19meir1-5":[ae(),"px"]}});function de(){const[t,s]=r.useState();return[t??void 0,s]}function le(){const[t,s]=de(),[n,y]=r.useState(0),[g,x]=r.useState(!0);r.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const a=new IntersectionObserver(o=>{o.length!==0&&x(o[0].isIntersecting)},{threshold:1});return a.observe(t),()=>a.disconnect()},[t]),r.useEffect(()=>{if(g||t===void 0)return;let a;const o=()=>{const{right:S}=t.getBoundingClientRect();y(p=>Math.min(p+window.innerWidth-S-10,0)),a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!==void 0&&cancelAnimationFrame(a)}},[t,g]);const O=r.useMemo(()=>({transform:`translateX(${n}px)`}),[n]);return{ref:s,style:O}}const Oe=t=>{const{target:s,content:n,onFinishEditing:y,forceEditMode:g,initialValue:x,imageEditorOverride:O,markdownDivCreateNode:a,highlight:o,className:S,theme:p,id:H,cell:v,bloom:c,validateCell:d,getCellRenderer:F,provideEditor:h,isOutsideClick:X}=t,[l,A]=r.useState(g?n:void 0),k=r.useRef(l??n);k.current=l??n;const[E,R]=r.useState(()=>d===void 0?!0:!(w(n)&&(d==null?void 0:d(v,n,k.current))===!1)),f=r.useCallback((e,i)=>{y(E?e:void 0,i)},[E,y]),K=r.useCallback(e=>{if(d!==void 0&&e!==void 0&&w(e)){const i=d(v,e,k.current);i===!1?R(!1):(typeof i=="object"&&(e=i),R(!0))}A(e)},[v,d]),C=r.useRef(!1),m=r.useRef(void 0),W=r.useCallback(()=>{f(l,[0,0]),C.current=!0},[l,f]),Y=r.useCallback((e,i)=>{f(e,i??m.current??[0,0]),C.current=!0},[f]),j=r.useCallback(async e=>{let i=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),m.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),m.current=[0,1],i=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),m.current=[e.shiftKey?-1:1,0],i=!0),window.setTimeout(()=>{!C.current&&m.current!==void 0&&(f(i?l:void 0,m.current),C.current=!0)},0)},[f,l]),D=l??n,[u,q]=r.useMemo(()=>{var i,G;if(J(n))return[];const e=h==null?void 0:h(n);return e!==void 0?[e,!1]:[(G=(i=F(n))==null?void 0:i.provideEditor)==null?void 0:G.call(i,n),!1]},[n,F,h]),{ref:B,style:L}=le();let P=!0,M,_=!0,b;if(u!==void 0){P=u.disablePadding!==!0,_=u.disableStyling!==!0;const e=Q(u);e&&(b=u.styleOverride);const i=e?u.editor:u;M=r.createElement(i,{isHighlighted:o,onChange:K,value:D,initialValue:x,onFinishedEditing:Y,validatedSelection:w(D)?D.selectionRange:void 0,forceEditMode:g,target:s,imageEditorOverride:O,markdownDivCreateNode:a,isValid:E,theme:p})}b={...b,...L};const N=document.getElementById("portal");if(N===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `<div id="portal" />` as the last child of your `<body>`.'),null;let I=_?"gdg-style":"gdg-unstyle";E||(I+=" gdg-invalid"),P&&(I+=" gdg-pad");const T=(c==null?void 0:c[0])??1,V=(c==null?void 0:c[1])??1;return $.createPortal(r.createElement(U.Provider,{value:p},r.createElement(Z,{style:ee(p),className:S,onClickOutside:W,isOutsideClick:X},r.createElement(oe,{ref:B,id:H,className:I,style:b,as:q===!0?"label":void 0,targetX:s.x-T,targetY:s.y-V,targetWidth:s.width+T*2,targetHeight:s.height+V*2},r.createElement("div",{className:"gdg-clip-region",onKeyDown:j},M)))),N)};export{Oe as default};
1
+ import{r,b as $}from"./index.gthzAzzy.js";import{s as z,i as w,a as J,b as Q,T as U,C as Z,m as ee}from"./index.D4zWkike.js";import"./FormClearHelper.LI0uGKXr.js";import"./withFullScreenWrapper.CKNKx70m.js";import"./Toolbar.Bws727nN.js";import"./mergeWith.CjWtfLVK.js";import"./sprintf.C-r3gIuM.js";import"./createDownloadLinkElement.DZMwyjvU.js";import"./toConsumableArray.eNZZBqsg.js";import"./possibleConstructorReturn.BiMrneUm.js";import"./createSuper.BF6PuRKW.js";import"./FileDownload.esm.DwBO4CPU.js";const te=()=>t=>t.targetX,re=()=>t=>t.targetY,ie=()=>t=>t.targetWidth,ne=()=>t=>t.targetHeight,se=()=>t=>t.targetY+10,ae=()=>t=>Math.max(0,(t.targetHeight-28)/2),oe=z("div")({name:"DataGridOverlayEditorStyle",class:"gdg-d19meir1",propsAsIs:!1,vars:{"d19meir1-0":[re(),"px"],"d19meir1-1":[te(),"px"],"d19meir1-2":[ie(),"px"],"d19meir1-3":[ne(),"px"],"d19meir1-4":[se(),"px"],"d19meir1-5":[ae(),"px"]}});function de(){const[t,s]=r.useState();return[t??void 0,s]}function le(){const[t,s]=de(),[n,y]=r.useState(0),[g,x]=r.useState(!0);r.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const a=new IntersectionObserver(o=>{o.length!==0&&x(o[0].isIntersecting)},{threshold:1});return a.observe(t),()=>a.disconnect()},[t]),r.useEffect(()=>{if(g||t===void 0)return;let a;const o=()=>{const{right:S}=t.getBoundingClientRect();y(p=>Math.min(p+window.innerWidth-S-10,0)),a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!==void 0&&cancelAnimationFrame(a)}},[t,g]);const O=r.useMemo(()=>({transform:`translateX(${n}px)`}),[n]);return{ref:s,style:O}}const Oe=t=>{const{target:s,content:n,onFinishEditing:y,forceEditMode:g,initialValue:x,imageEditorOverride:O,markdownDivCreateNode:a,highlight:o,className:S,theme:p,id:H,cell:v,bloom:c,validateCell:d,getCellRenderer:F,provideEditor:h,isOutsideClick:X}=t,[l,A]=r.useState(g?n:void 0),k=r.useRef(l??n);k.current=l??n;const[E,R]=r.useState(()=>d===void 0?!0:!(w(n)&&(d==null?void 0:d(v,n,k.current))===!1)),f=r.useCallback((e,i)=>{y(E?e:void 0,i)},[E,y]),K=r.useCallback(e=>{if(d!==void 0&&e!==void 0&&w(e)){const i=d(v,e,k.current);i===!1?R(!1):(typeof i=="object"&&(e=i),R(!0))}A(e)},[v,d]),C=r.useRef(!1),m=r.useRef(void 0),W=r.useCallback(()=>{f(l,[0,0]),C.current=!0},[l,f]),Y=r.useCallback((e,i)=>{f(e,i??m.current??[0,0]),C.current=!0},[f]),j=r.useCallback(async e=>{let i=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),m.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),m.current=[0,1],i=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),m.current=[e.shiftKey?-1:1,0],i=!0),window.setTimeout(()=>{!C.current&&m.current!==void 0&&(f(i?l:void 0,m.current),C.current=!0)},0)},[f,l]),D=l??n,[u,q]=r.useMemo(()=>{var i,G;if(J(n))return[];const e=h==null?void 0:h(n);return e!==void 0?[e,!1]:[(G=(i=F(n))==null?void 0:i.provideEditor)==null?void 0:G.call(i,n),!1]},[n,F,h]),{ref:B,style:L}=le();let P=!0,M,_=!0,b;if(u!==void 0){P=u.disablePadding!==!0,_=u.disableStyling!==!0;const e=Q(u);e&&(b=u.styleOverride);const i=e?u.editor:u;M=r.createElement(i,{isHighlighted:o,onChange:K,value:D,initialValue:x,onFinishedEditing:Y,validatedSelection:w(D)?D.selectionRange:void 0,forceEditMode:g,target:s,imageEditorOverride:O,markdownDivCreateNode:a,isValid:E,theme:p})}b={...b,...L};const N=document.getElementById("portal");if(N===null)return console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `<div id="portal" />` as the last child of your `<body>`.'),null;let I=_?"gdg-style":"gdg-unstyle";E||(I+=" gdg-invalid"),P&&(I+=" gdg-pad");const T=(c==null?void 0:c[0])??1,V=(c==null?void 0:c[1])??1;return $.createPortal(r.createElement(U.Provider,{value:p},r.createElement(Z,{style:ee(p),className:S,onClickOutside:W,isOutsideClick:X},r.createElement(oe,{ref:B,id:H,className:I,style:b,as:q===!0?"label":void 0,targetX:s.x-T,targetY:s.y-V,targetWidth:s.width+T*2,targetHeight:s.height+V*2},r.createElement("div",{className:"gdg-clip-region",onKeyDown:j},M)))),N)};export{Oe as default};
@@ -1 +1 @@
1
- import{c as b,e as P}from"./es6.DpUKmjxe.js";import"./index.DuqdUleB.js";const{WritableStream:y,TransformStream:_,DOMException:v,Blob:u}=b,{GONE:E}=P,M=/constructor/i.test(window.HTMLElement);class F{constructor(e="unkown"){this.name=e,this.kind="file"}async getFile(){throw new v(...E)}async isSameEntry(e){return this===e}async createWritable(e={}){var d;const t=await((d=navigator.serviceWorker)==null?void 0:d.getRegistration()),o=document.createElement("a"),n=new _,R=n.writable;if(o.download=this.name,M||!t){let r=[];n.readable.pipeTo(new y({write(s){r.push(new u([s]))},close(){const s=new u(r,{type:"application/octet-stream; charset=utf-8"});r=[],o.href=URL.createObjectURL(s),o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e4)}}))}else{const{writable:r,readablePort:s}=new j(y),a=encodeURIComponent(this.name).replace(/['()]/g,escape).replace(/\*/g,"%2A"),f={"content-disposition":"attachment; filename*=UTF-8''"+a,"content-type":"application/octet-stream; charset=utf-8",...e.size?{"content-length":e.size}:{}},g=setTimeout(()=>t.active.postMessage(0),1e4);n.readable.pipeThrough(new _({transform(c,h){if(c instanceof Uint8Array)return h.enqueue(c);const w=new Response(c).body.getReader(),p=W=>w.read().then(m=>m.done?0:p(h.enqueue(m.value)));return p()}})).pipeTo(r).finally(()=>{clearInterval(g)}),t.active.postMessage({url:t.scope+a,headers:f,readablePort:s},[s]);const i=document.createElement("iframe");i.hidden=!0,i.src=t.scope+a,document.body.appendChild(i)}return R.getWriter()}}const T=0,L=0,O=1,U=1,k=2;class S{constructor(e){e.onmessage=t=>this._onMessage(t.data),this._port=e,this._resetReady()}start(e){return this._controller=e,this._readyPromise}write(e){const t={type:T,chunk:e};return this._port.postMessage(t,[e.buffer]),this._resetReady(),this._readyPromise}close(){this._port.postMessage({type:k}),this._port.close()}abort(e){this._port.postMessage({type:U,reason:e}),this._port.close()}_onMessage(e){e.type===L&&this._resolveReady(),e.type===O&&this._onError(e.reason)}_onError(e){this._controller.error(e),this._rejectReady(e),this._port.close()}_resetReady(){this._readyPromise=new Promise((e,t)=>{this._readyResolve=e,this._readyReject=t}),this._readyPending=!0}_resolveReady(){this._readyResolve(),this._readyPending=!1}_rejectReady(e){this._readyPending||this._resetReady(),this._readyPromise.catch(()=>{}),this._readyReject(e),this._readyPending=!1}}class j{constructor(e){const t=new MessageChannel;this.readablePort=t.port1,this.writable=new e(new S(t.port2))}}export{F as FileHandle};
1
+ import{c as b,e as P}from"./es6.CKbvqIhx.js";import"./index.gthzAzzy.js";const{WritableStream:y,TransformStream:_,DOMException:v,Blob:u}=b,{GONE:E}=P,M=/constructor/i.test(window.HTMLElement);class F{constructor(e="unkown"){this.name=e,this.kind="file"}async getFile(){throw new v(...E)}async isSameEntry(e){return this===e}async createWritable(e={}){var d;const t=await((d=navigator.serviceWorker)==null?void 0:d.getRegistration()),o=document.createElement("a"),n=new _,R=n.writable;if(o.download=this.name,M||!t){let r=[];n.readable.pipeTo(new y({write(s){r.push(new u([s]))},close(){const s=new u(r,{type:"application/octet-stream; charset=utf-8"});r=[],o.href=URL.createObjectURL(s),o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e4)}}))}else{const{writable:r,readablePort:s}=new j(y),a=encodeURIComponent(this.name).replace(/['()]/g,escape).replace(/\*/g,"%2A"),f={"content-disposition":"attachment; filename*=UTF-8''"+a,"content-type":"application/octet-stream; charset=utf-8",...e.size?{"content-length":e.size}:{}},g=setTimeout(()=>t.active.postMessage(0),1e4);n.readable.pipeThrough(new _({transform(c,h){if(c instanceof Uint8Array)return h.enqueue(c);const w=new Response(c).body.getReader(),p=W=>w.read().then(m=>m.done?0:p(h.enqueue(m.value)));return p()}})).pipeTo(r).finally(()=>{clearInterval(g)}),t.active.postMessage({url:t.scope+a,headers:f,readablePort:s},[s]);const i=document.createElement("iframe");i.hidden=!0,i.src=t.scope+a,document.body.appendChild(i)}return R.getWriter()}}const T=0,L=0,O=1,U=1,k=2;class S{constructor(e){e.onmessage=t=>this._onMessage(t.data),this._port=e,this._resetReady()}start(e){return this._controller=e,this._readyPromise}write(e){const t={type:T,chunk:e};return this._port.postMessage(t,[e.buffer]),this._resetReady(),this._readyPromise}close(){this._port.postMessage({type:k}),this._port.close()}abort(e){this._port.postMessage({type:U,reason:e}),this._port.close()}_onMessage(e){e.type===L&&this._resolveReady(),e.type===O&&this._onError(e.reason)}_onError(e){this._controller.error(e),this._rejectReady(e),this._port.close()}_resetReady(){this._readyPromise=new Promise((e,t)=>{this._readyResolve=e,this._readyReject=t}),this._readyPending=!0}_resolveReady(){this._readyResolve(),this._readyPending=!1}_rejectReady(e){this._readyPending||this._resetReady(),this._readyPromise.catch(()=>{}),this._readyReject(e),this._readyPending=!1}}class j{constructor(e){const t=new MessageChannel;this.readablePort=t.port1,this.writable=new e(new S(t.port2))}}export{F as FileHandle};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./downloader.y-Ssi2d3.js","./index.DuqdUleB.js","../css/index.DpJG_94W.css","./sandbox.BMuVLu80.js","./memory.DTxlMbK7.js"])))=>i.map(i=>d[i]);
2
- var G=Object.defineProperty;var R=a=>{throw TypeError(a)};var Y=(a,t,e)=>t in a?G(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var g=(a,t,e)=>Y(a,typeof t!="symbol"?t+"":t,e),X=(a,t,e)=>t.has(a)||R("Cannot "+e);var j=(a,t,e)=>t.has(a)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e),M=(a,t,e,r)=>(X(a,t,"write to private field"),r?r.call(a,e):t.set(a,e),e);import{w as d}from"./index.DuqdUleB.js";const N=globalThis.showDirectoryPicker;async function k(a={}){if(N&&!a._preferPolyfill)return N(a);const t=document.createElement("input");t.type="file",t.webkitdirectory=!0,t.multiple=!0,t.style.position="fixed",t.style.top="-100000px",t.style.left="-100000px",document.body.appendChild(t);const e=d(()=>Promise.resolve().then(()=>B),void 0,import.meta.url);return await new Promise(r=>{t.addEventListener("change",r),t.click()}),e.then(r=>r.getDirHandlesFromInput(t))}const J={accepts:[]},V=globalThis.showOpenFilePicker;async function K(a={}){const t={...J,...a};if(V&&!a._preferPolyfill)return V(t);const e=document.createElement("input");e.type="file",e.multiple=t.multiple,e.accept=(t.accepts||[]).map(n=>[...(n.extensions||[]).map(o=>"."+o),...n.mimeTypes||[]]).flat().join(","),Object.assign(e.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(e);const r=d(()=>Promise.resolve().then(()=>B),void 0,import.meta.url);return await new Promise(n=>{e.addEventListener("change",n,{once:!0}),e.click()}),e.remove(),r.then(n=>n.getFileHandlesFromInput(e))}const W=globalThis.showSaveFilePicker;async function Q(a={}){if(W&&!a._preferPolyfill)return W(a);a._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),a.suggestedName=a._name);const{FileSystemFileHandle:t}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url),{FileHandle:e}=await d(async()=>{const{FileHandle:r}=await import("./downloader.y-Ssi2d3.js");return{FileHandle:r}},__vite__mapDeps([0,1,2]),import.meta.url);return new t(new e(a.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const a=this.webkitGetAsEntry(),[{FileHandle:t,FolderHandle:e},{FileSystemDirectoryHandle:r},{FileSystemFileHandle:n}]=await Promise.all([d(()=>import("./sandbox.BMuVLu80.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>D),void 0,import.meta.url),d(()=>Promise.resolve().then(()=>_),void 0,import.meta.url)]);return a.isFile?new n(new t(a,!1)):new r(new e(a,!1))});async function Z(a,t={}){var o,s;if(!a)return((s=(o=globalThis.navigator)==null?void 0:o.storage)==null?void 0:s.getDirectory())||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:e}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>D);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),r=await a,n=await(r.default?r.default(t):r(t));return new e(n)}const ee={ReadableStream:globalThis.ReadableStream,WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:te}=ee;var H;const L=class L extends te{constructor(e){super(e);j(this,H);M(this,H,e),Object.setPrototypeOf(this,L.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),r=e.close();return e.releaseLock(),r}seek(e){return this.write({type:"seek",position:e})}truncate(e){return this.write({type:"truncate",size:e})}write(e){if(this._closed)return Promise.reject(new TypeError("Cannot write to a CLOSED writable stream"));const r=this.getWriter(),n=r.write(e);return r.releaseLock(),n}};H=new WeakMap;let p=L;Object.defineProperty(p.prototype,Symbol.toStringTag,{value:"FileSystemWritableFileStream",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(p.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}});globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=p);const m=Symbol("adapter");var q;q=m;class P{constructor(t){g(this,q);g(this,"name");g(this,"kind");this.kind=t.kind,this.name=t.name,this[m]=t}async queryPermission(t={}){const{mode:e="read"}=t,r=this[m];if(r.queryPermission)return r.queryPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return r.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async requestPermission({mode:t="read"}={}){const e=this[m];if(e.requestPermission)return e.requestPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return e.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async remove(t={}){await this[m].remove(t)}async isSameEntry(t){return this===t?!0:!t||typeof t!="object"||this.kind!==t.kind||!t[m]?!1:this[m].isSameEntry(t[m])}}Object.defineProperty(P.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});var $;globalThis.FileSystemHandle&&(($=globalThis.FileSystemHandle.prototype).queryPermission??($.queryPermission=function(a){return"granted"}));const x={INVALID:["seeking position failed.","InvalidStateError"],GONE:["A requested file or directory could not be found at the time an operation was processed.","NotFoundError"],MISMATCH:["The path supplied exists, but was not an entry of requested type.","TypeMismatchError"],MOD_ERR:["The object can not be modified in this way.","InvalidModificationError"],SYNTAX:a=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${a}`,"SyntaxError"],SECURITY:["It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.","SecurityError"],DISALLOWED:["The request is not allowed by the user agent or the platform in the current context.","NotAllowedError"]},re={writable:globalThis.WritableStream};async function ae(a){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[t,e,r]=await Promise.all([d(()=>import("./memory.DTxlMbK7.js"),__vite__mapDeps([4,1,2]),import.meta.url),d(()=>import("./sandbox.BMuVLu80.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>D),void 0,import.meta.url)]),n=new t.FolderHandle("",!1);return n._entries=a.map(o=>o.isFile?new e.FileHandle(o,!1):new e.FolderHandle(o,!1)),new r.FileSystemDirectoryHandle(n)}async function ie(a){const{FolderHandle:t,FileHandle:e}=await d(async()=>{const{FolderHandle:y,FileHandle:l}=await import("./memory.DTxlMbK7.js");return{FolderHandle:y,FileHandle:l}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemDirectoryHandle:r}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>D);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),n=Array.from(a.files),o=n[0].webkitRelativePath.split("/",1)[0],s=new t(o,!1);return n.forEach(y=>{const l=y.webkitRelativePath.split("/");l.shift();const c=l.pop(),f=l.reduce((w,b)=>(w._entries[b]||(w._entries[b]=new t(b,!1)),w._entries[b]),s);f._entries[c]=new e(y.name,y,!1)}),new r(s)}async function ne(a){const{FileHandle:t}=await d(async()=>{const{FileHandle:r}=await import("./memory.DTxlMbK7.js");return{FileHandle:r}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);return Array.from(a.files).map(r=>new e(new t(r.name,r,!1)))}const B=Object.freeze(Object.defineProperty({__proto__:null,config:re,errors:x,fromDataTransfer:ae,getDirHandlesFromInput:ie,getFileHandlesFromInput:ne},Symbol.toStringTag,{value:"Module"})),{GONE:oe,MOD_ERR:se}=x,u=Symbol("adapter");var z;let F=class T extends P{constructor(e){super(e);g(this,z);this[u]=e}async getDirectoryHandle(e,r={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");r.create=!!r.create;const n=await this[u].getDirectoryHandle(e,r);return new T(n)}async*entries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);for await(const[r,n]of this[u].entries())yield[n.name,n.kind==="file"?new e(n):new T(n)]}async*getEntries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);console.warn("deprecated, use .entries() instead");for await(let r of this[u].entries())yield r.kind==="file"?new e(r):new T(r)}async getFileHandle(e,r={}){const{FileSystemFileHandle:n}=await d(async()=>{const{FileSystemFileHandle:s}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:s}},void 0,import.meta.url);if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");r.create=!!r.create;const o=await this[u].getFileHandle(e,r);return new n(o)}async removeEntry(e,r={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");return r.recursive=!!r.recursive,this[u].removeEntry(e,r)}async resolve(e){if(await e.isSameEntry(this))return[];const r=[{handle:this,path:[]}];for(;r.length;){let{handle:n,path:o}=r.pop();for await(const s of n.values()){if(await s.isSameEntry(e))return[...o,s.name];s.kind==="directory"&&r.push({handle:s,path:[...o,s.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,r]of this)yield r}[(z=u,Symbol.asyncIterator)](){return this.entries()}};Object.defineProperty(F.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(F.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const a=globalThis.FileSystemDirectoryHandle.prototype;a.resolve=async function(o){if(await o.isSameEntry(this))return[];const s=[{handle:this,path:[]}];for(;s.length;){let{handle:y,path:l}=s.pop();for await(const c of y.values()){if(await c.isSameEntry(o))return[...l,c.name];c.kind==="directory"&&s.push({handle:c,path:[...l,c.name]})}}return null};async function t(n){if(await(await navigator.storage.getDirectory()).resolve(n)===null)throw new DOMException(...oe)}const e=a.entries;a.entries=async function*(){await t(this),yield*e.call(this)},a[Symbol.asyncIterator]=async function*(){yield*this.entries()};const r=a.removeEntry;a.removeEntry=async function(n,o={}){return r.call(this,n,o).catch(async s=>{throw s instanceof DOMException&&s.name==="UnknownError"&&!o.recursive&&!(await e.call(this).next()).done?new DOMException(...se):s})}}const D=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:F,default:F},Symbol.toStringTag,{value:"Module"})),{INVALID:le,SYNTAX:I,GONE:ce}=x,v=Symbol("adapter");var U,C;class S extends(C=P,U=v,C){constructor(e){super(e);g(this,U);this[v]=e}async createWritable(e={}){return new p(await this[v].createWritable(e))}async getFile(){return this[v].getFile()}}Object.defineProperty(S.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(S.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const a=new WeakMap;let t;const e=()=>{let n,o;onmessage=async s=>{const y=s.ports[0],l=s.data;switch(l.type){case"open":const c=l.name;let f=await navigator.storage.getDirectory();for(const w of l.path)f=await f.getDirectoryHandle(w);n=await f.getFileHandle(c),o=await n.createSyncAccessHandle();break;case"write":o.write(l.data,{at:l.position}),o.flush();break;case"truncate":o.truncate(l.size);break;case"abort":case"close":o.close();break}y.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(n){if(!t){const i=`(${e.toString()})()`,E=new Blob([i],{type:"text/javascript"});t=URL.createObjectURL(E)}const o=new Worker(t,{type:"module"});let s=0;const y=new TextEncoder;let l=await this.getFile().then(i=>i.size);const c=i=>new Promise((E,O)=>{const h=new MessageChannel;h.port1.onmessage=A=>{A.data instanceof Error?O(A.data):E(A.data),h.port1.close(),h.port2.close(),h.port1.onmessage=null},o.postMessage(i,[h.port2])}),f=await navigator.storage.getDirectory(),w=await a.get(this),b=await f.resolve(w);if(b===null)throw new DOMException(...ce);return await c({type:"open",path:b,name:this.name}),(n==null?void 0:n.keepExistingData)===!1&&(await c({type:"truncate",size:0}),l=0),new p({start:i=>{},async write(i){if((i==null?void 0:i.constructor)===Object?i={...i}:i={type:"write",data:i,position:s},i.type==="write"){if(!("data"in i))throw await c({type:"close"}),new DOMException(...I("write requires a data argument"));if(i.position??(i.position=s),typeof i.data=="string")i.data=y.encode(i.data);else if(i.data instanceof ArrayBuffer)i.data=new Uint8Array(i.data);else if(!(i.data instanceof Uint8Array)&&ArrayBuffer.isView(i.data))i.data=new Uint8Array(i.data.buffer,i.data.byteOffset,i.data.byteLength);else if(!(i.data instanceof Uint8Array)){const O=await new Response(i.data).arrayBuffer();i.data=new Uint8Array(O)}Number.isInteger(i.position)&&i.position>=0&&(s=i.position),s+=i.data.byteLength,l+=i.data.byteLength}else if(i.type==="seek")if(Number.isInteger(i.position)&&i.position>=0){if(l<i.position)throw new DOMException(...le);console.log("seeking",i),s=i.position;return}else throw await c({type:"close"}),new DOMException(...I("seek requires a position argument"));else if(i.type==="truncate")if(Number.isInteger(i.size)&&i.size>=0)l=i.size,s>l&&(s=l);else throw await c({type:"close"}),new DOMException(...I("truncate requires a size argument"));await c(i)},async close(){await c({type:"close"}),o.terminate()},async abort(i){await c({type:"abort",reason:i}),o.terminate()}})};const r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...n){const o=await r.call(this,...n);return a.set(o,this),o}}const _=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:S,default:S},Symbol.toStringTag,{value:"Module"})),ue=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:F,FileSystemFileHandle:S,FileSystemHandle:P,FileSystemWritableFileStream:p,getOriginPrivateDirectory:Z,showDirectoryPicker:k,showOpenFilePicker:K,showSaveFilePicker:Q},Symbol.toStringTag,{value:"Module"}));export{ue as a,ee as c,x as e};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./downloader.CVHmveIJ.js","./index.gthzAzzy.js","../css/index.DpJG_94W.css","./sandbox.B1Cwdby0.js","./memory.CzhWwr8k.js"])))=>i.map(i=>d[i]);
2
+ var G=Object.defineProperty;var R=a=>{throw TypeError(a)};var Y=(a,t,e)=>t in a?G(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var g=(a,t,e)=>Y(a,typeof t!="symbol"?t+"":t,e),X=(a,t,e)=>t.has(a)||R("Cannot "+e);var j=(a,t,e)=>t.has(a)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e),M=(a,t,e,r)=>(X(a,t,"write to private field"),r?r.call(a,e):t.set(a,e),e);import{w as d}from"./index.gthzAzzy.js";const N=globalThis.showDirectoryPicker;async function k(a={}){if(N&&!a._preferPolyfill)return N(a);const t=document.createElement("input");t.type="file",t.webkitdirectory=!0,t.multiple=!0,t.style.position="fixed",t.style.top="-100000px",t.style.left="-100000px",document.body.appendChild(t);const e=d(()=>Promise.resolve().then(()=>B),void 0,import.meta.url);return await new Promise(r=>{t.addEventListener("change",r),t.click()}),e.then(r=>r.getDirHandlesFromInput(t))}const J={accepts:[]},V=globalThis.showOpenFilePicker;async function K(a={}){const t={...J,...a};if(V&&!a._preferPolyfill)return V(t);const e=document.createElement("input");e.type="file",e.multiple=t.multiple,e.accept=(t.accepts||[]).map(n=>[...(n.extensions||[]).map(o=>"."+o),...n.mimeTypes||[]]).flat().join(","),Object.assign(e.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(e);const r=d(()=>Promise.resolve().then(()=>B),void 0,import.meta.url);return await new Promise(n=>{e.addEventListener("change",n,{once:!0}),e.click()}),e.remove(),r.then(n=>n.getFileHandlesFromInput(e))}const W=globalThis.showSaveFilePicker;async function Q(a={}){if(W&&!a._preferPolyfill)return W(a);a._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),a.suggestedName=a._name);const{FileSystemFileHandle:t}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url),{FileHandle:e}=await d(async()=>{const{FileHandle:r}=await import("./downloader.CVHmveIJ.js");return{FileHandle:r}},__vite__mapDeps([0,1,2]),import.meta.url);return new t(new e(a.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const a=this.webkitGetAsEntry(),[{FileHandle:t,FolderHandle:e},{FileSystemDirectoryHandle:r},{FileSystemFileHandle:n}]=await Promise.all([d(()=>import("./sandbox.B1Cwdby0.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>D),void 0,import.meta.url),d(()=>Promise.resolve().then(()=>_),void 0,import.meta.url)]);return a.isFile?new n(new t(a,!1)):new r(new e(a,!1))});async function Z(a,t={}){var o,s;if(!a)return((s=(o=globalThis.navigator)==null?void 0:o.storage)==null?void 0:s.getDirectory())||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:e}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>D);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),r=await a,n=await(r.default?r.default(t):r(t));return new e(n)}const ee={ReadableStream:globalThis.ReadableStream,WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:te}=ee;var H;const L=class L extends te{constructor(e){super(e);j(this,H);M(this,H,e),Object.setPrototypeOf(this,L.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),r=e.close();return e.releaseLock(),r}seek(e){return this.write({type:"seek",position:e})}truncate(e){return this.write({type:"truncate",size:e})}write(e){if(this._closed)return Promise.reject(new TypeError("Cannot write to a CLOSED writable stream"));const r=this.getWriter(),n=r.write(e);return r.releaseLock(),n}};H=new WeakMap;let p=L;Object.defineProperty(p.prototype,Symbol.toStringTag,{value:"FileSystemWritableFileStream",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(p.prototype,{close:{enumerable:!0},seek:{enumerable:!0},truncate:{enumerable:!0},write:{enumerable:!0}});globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable&&!globalThis.FileSystemWritableFileStream&&(globalThis.FileSystemWritableFileStream=p);const m=Symbol("adapter");var q;q=m;class P{constructor(t){g(this,q);g(this,"name");g(this,"kind");this.kind=t.kind,this.name=t.name,this[m]=t}async queryPermission(t={}){const{mode:e="read"}=t,r=this[m];if(r.queryPermission)return r.queryPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return r.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async requestPermission({mode:t="read"}={}){const e=this[m];if(e.requestPermission)return e.requestPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return e.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async remove(t={}){await this[m].remove(t)}async isSameEntry(t){return this===t?!0:!t||typeof t!="object"||this.kind!==t.kind||!t[m]?!1:this[m].isSameEntry(t[m])}}Object.defineProperty(P.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});var $;globalThis.FileSystemHandle&&(($=globalThis.FileSystemHandle.prototype).queryPermission??($.queryPermission=function(a){return"granted"}));const x={INVALID:["seeking position failed.","InvalidStateError"],GONE:["A requested file or directory could not be found at the time an operation was processed.","NotFoundError"],MISMATCH:["The path supplied exists, but was not an entry of requested type.","TypeMismatchError"],MOD_ERR:["The object can not be modified in this way.","InvalidModificationError"],SYNTAX:a=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${a}`,"SyntaxError"],SECURITY:["It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.","SecurityError"],DISALLOWED:["The request is not allowed by the user agent or the platform in the current context.","NotAllowedError"]},re={writable:globalThis.WritableStream};async function ae(a){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[t,e,r]=await Promise.all([d(()=>import("./memory.CzhWwr8k.js"),__vite__mapDeps([4,1,2]),import.meta.url),d(()=>import("./sandbox.B1Cwdby0.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>D),void 0,import.meta.url)]),n=new t.FolderHandle("",!1);return n._entries=a.map(o=>o.isFile?new e.FileHandle(o,!1):new e.FolderHandle(o,!1)),new r.FileSystemDirectoryHandle(n)}async function ie(a){const{FolderHandle:t,FileHandle:e}=await d(async()=>{const{FolderHandle:y,FileHandle:l}=await import("./memory.CzhWwr8k.js");return{FolderHandle:y,FileHandle:l}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemDirectoryHandle:r}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>D);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),n=Array.from(a.files),o=n[0].webkitRelativePath.split("/",1)[0],s=new t(o,!1);return n.forEach(y=>{const l=y.webkitRelativePath.split("/");l.shift();const c=l.pop(),f=l.reduce((w,b)=>(w._entries[b]||(w._entries[b]=new t(b,!1)),w._entries[b]),s);f._entries[c]=new e(y.name,y,!1)}),new r(s)}async function ne(a){const{FileHandle:t}=await d(async()=>{const{FileHandle:r}=await import("./memory.CzhWwr8k.js");return{FileHandle:r}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);return Array.from(a.files).map(r=>new e(new t(r.name,r,!1)))}const B=Object.freeze(Object.defineProperty({__proto__:null,config:re,errors:x,fromDataTransfer:ae,getDirHandlesFromInput:ie,getFileHandlesFromInput:ne},Symbol.toStringTag,{value:"Module"})),{GONE:oe,MOD_ERR:se}=x,u=Symbol("adapter");var z;let F=class T extends P{constructor(e){super(e);g(this,z);this[u]=e}async getDirectoryHandle(e,r={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");r.create=!!r.create;const n=await this[u].getDirectoryHandle(e,r);return new T(n)}async*entries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);for await(const[r,n]of this[u].entries())yield[n.name,n.kind==="file"?new e(n):new T(n)]}async*getEntries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:r}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:r}},void 0,import.meta.url);console.warn("deprecated, use .entries() instead");for await(let r of this[u].entries())yield r.kind==="file"?new e(r):new T(r)}async getFileHandle(e,r={}){const{FileSystemFileHandle:n}=await d(async()=>{const{FileSystemFileHandle:s}=await Promise.resolve().then(()=>_);return{FileSystemFileHandle:s}},void 0,import.meta.url);if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");r.create=!!r.create;const o=await this[u].getFileHandle(e,r);return new n(o)}async removeEntry(e,r={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");return r.recursive=!!r.recursive,this[u].removeEntry(e,r)}async resolve(e){if(await e.isSameEntry(this))return[];const r=[{handle:this,path:[]}];for(;r.length;){let{handle:n,path:o}=r.pop();for await(const s of n.values()){if(await s.isSameEntry(e))return[...o,s.name];s.kind==="directory"&&r.push({handle:s,path:[...o,s.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,r]of this)yield r}[(z=u,Symbol.asyncIterator)](){return this.entries()}};Object.defineProperty(F.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(F.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const a=globalThis.FileSystemDirectoryHandle.prototype;a.resolve=async function(o){if(await o.isSameEntry(this))return[];const s=[{handle:this,path:[]}];for(;s.length;){let{handle:y,path:l}=s.pop();for await(const c of y.values()){if(await c.isSameEntry(o))return[...l,c.name];c.kind==="directory"&&s.push({handle:c,path:[...l,c.name]})}}return null};async function t(n){if(await(await navigator.storage.getDirectory()).resolve(n)===null)throw new DOMException(...oe)}const e=a.entries;a.entries=async function*(){await t(this),yield*e.call(this)},a[Symbol.asyncIterator]=async function*(){yield*this.entries()};const r=a.removeEntry;a.removeEntry=async function(n,o={}){return r.call(this,n,o).catch(async s=>{throw s instanceof DOMException&&s.name==="UnknownError"&&!o.recursive&&!(await e.call(this).next()).done?new DOMException(...se):s})}}const D=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:F,default:F},Symbol.toStringTag,{value:"Module"})),{INVALID:le,SYNTAX:I,GONE:ce}=x,v=Symbol("adapter");var U,C;class S extends(C=P,U=v,C){constructor(e){super(e);g(this,U);this[v]=e}async createWritable(e={}){return new p(await this[v].createWritable(e))}async getFile(){return this[v].getFile()}}Object.defineProperty(S.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(S.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const a=new WeakMap;let t;const e=()=>{let n,o;onmessage=async s=>{const y=s.ports[0],l=s.data;switch(l.type){case"open":const c=l.name;let f=await navigator.storage.getDirectory();for(const w of l.path)f=await f.getDirectoryHandle(w);n=await f.getFileHandle(c),o=await n.createSyncAccessHandle();break;case"write":o.write(l.data,{at:l.position}),o.flush();break;case"truncate":o.truncate(l.size);break;case"abort":case"close":o.close();break}y.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(n){if(!t){const i=`(${e.toString()})()`,E=new Blob([i],{type:"text/javascript"});t=URL.createObjectURL(E)}const o=new Worker(t,{type:"module"});let s=0;const y=new TextEncoder;let l=await this.getFile().then(i=>i.size);const c=i=>new Promise((E,O)=>{const h=new MessageChannel;h.port1.onmessage=A=>{A.data instanceof Error?O(A.data):E(A.data),h.port1.close(),h.port2.close(),h.port1.onmessage=null},o.postMessage(i,[h.port2])}),f=await navigator.storage.getDirectory(),w=await a.get(this),b=await f.resolve(w);if(b===null)throw new DOMException(...ce);return await c({type:"open",path:b,name:this.name}),(n==null?void 0:n.keepExistingData)===!1&&(await c({type:"truncate",size:0}),l=0),new p({start:i=>{},async write(i){if((i==null?void 0:i.constructor)===Object?i={...i}:i={type:"write",data:i,position:s},i.type==="write"){if(!("data"in i))throw await c({type:"close"}),new DOMException(...I("write requires a data argument"));if(i.position??(i.position=s),typeof i.data=="string")i.data=y.encode(i.data);else if(i.data instanceof ArrayBuffer)i.data=new Uint8Array(i.data);else if(!(i.data instanceof Uint8Array)&&ArrayBuffer.isView(i.data))i.data=new Uint8Array(i.data.buffer,i.data.byteOffset,i.data.byteLength);else if(!(i.data instanceof Uint8Array)){const O=await new Response(i.data).arrayBuffer();i.data=new Uint8Array(O)}Number.isInteger(i.position)&&i.position>=0&&(s=i.position),s+=i.data.byteLength,l+=i.data.byteLength}else if(i.type==="seek")if(Number.isInteger(i.position)&&i.position>=0){if(l<i.position)throw new DOMException(...le);console.log("seeking",i),s=i.position;return}else throw await c({type:"close"}),new DOMException(...I("seek requires a position argument"));else if(i.type==="truncate")if(Number.isInteger(i.size)&&i.size>=0)l=i.size,s>l&&(s=l);else throw await c({type:"close"}),new DOMException(...I("truncate requires a size argument"));await c(i)},async close(){await c({type:"close"}),o.terminate()},async abort(i){await c({type:"abort",reason:i}),o.terminate()}})};const r=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...n){const o=await r.call(this,...n);return a.set(o,this),o}}const _=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:S,default:S},Symbol.toStringTag,{value:"Module"})),ue=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:F,FileSystemFileHandle:S,FileSystemHandle:P,FileSystemWritableFileStream:p,getOriginPrivateDirectory:Z,showDirectoryPicker:k,showOpenFilePicker:K,showSaveFilePicker:Q},Symbol.toStringTag,{value:"Module"}));export{ue as a,ee as c,x as e};
@@ -1 +1 @@
1
- import{g as it}from"./index.DuqdUleB.js";function ot(k,u){for(var p=0;p<u.length;p++){const O=u[p];if(typeof O!="string"&&!Array.isArray(O)){for(const E in O)if(E!=="default"&&!(E in k)){const S=Object.getOwnPropertyDescriptor(O,E);S&&Object.defineProperty(k,E,S.get?S:{enumerable:!0,get:()=>O[E]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var Re={exports:{}};(function(k){(function(u){if(typeof window>"u")return;var p=!0,O=10,E="",S=0,D="",_=null,oe="",W=!1,Ne={resize:1,click:1},V=128,re=!0,P=1,U="bodyOffset",h=U,ae=!0,se="",R={},I=32,ce=null,J=!1,X=!1,H="[iFrameSizer]",ue=H.length,B="",le={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",fe=window.parent,A="*",K=0,j=!1,de=null,N=16,x=1,me="scroll",v=me,xe=window,Q=function(){T("onMessage function not defined")},G=function(){},Z=function(){},$={height:function(){return T("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return T("Custom width calculation function not defined"),document.body.scrollWidth}},ee={},ge=!1;function he(){}try{var pe=Object.create({},{passive:{get:function(){ge=!0}}});window.addEventListener("test",he,pe),window.removeEventListener("test",he,pe)}catch{}function C(e,t,n,i){e.addEventListener(t,n,ge?i||{}:!1)}function De(e,t,n){e.removeEventListener(t,n,!1)}function ve(e){return e.charAt(0).toUpperCase()+e.slice(1)}function We(e){var t,n,i,a=null,f=0,m=function(){f=Date.now(),a=null,i=e.apply(t,n),a||(t=n=null)};return function(){var d=Date.now();f||(f=d);var s=N-(d-f);return t=this,n=arguments,s<=0||s>N?(a&&(clearTimeout(a),a=null),f=d,i=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,s)),i}}function ye(e){return H+"["+B+"] "+e}function o(e){J&&typeof window.console=="object"&&console.log(ye(e))}function T(e){typeof window.console=="object"&&console.warn(ye(e))}function He(){Be(),o("Initialising iFrame ("+window.location.href+")"),qe(),Ve(),te("background",E),te("padding",oe),Ye(),Te(),Me(),Ue(),Ge(),Qe(),Ee(),R=Ke(),L("init","Init message from host page"),G()}function Be(){function e(n){return n==="true"}var t=se.slice(ue).split(":");B=t[0],S=u===t[1]?S:Number(t[1]),W=u===t[2]?W:e(t[2]),J=u===t[3]?J:e(t[3]),I=u===t[4]?I:Number(t[4]),p=u===t[6]?p:e(t[6]),D=t[7],h=u===t[8]?h:t[8],E=t[9],oe=t[10],K=u===t[11]?K:Number(t[11]),R.enable=u===t[12]?!1:e(t[12]),Y=u===t[13]?Y:t[13],v=u===t[14]?v:t[14],X=u===t[15]?X:e(t[15])}function je(e){var t=e.split("Callback");if(t.length===2){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],T("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function qe(){function e(){var n=window.iFrameResizer;o("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(je,n),Q="onMessage"in n?n.onMessage:Q,G="onReady"in n?n.onReady:G,A="targetOrigin"in n?n.targetOrigin:A,h="heightCalculationMethod"in n?n.heightCalculationMethod:h,v="widthCalculationMethod"in n?n.widthCalculationMethod:v}function t(n,i){return typeof n=="function"&&(o("Setup custom "+i+"CalcMethod"),$[i]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),h=t(h,"height"),v=t(v,"width")),o("TargetOrigin for parent set to: "+A)}function _e(e,t){return t.indexOf("-")!==-1&&(T("Negative CSS value ignored for "+e),t=""),t}function te(e,t){u!==t&&t!==""&&t!=="null"&&(document.body.style[e]=t,o("Body "+e+' set to "'+t+'"'))}function Ve(){u===D&&(D=S+"px"),te("margin",_e("margin",D))}function Ue(){document.documentElement.style.height="",document.body.style.height="",o('HTML & body height set to "auto"')}function g(e){var t={add:function(n){function i(){L(e.eventName,e.eventType)}ee[n]=i,C(window,n,i,{passive:!0})},remove:function(n){var i=ee[n];delete ee[n],De(window,n,i)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),o(ve(e.method)+" event listener: "+e.eventType)}function we(e){g({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),g({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),g({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),g({method:e,eventType:"Input",eventName:"input"}),g({method:e,eventType:"Mouse Up",eventName:"mouseup"}),g({method:e,eventType:"Mouse Down",eventName:"mousedown"}),g({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),g({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),g({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),g({method:e,eventType:"Touch Start",eventName:"touchstart"}),g({method:e,eventType:"Touch End",eventName:"touchend"}),g({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),g({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),g({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),g({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),Y==="child"&&g({method:e,eventType:"IFrame Resized",eventName:"resize"})}function be(e,t,n,i){return t!==e&&(e in n||(T(e+" is not a valid option for "+i+"CalculationMethod."),e=t),o(i+' calculation method set to "'+e+'"')),e}function Te(){h=be(h,U,M,"height")}function Me(){v=be(v,me,F,"width")}function Ee(){p===!0?(we("add"),$e()):o("Auto Resize disabled")}function Je(){_!==null&&_.disconnect()}function Xe(){we("remove"),Je(),clearInterval(ce)}function Ye(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Ke(){function e(){return{x:window.pageXOffset===u?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===u?document.documentElement.scrollTop:window.pageYOffset}}function t(s){var l=s.getBoundingClientRect(),c=e();return{x:parseInt(l.left,10)+parseInt(c.x,10),y:parseInt(l.top,10)+parseInt(c.y,10)}}function n(s){function l(b){var z=t(b);o("Moving to in page link (#"+c+") at x: "+z.x+" y: "+z.y),y(z.y,z.x,"scrollToOffset")}var c=s.split("#")[1]||s,r=decodeURIComponent(c),w=document.getElementById(r)||document.getElementsByName(r)[0];u===w?(o("In page link (#"+c+") not found in iFrame, so sending to parent"),y(0,0,"inPageLink","#"+c)):l(w)}function i(){var s=window.location.hash,l=window.location.href;s!==""&&s!=="#"&&n(l)}function a(){function s(l){function c(r){r.preventDefault(),n(this.getAttribute("href"))}l.getAttribute("href")!=="#"&&C(l,"click",c)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),s)}function f(){C(window,"hashchange",i)}function m(){setTimeout(i,V)}function d(){Array.prototype.forEach&&document.querySelectorAll?(o("Setting up location.hash handlers"),a(),f(),m()):T("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return R.enable?d():o("In page linking not enabled"),{findTarget:n}}function Qe(){if(X!==!0)return;function e(n){y(0,0,n.type,n.screenY+":"+n.screenX)}function t(n,i){o("Add event listener: "+i),C(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ge(){o("Enable public methods"),xe.parentIFrame={autoResize:function(t){return t===!0&&p===!1?(p=!0,Ee()):t===!1&&p===!0&&(p=!1,Xe()),y(0,0,"autoResize",JSON.stringify(p)),p},close:function(){y(0,0,"close")},getId:function(){return B},getPageInfo:function(t){typeof t=="function"?(Z=t,y(0,0,"pageInfo")):(Z=function(){},y(0,0,"pageInfoStop"))},moveToAnchor:function(t){R.findTarget(t)},reset:function(){ze("parentIFrame.reset")},scrollTo:function(t,n){y(n,t,"scrollTo")},scrollToOffset:function(t,n){y(n,t,"scrollToOffset")},sendMessage:function(t,n){y(0,0,"message",JSON.stringify(t),n)},setHeightCalculationMethod:function(t){h=t,Te()},setWidthCalculationMethod:function(t){v=t,Me()},setTargetOrigin:function(t){o("Set targetOrigin: "+t),A=t},size:function(t,n){var i=""+(t||"")+(n?","+n:"");L("size","parentIFrame.size("+i+")",t,n)}}}function Oe(){I!==0&&(o("setInterval: "+I+"ms"),ce=setInterval(function(){L("interval","setInterval: "+I)},Math.abs(I)))}function Ze(){function e(r){function w(b){b.complete===!1&&(o("Attach listeners to "+b.src),b.addEventListener("load",a,!1),b.addEventListener("error",f,!1),s.push(b))}r.type==="attributes"&&r.attributeName==="src"?w(r.target):r.type==="childList"&&Array.prototype.forEach.call(r.target.querySelectorAll("img"),w)}function t(r){s.splice(s.indexOf(r),1)}function n(r){o("Remove listeners from "+r.src),r.removeEventListener("load",a,!1),r.removeEventListener("error",f,!1),t(r)}function i(r,w,b){n(r.target),L(w,b+": "+r.target.src)}function a(r){i(r,"imageLoad","Image loaded")}function f(r){i(r,"imageLoadFailed","Image load failed")}function m(r){L("mutationObserver","mutationObserver: "+r[0].target+" "+r[0].type),r.forEach(e)}function d(){var r=document.querySelector("body"),w={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};return c=new l(m),o("Create body MutationObserver"),c.observe(r,w),c}var s=[],l=window.MutationObserver||window.WebKitMutationObserver,c=d();return{disconnect:function(){"disconnect"in c&&(o("Disconnect body MutationObserver"),c.disconnect(),s.forEach(n))}}}function $e(){var e=0>I;window.MutationObserver||window.WebKitMutationObserver?e?Oe():_=Ze():(o("MutationObserver not supported in this browser!"),Oe())}function ne(e,t){var n=0;return t=t||document.body,n=document.defaultView.getComputedStyle(t,null),n=n===null?0:n[e],parseInt(n,O)}function et(e){e>N/2&&(N=2*e,o("Event throttle increased to "+N+"ms"))}function ie(e,t){for(var n=t.length,i=0,a=0,f=ve(e),m=Date.now(),d=0;d<n;d++)i=t[d].getBoundingClientRect()[e]+ne("margin"+f,t[d]),i>a&&(a=i);return m=Date.now()-m,o("Parsed "+n+" HTML elements"),o("Element position calculated in "+m+"ms"),et(m),a}function q(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Se(e,t){function n(){return T("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var i=document.querySelectorAll("["+t+"]");return i.length===0&&n(),ie(e,i)}function Ie(){return document.querySelectorAll("body *")}var M={bodyOffset:function(){return document.body.offsetHeight+ne("marginTop")+ne("marginBottom")},offset:function(){return M.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return $.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,q(M))},min:function(){return Math.min.apply(null,q(M))},grow:function(){return M.max()},lowestElement:function(){return Math.max(M.bodyOffset()||M.documentElementOffset(),ie("bottom",Ie()))},taggedElement:function(){return Se("bottom","data-iframe-height")}},F={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return $.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(F.bodyScroll(),F.documentElementScroll())},max:function(){return Math.max.apply(null,q(F))},min:function(){return Math.min.apply(null,q(F))},rightMostElement:function(){return ie("right",Ie())},taggedElement:function(){return Se("right","data-iframe-width")}};function Fe(e,t,n,i){function a(){P=c,x=r,y(P,x,e)}function f(){function w(b,z){var nt=Math.abs(b-z)<=K;return!nt}return c=u===n?M[h]():n,r=u===i?F[v]():i,w(P,c)||W&&w(x,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in le||W&&v in le}function s(){o("No change in size detected")}function l(){m()&&d()?ze(t):e in{interval:1}||s()}var c,r;f()||e==="init"?(Le(),a()):l()}var tt=We(Fe);function L(e,t,n,i){function a(){e in{reset:1,resetPage:1,init:1}||o("Trigger event: "+t)}function f(){return j&&e in Ne}f()?o("Trigger event cancelled: "+e):(a(),e==="init"?Fe(e,t,n,i):tt(e,t,n,i))}function Le(){j||(j=!0,o("Trigger event lock on")),clearTimeout(de),de=setTimeout(function(){j=!1,o("Trigger event lock off"),o("--")},V)}function Ce(e){P=M[h](),x=F[v](),y(P,x,e)}function ze(e){var t=h;h=U,o("Reset trigger event: "+e),Le(),Ce("reset"),h=t}function y(e,t,n,i,a){function f(){u===a?a=A:o("Message targetOrigin: "+a)}function m(){var d=e+":"+t,s=B+":"+d+":"+n+(u===i?"":":"+i);o("Sending message to host page ("+s+")"),fe.postMessage(H+s,a)}f(),m()}function ke(e){var t={init:function(){se=e.data,fe=e.source,He(),re=!1,setTimeout(function(){ae=!1},V)},reset:function(){ae?o("Page reset ignored by init"):(o("Page size reset by host page"),Ce("resetPage"))},resize:function(){L("resizeParent","Parent window requested size check")},moveToAnchor:function(){R.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var c=a();o("PageInfoFromParent called from parent: "+c),Z(JSON.parse(c)),o(" --")},message:function(){var c=a();o("onMessage called from parent: "+c),Q(JSON.parse(c)),o(" --")}};function n(){return H===(""+e.data).slice(0,ue)}function i(){return e.data.split("]")[1].split(":")[0]}function a(){return e.data.slice(e.data.indexOf(":")+1)}function f(){return!k.exports&&"iFrameResize"in window||window.jQuery!==u&&"iFrameResize"in window.jQuery.prototype}function m(){return e.data.split(":")[2]in{true:1,false:1}}function d(){var l=i();l in t?t[l]():!f()&&!m()&&T("Unexpected message ("+e.data+")")}function s(){re===!1?d():m()?t.init():o('Ignored message of type "'+i()+'". Received before initialization.')}n()&&s()}function Pe(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){ke({data:e,sameDomian:!0})},C(window,"message",ke),C(window,"readystatechange",Pe),Pe())})()})(Re);var Ae=Re.exports;const rt=it(Ae),st=ot({__proto__:null,default:rt},[Ae]);export{st as i};
1
+ import{g as it}from"./index.gthzAzzy.js";function ot(k,u){for(var p=0;p<u.length;p++){const O=u[p];if(typeof O!="string"&&!Array.isArray(O)){for(const E in O)if(E!=="default"&&!(E in k)){const S=Object.getOwnPropertyDescriptor(O,E);S&&Object.defineProperty(k,E,S.get?S:{enumerable:!0,get:()=>O[E]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var Re={exports:{}};(function(k){(function(u){if(typeof window>"u")return;var p=!0,O=10,E="",S=0,D="",_=null,oe="",W=!1,Ne={resize:1,click:1},V=128,re=!0,P=1,U="bodyOffset",h=U,ae=!0,se="",R={},I=32,ce=null,J=!1,X=!1,H="[iFrameSizer]",ue=H.length,B="",le={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",fe=window.parent,A="*",K=0,j=!1,de=null,N=16,x=1,me="scroll",v=me,xe=window,Q=function(){T("onMessage function not defined")},G=function(){},Z=function(){},$={height:function(){return T("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return T("Custom width calculation function not defined"),document.body.scrollWidth}},ee={},ge=!1;function he(){}try{var pe=Object.create({},{passive:{get:function(){ge=!0}}});window.addEventListener("test",he,pe),window.removeEventListener("test",he,pe)}catch{}function C(e,t,n,i){e.addEventListener(t,n,ge?i||{}:!1)}function De(e,t,n){e.removeEventListener(t,n,!1)}function ve(e){return e.charAt(0).toUpperCase()+e.slice(1)}function We(e){var t,n,i,a=null,f=0,m=function(){f=Date.now(),a=null,i=e.apply(t,n),a||(t=n=null)};return function(){var d=Date.now();f||(f=d);var s=N-(d-f);return t=this,n=arguments,s<=0||s>N?(a&&(clearTimeout(a),a=null),f=d,i=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,s)),i}}function ye(e){return H+"["+B+"] "+e}function o(e){J&&typeof window.console=="object"&&console.log(ye(e))}function T(e){typeof window.console=="object"&&console.warn(ye(e))}function He(){Be(),o("Initialising iFrame ("+window.location.href+")"),qe(),Ve(),te("background",E),te("padding",oe),Ye(),Te(),Me(),Ue(),Ge(),Qe(),Ee(),R=Ke(),L("init","Init message from host page"),G()}function Be(){function e(n){return n==="true"}var t=se.slice(ue).split(":");B=t[0],S=u===t[1]?S:Number(t[1]),W=u===t[2]?W:e(t[2]),J=u===t[3]?J:e(t[3]),I=u===t[4]?I:Number(t[4]),p=u===t[6]?p:e(t[6]),D=t[7],h=u===t[8]?h:t[8],E=t[9],oe=t[10],K=u===t[11]?K:Number(t[11]),R.enable=u===t[12]?!1:e(t[12]),Y=u===t[13]?Y:t[13],v=u===t[14]?v:t[14],X=u===t[15]?X:e(t[15])}function je(e){var t=e.split("Callback");if(t.length===2){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],T("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function qe(){function e(){var n=window.iFrameResizer;o("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(je,n),Q="onMessage"in n?n.onMessage:Q,G="onReady"in n?n.onReady:G,A="targetOrigin"in n?n.targetOrigin:A,h="heightCalculationMethod"in n?n.heightCalculationMethod:h,v="widthCalculationMethod"in n?n.widthCalculationMethod:v}function t(n,i){return typeof n=="function"&&(o("Setup custom "+i+"CalcMethod"),$[i]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e(),h=t(h,"height"),v=t(v,"width")),o("TargetOrigin for parent set to: "+A)}function _e(e,t){return t.indexOf("-")!==-1&&(T("Negative CSS value ignored for "+e),t=""),t}function te(e,t){u!==t&&t!==""&&t!=="null"&&(document.body.style[e]=t,o("Body "+e+' set to "'+t+'"'))}function Ve(){u===D&&(D=S+"px"),te("margin",_e("margin",D))}function Ue(){document.documentElement.style.height="",document.body.style.height="",o('HTML & body height set to "auto"')}function g(e){var t={add:function(n){function i(){L(e.eventName,e.eventType)}ee[n]=i,C(window,n,i,{passive:!0})},remove:function(n){var i=ee[n];delete ee[n],De(window,n,i)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),o(ve(e.method)+" event listener: "+e.eventType)}function we(e){g({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),g({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),g({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),g({method:e,eventType:"Input",eventName:"input"}),g({method:e,eventType:"Mouse Up",eventName:"mouseup"}),g({method:e,eventType:"Mouse Down",eventName:"mousedown"}),g({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),g({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),g({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),g({method:e,eventType:"Touch Start",eventName:"touchstart"}),g({method:e,eventType:"Touch End",eventName:"touchend"}),g({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),g({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),g({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),g({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),Y==="child"&&g({method:e,eventType:"IFrame Resized",eventName:"resize"})}function be(e,t,n,i){return t!==e&&(e in n||(T(e+" is not a valid option for "+i+"CalculationMethod."),e=t),o(i+' calculation method set to "'+e+'"')),e}function Te(){h=be(h,U,M,"height")}function Me(){v=be(v,me,F,"width")}function Ee(){p===!0?(we("add"),$e()):o("Auto Resize disabled")}function Je(){_!==null&&_.disconnect()}function Xe(){we("remove"),Je(),clearInterval(ce)}function Ye(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Ke(){function e(){return{x:window.pageXOffset===u?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===u?document.documentElement.scrollTop:window.pageYOffset}}function t(s){var l=s.getBoundingClientRect(),c=e();return{x:parseInt(l.left,10)+parseInt(c.x,10),y:parseInt(l.top,10)+parseInt(c.y,10)}}function n(s){function l(b){var z=t(b);o("Moving to in page link (#"+c+") at x: "+z.x+" y: "+z.y),y(z.y,z.x,"scrollToOffset")}var c=s.split("#")[1]||s,r=decodeURIComponent(c),w=document.getElementById(r)||document.getElementsByName(r)[0];u===w?(o("In page link (#"+c+") not found in iFrame, so sending to parent"),y(0,0,"inPageLink","#"+c)):l(w)}function i(){var s=window.location.hash,l=window.location.href;s!==""&&s!=="#"&&n(l)}function a(){function s(l){function c(r){r.preventDefault(),n(this.getAttribute("href"))}l.getAttribute("href")!=="#"&&C(l,"click",c)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),s)}function f(){C(window,"hashchange",i)}function m(){setTimeout(i,V)}function d(){Array.prototype.forEach&&document.querySelectorAll?(o("Setting up location.hash handlers"),a(),f(),m()):T("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return R.enable?d():o("In page linking not enabled"),{findTarget:n}}function Qe(){if(X!==!0)return;function e(n){y(0,0,n.type,n.screenY+":"+n.screenX)}function t(n,i){o("Add event listener: "+i),C(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ge(){o("Enable public methods"),xe.parentIFrame={autoResize:function(t){return t===!0&&p===!1?(p=!0,Ee()):t===!1&&p===!0&&(p=!1,Xe()),y(0,0,"autoResize",JSON.stringify(p)),p},close:function(){y(0,0,"close")},getId:function(){return B},getPageInfo:function(t){typeof t=="function"?(Z=t,y(0,0,"pageInfo")):(Z=function(){},y(0,0,"pageInfoStop"))},moveToAnchor:function(t){R.findTarget(t)},reset:function(){ze("parentIFrame.reset")},scrollTo:function(t,n){y(n,t,"scrollTo")},scrollToOffset:function(t,n){y(n,t,"scrollToOffset")},sendMessage:function(t,n){y(0,0,"message",JSON.stringify(t),n)},setHeightCalculationMethod:function(t){h=t,Te()},setWidthCalculationMethod:function(t){v=t,Me()},setTargetOrigin:function(t){o("Set targetOrigin: "+t),A=t},size:function(t,n){var i=""+(t||"")+(n?","+n:"");L("size","parentIFrame.size("+i+")",t,n)}}}function Oe(){I!==0&&(o("setInterval: "+I+"ms"),ce=setInterval(function(){L("interval","setInterval: "+I)},Math.abs(I)))}function Ze(){function e(r){function w(b){b.complete===!1&&(o("Attach listeners to "+b.src),b.addEventListener("load",a,!1),b.addEventListener("error",f,!1),s.push(b))}r.type==="attributes"&&r.attributeName==="src"?w(r.target):r.type==="childList"&&Array.prototype.forEach.call(r.target.querySelectorAll("img"),w)}function t(r){s.splice(s.indexOf(r),1)}function n(r){o("Remove listeners from "+r.src),r.removeEventListener("load",a,!1),r.removeEventListener("error",f,!1),t(r)}function i(r,w,b){n(r.target),L(w,b+": "+r.target.src)}function a(r){i(r,"imageLoad","Image loaded")}function f(r){i(r,"imageLoadFailed","Image load failed")}function m(r){L("mutationObserver","mutationObserver: "+r[0].target+" "+r[0].type),r.forEach(e)}function d(){var r=document.querySelector("body"),w={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};return c=new l(m),o("Create body MutationObserver"),c.observe(r,w),c}var s=[],l=window.MutationObserver||window.WebKitMutationObserver,c=d();return{disconnect:function(){"disconnect"in c&&(o("Disconnect body MutationObserver"),c.disconnect(),s.forEach(n))}}}function $e(){var e=0>I;window.MutationObserver||window.WebKitMutationObserver?e?Oe():_=Ze():(o("MutationObserver not supported in this browser!"),Oe())}function ne(e,t){var n=0;return t=t||document.body,n=document.defaultView.getComputedStyle(t,null),n=n===null?0:n[e],parseInt(n,O)}function et(e){e>N/2&&(N=2*e,o("Event throttle increased to "+N+"ms"))}function ie(e,t){for(var n=t.length,i=0,a=0,f=ve(e),m=Date.now(),d=0;d<n;d++)i=t[d].getBoundingClientRect()[e]+ne("margin"+f,t[d]),i>a&&(a=i);return m=Date.now()-m,o("Parsed "+n+" HTML elements"),o("Element position calculated in "+m+"ms"),et(m),a}function q(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function Se(e,t){function n(){return T("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var i=document.querySelectorAll("["+t+"]");return i.length===0&&n(),ie(e,i)}function Ie(){return document.querySelectorAll("body *")}var M={bodyOffset:function(){return document.body.offsetHeight+ne("marginTop")+ne("marginBottom")},offset:function(){return M.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return $.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,q(M))},min:function(){return Math.min.apply(null,q(M))},grow:function(){return M.max()},lowestElement:function(){return Math.max(M.bodyOffset()||M.documentElementOffset(),ie("bottom",Ie()))},taggedElement:function(){return Se("bottom","data-iframe-height")}},F={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return $.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(F.bodyScroll(),F.documentElementScroll())},max:function(){return Math.max.apply(null,q(F))},min:function(){return Math.min.apply(null,q(F))},rightMostElement:function(){return ie("right",Ie())},taggedElement:function(){return Se("right","data-iframe-width")}};function Fe(e,t,n,i){function a(){P=c,x=r,y(P,x,e)}function f(){function w(b,z){var nt=Math.abs(b-z)<=K;return!nt}return c=u===n?M[h]():n,r=u===i?F[v]():i,w(P,c)||W&&w(x,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in le||W&&v in le}function s(){o("No change in size detected")}function l(){m()&&d()?ze(t):e in{interval:1}||s()}var c,r;f()||e==="init"?(Le(),a()):l()}var tt=We(Fe);function L(e,t,n,i){function a(){e in{reset:1,resetPage:1,init:1}||o("Trigger event: "+t)}function f(){return j&&e in Ne}f()?o("Trigger event cancelled: "+e):(a(),e==="init"?Fe(e,t,n,i):tt(e,t,n,i))}function Le(){j||(j=!0,o("Trigger event lock on")),clearTimeout(de),de=setTimeout(function(){j=!1,o("Trigger event lock off"),o("--")},V)}function Ce(e){P=M[h](),x=F[v](),y(P,x,e)}function ze(e){var t=h;h=U,o("Reset trigger event: "+e),Le(),Ce("reset"),h=t}function y(e,t,n,i,a){function f(){u===a?a=A:o("Message targetOrigin: "+a)}function m(){var d=e+":"+t,s=B+":"+d+":"+n+(u===i?"":":"+i);o("Sending message to host page ("+s+")"),fe.postMessage(H+s,a)}f(),m()}function ke(e){var t={init:function(){se=e.data,fe=e.source,He(),re=!1,setTimeout(function(){ae=!1},V)},reset:function(){ae?o("Page reset ignored by init"):(o("Page size reset by host page"),Ce("resetPage"))},resize:function(){L("resizeParent","Parent window requested size check")},moveToAnchor:function(){R.findTarget(a())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var c=a();o("PageInfoFromParent called from parent: "+c),Z(JSON.parse(c)),o(" --")},message:function(){var c=a();o("onMessage called from parent: "+c),Q(JSON.parse(c)),o(" --")}};function n(){return H===(""+e.data).slice(0,ue)}function i(){return e.data.split("]")[1].split(":")[0]}function a(){return e.data.slice(e.data.indexOf(":")+1)}function f(){return!k.exports&&"iFrameResize"in window||window.jQuery!==u&&"iFrameResize"in window.jQuery.prototype}function m(){return e.data.split(":")[2]in{true:1,false:1}}function d(){var l=i();l in t?t[l]():!f()&&!m()&&T("Unexpected message ("+e.data+")")}function s(){re===!1?d():m()?t.init():o('Ignored message of type "'+i()+'". Received before initialization.')}n()&&s()}function Pe(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){ke({data:e,sameDomian:!0})},C(window,"message",ke),C(window,"readystatechange",Pe),Pe())})()})(Re);var Ae=Re.exports;const rt=it(Ae),st=ot({__proto__:null,default:rt},[Ae]);export{st as i};
@@ -1 +1 @@
1
- import{n as U,r as s,bj as V,j as l}from"./index.DuqdUleB.js";const P=U("iframe",{target:"eymnmwl0"})(({theme:a})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,width:"100%",aspectRatio:"16 / 9"})),R=528;function w({element:a,width:f,endpoints:m,elementMgr:c}){const i=s.useRef(null),{type:E,url:p,startTime:n,subtitles:y,endTime:d,loop:u,autoplay:T,muted:h}=a,S=s.useMemo(()=>{if(!a.id)return!0;const e=c.getElementState(a.id,"preventAutoplay");return e||c.setElementState(a.id,"preventAutoplay",!0),e??!1},[a.id,c]);s.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),s.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),s.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const o=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",o),()=>{e&&d>0&&e.removeEventListener("timeupdate",o)}},[d,u,n]),s.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const g=e=>{const{startTime:t,endTime:o,loop:L,autoplay:N,muted:b}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),o&&!isNaN(o)&&r.searchParams.append("end",o.toString()),L){r.searchParams.append("loop","1");const v=r.pathname.split("/").pop();v&&r.searchParams.append("playlist",v)}return N&&r.searchParams.append("autoplay","1"),b&&r.searchParams.append("mute","1"),r.toString()};return E===V.Type.YOUTUBE_IFRAME?l(P,{className:"stVideo","data-testid":"stVideo",title:p,src:g(p),allow:"autoplay; encrypted-media",allowFullScreen:!0}):l("video",{className:"stVideo","data-testid":"stVideo",ref:i,controls:!0,muted:h,autoPlay:T&&!S,src:m.buildMediaURL(p),style:{width:f,height:f===0?R:void 0},crossOrigin:void 0,children:y&&y.map((e,t)=>l("track",{kind:"captions",src:m.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0},t))})}export{w as default};
1
+ import{n as U,r as s,bj as V,j as l}from"./index.gthzAzzy.js";const P=U("iframe",{target:"eymnmwl0"})(({theme:a})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,width:"100%",aspectRatio:"16 / 9"})),R=528;function w({element:a,width:f,endpoints:m,elementMgr:c}){const i=s.useRef(null),{type:E,url:p,startTime:n,subtitles:y,endTime:d,loop:u,autoplay:T,muted:h}=a,S=s.useMemo(()=>{if(!a.id)return!0;const e=c.getElementState(a.id,"preventAutoplay");return e||c.setElementState(a.id,"preventAutoplay",!0),e??!1},[a.id,c]);s.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),s.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),s.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const o=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",o),()=>{e&&d>0&&e.removeEventListener("timeupdate",o)}},[d,u,n]),s.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const g=e=>{const{startTime:t,endTime:o,loop:L,autoplay:N,muted:b}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),o&&!isNaN(o)&&r.searchParams.append("end",o.toString()),L){r.searchParams.append("loop","1");const v=r.pathname.split("/").pop();v&&r.searchParams.append("playlist",v)}return N&&r.searchParams.append("autoplay","1"),b&&r.searchParams.append("mute","1"),r.toString()};return E===V.Type.YOUTUBE_IFRAME?l(P,{className:"stVideo","data-testid":"stVideo",title:p,src:g(p),allow:"autoplay; encrypted-media",allowFullScreen:!0}):l("video",{className:"stVideo","data-testid":"stVideo",ref:i,controls:!0,muted:h,autoPlay:T&&!S,src:m.buildMediaURL(p),style:{width:f,height:f===0?R:void 0},crossOrigin:void 0,children:y&&y.map((e,t)=>l("track",{kind:"captions",src:m.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0},t))})}export{w as default};
@@ -1,2 +1,2 @@
1
- import{bw as Z,bx as J,r as f,by as Q,y as Y,bz as s,j as v,z as ee,bs as te,bA as re,bB as ne,bt as oe,bc as ie,bu as ae,bq as ue,b8 as P,b7 as W,ba as le}from"./index.DuqdUleB.js";import{a as ce}from"./useBasicWidgetState.D572sX2t.js";import"./FormClearHelper.Bue0QSIn.js";var se={primary:"primary",secondary:"secondary",tertiary:"tertiary"},G={default:"default",pill:"pill",round:"round",circle:"circle",square:"square"},fe={mini:"mini",default:"default",compact:"compact",large:"large"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return he(e)||me(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{bw as Z,bx as J,r as f,by as Q,y as Y,bz as s,j as v,z as ee,bs as te,bA as re,bB as ne,bt as oe,bc as ie,bu as ae,bq as ue,b8 as P,b7 as W,ba as le}from"./index.gthzAzzy.js";import{a as ce}from"./useBasicWidgetState.BJ0FCAzu.js";import"./FormClearHelper.LI0uGKXr.js";var se={primary:"primary",secondary:"secondary",tertiary:"tertiary"},G={default:"default",pill:"pill",round:"round",circle:"circle",square:"square"},fe={mini:"mini",default:"default",compact:"compact",large:"large"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return he(e)||me(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function be(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function me(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,p;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,p=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw p}}return n}}function he(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ve(e,t,r){return t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(e,t)}function Ee(e){var t=we();return function(){var n=A(e),o;if(t){var i=A(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return _e(this,o)}}function _e(e,t){if(t&&(j(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K(e)}function K(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function we(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},A(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Le(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var F=function(e){Oe(r,e);var t=Ee(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),N(K(n),"childRefs",{}),n}return ve(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,p=a===void 0?{}:a,c=i.mode,C=c===void 0?k.checkbox:c,d=i.children,y=i.selected,m=i.disabled,l=i.onClick,_=i.kind,h=i.shape,w=i.size,B=J(p.Root,z),O=de(B,2),E=O[0],L=O[1],q=this.props["aria-label"]||this.props.ariaLabel,g=C===k.radio,V=f.Children.count(d);return f.createElement(Q.Consumer,null,function(H){return f.createElement(E,M({"aria-label":q||H.buttongroup.ariaLabel,"data-baseweb":"button-group",role:g?"radiogroup":"group",$shape:h,$length:d.length},L),f.Children.map(d,function(b,R){if(!f.isValidElement(b))return null;var I=b.props.isSelected?b.props.isSelected:Le(y,R);return g&&(o.childRefs[R]=f.createRef()),f.cloneElement(b,{disabled:m||b.props.disabled,isSelected:I,ref:g?o.childRefs[R]:void 0,tabIndex:!g||I||g&&(!y||y===-1)&&R===0?0:-1,onKeyDown:function(u){if(g){var S=Number(y)?Number(y):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var T=S-1<0?V-1:S-1;l&&l(u,T),o.childRefs[T].current&&o.childRefs[T].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var D=S+1>V-1?0:S+1;l&&l(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}}},kind:_,onClick:function(u){m||(b.props.onClick&&b.props.onClick(u),l&&l(u,R))},shape:h,size:w,overrides:pe({BaseButton:{style:function(u){var S=u.$theme;return d.length===1?{}:h!==G.default?{marginLeft:S.sizing.scale100,marginRight:S.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":I,role:g?"radio":"checkbox"}}},b.props.overrides)})}))})}}]),r}(f.Component);N(F,"defaultProps",{disabled:!1,onClick:function(){},shape:G.default,size:fe.default,kind:se.secondary});function Re(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Pe(e,t,r){return e==s.ClickMode.MULTI_SELECT?Re(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Ce(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ae(e,t,r){const n=r===s.Style.PILLS?P.PILLS:r===s.Style.BORDERLESS?P.BORDERLESS_ICON:P.SEGMENTED_CONTROL,o=r===s.Style.BORDERLESS?W.XSMALL:W.MEDIUM,i=n===P.PILLS||n===P.SEGMENTED_CONTROL,a=r===s.Style.BORDERLESS?"lg":"base";return{element:v(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Be(e,t,r,n){return r.indexOf(n)>-1?!0:t!==s.ClickMode.SINGLE_SELECT||e!==s.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Ie(e,t){return e&&(t=`${t}Active`),t}function Te(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case s.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case s.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case s.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function De(e,t,r,n,o,i){const a=Be(r,n,o,t);let p=e.content,c=e.contentIcon;return a&&(p=e.selectedContent?e.selectedContent:p,c=e.selectedContentIcon?e.selectedContentIcon:c),f.forwardRef(function(d,y){const{element:m,kind:l,size:_}=Ae(p??"",c??void 0,i),h=Ie(!!(a&&!e.selectedContent&&!e.selectedContentIcon),l);return v(ue,{...d,size:_,kind:h,children:m})})}function je(e,t){return e.getIntArrayValue(t)}function Me(e){return e.default??null}function $e(e){return e.value??null}function Ge(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:p,style:c,label:C,labelVisibility:d,help:y}=r,m=Y(),[l,_]=ce({getStateFromWidgetMgr:je,getDefaultStateFromProto:Me,getCurrStateFromProto:$e,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),h=(O,E)=>{const L=Pe(i,E,l);_({value:L,fromUi:!0})};let w;i===s.ClickMode.SINGLE_SELECT?w=k.radio:i===s.ClickMode.MULTI_SELECT&&(w=k.checkbox);const B=f.useMemo(()=>a.map((O,E)=>{const L=De(O,E,p,i,l,c);return v(L,{},`${O.content}-${E}`)}),[i,a,p,c,l]);return ee("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[v(ae,{label:C,disabled:t,labelVisibility:te((d==null?void 0:d.value)??re.LabelVisibilityOptions.COLLAPSED),children:y&&v(ne,{children:v(oe,{content:y,placement:ie.TOP})})}),v(F,{disabled:t,mode:w,onClick:h,selected:i===s.ClickMode.MULTI_SELECT?l:Ce(l),overrides:{Root:{style:f.useCallback(()=>Te(c,m.spacing),[c,m.spacing])}},children:B})]})}const Ue=f.memo(Ge);export{Ue as default};
@@ -1 +1 @@
1
- import{n as p,aR as w,r as a,z as x,j as r,D as v,aE as h,aS as e,aT as k,aU as z,F as R,C as L}from"./index.DuqdUleB.js";const C=p("button",{target:"e1rpgzpk0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),B=p("div",{target:"e1rpgzpk1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),E=p("div",{target:"e1rpgzpk3"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function m(o){const t=L(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:t?o.colors.gray10:o.colors.gray90,color:o.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function D(o){if(o.length>104){let s=o.replace(/^(.{104}[^\s]*).*/,"$1");return s.length>104&&(s=s.substring(0,104).split(" ").slice(0,-1).join(" ")),s.trim()}return o}function H({theme:o,body:t,icon:s,width:y}){const n=D(t),d=t!==n,[i,b]=a.useState(!d),[u,S]=a.useState(0),f=a.useCallback(()=>{b(!i)},[i]),c=a.useMemo(()=>m(o),[o]),l=a.useMemo(()=>x(B,{expanded:i,children:[s&&r(v,{iconValue:s,size:"xl",testid:"stToastDynamicIcon"}),x(E,{children:[r(h,{source:i?t:n,allowHTML:!1,isToast:!0}),d&&r(C,{"data-testid":"stToastViewButton",onClick:f,children:i?"view less":"view more"})]})]}),[d,i,t,s,n,f]);a.useEffect(()=>{if(o.inSidebar)return;const g=e.info(l,{overrides:{...c}});return S(g),()=>{e.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),e.clear(g)}},[]),a.useEffect(()=>{e.update(u,{children:l,overrides:{...c}})},[u,l,c]);const T=r(z,{kind:k.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information.",width:y});return r(R,{children:o.inSidebar&&T})}const M=w(H);export{M as default};
1
+ import{n as p,aR as w,r as a,z as x,j as r,D as v,aE as h,aS as e,aT as k,aU as z,F as R,C as L}from"./index.gthzAzzy.js";const C=p("button",{target:"e1rpgzpk0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),B=p("div",{target:"e1rpgzpk1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),E=p("div",{target:"e1rpgzpk3"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function m(o){const t=L(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:t?o.colors.gray10:o.colors.gray90,color:o.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function D(o){if(o.length>104){let s=o.replace(/^(.{104}[^\s]*).*/,"$1");return s.length>104&&(s=s.substring(0,104).split(" ").slice(0,-1).join(" ")),s.trim()}return o}function H({theme:o,body:t,icon:s,width:y}){const n=D(t),d=t!==n,[i,b]=a.useState(!d),[u,S]=a.useState(0),f=a.useCallback(()=>{b(!i)},[i]),c=a.useMemo(()=>m(o),[o]),l=a.useMemo(()=>x(B,{expanded:i,children:[s&&r(v,{iconValue:s,size:"xl",testid:"stToastDynamicIcon"}),x(E,{children:[r(h,{source:i?t:n,allowHTML:!1,isToast:!0}),d&&r(C,{"data-testid":"stToastViewButton",onClick:f,children:i?"view less":"view more"})]})]}),[d,i,t,s,n,f]);a.useEffect(()=>{if(o.inSidebar)return;const g=e.info(l,{overrides:{...c}});return S(g),()=>{e.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),e.clear(g)}},[]),a.useEffect(()=>{e.update(u,{children:l,overrides:{...c}})},[u,l,c]);const T=r(z,{kind:k.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information.",width:y});return r(R,{children:o.inSidebar&&T})}const M=w(H);export{M as default};
@@ -1,4 +1,4 @@
1
- import{r as g,bQ as wr,bR as kr,bS as Cr,bT as Mr,b as qr,g as Xr,bw as A,bK as de,bL as fe,bU as Qr,bJ as Pr,bx as I,G as Ir,bV as Zr,bW as Hr,bX as Qt,bY as Gr,by as De,bZ as Jr,b_ as en,b$ as tn,B as rn,A as Ar,y as Zt,aF as nn,N as _t,J as an,z as on,j as $e,bs as sn,bF as ln,bt as un,bc as cn,bu as pn}from"./index.DuqdUleB.js";import{a as dn}from"./useBasicWidgetState.D572sX2t.js";import{D as ue,a as ce,T as fn,l as We}from"./timepicker.DsaAj0da.js";import{I as hn}from"./input.BANuQoGH.js";import{I as yn}from"./base-input.P8VGAZdC.js";import"./FormClearHelper.Bue0QSIn.js";import"./possibleConstructorReturn.BErM7qST.js";import"./createSuper.GYQHnroV.js";var vn=["title","size","color","overrides"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},et.apply(this,arguments)}function gn(t,r){if(t==null)return{};var n=mn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function mn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function bn(t,r){return $n(t)||Sn(t,r)||Dn(t,r)||On()}function On(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as g,bQ as wr,bR as kr,bS as Cr,bT as Mr,b as qr,g as Xr,bw as A,bK as de,bL as fe,bU as Qr,bJ as Pr,bx as I,G as Ir,bV as Zr,bW as Hr,bX as Qt,bY as Gr,by as De,bZ as Jr,b_ as en,b$ as tn,B as rn,A as Ar,y as Zt,aF as nn,N as _t,J as an,z as on,j as $e,bs as sn,bF as ln,bt as un,bc as cn,bu as pn}from"./index.gthzAzzy.js";import{a as dn}from"./useBasicWidgetState.BJ0FCAzu.js";import{D as ue,a as ce,T as fn,l as We}from"./timepicker.BbVkXpKf.js";import{I as hn}from"./input.ekQXAXS2.js";import{I as yn}from"./base-input.BG3_mR5a.js";import"./FormClearHelper.LI0uGKXr.js";import"./possibleConstructorReturn.BiMrneUm.js";import"./createSuper.BF6PuRKW.js";var vn=["title","size","color","overrides"];function et(){return et=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},et.apply(this,arguments)}function gn(t,r){if(t==null)return{};var n=mn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function mn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function bn(t,r){return $n(t)||Sn(t,r)||Dn(t,r)||On()}function On(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dn(t,r){if(t){if(typeof t=="string")return Gt(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gt(t,r)}}function Gt(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Sn(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(l){o=!0,s=l}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function $n(t){if(Array.isArray(t))return t}function _n(t,r){var n=wr(),a=bn(n,2),e=a[1],o=t.title,i=o===void 0?"Left":o,s=t.size,l=t.color,u=t.overrides,d=u===void 0?{}:u,p=gn(t,vn),f=kr({component:e.icons&&e.icons.ChevronLeft?e.icons.ChevronLeft:null},d&&d.Svg?Cr(d.Svg):{});return g.createElement(Mr,et({viewBox:"0 0 24 24",ref:r,title:i,size:s,color:l,overrides:{Svg:f}},p),g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const Jt=g.forwardRef(_n);var wn=["title","size","color","overrides"];function tt(){return tt=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},tt.apply(this,arguments)}function kn(t,r){if(t==null)return{};var n=Cn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Cn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Mn(t,r){return An(t)||Hn(t,r)||In(t,r)||Pn()}function Pn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function In(t,r){if(t){if(typeof t=="string")return er(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return er(t,r)}}function er(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Hn(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(l){o=!0,s=l}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function An(t){if(Array.isArray(t))return t}function En(t,r){var n=wr(),a=Mn(n,2),e=a[1],o=t.title,i=o===void 0?"Right":o,s=t.size,l=t.color,u=t.overrides,d=u===void 0?{}:u,p=kn(t,wn),f=kr({component:e.icons&&e.icons.ChevronRight?e.icons.ChevronRight:null},d&&d.Svg?Cr(d.Svg):{});return g.createElement(Mr,tt({viewBox:"0 0 24 24",ref:r,title:i,size:s,color:l,overrides:{Svg:f}},p),g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const tr=g.forwardRef(En);var Er={exports:{}};function Rn(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Ve=Rn(g),Tn=qr;function Ln(t,r){for(var n=Object.getOwnPropertyNames(r),a=0;a<n.length;a++){var e=n[a],o=Object.getOwnPropertyDescriptor(r,e);o&&o.configurable&&t[e]===void 0&&Object.defineProperty(t,e,o)}return t}function rt(){return(rt=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t}).apply(this,arguments)}function xn(t,r){t.prototype=Object.create(r.prototype),Ln(t.prototype.constructor=t,r)}function jn(t,r){if(t==null)return{};var n,a,e={},o=Object.keys(t);for(a=0;a<o.length;a++)n=o[a],0<=r.indexOf(n)||(e[n]=t[n]);return e}function ie(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Bn=function(t,r,n,a,e,o,i,s){if(!t){var l;if(r===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,a,e,o,i,s],d=0;(l=new Error(r.replace(/%s/g,function(){return u[d++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}},rr=Bn;function nr(t,r,n){if("selectionStart"in t&&"selectionEnd"in t)t.selectionStart=r,t.selectionEnd=n;else{var a=t.createTextRange();a.collapse(!0),a.moveStart("character",r),a.moveEnd("character",n-r),a.select()}}function Fn(t){var r=0,n=0;if("selectionStart"in t&&"selectionEnd"in t)r=t.selectionStart,n=t.selectionEnd;else{var a=document.selection.createRange();a.parentElement()===t&&(r=-a.moveStart("character",-t.value.length),n=-a.moveEnd("character",-t.value.length))}return{start:r,end:n,length:n-r}}var Nn={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},Wn="_";function ar(t,r,n){var a="",e="",o=null,i=[];if(r===void 0&&(r=Wn),n==null&&(n=Nn),!t||typeof t!="string")return{maskChar:r,formatChars:n,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var s=!1;return t.split("").forEach(function(l){s=!s&&l==="\\"||(s||!n[l]?(i.push(a.length),a.length===i.length-1&&(e+=l)):o=a.length+1,a+=l,!1)}),{maskChar:r,formatChars:n,prefix:e,mask:a,lastEditablePosition:o,permanents:i}}function Q(t,r){return t.permanents.indexOf(r)!==-1}function Le(t,r,n){var a=t.mask,e=t.formatChars;if(!n)return!1;if(Q(t,r))return a[r]===n;var o=e[a[r]];return new RegExp(o).test(n)}function or(t,r){return r.split("").every(function(n,a){return Q(t,a)||!Le(t,a,n)})}function ye(t,r){var n=t.maskChar,a=t.prefix;if(!n){for(;r.length>a.length&&Q(t,r.length-1);)r=r.slice(0,r.length-1);return r.length}for(var e=a.length,o=r.length;o>=a.length;o--){var i=r[o];if(!Q(t,o)&&Le(t,o,i)){e=o+1;break}}return e}function Rr(t,r){return ye(t,r)===t.mask.length}function ne(t,r){var n=t.maskChar,a=t.mask,e=t.prefix;if(!n){for((r=nt(t,"",r,0)).length<e.length&&(r=e);r.length<a.length&&Q(t,r.length);)r+=a[r.length];return r}if(r)return nt(t,ne(t,""),r,0);for(var o=0;o<a.length;o++)Q(t,o)?r+=a[o]:r+=n;return r}function Vn(t,r,n,a){var e=n+a,o=t.maskChar,i=t.mask,s=t.prefix,l=r.split("");if(o)return l.map(function(d,p){return p<n||e<=p?d:Q(t,p)?i[p]:o}).join("");for(var u=e;u<l.length;u++)Q(t,u)&&(l[u]="");return n=Math.max(s.length,n),l.splice(n,e-n),r=l.join(""),ne(t,r)}function nt(t,r,n,a){var e=t.mask,o=t.maskChar,i=t.prefix,s=n.split(""),l=Rr(t,r);return!o&&a>r.length&&(r+=e.slice(r.length,a)),s.every(function(u){for(;h=u,Q(t,f=a)&&h!==e[f];){if(a>=r.length&&(r+=e[a]),d=u,p=a,o&&Q(t,p)&&d===o)return!0;if(++a>=e.length)return!1}var d,p,f,h;return!Le(t,a,u)&&u!==o||(a<r.length?r=o||l||a<i.length?r.slice(0,a)+u+r.slice(a+1):(r=r.slice(0,a)+u+r.slice(a),ne(t,r)):o||(r+=u),++a<e.length)}),r}function Yn(t,r,n,a){var e=t.mask,o=t.maskChar,i=n.split(""),s=a;return i.every(function(l){for(;d=l,Q(t,u=a)&&d!==e[u];)if(++a>=e.length)return!1;var u,d;return(Le(t,a,l)||l===o)&&a++,a<e.length}),a-s}function zn(t,r){for(var n=r;0<=n;--n)if(!Q(t,n))return n;return null}function me(t,r){for(var n=t.mask,a=r;a<n.length;++a)if(!Q(t,a))return a;return null}function Ye(t){return t||t===0?t+"":""}function Un(t,r,n,a,e){var o=t.mask,i=t.prefix,s=t.lastEditablePosition,l=r,u="",d=0,p=0,f=Math.min(e.start,n.start);return n.end>e.start?p=(d=Yn(t,a,u=l.slice(e.start,n.end),f))?e.length:0:l.length<a.length&&(p=a.length-l.length),l=a,p&&(p===1&&!e.length&&(f=e.start===n.start?me(t,n.start):zn(t,n.start)),l=Vn(t,l,f,p)),l=nt(t,l,u,f),(f+=d)>=o.length?f=o.length:f<i.length&&!d?f=i.length:f>=i.length&&f<s&&d&&(f=me(t,f)),u||(u=null),{value:l=ne(t,l),enteredString:u,selection:{start:f,end:f}}}function Kn(){var t=new RegExp("windows","i"),r=new RegExp("phone","i"),n=navigator.userAgent;return t.test(n)&&r.test(n)}function X(t){return typeof t=="function"}function qn(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function Tr(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function ir(t){return(Tr()?qn():function(){return setTimeout(t,1e3/60)})(t)}function ze(t){(Tr()||clearTimeout)(t)}var Xn=function(t){function r(a){var e=t.call(this,a)||this;e.focused=!1,e.mounted=!1,e.previousSelection=null,e.selectionDeferId=null,e.saveSelectionLoopDeferId=null,e.saveSelectionLoop=function(){e.previousSelection=e.getSelection(),e.saveSelectionLoopDeferId=ir(e.saveSelectionLoop)},e.runSaveSelectionLoop=function(){e.saveSelectionLoopDeferId===null&&e.saveSelectionLoop()},e.stopSaveSelectionLoop=function(){e.saveSelectionLoopDeferId!==null&&(ze(e.saveSelectionLoopDeferId),e.saveSelectionLoopDeferId=null,e.previousSelection=null)},e.getInputDOMNode=function(){if(!e.mounted)return null;var c=Tn.findDOMNode(ie(ie(e))),y=typeof window<"u"&&c instanceof window.Element;if(c&&!y)return null;if(c.nodeName!=="INPUT"&&(c=c.querySelector("input")),!c)throw new Error("react-input-mask: inputComponent doesn't contain input node");return c},e.getInputValue=function(){var c=e.getInputDOMNode();return c?c.value:null},e.setInputValue=function(c){var y=e.getInputDOMNode();y&&(e.value=c,y.value=c)},e.setCursorToEnd=function(){var c=ye(e.maskOptions,e.value),y=me(e.maskOptions,c);y!==null&&e.setCursorPosition(y)},e.setSelection=function(c,y,v){v===void 0&&(v={});var m=e.getInputDOMNode(),b=e.isFocused();m&&b&&(v.deferred||nr(m,c,y),e.selectionDeferId!==null&&ze(e.selectionDeferId),e.selectionDeferId=ir(function(){e.selectionDeferId=null,nr(m,c,y)}),e.previousSelection={start:c,end:y,length:Math.abs(y-c)})},e.getSelection=function(){return Fn(e.getInputDOMNode())},e.getCursorPosition=function(){return e.getSelection().start},e.setCursorPosition=function(c){e.setSelection(c,c)},e.isFocused=function(){return e.focused},e.getBeforeMaskedValueChangeConfig=function(){var c=e.maskOptions,y=c.mask,v=c.maskChar,m=c.permanents,b=c.formatChars;return{mask:y,maskChar:v,permanents:m,alwaysShowMask:!!e.props.alwaysShowMask,formatChars:b}},e.isInputAutofilled=function(c,y,v,m){var b=e.getInputDOMNode();try{if(b.matches(":-webkit-autofill"))return!0}catch{}return!e.focused||m.end<v.length&&y.end===c.length},e.onChange=function(c){var y=ie(ie(e)).beforePasteState,v=ie(ie(e)).previousSelection,m=e.props.beforeMaskedValueChange,b=e.getInputValue(),O=e.value,D=e.getSelection();e.isInputAutofilled(b,D,O,v)&&(O=ne(e.maskOptions,""),v={start:0,end:0,length:0}),y&&(v=y.selection,O=y.value,D={start:v.start+b.length,end:v.start+b.length,length:0},b=O.slice(0,v.start)+b+O.slice(v.end),e.beforePasteState=null);var C=Un(e.maskOptions,b,D,O,v),k=C.enteredString,$=C.selection,M=C.value;if(X(m)){var w=m({value:M,selection:$},{value:O,selection:v},k,e.getBeforeMaskedValueChangeConfig());M=w.value,$=w.selection}e.setInputValue(M),X(e.props.onChange)&&e.props.onChange(c),e.isWindowsPhoneBrowser?e.setSelection($.start,$.end,{deferred:!0}):e.setSelection($.start,$.end)},e.onFocus=function(c){var y=e.props.beforeMaskedValueChange,v=e.maskOptions,m=v.mask,b=v.prefix;if(e.focused=!0,e.mounted=!0,m){if(e.value)ye(e.maskOptions,e.value)<e.maskOptions.mask.length&&e.setCursorToEnd();else{var O=ne(e.maskOptions,b),D=ne(e.maskOptions,O),C=ye(e.maskOptions,D),k=me(e.maskOptions,C),$={start:k,end:k};if(X(y)){var M=y({value:D,selection:$},{value:e.value,selection:null},null,e.getBeforeMaskedValueChangeConfig());D=M.value,$=M.selection}var w=D!==e.getInputValue();w&&e.setInputValue(D),w&&X(e.props.onChange)&&e.props.onChange(c),e.setSelection($.start,$.end)}e.runSaveSelectionLoop()}X(e.props.onFocus)&&e.props.onFocus(c)},e.onBlur=function(c){var y=e.props.beforeMaskedValueChange,v=e.maskOptions.mask;if(e.stopSaveSelectionLoop(),e.focused=!1,v&&!e.props.alwaysShowMask&&or(e.maskOptions,e.value)){var m="";X(y)&&(m=y({value:m,selection:null},{value:e.value,selection:e.previousSelection},null,e.getBeforeMaskedValueChangeConfig()).value);var b=m!==e.getInputValue();b&&e.setInputValue(m),b&&X(e.props.onChange)&&e.props.onChange(c)}X(e.props.onBlur)&&e.props.onBlur(c)},e.onMouseDown=function(c){if(!e.focused&&document.addEventListener){e.mouseDownX=c.clientX,e.mouseDownY=c.clientY,e.mouseDownTime=new Date().getTime();var y=function v(m){if(document.removeEventListener("mouseup",v),e.focused){var b=Math.abs(m.clientX-e.mouseDownX),O=Math.abs(m.clientY-e.mouseDownY),D=Math.max(b,O),C=new Date().getTime()-e.mouseDownTime;(D<=10&&C<=200||D<=5&&C<=300)&&e.setCursorToEnd()}};document.addEventListener("mouseup",y)}X(e.props.onMouseDown)&&e.props.onMouseDown(c)},e.onPaste=function(c){X(e.props.onPaste)&&e.props.onPaste(c),c.defaultPrevented||(e.beforePasteState={value:e.getInputValue(),selection:e.getSelection()},e.setInputValue(""))},e.handleRef=function(c){e.props.children==null&&X(e.props.inputRef)&&e.props.inputRef(c)};var o=a.mask,i=a.maskChar,s=a.formatChars,l=a.alwaysShowMask,u=a.beforeMaskedValueChange,d=a.defaultValue,p=a.value;e.maskOptions=ar(o,i,s),d==null&&(d=""),p==null&&(p=d);var f=Ye(p);if(e.maskOptions.mask&&(l||f)&&(f=ne(e.maskOptions,f),X(u))){var h=a.value;a.value==null&&(h=d),f=u({value:f,selection:null},{value:h=Ye(h),selection:null},null,e.getBeforeMaskedValueChangeConfig()).value}return e.value=f,e}xn(r,t);var n=r.prototype;return n.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=Kn(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},n.componentDidUpdate=function(){var a=this.previousSelection,e=this.props,o=e.beforeMaskedValueChange,i=e.alwaysShowMask,s=e.mask,l=e.maskChar,u=e.formatChars,d=this.maskOptions,p=i||this.isFocused(),f=this.props.value!=null,h=f?Ye(this.props.value):this.value,c=a?a.start:null;if(this.maskOptions=ar(s,l,u),this.maskOptions.mask){!d.mask&&this.isFocused()&&this.runSaveSelectionLoop();var y=this.maskOptions.mask&&this.maskOptions.mask!==d.mask;if(d.mask||f||(h=this.getInputValue()),(y||this.maskOptions.mask&&(h||p))&&(h=ne(this.maskOptions,h)),y){var v=ye(this.maskOptions,h);(c===null||v<c)&&(c=Rr(this.maskOptions,h)?v:me(this.maskOptions,v))}!this.maskOptions.mask||!or(this.maskOptions,h)||p||f&&this.props.value||(h="");var m={start:c,end:c};if(X(o)){var b=o({value:h,selection:m},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());h=b.value,m=b.selection}this.value=h;var O=this.getInputValue()!==this.value;O?(this.setInputValue(this.value),this.forceUpdate()):y&&this.forceUpdate();var D=!1;m.start!=null&&m.end!=null&&(D=!a||a.start!==m.start||a.end!==m.end),(D||O)&&this.setSelection(m.start,m.end)}else d.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},n.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&ze(this.selectionDeferId),this.stopSaveSelectionLoop()},n.render=function(){var a,e=this.props,o=(e.mask,e.alwaysShowMask,e.maskChar,e.formatChars,e.inputRef,e.beforeMaskedValueChange,e.children),i=jn(e,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(o){X(o)||rr(!1);var s=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],l=rt({},i);s.forEach(function(d){return delete l[d]}),a=o(l),s.filter(function(d){return a.props[d]!=null&&a.props[d]!==i[d]}).length&&rr(!1)}else a=Ve.createElement("input",rt({ref:this.handleRef},i));var u={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(i.disabled||i.readOnly||(u.onChange=this.onChange,u.onPaste=this.onPaste,u.onMouseDown=this.onMouseDown),i.value!=null&&(u.value=this.value)),a=Ve.cloneElement(a,u)},r}(Ve.Component),Qn=Xn;Er.exports=Qn;var Zn=Er.exports;const Gn=Xr(Zn);var Jn=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],ea=["Input"],ta=["mask","maskChar","overrides"];function sr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Ue(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?sr(Object(n),!0).forEach(function(a){ra(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ra(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function ke(t){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ke(t)}function Se(){return Se=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Se.apply(this,arguments)}function at(t,r){if(t==null)return{};var n=na(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function na(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}var Lr=g.forwardRef(function(t,r){t.startEnhancer,t.endEnhancer,t.error,t.positive;var n=t.onChange,a=t.onFocus,e=t.onBlur,o=t.value,i=t.disabled,s=t.readOnly,l=at(t,Jn);return g.createElement(Gn,Se({onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:s},l),function(u){return g.createElement(yn,Se({ref:r,onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:s},u))})});Lr.displayName="MaskOverride";function xr(t){var r=t.mask,n=t.maskChar,a=t.overrides;a=a===void 0?{}:a;var e=a.Input,o=e===void 0?{}:e,i=at(a,ea),s=at(t,ta),l=Lr,u={},d={};typeof o=="function"?l=o:ke(o)==="object"&&(l=o.component||l,u=o.props||{},d=o.style||{}),ke(u)==="object"&&(u=Ue(Ue({},u),{},{mask:u.mask||r,maskChar:u.maskChar||n}));var p=Ue({Input:{component:l,props:u,style:d}},i);return g.createElement(hn,Se({},s,{overrides:p}))}xr.defaultProps={maskChar:" "};var wt=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),jr=[0,1,2,3,4,5,6],aa=[0,1,2,3,4,5,6,7,8,9,10,11],F={high:"high",default:"default"},ae={startDate:"startDate",endDate:"endDate"},oa={default:"default",locked:"locked"};function lr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function le(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?lr(Object(n),!0).forEach(function(a){ia(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ia(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var kt=A("label",function(t){var r=t.$disabled,n=t.$theme,a=n.colors,e=n.typography;return le(le({},e.font250),{},{width:"100%",color:r?a.contentSecondary:a.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});kt.displayName="Label";kt.displayName="Label";var Ct=A("span",function(t){var r=t.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});Ct.displayName="LabelContainer";Ct.displayName="LabelContainer";var Mt=A("span",function(t){var r=t.$disabled,n=t.$counterError,a=t.$theme,e=a.colors,o=a.typography;return le(le({},o.font100),{},{flex:0,width:"100%",color:n?e.negative400:r?e.contentSecondary:e.contentPrimary})});Mt.displayName="LabelEndEnhancer";Mt.displayName="LabelEndEnhancer";var Pt=A("div",function(t){var r=t.$error,n=t.$positive,a=t.$theme,e=a.colors,o=a.sizing,i=a.typography,s=e.contentSecondary;return r?s=e.negative400:n&&(s=e.positive400),le(le({},i.font100),{},{color:s,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:o.scale300,marginRight:0,marginBottom:o.scale300,marginLeft:0})});Pt.displayName="Caption";Pt.displayName="Caption";var It=A("div",function(t){var r=t.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});It.displayName="ControlContainer";It.displayName="ControlContainer";function oe(){return oe=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},oe.apply(this,arguments)}function Ce(t){"@babel/helpers - typeof";return Ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ce(t)}function sa(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function la(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function ua(t,r,n){return r&&la(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ca(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&ot(t,r)}function ot(t,r){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},ot(t,r)}function pa(t){var r=ha();return function(){var a=Me(t),e;if(r){var o=Me(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return da(this,e)}}function da(t,r){if(r&&(Ce(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fa(t)}function fa(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ha(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Me(t){return Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Me(t)}function ya(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function va(t,r,n,a){return r&&typeof r!="boolean"?typeof r=="function"?r(a):r:n&&typeof n!="boolean"?typeof n=="function"?n(a):n:t?typeof t=="function"?t(a):t:null}var it=function(t){ca(n,t);var r=pa(n);function n(){return sa(this,n),r.apply(this,arguments)}return ua(n,[{key:"render",value:function(){var e=this.props,o=e.overrides,i=o.Label,s=o.LabelEndEnhancer,l=o.LabelContainer,u=o.Caption,d=o.ControlContainer,p=e.label,f=e.caption,h=e.disabled,c=e.error,y=e.positive,v=e.htmlFor,m=e.children,b=e.counter,O=g.Children.only(m).props,D={$disabled:!!h,$error:!!c,$positive:!!y},C=de(i)||kt,k=de(s)||Mt,$=de(l)||Ct,M=de(u)||Pt,w=de(d)||It,P=va(f,c,y,D),S=this.props.labelEndEnhancer;if(b){var _=null,E=null,R=null;Ce(b)==="object"&&(E=b.length,_=b.maxLength,R=b.error),_=_||O.maxLength,E==null&&typeof O.value=="string"&&(E=O.value.length),E==null&&(E=0),D.$length=E,_==null?S||(S="".concat(E)):(D.$maxLength=E,S||(S="".concat(E,"/").concat(_)),E>_&&R==null&&(R=!0)),R&&(D.$error=!0,D.$counterError=!0)}return g.createElement(g.Fragment,null,p&&g.createElement($,oe({},D,fe(l)),g.createElement(C,oe({"data-baseweb":"form-control-label",htmlFor:v||O.id},D,fe(i)),typeof p=="function"?p(D):p),!!S&&g.createElement(k,oe({},D,fe(s)),typeof S=="function"?S(D):S)),g.createElement(Qr,null,function(re){return g.createElement(w,oe({"data-baseweb":"form-control-container"},D,fe(d)),g.Children.map(m,function(K,W){if(K){var j=K.key||String(W);return g.cloneElement(K,{key:j,"aria-errormessage":c?re:null,"aria-describedby":f||y?re:null,disabled:O.disabled||h,error:typeof O.error<"u"?O.error:D.$error,positive:typeof O.positive<"u"?O.positive:D.$positive})}}),(!!f||!!c||y)&&g.createElement(M,oe({"data-baseweb":"form-control-caption",id:re},D,fe(u)),P))}))}}]),n}(g.Component);ya(it,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function ur(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function cr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?ur(Object(n),!0).forEach(function(a){ga(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ur(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ga(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var ma=function(r){return aa.map(function(n){return{id:n.toString(),label:r(n)}})},ba=function(r,n){return r.map(function(a){return n.includes(Number(a.id))?a:cr(cr({},a),{},{disabled:!0})})},Oa=function(r){var n=r.filterMonthsList,a=r.formatMonthLabel,e=ma(a);return n&&(e=ba(e,n)),e};function Da(t){var r=t.$range,n=r===void 0?!1:r,a=t.$disabled,e=a===void 0?!1:a,o=t.$isHighlighted,i=o===void 0?!1:o,s=t.$isHovered,l=s===void 0?!1:s,u=t.$selected,d=u===void 0?!1:u,p=t.$hasRangeSelected,f=p===void 0?!1:p,h=t.$startDate,c=h===void 0?!1:h,y=t.$endDate,v=y===void 0?!1:y,m=t.$pseudoSelected,b=m===void 0?!1:m,O=t.$hasRangeHighlighted,D=O===void 0?!1:O,C=t.$pseudoHighlighted,k=C===void 0?!1:C,$=t.$hasRangeOnRight,M=$===void 0?!1:$,w=t.$startOfMonth,P=w===void 0?!1:w,S=t.$endOfMonth,_=S===void 0?!1:S,E=t.$outsideMonth,R=E===void 0?!1:E;return"".concat(+n).concat(+e).concat(+(i||l)).concat(+d).concat(+f).concat(+c).concat(+v).concat(+b).concat(+D).concat(+k).concat(+(D&&!k&&M)).concat(+(D&&!k&&!M)).concat(+P).concat(+_).concat(+R)}function Sa(t,r){return ka(t)||wa(t,r)||_a(t,r)||$a()}function $a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _a(t,r){if(t){if(typeof t=="string")return pr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pr(t,r)}}function pr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function wa(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,s;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(l){o=!0,s=l}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw s}}return a}}function ka(t){if(Array.isArray(t))return t}function dr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function x(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?dr(Object(n),!0).forEach(function(a){be(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function be(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Ht=A("div",function(t){var r=t.$separateRangeInputs;return x({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});Ht.displayName="StyledInputWrapper";Ht.displayName="StyledInputWrapper";var At=A("div",function(t){var r=t.$theme;return x(x({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});At.displayName="StyledInputLabel";At.displayName="StyledInputLabel";var Et=A("div",function(t){var r=t.$theme;return{width:"100%",marginRight:r.sizing.scale300}});Et.displayName="StyledStartDate";Et.displayName="StyledStartDate";var Rt=A("div",function(t){return t.$theme,{width:"100%"}});Rt.displayName="StyledEndDate";Rt.displayName="StyledEndDate";var Tt=A("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.borders;return x(x({},n.font200),{},{color:a.calendarForeground,backgroundColor:a.calendarBackground,textAlign:"center",borderTopLeftRadius:e.surfaceBorderRadius,borderTopRightRadius:e.surfaceBorderRadius,borderBottomRightRadius:e.surfaceBorderRadius,borderBottomLeftRadius:e.surfaceBorderRadius,display:"inline-block"})});Tt.displayName="StyledRoot";Tt.displayName="StyledRoot";var Lt=A("div",function(t){var r=t.$orientation;return{display:"flex",flexDirection:r===wt.vertical?"column":"row"}});Lt.displayName="StyledMonthContainer";Lt.displayName="StyledMonthContainer";var xt=A("div",function(t){var r=t.$theme.sizing,n=t.$density;return{paddingTop:r.scale300,paddingBottom:n===F.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});xt.displayName="StyledCalendarContainer";xt.displayName="StyledCalendarContainer";var Pe=A("div",function(t){var r=t.$theme,n=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:n}});Pe.displayName="StyledSelectorContainer";Pe.displayName="StyledSelectorContainer";var jt=A("div",function(t){var r=t.$theme,n=r.typography,a=r.borders,e=r.colors,o=r.sizing,i=t.$density;return x(x({},i===F.high?n.LabelMedium:n.LabelLarge),{},{color:e.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:o.scale600,paddingBottom:o.scale300,paddingLeft:o.scale600,paddingRight:o.scale600,backgroundColor:e.calendarHeaderBackground,borderTopLeftRadius:a.surfaceBorderRadius,borderTopRightRadius:a.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===F.high?"calc(".concat(o.scale800," + ").concat(o.scale0,")"):o.scale950})});jt.displayName="StyledCalendarHeader";jt.displayName="StyledCalendarHeader";var Bt=A("div",function(t){return{color:t.$theme.colors.calendarHeaderForeground,backgroundColor:t.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});Bt.displayName="StyledMonthHeader";Bt.displayName="StyledMonthHeader";var Ft=A("button",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$isFocusVisible,o=t.$density;return x(x({},o===F.high?n.LabelMedium:n.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:a.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:e?"0 0 0 3px ".concat(a.accent):"none"}})});Ft.displayName="StyledMonthYearSelectButton";Ft.displayName="StyledMonthYearSelectButton";var Nt=A("span",function(t){var r=t.$theme.direction==="rtl"?"marginRight":"marginLeft";return be({alignItems:"center",display:"flex"},r,t.$theme.sizing.scale500)});Nt.displayName="StyledMonthYearSelectIconContainer";Nt.displayName="StyledMonthYearSelectIconContainer";function Br(t){var r=t.$theme,n=t.$disabled,a=t.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:n?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:n?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":n?{}:{boxShadow:a?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var Wt=A("button",Br);Wt.displayName="StyledPrevButton";Wt.displayName="StyledPrevButton";var Vt=A("button",Br);Vt.displayName="StyledNextButton";Vt.displayName="StyledNextButton";var Yt=A("div",function(t){return{display:"inline-block"}});Yt.displayName="StyledMonth";Yt.displayName="StyledMonth";var zt=A("div",function(t){var r=t.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});zt.displayName="StyledWeek";zt.displayName="StyledWeek";function H(t,r){var n,a=t.substr(0,12)+"1"+t.substr(13),e=t.substr(0,13)+"1"+t.substr(14);return n={},be(n,t,r),be(n,a,r),be(n,e,r),n}function Ke(t,r){var n=r.colors,a={":before":{content:null},":after":{content:null}},e=a,o={color:n.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:n.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},s={":before":{content:null}},l=1;t&&t[l]==="1"&&(e=o);var u=Object.assign({},H("001000000000000",{color:n.calendarDayForegroundPseudoSelected}),H("000100000000000",{color:n.calendarDayForegroundSelected}),H("001100000000000",{color:n.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},H("000000000000001",i),H("101000000000000",s),H("101010000000000",s),H("100100000000000",{color:n.calendarDayForegroundSelected}),H("101100000000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),H("100111100000000",{color:n.calendarDayForegroundSelected,":before":{content:null}}),H("101111100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),H("100111000000000",{color:n.calendarDayForegroundSelected}),H("100110100000000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),H("100100001010000",{color:n.calendarDayForegroundSelected}),H("100100001001000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),H("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},H("100010010000000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},H("100000001100000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),H("101111000000000",{color:n.calendarDayForegroundSelectedHighlighted}),H("101110100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),H("101010010000000",{color:n.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),H("100000000000001",i),H("100000001010001",i),H("100000001001001",i),H("100010000000001",i));return u[t]||e}var Ut=A("div",function(t){var r=t.$disabled,n=t.$isFocusVisible,a=t.$isHighlighted,e=t.$peekNextMonth,o=t.$pseudoSelected,i=t.$range,s=t.$selected,l=t.$outsideMonth,u=t.$outsideMonthWithinRange,d=t.$hasDateLabel,p=t.$density,f=t.$hasLockedBehavior,h=t.$selectedInput,c=t.$value,y=t.$theme,v=y.colors,m=y.typography,b=y.sizing,O=Da(t),D;d?p===F.high?D="60px":D="70px":p===F.high?D="40px":D="48px";var C=Array.isArray(c)?c:[c,null],k=Sa(C,2),$=k[0],M=k[1],w=h===ae.startDate?M!==null&&typeof M<"u":$!==null&&typeof $<"u",P=i&&!(f&&!w);return x(x(x({},p===F.high?m.ParagraphSmall:m.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!e&&l?"default":"pointer",color:v.calendarForeground,display:"inline-block",width:p===F.high?"42px":"50px",height:D,lineHeight:p===F.high?b.scale700:b.scale900,textAlign:"center",paddingTop:b.scale300,paddingBottom:b.scale300,paddingLeft:b.scale300,paddingRight:b.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},Ke(O,t.$theme)),{},{":after":x(x({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:n&&(!l||e)?"0 0 0 3px ".concat(v.accent):"none",backgroundColor:s?v.calendarDayBackgroundSelectedHighlighted:o&&a?v.calendarDayBackgroundPseudoSelectedHighlighted:v.calendarBackground,height:d?"100%":p===F.high?"42px":"50px",width:"100%",position:"absolute",top:d?0:"-1px",left:0,paddingTop:b.scale200,paddingBottom:b.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:v.borderSelected,borderBottomColor:v.borderSelected,borderRightColor:v.borderSelected,borderLeftColor:v.borderSelected,borderTopLeftRadius:d?b.scale800:"100%",borderTopRightRadius:d?b.scale800:"100%",borderBottomLeftRadius:d?b.scale800:"100%",borderBottomRightRadius:d?b.scale800:"100%"},Ke(O,t.$theme)[":after"]||{}),u?{content:null}:{})},P?{":before":x(x({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:v.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},Ke(O,t.$theme)[":before"]||{}),u?{backgroundColor:v.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});Ut.displayName="StyledDay";Ut.displayName="StyledDay";var Kt=A("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$selected;return x(x({},n.ParagraphXSmall),{},{color:e?a.contentInverseTertiary:a.contentTertiary})});Kt.displayName="StyledDayLabel";Kt.displayName="StyledDayLabel";var qt=A("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.sizing,o=t.$density;return x(x({},n.LabelMedium),{},{color:a.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:o===F.high?"42px":"50px",height:o===F.high?"40px":"48px",textAlign:"center",lineHeight:e.scale900,paddingTop:e.scale300,paddingBottom:e.scale300,paddingLeft:e.scale200,paddingRight:e.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});qt.displayName="StyledWeekdayHeader";qt.displayName="StyledWeekdayHeader";function st(t){"@babel/helpers - typeof";return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},st(t)}function q(){return q=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},q.apply(this,arguments)}function G(t,r){return Ia(t)||Pa(t,r)||Ma(t,r)||Ca()}function Ca(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -1,4 +1,4 @@
1
- import{n as i,k as m,r as c,j as e}from"./index.DuqdUleB.js";import{P as l,R as p}from"./RenderInPortalIfExists.CGAGPcQq.js";const d=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,f=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,S=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,r=150,g=10,E=90,u=4e3,n=(t,a=0)=>Math.random()*(t-a)+a,w=()=>m(`from{transform:translateY(0)
1
+ import{n as i,k as m,r as c,j as e}from"./index.gthzAzzy.js";import{P as l,R as p}from"./RenderInPortalIfExists.DXoPwgJm.js";const d=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,f=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,S=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,r=150,g=10,E=90,u=4e3,n=(t,a=0)=>Math.random()*(t-a)+a,w=()=>m(`from{transform:translateY(0)
2
2
  rotateX(`,n(360),`deg)
3
3
  rotateY(`,n(360),`deg)
4
4
  rotateZ(`,n(360),"deg);}to{transform:translateY(calc(100vh + ",o,`px))
@@ -1 +1 @@
1
- import{n as o,z as m,j as i,aE as S}from"./index.DuqdUleB.js";import{S as g,T as y}from"./Toolbar.DBtrI961.js";import{w as W,u as b,E as M}from"./withFullScreenWrapper.4QDrgZxA.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,width:u,endpoints:f,disableFullscreenMode:x}){const{expanded:n,width:w,height:r,expand:C,collapse:h}=b(M),d=n?w:u;let l;const a=t.width;if([-1,-3,-4].includes(a))l=void 0;else if([-2,-5].includes(a))l=d;else if(a>0)l=a;else throw Error(`Invalid image width: ${a}`);const e={};return r&&n?(e.maxHeight=r,e.objectFit="contain"):(e.width=l,e.maxWidth="100%"),m(g,{width:d,height:r,useContainerWidth:n,topCentered:!0,children:[i(y,{target:g,isFullScreen:n,onExpand:C,onCollapse:h,disableFullscreenMode:x}),i(E,{className:"stImage","data-testid":"stImage",children:t.imgs.map((I,c)=>{const s=I;return m(L,{"data-testid":"stImageContainer",children:[i("img",{style:e,src:f.buildMediaURL(s.url),alt:c.toString()}),s.caption&&i(O,{"data-testid":"stImageCaption",style:e,children:i(S,{source:s.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},c)})})]})}const R=W(T);export{R as default};
1
+ import{n as o,z as m,j as i,aE as S}from"./index.gthzAzzy.js";import{S as g,T as y}from"./Toolbar.Bws727nN.js";import{w as W,u as b,E as M}from"./withFullScreenWrapper.CKNKx70m.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,width:u,endpoints:f,disableFullscreenMode:x}){const{expanded:n,width:w,height:r,expand:C,collapse:h}=b(M),d=n?w:u;let l;const a=t.width;if([-1,-3,-4].includes(a))l=void 0;else if([-2,-5].includes(a))l=d;else if(a>0)l=a;else throw Error(`Invalid image width: ${a}`);const e={};return r&&n?(e.maxHeight=r,e.objectFit="contain"):(e.width=l,e.maxWidth="100%"),m(g,{width:d,height:r,useContainerWidth:n,topCentered:!0,children:[i(y,{target:g,isFullScreen:n,onExpand:C,onCollapse:h,disableFullscreenMode:x}),i(E,{className:"stImage","data-testid":"stImage",children:t.imgs.map((I,c)=>{const s=I;return m(L,{"data-testid":"stImageContainer",children:[i("img",{style:e,src:f.buildMediaURL(s.url),alt:c.toString()}),s.caption&&i(O,{"data-testid":"stImageCaption",style:e,children:i(S,{source:s.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},c)})})]})}const R=W(T);export{R as default};
@@ -1 +1 @@
1
- import{r as i,j as g,bs as b,bP as m}from"./index.DuqdUleB.js";import{a as f}from"./useBasicWidgetState.D572sX2t.js";import"./FormClearHelper.Bue0QSIn.js";const p=(t,e)=>t.getStringValue(e),C=t=>t.default??null,d=t=>t.value??null,P=(t,e,r,o)=>{e.setStringValue(t,r.value,{fromUi:r.fromUi},o)},S=({element:t,disabled:e,widgetMgr:r,width:o,fragmentId:s})=>{var l;const[u,a]=f({getStateFromWidgetMgr:p,getDefaultStateFromProto:C,getCurrStateFromProto:d,updateWidgetMgrState:P,element:t,widgetMgr:r,fragmentId:s}),n=i.useCallback(c=>{a({value:c,fromUi:!0})},[a]);return g(m,{label:t.label,labelVisibility:b((l=t.labelVisibility)==null?void 0:l.value),help:t.help,onChange:n,disabled:e,width:o,value:u})},v=i.memo(S);export{v as default};
1
+ import{r as i,j as g,bs as b,bP as m}from"./index.gthzAzzy.js";import{a as f}from"./useBasicWidgetState.BJ0FCAzu.js";import"./FormClearHelper.LI0uGKXr.js";const p=(t,e)=>t.getStringValue(e),C=t=>t.default??null,d=t=>t.value??null,P=(t,e,r,o)=>{e.setStringValue(t,r.value,{fromUi:r.fromUi},o)},S=({element:t,disabled:e,widgetMgr:r,width:o,fragmentId:s})=>{var l;const[u,a]=f({getStateFromWidgetMgr:p,getDefaultStateFromProto:C,getCurrStateFromProto:d,updateWidgetMgrState:P,element:t,widgetMgr:r,fragmentId:s}),n=i.useCallback(c=>{a({value:c,fromUi:!0})},[a]);return g(m,{label:t.label,labelVisibility:b((l=t.labelVisibility)==null?void 0:l.value),help:t.help,onChange:n,disabled:e,width:o,value:u})},v=i.memo(S);export{v as default};
@@ -1 +1 @@
1
- import{r as l,E as R,_ as M,n as g,C as ht,y as q,j as a,bc as J,bv as ft,z as w,bq as Q,b8 as Z,bp as E,b2 as mt,bG as yt,bH as S,bt as vt,bk as Ct,bI as wt,J as L,F as X,bm as It,bl as bt}from"./index.DuqdUleB.js";import{g as xt,F as St,C as Ft,I as Et,E as zt,u as Ut,a as Ht}from"./FileDropzone.BFkJKygp.js";import{I as Tt}from"./InputInstructions.DpG38kbY.js";import{i as Dt}from"./inputUtils.CQWz5UKz.js";import{a as G}from"./axios.upsvKRUO.js";import{U as k}from"./UploadFileInfo.C-jY39rj.js";import{T as Lt}from"./textarea.CmSZv6UE.js";import"./base-input.P8VGAZdC.js";var tt=l.forwardRef(function(t,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(R,M({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.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"}))});tt.displayName="AttachFile";var et=l.forwardRef(function(t,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(R,M({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.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"}))});et.displayName="ErrorOutline";var ot=l.forwardRef(function(t,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(R,M({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.createElement("rect",{width:24,height:24,fill:"none"}),l.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"}))});ot.displayName="Send";const Bt=g("div",{target:"e1w2ot2t0"})(({theme:t,width:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,display:"flex",backgroundColor:t.colors.secondaryBg,width:`${e}px`,overflow:"hidden",":focus-within":{borderColor:t.colors.primary},"&.dropzone":{borderColor:t.colors.primary,borderRadius:t.radii.full,height:t.sizes.emptyDropdownHeight}})),Vt=g("div",{target:"e1w2ot2t1"})(({theme:t})=>({position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,gap:t.spacing.sm})),kt=g("button",{target:"e1w2ot2t2"})(({theme:t,disabled:e,extended:s})=>{const h=ht(t),[y,p]=h?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:s?"0":t.radii.chatInput,borderTopLeftRadius:s?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?y:p,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:h?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}}}),Rt=g("div",{target:"e1w2ot2t3"})({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,pointerEvents:"none"}),Mt=g("div",{target:"e1w2ot2t4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),Nt=g("div",{target:"e12v7o8j0"})(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",margin:"auto",height:"100%",width:"100%",color:t.colors.primary,fontWeight:t.fontWeights.bold})),At=g("div",{target:"e12v7o8j1"})(({})=>({display:"flex",alignItems:"top",height:"100%"})),$t=g("div",{target:"e12v7o8j2"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),jt=g("div",{target:"e12v7o8j3"})(({theme:t})=>({left:0,right:0,border:`${t.sizes.borderWidth} solid ${t.colors.transparent}`,minHeight:t.sizes.minChatInputFileListHeight,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Pt=g("div",{target:"e12v7o8j4"})(({})=>({display:"flex"})),Wt=g("div",{target:"e12v7o8j5"})(({})=>({flex:"0 0 auto"})),Kt=g("div",{target:"e12v7o8j6"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Ot=g("div",{target:"e12v7o8j7"})(({theme:t})=>({color:t.colors.fadedText60})),_t=g("div",{target:"e12v7o8j8"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Xt=g("div",{target:"e12v7o8j9"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Gt=g("small",{target:"e12v7o8j10"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Yt({children:t,content:e}){const s=q();return a(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${s.sizes.minElementHeight}`}}},children:t})}const qt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return a(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return a(Yt,{content:t.status.errorMessage,children:a(E,{content:et,size:"lg"})});case"uploaded":return a(E,{content:Et,size:"lg"});default:return mt(e),null}},Jt=({fileInfo:t,onDelete:e})=>w(Kt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(Ot,{children:a(qt,{fileInfo:t})}),a(_t,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),a(Xt,{children:xt(t.size,St.Byte)}),a(Gt,{"data-testid":"stChatInputDeleteBtn",children:a(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:a(E,{content:Ft,size:"lg"})})})]}),Qt=({items:t,onDelete:e})=>a(jt,{"data-testid":"stChatUploadedFiles",children:a(Pt,{children:t.map(s=>a(Wt,{children:a(Jt,{fileInfo:s,onDelete:e})},s.id))})}),Zt=({getRootProps:t,getInputProps:e,acceptFile:s,showDropzone:h,disabled:y,theme:p})=>h?w(Nt,{...t(),children:[a("input",{...e()}),"Drag and drop files here"]}):w(At,{children:[w("div",{"data-testid":"stChatInputFileUploadButton",...t(),children:[a("input",{...e()}),a(vt,{content:`Upload or drag and drop ${s===S.Multiple?"files":"a file"}`,placement:J.TOP,children:a(Q,{kind:Z.MINIMAL,disabled:y,children:a(E,{content:tt,size:"lg",color:p.colors.fadedText60})})})]}),a($t,{})]}),te=({getNextLocalFileId:t,addFiles:e,updateFile:s,uploadClient:h,element:y,onUploadProgress:p,onUploadComplete:f})=>(v,m)=>{const u=G.CancelToken.source(),d=new k(m.name,m.size,t(),{type:"uploading",cancelToken:u,progress:1});e([d]),h.uploadFile({formId:"",...y},v.uploadUrl,m,c=>p(c,d.id),u.token).then(()=>f(d.id,v)).catch(c=>{G.isCancel(c)||s(d.id,d.setStatus({type:"error",errorMessage:c?c.toString():"Unknown error"}))})},ee=({acceptMultipleFiles:t,uploadClient:e,uploadFile:s,addFiles:h,getNextLocalFileId:y,deleteExistingFiles:p,onUploadComplete:f})=>(v,m)=>{if(!t&&v.length===0&&m.length>1){const u=m.findIndex(d=>{var c;return((c=d.errors)==null?void 0:c[0].code)===zt.TooManyFiles});u>=0&&(v.push(m[u].file),m.splice(u,1))}if(!t&&v.length>0&&p(),e.fetchFileURLs(v).then(u=>{Ct(u,v).forEach(([d,c])=>{s(d,c)})}).catch(u=>{h(v.map(d=>new k(d.name,d.size,y(),{type:"error",errorMessage:u})))}),m.length>0){const u=m.map(d=>new k(d.file.name,d.file.size,y(),{type:"error",errorMessage:d.errors.map(c=>c.message).filter(c=>!!c).join(", ")}));h(u)}f()},oe=6.5,Y=1,B=(t,e,s)=>s.map(h=>h.id===t?e:h),V=(t,e)=>e.find(s=>s.id===t);function pe({width:t,element:e,widgetMgr:s,fragmentId:h,uploadClient:y}){const p=q(),f=l.useRef(null),v=l.useRef(0),m=l.useRef({minHeight:0,maxHeight:0}),[u,d]=l.useState(!1),[c,z]=l.useState(e.default),[U,N]=l.useState(0),[I,b]=l.useState([]),[F,H]=l.useState(!1),x=wt(e.acceptFile),A=l.useCallback(o=>b(n=>[...n,...o]),[]),$=l.useCallback(o=>{b(n=>{const i=V(o,n);return L(i)?n:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&y.deleteFile(i.status.fileUrls.deleteUrl),n.filter(r=>r.id!==o))})},[y]),nt=()=>{const o=I.filter(n=>n.status.type==="uploaded").map(n=>{const{name:i,size:r,status:C}=n,{fileId:ut,fileUrls:gt}=C;return new It({fileId:ut,fileUrls:gt,name:i,size:r})});return new bt({uploadedFileInfo:o})},j=()=>v.current++,at=ee({acceptMultipleFiles:x===S.Multiple,uploadClient:y,uploadFile:te({getNextLocalFileId:j,addFiles:A,updateFile:(o,n)=>{b(i=>B(o,n,i))},uploadClient:y,element:e,onUploadProgress:(o,n)=>{b(i=>{const r=V(n,i);if(L(r)||r.status.type!=="uploading")return i;const C=Math.round(o.loaded*100/o.total);return r.status.progress===C?i:B(n,r.setStatus({type:"uploading",cancelToken:r.status.cancelToken,progress:C}),i)})},onUploadComplete:(o,n)=>{b(i=>{const r=V(o,i);return L(r)||r.status.type!=="uploading"?i:B(r.id,r.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}),i)})}}),addFiles:A,getNextLocalFileId:j,deleteExistingFiles:()=>I.forEach(o=>$(o.id)),onUploadComplete:()=>{f.current&&f.current.focus()}}),{getRootProps:rt,getInputProps:it}=Ut({onDrop:at,multiple:x===S.Multiple,accept:Ht(e.fileType)}),st=()=>{let o=0;const{current:n}=f;if(n){const i=n.placeholder;n.placeholder="",n.style.height="auto",o=n.scrollHeight,n.placeholder=i,n.style.height=""}return o},P=()=>{if(f.current&&f.current.focus(),!u||e.disabled)return;const o={data:c,fileUploaderState:nt()};s.setChatInputValue(e,o,{fromUi:!0},h),d(!1),b([]),z(""),N(0)},lt=o=>{const{metaKey:n,ctrlKey:i,shiftKey:r}=o;Dt(o)&&!r&&!i&&!n&&(o.preventDefault(),P())},dt=o=>{const{value:n}=o.target,{maxChars:i}=e;i!==0&&n.length>i||(z(n),N(st()))};l.useEffect(()=>I.some(o=>o.status.type==="uploading")?d(!1):d(c!==""||I.length>0),[I,c]),l.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";z(o)}},[e]),l.useEffect(()=>{if(f.current){const{offsetHeight:o}=f.current;m.current.minHeight=o,m.current.maxHeight=o*oe}},[f]),l.useEffect(()=>{const o=r=>{var C;r.preventDefault(),r.stopPropagation(),!F&&((C=r.dataTransfer)!=null&&C.types.includes("Files"))&&H(!0)},n=r=>{r.preventDefault(),r.stopPropagation(),F&&(r.clientX<=0&&r.clientY<=0||r.clientX>=window.innerWidth&&r.clientY>=window.innerHeight)&&H(!1)},i=r=>{r.preventDefault(),r.stopPropagation(),F&&H(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",n),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",n)}},[F]);const{disabled:T,placeholder:W,maxChars:ct}=e,{minHeight:pt,maxHeight:K}=m.current,O=U>0&&f.current?Math.abs(U-pt)>Y:!1,D=x!==S.None&&F,_="stChatInput";return w(X,{children:[x===S.None?null:a(Qt,{items:[...I],onDelete:$}),a(Bt,{className:D?`${_} dropzone`:_,"data-testid":"stChatInput",width:t,children:w(Vt,{children:[x===S.None?null:a(Zt,{getRootProps:rt,getInputProps:it,acceptFile:x,showDropzone:D,disabled:T,theme:p}),D?null:w(X,{children:[a(Lt,{inputRef:f,value:c,placeholder:W,onChange:dt,onKeyDown:lt,"aria-label":W,disabled:T,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",border:"none"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:O?`${U+Y}px`:"auto",maxHeight:K?`${K}px`:"none",paddingLeft:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),t>p.breakpoints.hideWidgetDetails&&a(Mt,{children:a(Tt,{dirty:u,value:c,maxLength:ct,type:"chat",inForm:!1})}),a(Rt,{children:a(kt,{onClick:P,disabled:!u||T,extended:O,"data-testid":"stChatInputSubmitButton",children:a(E,{content:ot,size:"xl",color:"inherit"})})})]})]})})]})}export{pe as default};
1
+ import{r as l,E as k,_ as M,n as g,C as ht,y as q,j as a,bc as J,bv as ft,z as w,bq as Q,b8 as Z,bp as E,b2 as mt,bG as yt,bH as S,bt as vt,bk as Ct,bI as wt,J as L,F as X,bm as It,bl as bt}from"./index.gthzAzzy.js";import{g as xt,F as St,C as Ft,I as Et,E as zt,u as Ut,a as Ht}from"./FileDropzone.l_rm_qyP.js";import{I as Tt}from"./InputInstructions.BVSrSzyM.js";import{i as Dt}from"./inputUtils.CQWz5UKz.js";import{a as G}from"./axios.upsvKRUO.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Lt}from"./textarea.BYQOUi7u.js";import"./base-input.BG3_mR5a.js";var tt=l.forwardRef(function(t,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(k,M({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.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"}))});tt.displayName="AttachFile";var et=l.forwardRef(function(t,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(k,M({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.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"}))});et.displayName="ErrorOutline";var ot=l.forwardRef(function(t,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(k,M({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.createElement("rect",{width:24,height:24,fill:"none"}),l.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"}))});ot.displayName="Send";const Bt=g("div",{target:"e1w2ot2t0"})(({theme:t,width:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,display:"flex",backgroundColor:t.colors.secondaryBg,width:`${e}px`,overflow:"hidden",":focus-within":{borderColor:t.colors.primary},"&.dropzone":{borderColor:t.colors.primary,borderRadius:t.radii.full,height:t.sizes.emptyDropdownHeight}})),Rt=g("div",{target:"e1w2ot2t1"})(({theme:t})=>({position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,gap:t.spacing.sm})),Vt=g("button",{target:"e1w2ot2t2"})(({theme:t,disabled:e,extended:s})=>{const h=ht(t),[y,p]=h?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:s?"0":t.radii.chatInput,borderTopLeftRadius:s?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?y:p,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:h?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}}}),kt=g("div",{target:"e1w2ot2t3"})({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,pointerEvents:"none"}),Mt=g("div",{target:"e1w2ot2t4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),Nt=g("div",{target:"e12v7o8j0"})(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",margin:"auto",height:"100%",width:"100%",color:t.colors.primary,fontWeight:t.fontWeights.bold})),At=g("div",{target:"e12v7o8j1"})(({})=>({display:"flex",alignItems:"top",height:"100%"})),$t=g("div",{target:"e12v7o8j2"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Wt=g("div",{target:"e12v7o8j3"})(({theme:t})=>({left:0,right:0,border:`${t.sizes.borderWidth} solid ${t.colors.transparent}`,minHeight:t.sizes.minChatInputFileListHeight,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),jt=g("div",{target:"e12v7o8j4"})(({})=>({display:"flex"})),Pt=g("div",{target:"e12v7o8j5"})(({})=>({flex:"0 0 auto"})),Kt=g("div",{target:"e12v7o8j6"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Ot=g("div",{target:"e12v7o8j7"})(({theme:t})=>({color:t.colors.fadedText60})),_t=g("div",{target:"e12v7o8j8"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Xt=g("div",{target:"e12v7o8j9"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Gt=g("small",{target:"e12v7o8j10"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Yt({children:t,content:e}){const s=q();return a(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${s.sizes.minElementHeight}`}}},children:t})}const qt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return a(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return a(Yt,{content:t.status.errorMessage,children:a(E,{content:et,size:"lg"})});case"uploaded":return a(E,{content:Et,size:"lg"});default:return mt(e),null}},Jt=({fileInfo:t,onDelete:e})=>w(Kt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(Ot,{children:a(qt,{fileInfo:t})}),a(_t,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),a(Xt,{children:xt(t.size,St.Byte)}),a(Gt,{"data-testid":"stChatInputDeleteBtn",children:a(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:a(E,{content:Ft,size:"lg"})})})]}),Qt=({items:t,onDelete:e})=>a(Wt,{"data-testid":"stChatUploadedFiles",children:a(jt,{children:t.map(s=>a(Pt,{children:a(Jt,{fileInfo:s,onDelete:e})},s.id))})}),Zt=({getRootProps:t,getInputProps:e,acceptFile:s,showDropzone:h,disabled:y,theme:p})=>h?w(Nt,{...t(),children:[a("input",{...e()}),"Drag and drop files here"]}):w(At,{children:[w("div",{"data-testid":"stChatInputFileUploadButton",...t(),children:[a("input",{...e()}),a(vt,{content:`Upload or drag and drop ${s===S.Multiple?"files":"a file"}`,placement:J.TOP,children:a(Q,{kind:Z.MINIMAL,disabled:y,children:a(E,{content:tt,size:"lg",color:p.colors.fadedText60})})})]}),a($t,{})]}),te=({getNextLocalFileId:t,addFiles:e,updateFile:s,uploadClient:h,element:y,onUploadProgress:p,onUploadComplete:f})=>(v,m)=>{const u=G.CancelToken.source(),d=new V(m.name,m.size,t(),{type:"uploading",cancelToken:u,progress:1});e([d]),h.uploadFile({formId:"",...y},v.uploadUrl,m,c=>p(c,d.id),u.token).then(()=>f(d.id,v)).catch(c=>{G.isCancel(c)||s(d.id,d.setStatus({type:"error",errorMessage:c?c.toString():"Unknown error"}))})},ee=({acceptMultipleFiles:t,uploadClient:e,uploadFile:s,addFiles:h,getNextLocalFileId:y,deleteExistingFiles:p,onUploadComplete:f})=>(v,m)=>{if(!t&&v.length===0&&m.length>1){const u=m.findIndex(d=>{var c;return((c=d.errors)==null?void 0:c[0].code)===zt.TooManyFiles});u>=0&&(v.push(m[u].file),m.splice(u,1))}if(!t&&v.length>0&&p(),e.fetchFileURLs(v).then(u=>{Ct(u,v).forEach(([d,c])=>{s(d,c)})}).catch(u=>{h(v.map(d=>new V(d.name,d.size,y(),{type:"error",errorMessage:u})))}),m.length>0){const u=m.map(d=>new V(d.file.name,d.file.size,y(),{type:"error",errorMessage:d.errors.map(c=>c.message).filter(c=>!!c).join(", ")}));h(u)}f()},oe=6.5,Y=1,B=(t,e,s)=>s.map(h=>h.id===t?e:h),R=(t,e)=>e.find(s=>s.id===t);function pe({width:t,element:e,widgetMgr:s,fragmentId:h,uploadClient:y}){const p=q(),f=l.useRef(null),v=l.useRef(0),m=l.useRef({minHeight:0,maxHeight:0}),[u,d]=l.useState(!1),[c,z]=l.useState(e.default),[U,N]=l.useState(0),[I,b]=l.useState([]),[F,H]=l.useState(!1),x=wt(e.acceptFile),A=l.useCallback(o=>b(n=>[...n,...o]),[]),$=l.useCallback(o=>{b(n=>{const i=R(o,n);return L(i)?n:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&y.deleteFile(i.status.fileUrls.deleteUrl),n.filter(r=>r.id!==o))})},[y]),nt=()=>{const o=I.filter(n=>n.status.type==="uploaded").map(n=>{const{name:i,size:r,status:C}=n,{fileId:ut,fileUrls:gt}=C;return new It({fileId:ut,fileUrls:gt,name:i,size:r})});return new bt({uploadedFileInfo:o})},W=()=>v.current++,at=ee({acceptMultipleFiles:x===S.Multiple,uploadClient:y,uploadFile:te({getNextLocalFileId:W,addFiles:A,updateFile:(o,n)=>{b(i=>B(o,n,i))},uploadClient:y,element:e,onUploadProgress:(o,n)=>{b(i=>{const r=R(n,i);if(L(r)||r.status.type!=="uploading")return i;const C=Math.round(o.loaded*100/o.total);return r.status.progress===C?i:B(n,r.setStatus({type:"uploading",cancelToken:r.status.cancelToken,progress:C}),i)})},onUploadComplete:(o,n)=>{b(i=>{const r=R(o,i);return L(r)||r.status.type!=="uploading"?i:B(r.id,r.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}),i)})}}),addFiles:A,getNextLocalFileId:W,deleteExistingFiles:()=>I.forEach(o=>$(o.id)),onUploadComplete:()=>{f.current&&f.current.focus()}}),{getRootProps:rt,getInputProps:it}=Ut({onDrop:at,multiple:x===S.Multiple,accept:Ht(e.fileType)}),st=()=>{let o=0;const{current:n}=f;if(n){const i=n.placeholder;n.placeholder="",n.style.height="auto",o=n.scrollHeight,n.placeholder=i,n.style.height=""}return o},j=()=>{if(f.current&&f.current.focus(),!u||e.disabled)return;const o={data:c,fileUploaderState:nt()};s.setChatInputValue(e,o,{fromUi:!0},h),d(!1),b([]),z(""),N(0)},lt=o=>{const{metaKey:n,ctrlKey:i,shiftKey:r}=o;Dt(o)&&!r&&!i&&!n&&(o.preventDefault(),j())},dt=o=>{const{value:n}=o.target,{maxChars:i}=e;i!==0&&n.length>i||(z(n),N(st()))};l.useEffect(()=>I.some(o=>o.status.type==="uploading")?d(!1):d(c!==""||I.length>0),[I,c]),l.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";z(o)}},[e]),l.useEffect(()=>{if(f.current){const{offsetHeight:o}=f.current;m.current.minHeight=o,m.current.maxHeight=o*oe}},[f]),l.useEffect(()=>{const o=r=>{var C;r.preventDefault(),r.stopPropagation(),!F&&((C=r.dataTransfer)!=null&&C.types.includes("Files"))&&H(!0)},n=r=>{r.preventDefault(),r.stopPropagation(),F&&(r.clientX<=0&&r.clientY<=0||r.clientX>=window.innerWidth&&r.clientY>=window.innerHeight)&&H(!1)},i=r=>{r.preventDefault(),r.stopPropagation(),F&&H(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",n),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",n)}},[F]);const{disabled:T,placeholder:P,maxChars:ct}=e,{minHeight:pt,maxHeight:K}=m.current,O=U>0&&f.current?Math.abs(U-pt)>Y:!1,D=x!==S.None&&F,_="stChatInput";return w(X,{children:[x===S.None?null:a(Qt,{items:[...I],onDelete:$}),a(Bt,{className:D?`${_} dropzone`:_,"data-testid":"stChatInput",width:t,children:w(Rt,{children:[x===S.None?null:a(Zt,{getRootProps:rt,getInputProps:it,acceptFile:x,showDropzone:D,disabled:T,theme:p}),D?null:w(X,{children:[a(Lt,{inputRef:f,value:c,placeholder:P,onChange:dt,onKeyDown:lt,"aria-label":P,disabled:T,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:O?`${U+Y}px`:"auto",maxHeight:K?`${K}px`:"none",paddingLeft:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),t>p.breakpoints.hideWidgetDetails&&a(Mt,{children:a(Tt,{dirty:u,value:c,maxLength:ct,type:"chat",inForm:!1})}),a(kt,{children:a(Vt,{onClick:j,disabled:!u||T,extended:O,"data-testid":"stChatInputSubmitButton",children:a(E,{content:ot,size:"xl",color:"inherit"})})})]})]})})]})}export{pe as default};
@@ -0,0 +1 @@
1
+ import{r as o,E as K,_ as X,n as x,aR as lt,al as ut,cq as ct,M as J,cB as I,J as f,z,j as c,bs as dt,bF as pt,bt as ft,bc as bt,bu as gt,bp as M}from"./index.gthzAzzy.js";import{s as mt}from"./sprintf.C-r3gIuM.js";import{u as yt}from"./uniqueId.Ci60uueL.js";import{u as It}from"./FormClearHelper.LI0uGKXr.js";import{I as ht}from"./InputInstructions.BVSrSzyM.js";import{I as Tt}from"./input.ekQXAXS2.js";import"./base-input.BG3_mR5a.js";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(K,X({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(K,X({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const Ct=x("div",{target:"e5tuigk0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),wt=x("div",{target:"e5tuigk1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),q=x("button",{target:"e5tuigk2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),St=x("div",{target:"e5tuigk3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Vt=ut.getLogger("NumberInput");function vt(t){return f(t)||t===""?void 0:t}const kt=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,G=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),B=({value:t,format:e,step:r,dataType:h})=>{if(f(t))return null;let n=vt(e);if(f(n)&&J(r)){const l=r.toString();h===I.DataType.FLOAT&&r!==0&&l.includes(".")&&(n=`%0.${l.split(".")[1].length}f`)}if(f(n))return t.toString();try{return mt.sprintf(n,t)}catch(l){return Vt.warn(`Error in sprintf(${n}, ${t}): ${l}`),String(t)}},xt=(t,e,r)=>f(t)?!1:t-e>=r,Rt=(t,e,r)=>f(t)?!1:t+e<=r,Dt=({disabled:t,element:e,widgetMgr:r,width:h,theme:n,fragmentId:l})=>{var O;const{dataType:w,id:R,formId:p,default:W,format:A}=e,b=e.hasMin?e.min:-1/0,g=e.hasMax?e.max:1/0,[s,Z]=o.useState(G(e)),H=kt({element:e,widgetMgr:r}),[m,T]=o.useState(!1),[i,C]=o.useState(H),[P,S]=o.useState(B({value:H,...e,step:s})),[L,U]=o.useState(!1),D=o.useRef(null),$=o.useRef(yt("number_input_")),V=xt(i,s,b),v=Rt(i,s,g),_=ct({formId:p}),tt=_?r.allowFormEnterToSubmit(p):m,et=L&&h>n.breakpoints.hideWidgetDetails;o.useEffect(()=>{Z(G({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const u=o.useCallback(({value:a,source:d})=>{var y;if(J(a)&&(b>a||a>g))(y=D.current)==null||y.reportValidity();else{const k=a??W??null;switch(w){case I.DataType.INT:r.setIntValue({id:R,formId:p},k,d,l);break;case I.DataType.FLOAT:r.setDoubleValue({id:R,formId:p},k,d,l);break;default:throw new Error("Invalid data type")}T(!1),C(k),S(B({value:k,dataType:w,format:A,step:s}))}},[b,g,D,r,l,s,w,R,p,W,A]),ot=o.useCallback(()=>{m&&u({value:i,source:{fromUi:!0}}),U(!1)},[m,i,u]),rt=o.useCallback(()=>{U(!0)},[]),j=o.useCallback(()=>{const{value:a}=e;e.setValue=!1,C(a??null),S(B({value:a??null,...e,step:s})),u({value:a??null,source:{fromUi:!1}})},[e,s,u]);o.useEffect(()=>{e.setValue?j():u({value:i,source:{fromUi:!1}})},[]),e.setValue&&j();const F=f(e.default)&&!t,nt=o.useCallback(()=>{const a=e.default??null;C(a),u({value:a,source:{fromUi:!0}})},[e]);It({element:e,widgetMgr:r,onFormCleared:nt});const at=a=>{const{value:d}=a.target;if(d==="")T(!0),C(null),S(null);else{let y;e.dataType===I.DataType.INT?y=parseInt(d,10):y=parseFloat(d),T(!0),C(y),S(d)}},E=o.useCallback(()=>{v&&(T(!0),u({value:(i??b)+s,source:{fromUi:!0}}))},[i,b,s,v]),N=o.useCallback(()=>{V&&(T(!0),u({value:(i??g)-s,source:{fromUi:!0}}))},[i,g,s,V]),st=o.useCallback(a=>{const{key:d}=a;switch(d){case"ArrowUp":a.preventDefault(),E();break;case"ArrowDown":a.preventDefault(),N();break}},[E,N]),it=o.useCallback(a=>{a.key==="Enter"&&(m&&u({value:i,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,l))},[m,i,u,r,p,l]);return z("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:h},children:[c(gt,{label:e.label,disabled:t,labelVisibility:dt((O=e.labelVisibility)==null?void 0:O.value),htmlFor:$.current,children:e.help&&c(pt,{children:c(ft,{content:e.help,placement:bt.TOP_RIGHT})})}),z(Ct,{className:L?"focused":"","data-testid":"stNumberInputContainer",children:[c(Tt,{type:"number",inputRef:D,value:P??"",placeholder:e.placeholder,onBlur:ot,onFocus:rt,onChange:at,onKeyPress:it,onKeyDown:st,clearable:F,clearOnEscape:F,disabled:t,"aria-label":e.label,id:$.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:n.colors.darkGray,padding:n.spacing.threeXS,height:n.sizes.clearIconSize,width:n.sizes.clearIconSize,":hover":{fill:n.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:b,max:g,type:"number",inputMode:""},style:{lineHeight:n.lineHeights.inputWidget,paddingRight:n.spacing.sm,paddingLeft:n.spacing.sm,paddingBottom:n.spacing.sm,paddingTop:n.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),h>n.breakpoints.hideNumberInputControls&&z(wt,{children:[c(q,{"data-testid":"stNumberInputStepDown",onClick:N,disabled:!V||t,tabIndex:-1,children:c(M,{content:Q,size:"xs",color:V?"inherit":n.colors.disabled})}),c(q,{"data-testid":"stNumberInputStepUp",onClick:E,disabled:!v||t,tabIndex:-1,children:c(M,{content:Y,size:"xs",color:v?"inherit":n.colors.disabled})})]})]}),et&&c(St,{clearable:F,children:c(ht,{dirty:m,value:P??"",inForm:_,allowEnterToSubmit:tt})})]})},Ht=lt(Dt);export{Ht as default};
@@ -1 +1 @@
1
- import{r as s,J as S,j as d,bs as x,c5 as V}from"./index.DuqdUleB.js";import{a as v}from"./useBasicWidgetState.D572sX2t.js";import"./FormClearHelper.Bue0QSIn.js";const U=(t,e)=>t.getIntValue(e),h=t=>t.default??null,C=t=>t.value??null,F=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},I=({disabled:t,element:e,widgetMgr:o,width:a,fragmentId:u})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:m}=e,[g,l]=v({getStateFromWidgetMgr:U,getDefaultStateFromProto:h,getCurrStateFromProto:C,updateWidgetMgrState:F,element:e,widgetMgr:o,fragmentId:u}),f=s.useCallback(b=>{l({value:b,fromUi:!0})},[l]),p=S(e.default)&&!t;return d(V,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,width:a,onChange:f,value:g,help:c,placeholder:m,clearable:p})},E=s.memo(I);export{E as default};
1
+ import{r as s,J as S,j as d,bs as x,c5 as V}from"./index.gthzAzzy.js";import{a as v}from"./useBasicWidgetState.BJ0FCAzu.js";import"./FormClearHelper.LI0uGKXr.js";const U=(t,e)=>t.getIntValue(e),h=t=>t.default??null,C=t=>t.value??null,F=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},I=({disabled:t,element:e,widgetMgr:o,width:a,fragmentId:u})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:m}=e,[g,l]=v({getStateFromWidgetMgr:U,getDefaultStateFromProto:h,getCurrStateFromProto:C,updateWidgetMgrState:F,element:e,widgetMgr:o,fragmentId:u}),f=s.useCallback(b=>{l({value:b,fromUi:!0})},[l]),p=S(e.default)&&!t;return d(V,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,width:a,onChange:f,value:g,help:c,placeholder:m,clearable:p})},E=s.memo(I);export{E as default};
@@ -1 +1 @@
1
- import{r as s,y as U,cq as T,z as k,j as l,bs as A,bF as L,bt as P,bc as B,bu as D}from"./index.DuqdUleB.js";import{u as j}from"./uniqueId.CVe3uxKs.js";import{u as _,a as q,b as K}from"./useOnInputChange.D9rTVyjn.js";import{I as O}from"./InputInstructions.DpG38kbY.js";import{a as $}from"./useBasicWidgetState.D572sX2t.js";import{T as G}from"./textarea.CmSZv6UE.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.Bue0QSIn.js";import"./base-input.P8VGAZdC.js";const W=(a,t)=>a.getStringValue(t)??t.default??null,N=a=>a.default??null,w=a=>a.value??null,J=(a,t,o,u)=>{t.setStringValue(a,o.value,{fromUi:o.fromUi},u)},Q=({disabled:a,element:t,widgetMgr:o,fragmentId:u,width:h})=>{var x;const b=s.useRef(j("text_area_")).current,[r,n]=s.useState(!1),[S,g]=s.useState(!1),[i,d]=s.useState(W(o,t)??null),y=s.useCallback(()=>{d(t.default??null),n(!0)},[t]),[I,c]=$({getStateFromWidgetMgr:W,getDefaultStateFromProto:N,getCurrStateFromProto:w,updateWidgetMgrState:J,element:t,widgetMgr:o,fragmentId:u,onFormCleared:y});_(I,i,d,r);const e=U(),p=s.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),F=s.useCallback(()=>{r&&p(),g(!1)},[r,p]),V=s.useCallback(()=>{g(!0)},[]),C=q({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),v=K(t.formId,p,r,o,u,!0),z={width:h},{height:f,placeholder:E,formId:m}=t,H=T({formId:m})?o.allowFormEnterToSubmit(m):r,R=S&&h>e.breakpoints.hideWidgetDetails;return k("div",{className:"stTextArea","data-testid":"stTextArea",style:z,children:[l(D,{label:t.label,disabled:a,labelVisibility:A((x=t.labelVisibility)==null?void 0:x.value),htmlFor:b,children:t.help&&l(L,{children:l(P,{content:t.help,placement:B.TOP_RIGHT})})}),l(G,{value:i??"",placeholder:E,onBlur:F,onFocus:V,onChange:C,onKeyDown:v,"aria-label":t.label,disabled:a,id:b,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:f?`${f}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:e.spacing.lg,paddingLeft:e.spacing.lg,paddingBottom:e.spacing.lg,paddingTop:e.spacing.lg}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),R&&l(O,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:T({formId:m}),allowEnterToSubmit:H})]})},rt=s.memo(Q);export{rt as default};
1
+ import{r as s,y as U,cq as T,z as k,j as l,bs as A,bF as L,bt as P,bc as B,bu as D}from"./index.gthzAzzy.js";import{u as j}from"./uniqueId.Ci60uueL.js";import{u as _,a as q,b as K}from"./useOnInputChange.xhIvlf7z.js";import{I as O}from"./InputInstructions.BVSrSzyM.js";import{a as $}from"./useBasicWidgetState.BJ0FCAzu.js";import{T as G}from"./textarea.BYQOUi7u.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.LI0uGKXr.js";import"./base-input.BG3_mR5a.js";const W=(a,t)=>a.getStringValue(t)??t.default??null,N=a=>a.default??null,w=a=>a.value??null,J=(a,t,o,u)=>{t.setStringValue(a,o.value,{fromUi:o.fromUi},u)},Q=({disabled:a,element:t,widgetMgr:o,fragmentId:u,width:h})=>{var x;const b=s.useRef(j("text_area_")).current,[r,n]=s.useState(!1),[S,g]=s.useState(!1),[i,d]=s.useState(W(o,t)??null),y=s.useCallback(()=>{d(t.default??null),n(!0)},[t]),[I,c]=$({getStateFromWidgetMgr:W,getDefaultStateFromProto:N,getCurrStateFromProto:w,updateWidgetMgrState:J,element:t,widgetMgr:o,fragmentId:u,onFormCleared:y});_(I,i,d,r);const e=U(),p=s.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),F=s.useCallback(()=>{r&&p(),g(!1)},[r,p]),V=s.useCallback(()=>{g(!0)},[]),C=q({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),v=K(t.formId,p,r,o,u,!0),z={width:h},{height:f,placeholder:E,formId:m}=t,H=T({formId:m})?o.allowFormEnterToSubmit(m):r,R=S&&h>e.breakpoints.hideWidgetDetails;return k("div",{className:"stTextArea","data-testid":"stTextArea",style:z,children:[l(D,{label:t.label,disabled:a,labelVisibility:A((x=t.labelVisibility)==null?void 0:x.value),htmlFor:b,children:t.help&&l(L,{children:l(P,{content:t.help,placement:B.TOP_RIGHT})})}),l(G,{value:i??"",placeholder:E,onBlur:F,onFocus:V,onChange:C,onKeyDown:v,"aria-label":t.label,disabled:a,id:b,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:f?`${f}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:e.spacing.lg,paddingLeft:e.spacing.lg,paddingBottom:e.spacing.lg,paddingTop:e.spacing.lg}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),R&&l(O,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:T({formId:m}),allowEnterToSubmit:H})]})},rt=s.memo(Q);export{rt as default};