streamlit-nightly 1.46.2.dev20250709__py3-none-any.whl → 1.46.2.dev20250710__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 (75) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/manifest.json +218 -218
  3. streamlit/static/static/js/{ErrorOutline.esm.CQd6KUc-.js → ErrorOutline.esm.DcxmqjUD.js} +1 -1
  4. streamlit/static/static/js/{FileDownload.esm.DViLqD3l.js → FileDownload.esm.jHGWeFoc.js} +1 -1
  5. streamlit/static/static/js/{FileHelper.C4kAiX-d.js → FileHelper.Zrnryqu0.js} +1 -1
  6. streamlit/static/static/js/{FormClearHelper.3-U9496x.js → FormClearHelper.BYxFNamA.js} +1 -1
  7. streamlit/static/static/js/{Hooks.rP-qI29F.js → Hooks.Bf489OB5.js} +1 -1
  8. streamlit/static/static/js/{InputInstructions.BbLQarVh.js → InputInstructions.BOAAgTvb.js} +1 -1
  9. streamlit/static/static/js/{ProgressBar.XjFCBQue.js → ProgressBar.CHyAN4g4.js} +1 -1
  10. streamlit/static/static/js/{RenderInPortalIfExists.BjvT0tcH.js → RenderInPortalIfExists.BnEeVRFq.js} +1 -1
  11. streamlit/static/static/js/{Toolbar.CI7e539m.js → Toolbar.CXl8zpFb.js} +1 -1
  12. streamlit/static/static/js/{base-input.BwJuQKxC.js → base-input.Df0b6Qry.js} +1 -1
  13. streamlit/static/static/js/{checkbox.YcCb7In-.js → checkbox._czeraZi.js} +1 -1
  14. streamlit/static/static/js/{createSuper.fMnDQXwy.js → createSuper.ZqMAxMzx.js} +1 -1
  15. streamlit/static/static/js/{data-grid-overlay-editor.DispNmCy.js → data-grid-overlay-editor.Bok03B1i.js} +1 -1
  16. streamlit/static/static/js/{downloader._vfB-j-e.js → downloader.C4jTgaKc.js} +1 -1
  17. streamlit/static/static/js/{es6.DIYMfE-r.js → es6.Do-e8HO9.js} +2 -2
  18. streamlit/static/static/js/{iframeResizer.contentWindow.CXpyzNXN.js → iframeResizer.contentWindow.mWYZgJrl.js} +1 -1
  19. streamlit/static/static/js/{index.Dga_qPJ0.js → index.-qN84VXE.js} +1 -1
  20. streamlit/static/static/js/{index.Jr-tvRTy.js → index.35y_AzR4.js} +1 -1
  21. streamlit/static/static/js/{index.Dgd7wAuk.js → index.B1l9OvXj.js} +1 -1
  22. streamlit/static/static/js/index.BF_sb0WL.js +73 -0
  23. streamlit/static/static/js/{index.D958aGV_.js → index.BIEGVO6Q.js} +5 -5
  24. streamlit/static/static/js/{index.DG9Ir4m4.js → index.BPbIttLy.js} +1 -1
  25. streamlit/static/static/js/{index.5oEU0Akm.js → index.BVdmv4f9.js} +1 -1
  26. streamlit/static/static/js/{index.DfriPCJP.js → index.BnBtCCi7.js} +1 -1
  27. streamlit/static/static/js/{index.BYrFjIUs.js → index.Bys870gz.js} +1 -1
  28. streamlit/static/static/js/{index.c5gLd5mL.js → index.BzF3lrfB.js} +1 -1
  29. streamlit/static/static/js/{index.LbtilNNP.js → index.C3rroFP9.js} +1 -1
  30. streamlit/static/static/js/{index.4cT3qV4n.js → index.CF7mP-ZJ.js} +1 -1
  31. streamlit/static/static/js/{index.BgUl4InR.js → index.Ca2H30nP.js} +1 -1
  32. streamlit/static/static/js/{index.B1xRrJhO.js → index.Ci7nbB2g.js} +1 -1
  33. streamlit/static/static/js/{index.E56AjTPB.js → index.CjIM7ERG.js} +1 -1
  34. streamlit/static/static/js/{index.DQXpaPor.js → index.CoYJofEx.js} +1 -1
  35. streamlit/static/static/js/{index.CQayRGxD.js → index.CqLB334S.js} +1 -1
  36. streamlit/static/static/js/{index.D2-Y5_wx.js → index.DFXciakO.js} +1 -1
  37. streamlit/static/static/js/{index.D8bLiwaV.js → index.DGHrEEt1.js} +1 -1
  38. streamlit/static/static/js/{index.Cx24fujh.js → index.DHdGt5Y8.js} +1 -1
  39. streamlit/static/static/js/{index.atasR7_f.js → index.DLiM-whD.js} +1 -1
  40. streamlit/static/static/js/{index.ColMLoRT.js → index.DTxuG-7x.js} +1 -1
  41. streamlit/static/static/js/{index.BIU1Hwtm.js → index.D_0R5OBc.js} +3 -3
  42. streamlit/static/static/js/{index.Dy7h795S.js → index.DcO57awd.js} +1 -1
  43. streamlit/static/static/js/{index.BNjHNjlf.js → index.DmGoE186.js} +1 -1
  44. streamlit/static/static/js/{index.BqJEh5EN.js → index.DmjIEMLZ.js} +1 -1
  45. streamlit/static/static/js/{index.BQVB466_.js → index.DsGIFS7a.js} +1 -1
  46. streamlit/static/static/js/{index.Cfv4QyQX.js → index.GgXBejJs.js} +1 -1
  47. streamlit/static/static/js/{index.BdEa6sZz.js → index.MiKM7bk8.js} +1 -1
  48. streamlit/static/static/js/{index.D1VFO1GM.js → index.QaE_KRXJ.js} +1 -1
  49. streamlit/static/static/js/{index.Chkl1asR.js → index.dGEV5Rcv.js} +1 -1
  50. streamlit/static/static/js/{index.D9GxqhKH.js → index.eyf91ITY.js} +1 -1
  51. streamlit/static/static/js/{index.BJLFstQK.js → index.fAtLaEj3.js} +1 -1
  52. streamlit/static/static/js/{index.D4qwHqKM.js → index.kBQMwU6d.js} +1 -1
  53. streamlit/static/static/js/{index.Bo8tNSYW.js → index.mvbBbK3q.js} +1 -1
  54. streamlit/static/static/js/{index.Bqhfg7Oa.js → index.rOGHN7Ug.js} +1 -1
  55. streamlit/static/static/js/{index.BIsGWvbq.js → index.rvtw60Rz.js} +1 -1
  56. streamlit/static/static/js/{input.Dudaq2DP.js → input.CbSNLKWI.js} +1 -1
  57. streamlit/static/static/js/{memory.DIuUp1Sn.js → memory.jXCvhbgc.js} +1 -1
  58. streamlit/static/static/js/{mergeWith.D9D0WgL_.js → mergeWith.DrPpfkW2.js} +1 -1
  59. streamlit/static/static/js/{number-overlay-editor.DUBtvgiU.js → number-overlay-editor.DcUxabQJ.js} +1 -1
  60. streamlit/static/static/js/{possibleConstructorReturn.ql9j_wzC.js → possibleConstructorReturn.CzPR4xGM.js} +1 -1
  61. streamlit/static/static/js/{sandbox.D_vlGgEg.js → sandbox.Bd0m3BOh.js} +1 -1
  62. streamlit/static/static/js/{timepicker.DtFPFwb0.js → timepicker.CpLBXuBk.js} +1 -1
  63. streamlit/static/static/js/{toConsumableArray.DMsseOni.js → toConsumableArray.D_piEkI9.js} +1 -1
  64. streamlit/static/static/js/{uniqueId.BkUMU8CT.js → uniqueId.wDqRFq8o.js} +1 -1
  65. streamlit/static/static/js/{useBasicWidgetState.Cp78gjjh.js → useBasicWidgetState.rpbnEZqG.js} +1 -1
  66. streamlit/static/static/js/{useOnInputChange.CHkjh73V.js → useOnInputChange.DLCh37tX.js} +1 -1
  67. streamlit/static/static/js/{useTextInputAutoExpand.CE_GiZ0L.js → useTextInputAutoExpand.Ba7vlWvW.js} +1 -1
  68. streamlit/static/static/js/{withFullScreenWrapper.CplO1PK6.js → withFullScreenWrapper.Cqo3BmOl.js} +1 -1
  69. {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/METADATA +1 -1
  70. {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/RECORD +74 -74
  71. streamlit/static/static/js/index.CUirymUQ.js +0 -73
  72. {streamlit_nightly-1.46.2.dev20250709.data → streamlit_nightly-1.46.2.dev20250710.data}/scripts/streamlit.cmd +0 -0
  73. {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/WHEEL +0 -0
  74. {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/entry_points.txt +0 -0
  75. {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{r,b as $}from"./index.BIU1Hwtm.js";import{s as z,i as D,a as J,b as Q,T as U,C as Z,m as ee}from"./index.D958aGV_.js";import"./FormClearHelper.3-U9496x.js";import"./withFullScreenWrapper.CplO1PK6.js";import"./Toolbar.CI7e539m.js";import"./checkbox.YcCb7In-.js";import"./mergeWith.D9D0WgL_.js";import"./sprintf.D7DtBTRn.js";import"./createDownloadLinkElement.DZMwyjvU.js";import"./toConsumableArray.DMsseOni.js";import"./possibleConstructorReturn.ql9j_wzC.js";import"./createSuper.fMnDQXwy.js";import"./FileDownload.esm.DViLqD3l.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 le(){const[t,s]=r.useState();return[t??void 0,s]}function de(){const[t,s]=le(),[n,h]=r.useState(0),[f,C]=r.useState(!0);r.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const a=new IntersectionObserver(o=>{o.length!==0&&C(o[0].isIntersecting)},{threshold:1});return a.observe(t),()=>a.disconnect()},[t]),r.useEffect(()=>{if(f||t===void 0)return;let a;const o=()=>{const{right:x}=t.getBoundingClientRect();h(m=>Math.min(m+window.innerWidth-x-10,0)),a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!==void 0&&cancelAnimationFrame(a)}},[t,f]);const v=r.useMemo(()=>({transform:`translateX(${n}px)`}),[n]);return{ref:s,style:v}}const Oe=t=>{const{target:s,content:n,onFinishEditing:h,forceEditMode:f,initialValue:C,imageEditorOverride:v,markdownDivCreateNode:a,highlight:o,className:x,theme:m,id:G,cell:g,bloom:I,validateCell:p,getCellRenderer:w,provideEditor:F,isOutsideClick:H,customEventTarget:W}=t,[l,X]=r.useState(f?n:void 0),O=r.useRef(l??n);O.current=l??n;const[y,S]=r.useState(()=>p===void 0?!0:!(D(n)&&p?.(g,n,O.current)===!1)),u=r.useCallback((e,i)=>{h(y?e:void 0,i)},[y,h]),A=r.useCallback(e=>{if(p!==void 0&&e!==void 0&&D(e)){const i=p(g,e,O.current);i===!1?S(!1):(typeof i=="object"&&(e=i),S(!0))}X(e)},[g,p]),E=r.useRef(!1),c=r.useRef(void 0),K=r.useCallback(()=>{u(l,[0,0]),E.current=!0},[l,u]),Y=r.useCallback((e,i)=>{u(e,i??c.current??[0,0]),E.current=!0},[u]),j=r.useCallback(async e=>{let i=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),c.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),c.current=[0,1],i=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),c.current=[e.shiftKey?-1:1,0],i=!0),window.setTimeout(()=>{!E.current&&c.current!==void 0&&(u(i?l:void 0,c.current),E.current=!0)},0)},[u,l]),k=l??n,[d,L]=r.useMemo(()=>{if(J(n))return[];const e={...n,location:g},i=F?.(e);return i!==void 0?[i,!1]:[w(n)?.provideEditor?.(e),!1]},[g,n,w,F]),{ref:q,style:B}=de();let P=!0,T,M=!0,b;if(d!==void 0){P=d.disablePadding!==!0,M=d.disableStyling!==!0;const e=Q(d);e&&(b=d.styleOverride);const i=e?d.editor:d;T=r.createElement(i,{isHighlighted:o,onChange:A,value:k,initialValue:C,onFinishedEditing:Y,validatedSelection:D(k)?k.selectionRange:void 0,forceEditMode:f,target:s,imageEditorOverride:v,markdownDivCreateNode:a,isValid:y,theme:m})}b={...b,...B};const _=document.getElementById("portal");if(_===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 R=M?"gdg-style":"gdg-unstyle";y||(R+=" gdg-invalid"),P&&(R+=" gdg-pad");const N=I?.[0]??1,V=I?.[1]??1;return $.createPortal(r.createElement(U.Provider,{value:m},r.createElement(Z,{style:ee(m),className:x,onClickOutside:K,isOutsideClick:H,customEventTarget:W},r.createElement(oe,{ref:q,id:G,className:R,style:b,as:L===!0?"label":void 0,targetX:s.x-N,targetY:s.y-V,targetWidth:s.width+N*2,targetHeight:s.height+V*2},r.createElement("div",{className:"gdg-clip-region",onKeyDown:j},T)))),_)};export{Oe as default};
1
+ import{r,b as $}from"./index.D_0R5OBc.js";import{s as z,i as D,a as J,b as Q,T as U,C as Z,m as ee}from"./index.BIEGVO6Q.js";import"./FormClearHelper.BYxFNamA.js";import"./withFullScreenWrapper.Cqo3BmOl.js";import"./Toolbar.CXl8zpFb.js";import"./checkbox._czeraZi.js";import"./mergeWith.DrPpfkW2.js";import"./sprintf.D7DtBTRn.js";import"./createDownloadLinkElement.DZMwyjvU.js";import"./toConsumableArray.D_piEkI9.js";import"./possibleConstructorReturn.CzPR4xGM.js";import"./createSuper.ZqMAxMzx.js";import"./FileDownload.esm.jHGWeFoc.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 le(){const[t,s]=r.useState();return[t??void 0,s]}function de(){const[t,s]=le(),[n,h]=r.useState(0),[f,C]=r.useState(!0);r.useLayoutEffect(()=>{if(t===void 0||!("IntersectionObserver"in window))return;const a=new IntersectionObserver(o=>{o.length!==0&&C(o[0].isIntersecting)},{threshold:1});return a.observe(t),()=>a.disconnect()},[t]),r.useEffect(()=>{if(f||t===void 0)return;let a;const o=()=>{const{right:x}=t.getBoundingClientRect();h(m=>Math.min(m+window.innerWidth-x-10,0)),a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!==void 0&&cancelAnimationFrame(a)}},[t,f]);const v=r.useMemo(()=>({transform:`translateX(${n}px)`}),[n]);return{ref:s,style:v}}const Oe=t=>{const{target:s,content:n,onFinishEditing:h,forceEditMode:f,initialValue:C,imageEditorOverride:v,markdownDivCreateNode:a,highlight:o,className:x,theme:m,id:G,cell:g,bloom:I,validateCell:p,getCellRenderer:w,provideEditor:F,isOutsideClick:H,customEventTarget:W}=t,[l,X]=r.useState(f?n:void 0),O=r.useRef(l??n);O.current=l??n;const[y,S]=r.useState(()=>p===void 0?!0:!(D(n)&&p?.(g,n,O.current)===!1)),u=r.useCallback((e,i)=>{h(y?e:void 0,i)},[y,h]),A=r.useCallback(e=>{if(p!==void 0&&e!==void 0&&D(e)){const i=p(g,e,O.current);i===!1?S(!1):(typeof i=="object"&&(e=i),S(!0))}X(e)},[g,p]),E=r.useRef(!1),c=r.useRef(void 0),K=r.useCallback(()=>{u(l,[0,0]),E.current=!0},[l,u]),Y=r.useCallback((e,i)=>{u(e,i??c.current??[0,0]),E.current=!0},[u]),j=r.useCallback(async e=>{let i=!1;e.key==="Escape"?(e.stopPropagation(),e.preventDefault(),c.current=[0,0]):e.key==="Enter"&&!e.shiftKey?(e.stopPropagation(),e.preventDefault(),c.current=[0,1],i=!0):e.key==="Tab"&&(e.stopPropagation(),e.preventDefault(),c.current=[e.shiftKey?-1:1,0],i=!0),window.setTimeout(()=>{!E.current&&c.current!==void 0&&(u(i?l:void 0,c.current),E.current=!0)},0)},[u,l]),k=l??n,[d,L]=r.useMemo(()=>{if(J(n))return[];const e={...n,location:g},i=F?.(e);return i!==void 0?[i,!1]:[w(n)?.provideEditor?.(e),!1]},[g,n,w,F]),{ref:q,style:B}=de();let P=!0,T,M=!0,b;if(d!==void 0){P=d.disablePadding!==!0,M=d.disableStyling!==!0;const e=Q(d);e&&(b=d.styleOverride);const i=e?d.editor:d;T=r.createElement(i,{isHighlighted:o,onChange:A,value:k,initialValue:C,onFinishedEditing:Y,validatedSelection:D(k)?k.selectionRange:void 0,forceEditMode:f,target:s,imageEditorOverride:v,markdownDivCreateNode:a,isValid:y,theme:m})}b={...b,...B};const _=document.getElementById("portal");if(_===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 R=M?"gdg-style":"gdg-unstyle";y||(R+=" gdg-invalid"),P&&(R+=" gdg-pad");const N=I?.[0]??1,V=I?.[1]??1;return $.createPortal(r.createElement(U.Provider,{value:m},r.createElement(Z,{style:ee(m),className:x,onClickOutside:K,isOutsideClick:H,customEventTarget:W},r.createElement(oe,{ref:q,id:G,className:R,style:b,as:L===!0?"label":void 0,targetX:s.x-N,targetY:s.y-V,targetWidth:s.width+N*2,targetHeight:s.height+V*2},r.createElement("div",{className:"gdg-clip-region",onKeyDown:j},T)))),_)};export{Oe as default};
@@ -1 +1 @@
1
- import{c as w,e as b}from"./es6.DIYMfE-r.js";import"./index.BIU1Hwtm.js";const{WritableStream:m,TransformStream:y,DOMException:P,Blob:_}=w,{GONE:v}=b,E=/constructor/i.test(window.HTMLElement);class C{constructor(e="unkown"){this.name=e,this.kind="file"}async getFile(){throw new P(...v)}async isSameEntry(e){return this===e}async createWritable(e={}){const t=await navigator.serviceWorker?.getRegistration(),o=document.createElement("a"),n=new y,u=n.writable;if(o.download=this.name,E||!t){let r=[];n.readable.pipeTo(new m({write(s){r.push(new _([s]))},close(){const s=new _(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 S(m),a=encodeURIComponent(this.name).replace(/['()]/g,escape).replace(/\*/g,"%2A"),R={"content-disposition":"attachment; filename*=UTF-8''"+a,"content-type":"application/octet-stream; charset=utf-8",...e.size?{"content-length":e.size}:{}},f=setTimeout(()=>t.active.postMessage(0),1e4);n.readable.pipeThrough(new y({transform(c,d){if(c instanceof Uint8Array)return d.enqueue(c);const g=new Response(c).body.getReader(),h=j=>g.read().then(p=>p.done?0:h(d.enqueue(p.value)));return h()}})).pipeTo(r).finally(()=>{clearInterval(f)}),t.active.postMessage({url:t.scope+a,headers:R,readablePort:s},[s]);const i=document.createElement("iframe");i.hidden=!0,i.src=t.scope+a,document.body.appendChild(i)}return u.getWriter()}}const M=0,T=0,L=1,O=1,U=2;class k{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:M,chunk:e};return this._port.postMessage(t,[e.buffer]),this._resetReady(),this._readyPromise}close(){this._port.postMessage({type:U}),this._port.close()}abort(e){this._port.postMessage({type:O,reason:e}),this._port.close()}_onMessage(e){e.type===T&&this._resolveReady(),e.type===L&&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 S{constructor(e){const t=new MessageChannel;this.readablePort=t.port1,this.writable=new e(new k(t.port2))}}export{C as FileHandle};
1
+ import{c as w,e as b}from"./es6.Do-e8HO9.js";import"./index.D_0R5OBc.js";const{WritableStream:m,TransformStream:y,DOMException:P,Blob:_}=w,{GONE:v}=b,E=/constructor/i.test(window.HTMLElement);class C{constructor(e="unkown"){this.name=e,this.kind="file"}async getFile(){throw new P(...v)}async isSameEntry(e){return this===e}async createWritable(e={}){const t=await navigator.serviceWorker?.getRegistration(),o=document.createElement("a"),n=new y,u=n.writable;if(o.download=this.name,E||!t){let r=[];n.readable.pipeTo(new m({write(s){r.push(new _([s]))},close(){const s=new _(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 S(m),a=encodeURIComponent(this.name).replace(/['()]/g,escape).replace(/\*/g,"%2A"),R={"content-disposition":"attachment; filename*=UTF-8''"+a,"content-type":"application/octet-stream; charset=utf-8",...e.size?{"content-length":e.size}:{}},f=setTimeout(()=>t.active.postMessage(0),1e4);n.readable.pipeThrough(new y({transform(c,d){if(c instanceof Uint8Array)return d.enqueue(c);const g=new Response(c).body.getReader(),h=j=>g.read().then(p=>p.done?0:h(d.enqueue(p.value)));return h()}})).pipeTo(r).finally(()=>{clearInterval(f)}),t.active.postMessage({url:t.scope+a,headers:R,readablePort:s},[s]);const i=document.createElement("iframe");i.hidden=!0,i.src=t.scope+a,document.body.appendChild(i)}return u.getWriter()}}const M=0,T=0,L=1,O=1,U=2;class k{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:M,chunk:e};return this._port.postMessage(t,[e.buffer]),this._resetReady(),this._readyPromise}close(){this._port.postMessage({type:U}),this._port.close()}abort(e){this._port.postMessage({type:O,reason:e}),this._port.close()}_onMessage(e){e.type===T&&this._resolveReady(),e.type===L&&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 S{constructor(e){const t=new MessageChannel;this.readablePort=t.port1,this.writable=new e(new k(t.port2))}}export{C as FileHandle};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./downloader._vfB-j-e.js","./index.BIU1Hwtm.js","../css/index.CJVRHjQZ.css","./sandbox.D_vlGgEg.js","./memory.DIuUp1Sn.js"])))=>i.map(i=>d[i]);
2
- import{y as d}from"./index.BIU1Hwtm.js";const I=globalThis.showDirectoryPicker;async function j(i={}){if(I&&!i._preferPolyfill)return I(i);const e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0,e.style.position="fixed",e.style.top="-100000px",e.style.left="-100000px",document.body.appendChild(e);const t=d(()=>Promise.resolve().then(()=>R),void 0,import.meta.url);return await new Promise(a=>{e.addEventListener("change",a),e.click()}),t.then(a=>a.getDirHandlesFromInput(e))}const M={accepts:[]},x=globalThis.showOpenFilePicker;async function N(i={}){const e={...M,...i};if(x&&!i._preferPolyfill)return x(e);const t=document.createElement("input");t.type="file",t.multiple=e.multiple,t.accept=(e.accepts||[]).map(o=>[...(o.extensions||[]).map(n=>"."+n),...o.mimeTypes||[]]).flat().join(","),Object.assign(t.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(t);const a=d(()=>Promise.resolve().then(()=>R),void 0,import.meta.url);return await new Promise(o=>{t.addEventListener("change",o,{once:!0}),t.click()}),t.remove(),a.then(o=>o.getFileHandlesFromInput(t))}const L=globalThis.showSaveFilePicker;async function V(i={}){if(L&&!i._preferPolyfill)return L(i);i._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),i.suggestedName=i._name);const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:a}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:a}},void 0,import.meta.url),{FileHandle:t}=await d(async()=>{const{FileHandle:a}=await import("./downloader._vfB-j-e.js");return{FileHandle:a}},__vite__mapDeps([0,1,2]),import.meta.url);return new e(new t(i.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const i=this.webkitGetAsEntry(),[{FileHandle:e,FolderHandle:t},{FileSystemDirectoryHandle:a},{FileSystemFileHandle:o}]=await Promise.all([d(()=>import("./sandbox.D_vlGgEg.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>H),void 0,import.meta.url),d(()=>Promise.resolve().then(()=>g),void 0,import.meta.url)]);return i.isFile?new o(new e(i,!1)):new a(new t(i,!1))});async function W(i,e={}){if(!i)return globalThis.navigator?.storage?.getDirectory()||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:t}=await d(async()=>{const{FileSystemDirectoryHandle:n}=await Promise.resolve().then(()=>H);return{FileSystemDirectoryHandle:n}},void 0,import.meta.url),a=await i,o=await(a.default?a.default(e):a(e));return new t(o)}const q={WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:$}=q;class p extends ${#e;constructor(e){super(e),this.#e=e,Object.setPrototypeOf(this,p.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),t=e.close();return e.releaseLock(),t}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 t=this.getWriter(),a=t.write(e);return t.releaseLock(),a}}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");class T{[m];name;kind;constructor(e){this.kind=e.kind,this.name=e.name,this[m]=e}async queryPermission(e={}){const{mode:t="read"}=e,a=this[m];if(a.queryPermission)return a.queryPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return a.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async requestPermission({mode:e="read"}={}){const t=this[m];if(t.requestPermission)return t.requestPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return t.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async remove(e={}){await this[m].remove(e)}async isSameEntry(e){return this===e?!0:!e||typeof e!="object"||this.kind!==e.kind||!e[m]?!1:this[m].isSameEntry(e[m])}}Object.defineProperty(T.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});globalThis.FileSystemHandle&&(globalThis.FileSystemHandle.prototype.queryPermission??=function(i){return"granted"});const A={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:i=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${i}`,"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"]},z={writable:globalThis.WritableStream};async function U(i){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[e,t,a]=await Promise.all([d(()=>import("./memory.DIuUp1Sn.js"),__vite__mapDeps([4,1,2]),import.meta.url),d(()=>import("./sandbox.D_vlGgEg.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>H),void 0,import.meta.url)]),o=new e.FolderHandle("",!1);return o._entries=i.map(n=>n.isFile?new t.FileHandle(n,!1):new t.FolderHandle(n,!1)),new a.FileSystemDirectoryHandle(o)}async function k(i){const{FolderHandle:e,FileHandle:t}=await d(async()=>{const{FolderHandle:y,FileHandle:s}=await import("./memory.DIuUp1Sn.js");return{FolderHandle:y,FileHandle:s}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemDirectoryHandle:a}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>H);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),o=Array.from(i.files),n=o[0].webkitRelativePath.split("/",1)[0],l=new e(n,!1);return o.forEach(y=>{const s=y.webkitRelativePath.split("/");s.shift();const c=s.pop(),f=s.reduce((w,b)=>(w._entries[b]||(w._entries[b]=new e(b,!1)),w._entries[b]),l);f._entries[c]=new t(y.name,y,!1)}),new a(l)}async function C(i){const{FileHandle:e}=await d(async()=>{const{FileHandle:a}=await import("./memory.DIuUp1Sn.js");return{FileHandle:a}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemFileHandle:t}=await d(async()=>{const{FileSystemFileHandle:a}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:a}},void 0,import.meta.url);return Array.from(i.files).map(a=>new t(new e(a.name,a,!1)))}const R=Object.freeze(Object.defineProperty({__proto__:null,config:z,errors:A,fromDataTransfer:U,getDirHandlesFromInput:k,getFileHandlesFromInput:C},Symbol.toStringTag,{value:"Module"})),{GONE:B,MOD_ERR:G}=A,u=Symbol("adapter");let h=class v extends T{[u];constructor(e){super(e),this[u]=e}async getDirectoryHandle(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const a=await this[u].getDirectoryHandle(e,t);return new v(a)}async*entries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:t}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:t}},void 0,import.meta.url);for await(const[t,a]of this[u].entries())yield[a.name,a.kind==="file"?new e(a):new v(a)]}async*getEntries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:t}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:t}},void 0,import.meta.url);console.warn("deprecated, use .entries() instead");for await(let t of this[u].entries())yield t.kind==="file"?new e(t):new v(t)}async getFileHandle(e,t={}){const{FileSystemFileHandle:a}=await d(async()=>{const{FileSystemFileHandle:n}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:n}},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.");t.create=!!t.create;const o=await this[u].getFileHandle(e,t);return new a(o)}async removeEntry(e,t={}){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 t.recursive=!!t.recursive,this[u].removeEntry(e,t)}async resolve(e){if(await e.isSameEntry(this))return[];const t=[{handle:this,path:[]}];for(;t.length;){let{handle:a,path:o}=t.pop();for await(const n of a.values()){if(await n.isSameEntry(e))return[...o,n.name];n.kind==="directory"&&t.push({handle:n,path:[...o,n.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,t]of this)yield t}[Symbol.asyncIterator](){return this.entries()}};Object.defineProperty(h.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(h.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const i=globalThis.FileSystemDirectoryHandle.prototype;i.resolve=async function(n){if(await n.isSameEntry(this))return[];const l=[{handle:this,path:[]}];for(;l.length;){let{handle:y,path:s}=l.pop();for await(const c of y.values()){if(await c.isSameEntry(n))return[...s,c.name];c.kind==="directory"&&l.push({handle:c,path:[...s,c.name]})}}return null};async function e(o){if(await(await navigator.storage.getDirectory()).resolve(o)===null)throw new DOMException(...B)}const t=i.entries;i.entries=async function*(){await e(this),yield*t.call(this)},i[Symbol.asyncIterator]=async function*(){yield*this.entries()};const a=i.removeEntry;i.removeEntry=async function(o,n={}){return a.call(this,o,n).catch(async l=>{throw l instanceof DOMException&&l.name==="UnknownError"&&!n.recursive&&!(await t.call(this).next()).done?new DOMException(...G):l})}}const H=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:h,default:h},Symbol.toStringTag,{value:"Module"})),{INVALID:Y,SYNTAX:O,GONE:X}=A,E=Symbol("adapter");class F extends T{[E];constructor(e){super(e),this[E]=e}async createWritable(e={}){return new p(await this[E].createWritable(e))}async getFile(){return this[E].getFile()}}Object.defineProperty(F.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(F.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const i=new WeakMap;let e;const t=()=>{let o,n;onmessage=async l=>{const y=l.ports[0],s=l.data;switch(s.type){case"open":const c=s.name;let f=await navigator.storage.getDirectory();for(const w of s.path)f=await f.getDirectoryHandle(w);o=await f.getFileHandle(c),n=await o.createSyncAccessHandle();break;case"write":n.write(s.data,{at:s.position}),n.flush();break;case"truncate":n.truncate(s.size);break;case"abort":case"close":n.close();break}y.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(o){if(!e){const r=`(${t.toString()})()`,S=new Blob([r],{type:"text/javascript"});e=URL.createObjectURL(S)}const n=new Worker(e,{type:"module"});let l=0;const y=new TextEncoder;let s=await this.getFile().then(r=>r.size);const c=r=>new Promise((S,P)=>{const _=new MessageChannel;_.port1.onmessage=D=>{D.data instanceof Error?P(D.data):S(D.data),_.port1.close(),_.port2.close(),_.port1.onmessage=null},n.postMessage(r,[_.port2])}),f=await navigator.storage.getDirectory(),w=await i.get(this),b=await f.resolve(w);if(b===null)throw new DOMException(...X);return await c({type:"open",path:b,name:this.name}),o?.keepExistingData===!1&&(await c({type:"truncate",size:0}),s=0),new p({start:r=>{},async write(r){if(r?.constructor===Object?r={...r}:r={type:"write",data:r,position:l},r.type==="write"){if(!("data"in r))throw await c({type:"close"}),new DOMException(...O("write requires a data argument"));if(r.position??=l,typeof r.data=="string")r.data=y.encode(r.data);else if(r.data instanceof ArrayBuffer)r.data=new Uint8Array(r.data);else if(!(r.data instanceof Uint8Array)&&ArrayBuffer.isView(r.data))r.data=new Uint8Array(r.data.buffer,r.data.byteOffset,r.data.byteLength);else if(!(r.data instanceof Uint8Array)){const P=await new Response(r.data).arrayBuffer();r.data=new Uint8Array(P)}Number.isInteger(r.position)&&r.position>=0&&(l=r.position),l+=r.data.byteLength,s+=r.data.byteLength}else if(r.type==="seek")if(Number.isInteger(r.position)&&r.position>=0){if(s<r.position)throw new DOMException(...Y);console.log("seeking",r),l=r.position;return}else throw await c({type:"close"}),new DOMException(...O("seek requires a position argument"));else if(r.type==="truncate")if(Number.isInteger(r.size)&&r.size>=0)s=r.size,l>s&&(l=s);else throw await c({type:"close"}),new DOMException(...O("truncate requires a size argument"));await c(r)},async close(){await c({type:"close"}),n.terminate()},async abort(r){await c({type:"abort",reason:r}),n.terminate()}})};const a=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...o){const n=await a.call(this,...o);return i.set(n,this),n}}const g=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:F,default:F},Symbol.toStringTag,{value:"Module"})),Q=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:h,FileSystemFileHandle:F,FileSystemHandle:T,FileSystemWritableFileStream:p,getOriginPrivateDirectory:W,showDirectoryPicker:j,showOpenFilePicker:N,showSaveFilePicker:V},Symbol.toStringTag,{value:"Module"}));export{Q as a,q as c,A as e};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./downloader.C4jTgaKc.js","./index.D_0R5OBc.js","../css/index.CJVRHjQZ.css","./sandbox.Bd0m3BOh.js","./memory.jXCvhbgc.js"])))=>i.map(i=>d[i]);
2
+ import{y as d}from"./index.D_0R5OBc.js";const I=globalThis.showDirectoryPicker;async function j(i={}){if(I&&!i._preferPolyfill)return I(i);const e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0,e.style.position="fixed",e.style.top="-100000px",e.style.left="-100000px",document.body.appendChild(e);const t=d(()=>Promise.resolve().then(()=>R),void 0,import.meta.url);return await new Promise(a=>{e.addEventListener("change",a),e.click()}),t.then(a=>a.getDirHandlesFromInput(e))}const M={accepts:[]},x=globalThis.showOpenFilePicker;async function N(i={}){const e={...M,...i};if(x&&!i._preferPolyfill)return x(e);const t=document.createElement("input");t.type="file",t.multiple=e.multiple,t.accept=(e.accepts||[]).map(o=>[...(o.extensions||[]).map(n=>"."+n),...o.mimeTypes||[]]).flat().join(","),Object.assign(t.style,{position:"fixed",top:"-100000px",left:"-100000px"}),document.body.appendChild(t);const a=d(()=>Promise.resolve().then(()=>R),void 0,import.meta.url);return await new Promise(o=>{t.addEventListener("change",o,{once:!0}),t.click()}),t.remove(),a.then(o=>o.getFileHandlesFromInput(t))}const L=globalThis.showSaveFilePicker;async function V(i={}){if(L&&!i._preferPolyfill)return L(i);i._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),i.suggestedName=i._name);const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:a}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:a}},void 0,import.meta.url),{FileHandle:t}=await d(async()=>{const{FileHandle:a}=await import("./downloader.C4jTgaKc.js");return{FileHandle:a}},__vite__mapDeps([0,1,2]),import.meta.url);return new e(new t(i.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){const i=this.webkitGetAsEntry(),[{FileHandle:e,FolderHandle:t},{FileSystemDirectoryHandle:a},{FileSystemFileHandle:o}]=await Promise.all([d(()=>import("./sandbox.Bd0m3BOh.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>H),void 0,import.meta.url),d(()=>Promise.resolve().then(()=>g),void 0,import.meta.url)]);return i.isFile?new o(new e(i,!1)):new a(new t(i,!1))});async function W(i,e={}){if(!i)return globalThis.navigator?.storage?.getDirectory()||globalThis.getOriginPrivateDirectory();const{FileSystemDirectoryHandle:t}=await d(async()=>{const{FileSystemDirectoryHandle:n}=await Promise.resolve().then(()=>H);return{FileSystemDirectoryHandle:n}},void 0,import.meta.url),a=await i,o=await(a.default?a.default(e):a(e));return new t(o)}const q={WritableStream:globalThis.WritableStream,TransformStream:globalThis.TransformStream,DOMException:globalThis.DOMException,Blob:globalThis.Blob,File:globalThis.File},{WritableStream:$}=q;class p extends ${#e;constructor(e){super(e),this.#e=e,Object.setPrototypeOf(this,p.prototype),this._closed=!1}async close(){this._closed=!0;const e=this.getWriter(),t=e.close();return e.releaseLock(),t}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 t=this.getWriter(),a=t.write(e);return t.releaseLock(),a}}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");class T{[m];name;kind;constructor(e){this.kind=e.kind,this.name=e.name,this[m]=e}async queryPermission(e={}){const{mode:t="read"}=e,a=this[m];if(a.queryPermission)return a.queryPermission({mode:t});if(t==="read")return"granted";if(t==="readwrite")return a.writable?"granted":"denied";throw new TypeError(`Mode ${t} must be 'read' or 'readwrite'`)}async requestPermission({mode:e="read"}={}){const t=this[m];if(t.requestPermission)return t.requestPermission({mode:e});if(e==="read")return"granted";if(e==="readwrite")return t.writable?"granted":"denied";throw new TypeError(`Mode ${e} must be 'read' or 'readwrite'`)}async remove(e={}){await this[m].remove(e)}async isSameEntry(e){return this===e?!0:!e||typeof e!="object"||this.kind!==e.kind||!e[m]?!1:this[m].isSameEntry(e[m])}}Object.defineProperty(T.prototype,Symbol.toStringTag,{value:"FileSystemHandle",writable:!1,enumerable:!1,configurable:!0});globalThis.FileSystemHandle&&(globalThis.FileSystemHandle.prototype.queryPermission??=function(i){return"granted"});const A={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:i=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${i}`,"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"]},z={writable:globalThis.WritableStream};async function U(i){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");const[e,t,a]=await Promise.all([d(()=>import("./memory.jXCvhbgc.js"),__vite__mapDeps([4,1,2]),import.meta.url),d(()=>import("./sandbox.Bd0m3BOh.js"),__vite__mapDeps([3,1,2]),import.meta.url),d(()=>Promise.resolve().then(()=>H),void 0,import.meta.url)]),o=new e.FolderHandle("",!1);return o._entries=i.map(n=>n.isFile?new t.FileHandle(n,!1):new t.FolderHandle(n,!1)),new a.FileSystemDirectoryHandle(o)}async function k(i){const{FolderHandle:e,FileHandle:t}=await d(async()=>{const{FolderHandle:y,FileHandle:s}=await import("./memory.jXCvhbgc.js");return{FolderHandle:y,FileHandle:s}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemDirectoryHandle:a}=await d(async()=>{const{FileSystemDirectoryHandle:y}=await Promise.resolve().then(()=>H);return{FileSystemDirectoryHandle:y}},void 0,import.meta.url),o=Array.from(i.files),n=o[0].webkitRelativePath.split("/",1)[0],l=new e(n,!1);return o.forEach(y=>{const s=y.webkitRelativePath.split("/");s.shift();const c=s.pop(),f=s.reduce((w,b)=>(w._entries[b]||(w._entries[b]=new e(b,!1)),w._entries[b]),l);f._entries[c]=new t(y.name,y,!1)}),new a(l)}async function C(i){const{FileHandle:e}=await d(async()=>{const{FileHandle:a}=await import("./memory.jXCvhbgc.js");return{FileHandle:a}},__vite__mapDeps([4,1,2]),import.meta.url),{FileSystemFileHandle:t}=await d(async()=>{const{FileSystemFileHandle:a}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:a}},void 0,import.meta.url);return Array.from(i.files).map(a=>new t(new e(a.name,a,!1)))}const R=Object.freeze(Object.defineProperty({__proto__:null,config:z,errors:A,fromDataTransfer:U,getDirHandlesFromInput:k,getFileHandlesFromInput:C},Symbol.toStringTag,{value:"Module"})),{GONE:B,MOD_ERR:G}=A,u=Symbol("adapter");let h=class v extends T{[u];constructor(e){super(e),this[u]=e}async getDirectoryHandle(e,t={}){if(e==="")throw new TypeError("Name can't be an empty string.");if(e==="."||e===".."||e.includes("/"))throw new TypeError("Name contains invalid characters.");t.create=!!t.create;const a=await this[u].getDirectoryHandle(e,t);return new v(a)}async*entries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:t}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:t}},void 0,import.meta.url);for await(const[t,a]of this[u].entries())yield[a.name,a.kind==="file"?new e(a):new v(a)]}async*getEntries(){const{FileSystemFileHandle:e}=await d(async()=>{const{FileSystemFileHandle:t}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:t}},void 0,import.meta.url);console.warn("deprecated, use .entries() instead");for await(let t of this[u].entries())yield t.kind==="file"?new e(t):new v(t)}async getFileHandle(e,t={}){const{FileSystemFileHandle:a}=await d(async()=>{const{FileSystemFileHandle:n}=await Promise.resolve().then(()=>g);return{FileSystemFileHandle:n}},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.");t.create=!!t.create;const o=await this[u].getFileHandle(e,t);return new a(o)}async removeEntry(e,t={}){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 t.recursive=!!t.recursive,this[u].removeEntry(e,t)}async resolve(e){if(await e.isSameEntry(this))return[];const t=[{handle:this,path:[]}];for(;t.length;){let{handle:a,path:o}=t.pop();for await(const n of a.values()){if(await n.isSameEntry(e))return[...o,n.name];n.kind==="directory"&&t.push({handle:n,path:[...o,n.name]})}}return null}async*keys(){for await(const[e]of this[u].entries())yield e}async*values(){for await(const[e,t]of this)yield t}[Symbol.asyncIterator](){return this.entries()}};Object.defineProperty(h.prototype,Symbol.toStringTag,{value:"FileSystemDirectoryHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(h.prototype,{getDirectoryHandle:{enumerable:!0},entries:{enumerable:!0},getFileHandle:{enumerable:!0},removeEntry:{enumerable:!0}});if(globalThis.FileSystemDirectoryHandle){const i=globalThis.FileSystemDirectoryHandle.prototype;i.resolve=async function(n){if(await n.isSameEntry(this))return[];const l=[{handle:this,path:[]}];for(;l.length;){let{handle:y,path:s}=l.pop();for await(const c of y.values()){if(await c.isSameEntry(n))return[...s,c.name];c.kind==="directory"&&l.push({handle:c,path:[...s,c.name]})}}return null};async function e(o){if(await(await navigator.storage.getDirectory()).resolve(o)===null)throw new DOMException(...B)}const t=i.entries;i.entries=async function*(){await e(this),yield*t.call(this)},i[Symbol.asyncIterator]=async function*(){yield*this.entries()};const a=i.removeEntry;i.removeEntry=async function(o,n={}){return a.call(this,o,n).catch(async l=>{throw l instanceof DOMException&&l.name==="UnknownError"&&!n.recursive&&!(await t.call(this).next()).done?new DOMException(...G):l})}}const H=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:h,default:h},Symbol.toStringTag,{value:"Module"})),{INVALID:Y,SYNTAX:O,GONE:X}=A,E=Symbol("adapter");class F extends T{[E];constructor(e){super(e),this[E]=e}async createWritable(e={}){return new p(await this[E].createWritable(e))}async getFile(){return this[E].getFile()}}Object.defineProperty(F.prototype,Symbol.toStringTag,{value:"FileSystemFileHandle",writable:!1,enumerable:!1,configurable:!0});Object.defineProperties(F.prototype,{createWritable:{enumerable:!0},getFile:{enumerable:!0}});if(globalThis.FileSystemFileHandle&&!globalThis.FileSystemFileHandle.prototype.createWritable){const i=new WeakMap;let e;const t=()=>{let o,n;onmessage=async l=>{const y=l.ports[0],s=l.data;switch(s.type){case"open":const c=s.name;let f=await navigator.storage.getDirectory();for(const w of s.path)f=await f.getDirectoryHandle(w);o=await f.getFileHandle(c),n=await o.createSyncAccessHandle();break;case"write":n.write(s.data,{at:s.position}),n.flush();break;case"truncate":n.truncate(s.size);break;case"abort":case"close":n.close();break}y.postMessage(0)}};globalThis.FileSystemFileHandle.prototype.createWritable=async function(o){if(!e){const r=`(${t.toString()})()`,S=new Blob([r],{type:"text/javascript"});e=URL.createObjectURL(S)}const n=new Worker(e,{type:"module"});let l=0;const y=new TextEncoder;let s=await this.getFile().then(r=>r.size);const c=r=>new Promise((S,P)=>{const _=new MessageChannel;_.port1.onmessage=D=>{D.data instanceof Error?P(D.data):S(D.data),_.port1.close(),_.port2.close(),_.port1.onmessage=null},n.postMessage(r,[_.port2])}),f=await navigator.storage.getDirectory(),w=await i.get(this),b=await f.resolve(w);if(b===null)throw new DOMException(...X);return await c({type:"open",path:b,name:this.name}),o?.keepExistingData===!1&&(await c({type:"truncate",size:0}),s=0),new p({start:r=>{},async write(r){if(r?.constructor===Object?r={...r}:r={type:"write",data:r,position:l},r.type==="write"){if(!("data"in r))throw await c({type:"close"}),new DOMException(...O("write requires a data argument"));if(r.position??=l,typeof r.data=="string")r.data=y.encode(r.data);else if(r.data instanceof ArrayBuffer)r.data=new Uint8Array(r.data);else if(!(r.data instanceof Uint8Array)&&ArrayBuffer.isView(r.data))r.data=new Uint8Array(r.data.buffer,r.data.byteOffset,r.data.byteLength);else if(!(r.data instanceof Uint8Array)){const P=await new Response(r.data).arrayBuffer();r.data=new Uint8Array(P)}Number.isInteger(r.position)&&r.position>=0&&(l=r.position),l+=r.data.byteLength,s+=r.data.byteLength}else if(r.type==="seek")if(Number.isInteger(r.position)&&r.position>=0){if(s<r.position)throw new DOMException(...Y);console.log("seeking",r),l=r.position;return}else throw await c({type:"close"}),new DOMException(...O("seek requires a position argument"));else if(r.type==="truncate")if(Number.isInteger(r.size)&&r.size>=0)s=r.size,l>s&&(l=s);else throw await c({type:"close"}),new DOMException(...O("truncate requires a size argument"));await c(r)},async close(){await c({type:"close"}),n.terminate()},async abort(r){await c({type:"abort",reason:r}),n.terminate()}})};const a=FileSystemDirectoryHandle.prototype.getFileHandle;FileSystemDirectoryHandle.prototype.getFileHandle=async function(...o){const n=await a.call(this,...o);return i.set(n,this),n}}const g=Object.freeze(Object.defineProperty({__proto__:null,FileSystemFileHandle:F,default:F},Symbol.toStringTag,{value:"Module"})),Q=Object.freeze(Object.defineProperty({__proto__:null,FileSystemDirectoryHandle:h,FileSystemFileHandle:F,FileSystemHandle:T,FileSystemWritableFileStream:p,getOriginPrivateDirectory:W,showDirectoryPicker:j,showOpenFilePicker:N,showSaveFilePicker:V},Symbol.toStringTag,{value:"Module"}));export{Q as a,q as c,A as e};
@@ -1 +1 @@
1
- import{g as ot}from"./index.BIU1Hwtm.js";function rt(k,u){for(var p=0;p<u.length;p++){const I=u[p];if(typeof I!="string"&&!Array.isArray(I)){for(const E in I)if(E!=="default"&&!(E in k)){const O=Object.getOwnPropertyDescriptor(I,E);O&&Object.defineProperty(k,E,O.get?O:{enumerable:!0,get:()=>I[E]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var oe={exports:{}},xe;function at(){return xe||(xe=1,function(k){(function(u){if(typeof window>"u")return;var p=!0,I=10,E="",O=0,D="",_=null,re="",W=!1,Ne={resize:1,click:1},V=128,ae=!0,P=1,U="bodyOffset",h=U,se=!0,ce="",R={},S=32,ue=null,J=!1,X=!1,H="[iFrameSizer]",le=H.length,B="",fe={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",de=window.parent,x="*",K=0,j=!1,me=null,A=16,N=1,ge="scroll",v=ge,De=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={},he=!1;function pe(){}try{var ve=Object.create({},{passive:{get:function(){he=!0}}});window.addEventListener("test",pe,ve),window.removeEventListener("test",pe,ve)}catch{}function z(e,t,n,i){e.addEventListener(t,n,he?i||{}:!1)}function We(e,t,n){e.removeEventListener(t,n,!1)}function ye(e){return e.charAt(0).toUpperCase()+e.slice(1)}function He(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=A-(d-f);return t=this,n=arguments,s<=0||s>A?(a&&(clearTimeout(a),a=null),f=d,i=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,s)),i}}function we(e){return H+"["+B+"] "+e}function o(e){J&&typeof window.console=="object"&&console.log(we(e))}function T(e){typeof window.console=="object"&&console.warn(we(e))}function Be(){je(),o("Initialising iFrame ("+window.location.href+")"),_e(),Ue(),te("background",E),te("padding",re),Ke(),Me(),Ee(),Je(),Ze(),Ge(),Ie(),R=Qe(),L("init","Init message from host page"),G()}function je(){function e(n){return n==="true"}var t=ce.slice(le).split(":");B=t[0],O=u===t[1]?O:Number(t[1]),W=u===t[2]?W:e(t[2]),J=u===t[3]?J:e(t[3]),S=u===t[4]?S:Number(t[4]),p=u===t[6]?p:e(t[6]),D=t[7],h=u===t[8]?h:t[8],E=t[9],re=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 qe(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 _e(){function e(){var n=window.iFrameResizer;o("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(qe,n),Q="onMessage"in n?n.onMessage:Q,G="onReady"in n?n.onReady:G,x="targetOrigin"in n?n.targetOrigin:x,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: "+x)}function Ve(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 Ue(){u===D&&(D=O+"px"),te("margin",Ve("margin",D))}function Je(){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,z(window,n,i,{passive:!0})},remove:function(n){var i=ee[n];delete ee[n],We(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(ye(e.method)+" event listener: "+e.eventType)}function be(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 Te(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 Me(){h=Te(h,U,M,"height")}function Ee(){v=Te(v,ge,F,"width")}function Ie(){p===!0?(be("add"),et()):o("Auto Resize disabled")}function Xe(){_!==null&&_.disconnect()}function Ye(){be("remove"),Xe(),clearInterval(ue)}function Ke(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Qe(){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 C=t(b);o("Moving to in page link (#"+c+") at x: "+C.x+" y: "+C.y),y(C.y,C.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")!=="#"&&z(l,"click",c)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),s)}function f(){z(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 Ge(){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),z(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ze(){o("Enable public methods"),De.parentIFrame={autoResize:function(t){return t===!0&&p===!1?(p=!0,Ie()):t===!1&&p===!0&&(p=!1,Ye()),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(){ke("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,Me()},setWidthCalculationMethod:function(t){v=t,Ee()},setTargetOrigin:function(t){o("Set targetOrigin: "+t),x=t},size:function(t,n){var i=""+(t||"")+(n?","+n:"");L("size","parentIFrame.size("+i+")",t,n)}}}function Oe(){S!==0&&(o("setInterval: "+S+"ms"),ue=setInterval(function(){L("interval","setInterval: "+S)},Math.abs(S)))}function $e(){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 et(){var e=0>S;window.MutationObserver||window.WebKitMutationObserver?e?Oe():_=$e():(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,I)}function tt(e){e>A/2&&(A=2*e,o("Event throttle increased to "+A+"ms"))}function ie(e,t){for(var n=t.length,i=0,a=0,f=ye(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"),tt(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 Fe(){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",Fe()))},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",Fe())},taggedElement:function(){return Se("right","data-iframe-width")}};function Le(e,t,n,i){function a(){P=c,N=r,y(P,N,e)}function f(){function w(b,C){var it=Math.abs(b-C)<=K;return!it}return c=u===n?M[h]():n,r=u===i?F[v]():i,w(P,c)||W&&w(N,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in fe||W&&v in fe}function s(){o("No change in size detected")}function l(){m()&&d()?ke(t):e in{interval:1}||s()}var c,r;f()||e==="init"?(ze(),a()):l()}var nt=He(Le);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"?Le(e,t,n,i):nt(e,t,n,i))}function ze(){j||(j=!0,o("Trigger event lock on")),clearTimeout(me),me=setTimeout(function(){j=!1,o("Trigger event lock off"),o("--")},V)}function Ce(e){P=M[h](),N=F[v](),y(P,N,e)}function ke(e){var t=h;h=U,o("Reset trigger event: "+e),ze(),Ce("reset"),h=t}function y(e,t,n,i,a){function f(){u===a?a=x:o("Message targetOrigin: "+a)}function m(){var d=e+":"+t,s=B+":"+d+":"+n+(u===i?"":":"+i);o("Sending message to host page ("+s+")"),de.postMessage(H+s,a)}f(),m()}function Pe(e){var t={init:function(){ce=e.data,de=e.source,Be(),ae=!1,setTimeout(function(){se=!1},V)},reset:function(){se?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,le)}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(){ae===!1?d():m()?t.init():o('Ignored message of type "'+i()+'". Received before initialization.')}n()&&s()}function Re(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){Pe({data:e})},z(window,"message",Pe),z(window,"readystatechange",Re),Re())})()}(oe)),oe.exports}var Ae=at();const st=ot(Ae),ut=rt({__proto__:null,default:st},[Ae]);export{ut as i};
1
+ import{g as ot}from"./index.D_0R5OBc.js";function rt(k,u){for(var p=0;p<u.length;p++){const I=u[p];if(typeof I!="string"&&!Array.isArray(I)){for(const E in I)if(E!=="default"&&!(E in k)){const O=Object.getOwnPropertyDescriptor(I,E);O&&Object.defineProperty(k,E,O.get?O:{enumerable:!0,get:()=>I[E]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var oe={exports:{}},xe;function at(){return xe||(xe=1,function(k){(function(u){if(typeof window>"u")return;var p=!0,I=10,E="",O=0,D="",_=null,re="",W=!1,Ne={resize:1,click:1},V=128,ae=!0,P=1,U="bodyOffset",h=U,se=!0,ce="",R={},S=32,ue=null,J=!1,X=!1,H="[iFrameSizer]",le=H.length,B="",fe={max:1,min:1,bodyScroll:1,documentElementScroll:1},Y="child",de=window.parent,x="*",K=0,j=!1,me=null,A=16,N=1,ge="scroll",v=ge,De=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={},he=!1;function pe(){}try{var ve=Object.create({},{passive:{get:function(){he=!0}}});window.addEventListener("test",pe,ve),window.removeEventListener("test",pe,ve)}catch{}function z(e,t,n,i){e.addEventListener(t,n,he?i||{}:!1)}function We(e,t,n){e.removeEventListener(t,n,!1)}function ye(e){return e.charAt(0).toUpperCase()+e.slice(1)}function He(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=A-(d-f);return t=this,n=arguments,s<=0||s>A?(a&&(clearTimeout(a),a=null),f=d,i=e.apply(t,n),a||(t=n=null)):a||(a=setTimeout(m,s)),i}}function we(e){return H+"["+B+"] "+e}function o(e){J&&typeof window.console=="object"&&console.log(we(e))}function T(e){typeof window.console=="object"&&console.warn(we(e))}function Be(){je(),o("Initialising iFrame ("+window.location.href+")"),_e(),Ue(),te("background",E),te("padding",re),Ke(),Me(),Ee(),Je(),Ze(),Ge(),Ie(),R=Qe(),L("init","Init message from host page"),G()}function je(){function e(n){return n==="true"}var t=ce.slice(le).split(":");B=t[0],O=u===t[1]?O:Number(t[1]),W=u===t[2]?W:e(t[2]),J=u===t[3]?J:e(t[3]),S=u===t[4]?S:Number(t[4]),p=u===t[6]?p:e(t[6]),D=t[7],h=u===t[8]?h:t[8],E=t[9],re=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 qe(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 _e(){function e(){var n=window.iFrameResizer;o("Reading data from page: "+JSON.stringify(n)),Object.keys(n).forEach(qe,n),Q="onMessage"in n?n.onMessage:Q,G="onReady"in n?n.onReady:G,x="targetOrigin"in n?n.targetOrigin:x,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: "+x)}function Ve(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 Ue(){u===D&&(D=O+"px"),te("margin",Ve("margin",D))}function Je(){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,z(window,n,i,{passive:!0})},remove:function(n){var i=ee[n];delete ee[n],We(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(ye(e.method)+" event listener: "+e.eventType)}function be(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 Te(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 Me(){h=Te(h,U,M,"height")}function Ee(){v=Te(v,ge,F,"width")}function Ie(){p===!0?(be("add"),et()):o("Auto Resize disabled")}function Xe(){_!==null&&_.disconnect()}function Ye(){be("remove"),Xe(),clearInterval(ue)}function Ke(){var e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.appendChild(e)}function Qe(){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 C=t(b);o("Moving to in page link (#"+c+") at x: "+C.x+" y: "+C.y),y(C.y,C.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")!=="#"&&z(l,"click",c)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),s)}function f(){z(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 Ge(){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),z(window.document,n,e)}t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave")}function Ze(){o("Enable public methods"),De.parentIFrame={autoResize:function(t){return t===!0&&p===!1?(p=!0,Ie()):t===!1&&p===!0&&(p=!1,Ye()),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(){ke("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,Me()},setWidthCalculationMethod:function(t){v=t,Ee()},setTargetOrigin:function(t){o("Set targetOrigin: "+t),x=t},size:function(t,n){var i=""+(t||"")+(n?","+n:"");L("size","parentIFrame.size("+i+")",t,n)}}}function Oe(){S!==0&&(o("setInterval: "+S+"ms"),ue=setInterval(function(){L("interval","setInterval: "+S)},Math.abs(S)))}function $e(){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 et(){var e=0>S;window.MutationObserver||window.WebKitMutationObserver?e?Oe():_=$e():(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,I)}function tt(e){e>A/2&&(A=2*e,o("Event throttle increased to "+A+"ms"))}function ie(e,t){for(var n=t.length,i=0,a=0,f=ye(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"),tt(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 Fe(){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",Fe()))},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",Fe())},taggedElement:function(){return Se("right","data-iframe-width")}};function Le(e,t,n,i){function a(){P=c,N=r,y(P,N,e)}function f(){function w(b,C){var it=Math.abs(b-C)<=K;return!it}return c=u===n?M[h]():n,r=u===i?F[v]():i,w(P,c)||W&&w(N,r)}function m(){return!(e in{init:1,interval:1,size:1})}function d(){return h in fe||W&&v in fe}function s(){o("No change in size detected")}function l(){m()&&d()?ke(t):e in{interval:1}||s()}var c,r;f()||e==="init"?(ze(),a()):l()}var nt=He(Le);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"?Le(e,t,n,i):nt(e,t,n,i))}function ze(){j||(j=!0,o("Trigger event lock on")),clearTimeout(me),me=setTimeout(function(){j=!1,o("Trigger event lock off"),o("--")},V)}function Ce(e){P=M[h](),N=F[v](),y(P,N,e)}function ke(e){var t=h;h=U,o("Reset trigger event: "+e),ze(),Ce("reset"),h=t}function y(e,t,n,i,a){function f(){u===a?a=x:o("Message targetOrigin: "+a)}function m(){var d=e+":"+t,s=B+":"+d+":"+n+(u===i?"":":"+i);o("Sending message to host page ("+s+")"),de.postMessage(H+s,a)}f(),m()}function Pe(e){var t={init:function(){ce=e.data,de=e.source,Be(),ae=!1,setTimeout(function(){se=!1},V)},reset:function(){se?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,le)}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(){ae===!1?d():m()?t.init():o('Ignored message of type "'+i()+'". Received before initialization.')}n()&&s()}function Re(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeResizer"in window||(window.iframeChildListener=function(e){Pe({data:e})},z(window,"message",Pe),z(window,"readystatechange",Re),Re())})()}(oe)),oe.exports}var Ae=at();const st=ot(Ae),ut=rt({__proto__:null,default:st},[Ae]);export{ut as i};
@@ -1 +1 @@
1
- import{s as l,b2 as C,J as b,b3 as s,r as u,b4 as n,j as a,b5 as v,b6 as B,b7 as k}from"./index.BIU1Hwtm.js";function S(o,r){switch(o){case s.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case s.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case s.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const e=l("a",{target:"e1xsxz6b0"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.button,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${b(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...S(r,i)})),L=l(e,{target:"e1xsxz6b1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:C(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=l(e,{target:"e1xsxz6b2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),z=l(e,{target:"e1xsxz6b3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${b(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:i,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:x}){let d=L;return o===n.SECONDARY?d=$:o===n.TERTIARY&&(d=z),a(d,{kind:o,size:r||s.MEDIUM,containerWidth:t||!1,disabled:i||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:x,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const w=u.memo(T);function R(o){const{element:r}=o;let i=n.SECONDARY;r.type==="primary"?i=n.PRIMARY:r.type==="tertiary"&&(i=n.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return a(k,{className:"stLinkButton","data-testid":"stLinkButton",children:a(v,{help:r.help,containerWidth:r.useContainerWidth,children:a(w,{kind:i,size:s.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(B,{icon:r.icon,label:r.label})})})})}const W=u.memo(R);export{W as default};
1
+ import{s as l,b2 as C,J as b,b3 as s,r as u,b4 as n,j as a,b5 as v,b6 as B,b7 as k}from"./index.D_0R5OBc.js";function S(o,r){switch(o){case s.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case s.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case s.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const e=l("a",{target:"e1xsxz6b0"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.button,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${b(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...S(r,i)})),L=l(e,{target:"e1xsxz6b1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:C(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=l(e,{target:"e1xsxz6b2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),z=l(e,{target:"e1xsxz6b3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${b(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:i,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:x}){let d=L;return o===n.SECONDARY?d=$:o===n.TERTIARY&&(d=z),a(d,{kind:o,size:r||s.MEDIUM,containerWidth:t||!1,disabled:i||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:x,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const w=u.memo(T);function R(o){const{element:r}=o;let i=n.SECONDARY;r.type==="primary"?i=n.PRIMARY:r.type==="tertiary"&&(i=n.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return a(k,{className:"stLinkButton","data-testid":"stLinkButton",children:a(v,{help:r.help,containerWidth:r.useContainerWidth,children:a(w,{kind:i,size:s.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(B,{icon:r.icon,label:r.label})})})})}const W=u.memo(R);export{W as default};
@@ -1 +1 @@
1
- import{r,aI as f,b4 as l,j as t,b5 as m,bp as B,b3 as b,b6 as p}from"./index.BIU1Hwtm.js";import{c as h}from"./createDownloadLinkElement.DZMwyjvU.js";function w(n,o,e){return h({enforceDownloadInNewTab:e,url:n.buildMediaURL(o),filename:""})}function D(n){const{disabled:o,element:e,widgetMgr:s,endpoints:a,fragmentId:d}=n,{libConfig:{enforceDownloadInNewTab:c=!1}}=r.useContext(f);let i=l.SECONDARY;e.type==="primary"?i=l.PRIMARY:e.type==="tertiary"&&(i=l.TERTIARY),r.useEffect(()=>{a.checkSourceUrlResponse(e.url,"Download Button")},[e.url,a]);const u=()=>{e.ignoreRerun||s.setTriggerValue(e,{fromUi:!0},d),w(a,e.url,c).click()};return t("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:t(m,{help:e.help,containerWidth:e.useContainerWidth,children:t(B,{kind:i,size:b.SMALL,disabled:o,onClick:u,containerWidth:e.useContainerWidth,children:t(p,{icon:e.icon,label:e.label})})})})}const g=r.memo(D);export{g as default};
1
+ import{r,aI as f,b4 as l,j as t,b5 as m,bp as B,b3 as b,b6 as p}from"./index.D_0R5OBc.js";import{c as h}from"./createDownloadLinkElement.DZMwyjvU.js";function w(n,o,e){return h({enforceDownloadInNewTab:e,url:n.buildMediaURL(o),filename:""})}function D(n){const{disabled:o,element:e,widgetMgr:s,endpoints:a,fragmentId:d}=n,{libConfig:{enforceDownloadInNewTab:c=!1}}=r.useContext(f);let i=l.SECONDARY;e.type==="primary"?i=l.PRIMARY:e.type==="tertiary"&&(i=l.TERTIARY),r.useEffect(()=>{a.checkSourceUrlResponse(e.url,"Download Button")},[e.url,a]);const u=()=>{e.ignoreRerun||s.setTriggerValue(e,{fromUi:!0},d),w(a,e.url,c).click()};return t("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:t(m,{help:e.help,containerWidth:e.useContainerWidth,children:t(B,{kind:i,size:b.SMALL,disabled:o,onClick:u,containerWidth:e.useContainerWidth,children:t(p,{icon:e.icon,label:e.label})})})})}const g=r.memo(D);export{g as default};
@@ -1,3 +1,3 @@
1
- import{b$ as de,cw as ce,cx as pe,cy as fe,cz as ge,cA as ye,ce as me,bv as ve,bS as be,cB as he,cf as Se,cC as Oe,d as K,cD as Ce,s as Ie,r as V,b8 as Pe,M as J,z as $e,C as _e,j as z,br as Te,bH as Ee,bs as Re,b9 as we,bt as De,b_ as xe}from"./index.BIU1Hwtm.js";import{a as Ae}from"./useBasicWidgetState.Cp78gjjh.js";import{T as We}from"./timepicker.DtFPFwb0.js";import"./FormClearHelper.3-U9496x.js";import"./possibleConstructorReturn.ql9j_wzC.js";import"./createSuper.fMnDQXwy.js";var Be=de.Consumer;const Ne=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:Be,ThemeProvider:ce,createThemedStyled:pe,createThemedUseStyletron:fe,createThemedWithStyle:ge,expandBorderStyles:ye,hexToRgb:me,styled:ve,useStyletron:be,withStyle:he,withWrapper:Se},Symbol.toStringTag,{value:"Module"}));var C={};const Y=Oe(Ne);var w={},X;function Me(){if(X)return w;X=1,Object.defineProperty(w,"__esModule",{value:!0}),w.STATE_CHANGE_TYPE=w.SIZE=w.ENHANCER_POSITION=w.CUSTOM_INPUT_TYPE=w.ADJOINED=void 0;var g={change:"change"};w.STATE_CHANGE_TYPE=g;var c={textarea:"textarea"};w.CUSTOM_INPUT_TYPE=c;var h={none:"none",left:"left",right:"right",both:"both"};w.ADJOINED=h;var m={mini:"mini",default:"default",compact:"compact",large:"large"};w.SIZE=m;var b={start:"start",end:"end"};return w.ENHANCER_POSITION=b,w}var q={},A={},H={},Q;function Le(){if(Q)return H;Q=1,Object.defineProperty(H,"__esModule",{value:!0}),H.default=c;function g(m){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},g(m)}function c(m){m=m||{};for(var b=arguments.length<=1?0:arguments.length-1,v,y,S=0;S<b;S++){v=(S+1<1||arguments.length<=S+1?void 0:arguments[S+1])||{};for(var f in v)g(v[f])!==void 0&&(y=v[f],h(y)?m[f]=c(m[f]||Array.isArray(y)&&[]||{},y):m[f]=y)}return m}function h(m){return Array.isArray(m)||{}.toString.call(m)=="[object Object]"}return H}var ee;function ae(){if(ee)return A;ee=1,Object.defineProperty(A,"__esModule",{value:!0}),A.getOverride=E,A.getOverrideProps=_,A.getOverrides=L,A.mergeConfigurationOverrides=M,A.mergeOverride=x,A.mergeOverrides=N,A.toObjectOverride=D,A.useOverrides=F;var g=v(K()),c=Ce(),h=m(Le());function m(i){return i&&i.__esModule?i:{default:i}}function b(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,u=new WeakMap;return(b=function(r){return r?u:t})(i)}function v(i,t){if(i&&i.__esModule)return i;if(i===null||P(i)!=="object"&&typeof i!="function")return{default:i};var u=b(t);if(u&&u.has(i))return u.get(i);var s={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var l=r?Object.getOwnPropertyDescriptor(i,a):null;l&&(l.get||l.set)?Object.defineProperty(s,a,l):s[a]=i[a]}return s.default=i,u&&u.set(i,s),s}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var u=arguments[t];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(i[s]=u[s])}return i},y.apply(this,arguments)}function S(i,t){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),u.push.apply(u,s)}return u}function f(i){for(var t=1;t<arguments.length;t++){var u=arguments[t]!=null?arguments[t]:{};t%2?S(Object(u),!0).forEach(function(s){$(i,s,u[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):S(Object(u)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(u,s))})}return i}function $(i,t,u){return t in i?Object.defineProperty(i,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[t]=u,i}function P(i){"@babel/helpers - typeof";return P=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},P(i)}function E(i){return(0,c.isValidElementType)(i)?i:i&&P(i)==="object"?i.component:i}function _(i){return i&&P(i)==="object"?P(i.props)==="object"?f(f({},i.props),{},{$style:i.style}):{$style:i.style}:{}}function D(i){return(0,c.isValidElementType)(i)?{component:i}:i||{}}function L(i,t){var u=E(i)||t;if(i&&P(i)==="object"&&typeof i.props=="function"){var s=g.forwardRef(function(a,l){var n=i.props(a),e=_(f(f({},i),{},{props:n}));return g.createElement(u,y({ref:l},e))});return s.displayName=u.displayName,[s,{}]}var r=_(i);return[u,r]}function N(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=Object.assign({},i,t),s=Object.keys(u);return s.reduce(function(r,a){return r[a]=x(D(i[a]),D(t[a])),r},{})}function x(i,t){var u=f(f({},i),t);return i.props&&t.props&&(u.props=M(i.props,t.props)),i.style&&t.style&&(u.style=M(i.style,t.style)),u}function M(i,t){return P(i)==="object"&&P(t)==="object"?(0,h.default)({},i,t):function(){return(0,h.default)({},typeof i=="function"?i.apply(void 0,arguments):i,typeof t=="function"?t.apply(void 0,arguments):t)}}function F(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return g.useMemo(function(){return Object.keys(i).reduce(function(u,s){return u[s]=L(t[s],i[s]),u},{})},[t])}return A}var j={},Z={},te;function Fe(){if(te)return Z;te=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.Svg=void 0,Z.getSvgStyles=c;var g=Y;function c(m){var b=m.$theme,v=m.$size,y=m.$color,S=b.sizing.scale600;v&&(b.sizing[v]?S=b.sizing[v]:typeof v=="number"?S="".concat(v,"px"):S=v);var f="currentColor";return y&&(b.colors[y]?f=b.colors[y]:f=y),{display:"inline-block",fill:f,color:f,height:S,width:S}}var h=(0,g.styled)("svg",c);return Z.Svg=h,h.displayName="Svg",h.displayName="Svg",Z}var k={},re;function ze(){if(re)return k;re=1,Object.defineProperty(k,"__esModule",{value:!0}),k.default=g;function g(c){var h={};for(var m in c)m[0]!=="$"&&(h[m]=c[m]);return h}return k}var ne;function Ze(){if(ne)return j;ne=1;function g(r){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},g(r)}Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var c=f(K()),h=ae(),m=Fe(),b=y(ze()),v=["children","title","size","color","overrides"];function y(r){return r&&r.__esModule?r:{default:r}}function S(r){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(S=function(e){return e?l:a})(r)}function f(r,a){if(r&&r.__esModule)return r;if(r===null||g(r)!=="object"&&typeof r!="function")return{default:r};var l=S(a);if(l&&l.has(r))return l.get(r);var n={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)){var p=e?Object.getOwnPropertyDescriptor(r,o):null;p&&(p.get||p.set)?Object.defineProperty(n,o,p):n[o]=r[o]}return n.default=r,l&&l.set(r,n),n}function $(){return $=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(r[n]=l[n])}return r},$.apply(this,arguments)}function P(r,a){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);a&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),l.push.apply(l,n)}return l}function E(r){for(var a=1;a<arguments.length;a++){var l=arguments[a]!=null?arguments[a]:{};a%2?P(Object(l),!0).forEach(function(n){_(r,n,l[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):P(Object(l)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(l,n))})}return r}function _(r,a,l){return a in r?Object.defineProperty(r,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[a]=l,r}function D(r,a){return F(r)||M(r,a)||N(r,a)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{b$ as de,cw as ce,cx as pe,cy as fe,cz as ge,cA as ye,ce as me,bv as ve,bS as be,cB as he,cf as Se,cC as Oe,d as K,cD as Ce,s as Ie,r as V,b8 as Pe,M as J,z as $e,C as _e,j as z,br as Te,bH as Ee,bs as Re,b9 as we,bt as De,b_ as xe}from"./index.D_0R5OBc.js";import{a as Ae}from"./useBasicWidgetState.rpbnEZqG.js";import{T as We}from"./timepicker.CpLBXuBk.js";import"./FormClearHelper.BYxFNamA.js";import"./possibleConstructorReturn.CzPR4xGM.js";import"./createSuper.ZqMAxMzx.js";var Be=de.Consumer;const Ne=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:Be,ThemeProvider:ce,createThemedStyled:pe,createThemedUseStyletron:fe,createThemedWithStyle:ge,expandBorderStyles:ye,hexToRgb:me,styled:ve,useStyletron:be,withStyle:he,withWrapper:Se},Symbol.toStringTag,{value:"Module"}));var C={};const Y=Oe(Ne);var w={},X;function Me(){if(X)return w;X=1,Object.defineProperty(w,"__esModule",{value:!0}),w.STATE_CHANGE_TYPE=w.SIZE=w.ENHANCER_POSITION=w.CUSTOM_INPUT_TYPE=w.ADJOINED=void 0;var g={change:"change"};w.STATE_CHANGE_TYPE=g;var c={textarea:"textarea"};w.CUSTOM_INPUT_TYPE=c;var h={none:"none",left:"left",right:"right",both:"both"};w.ADJOINED=h;var m={mini:"mini",default:"default",compact:"compact",large:"large"};w.SIZE=m;var b={start:"start",end:"end"};return w.ENHANCER_POSITION=b,w}var q={},A={},H={},Q;function Le(){if(Q)return H;Q=1,Object.defineProperty(H,"__esModule",{value:!0}),H.default=c;function g(m){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},g(m)}function c(m){m=m||{};for(var b=arguments.length<=1?0:arguments.length-1,v,y,S=0;S<b;S++){v=(S+1<1||arguments.length<=S+1?void 0:arguments[S+1])||{};for(var f in v)g(v[f])!==void 0&&(y=v[f],h(y)?m[f]=c(m[f]||Array.isArray(y)&&[]||{},y):m[f]=y)}return m}function h(m){return Array.isArray(m)||{}.toString.call(m)=="[object Object]"}return H}var ee;function ae(){if(ee)return A;ee=1,Object.defineProperty(A,"__esModule",{value:!0}),A.getOverride=E,A.getOverrideProps=_,A.getOverrides=L,A.mergeConfigurationOverrides=M,A.mergeOverride=x,A.mergeOverrides=N,A.toObjectOverride=D,A.useOverrides=F;var g=v(K()),c=Ce(),h=m(Le());function m(i){return i&&i.__esModule?i:{default:i}}function b(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,u=new WeakMap;return(b=function(r){return r?u:t})(i)}function v(i,t){if(i&&i.__esModule)return i;if(i===null||P(i)!=="object"&&typeof i!="function")return{default:i};var u=b(t);if(u&&u.has(i))return u.get(i);var s={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var l=r?Object.getOwnPropertyDescriptor(i,a):null;l&&(l.get||l.set)?Object.defineProperty(s,a,l):s[a]=i[a]}return s.default=i,u&&u.set(i,s),s}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var u=arguments[t];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(i[s]=u[s])}return i},y.apply(this,arguments)}function S(i,t){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),u.push.apply(u,s)}return u}function f(i){for(var t=1;t<arguments.length;t++){var u=arguments[t]!=null?arguments[t]:{};t%2?S(Object(u),!0).forEach(function(s){$(i,s,u[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):S(Object(u)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(u,s))})}return i}function $(i,t,u){return t in i?Object.defineProperty(i,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[t]=u,i}function P(i){"@babel/helpers - typeof";return P=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},P(i)}function E(i){return(0,c.isValidElementType)(i)?i:i&&P(i)==="object"?i.component:i}function _(i){return i&&P(i)==="object"?P(i.props)==="object"?f(f({},i.props),{},{$style:i.style}):{$style:i.style}:{}}function D(i){return(0,c.isValidElementType)(i)?{component:i}:i||{}}function L(i,t){var u=E(i)||t;if(i&&P(i)==="object"&&typeof i.props=="function"){var s=g.forwardRef(function(a,l){var n=i.props(a),e=_(f(f({},i),{},{props:n}));return g.createElement(u,y({ref:l},e))});return s.displayName=u.displayName,[s,{}]}var r=_(i);return[u,r]}function N(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=Object.assign({},i,t),s=Object.keys(u);return s.reduce(function(r,a){return r[a]=x(D(i[a]),D(t[a])),r},{})}function x(i,t){var u=f(f({},i),t);return i.props&&t.props&&(u.props=M(i.props,t.props)),i.style&&t.style&&(u.style=M(i.style,t.style)),u}function M(i,t){return P(i)==="object"&&P(t)==="object"?(0,h.default)({},i,t):function(){return(0,h.default)({},typeof i=="function"?i.apply(void 0,arguments):i,typeof t=="function"?t.apply(void 0,arguments):t)}}function F(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return g.useMemo(function(){return Object.keys(i).reduce(function(u,s){return u[s]=L(t[s],i[s]),u},{})},[t])}return A}var j={},Z={},te;function Fe(){if(te)return Z;te=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.Svg=void 0,Z.getSvgStyles=c;var g=Y;function c(m){var b=m.$theme,v=m.$size,y=m.$color,S=b.sizing.scale600;v&&(b.sizing[v]?S=b.sizing[v]:typeof v=="number"?S="".concat(v,"px"):S=v);var f="currentColor";return y&&(b.colors[y]?f=b.colors[y]:f=y),{display:"inline-block",fill:f,color:f,height:S,width:S}}var h=(0,g.styled)("svg",c);return Z.Svg=h,h.displayName="Svg",h.displayName="Svg",Z}var k={},re;function ze(){if(re)return k;re=1,Object.defineProperty(k,"__esModule",{value:!0}),k.default=g;function g(c){var h={};for(var m in c)m[0]!=="$"&&(h[m]=c[m]);return h}return k}var ne;function Ze(){if(ne)return j;ne=1;function g(r){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},g(r)}Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var c=f(K()),h=ae(),m=Fe(),b=y(ze()),v=["children","title","size","color","overrides"];function y(r){return r&&r.__esModule?r:{default:r}}function S(r){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(S=function(e){return e?l:a})(r)}function f(r,a){if(r&&r.__esModule)return r;if(r===null||g(r)!=="object"&&typeof r!="function")return{default:r};var l=S(a);if(l&&l.has(r))return l.get(r);var n={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)){var p=e?Object.getOwnPropertyDescriptor(r,o):null;p&&(p.get||p.set)?Object.defineProperty(n,o,p):n[o]=r[o]}return n.default=r,l&&l.set(r,n),n}function $(){return $=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(r[n]=l[n])}return r},$.apply(this,arguments)}function P(r,a){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);a&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),l.push.apply(l,n)}return l}function E(r){for(var a=1;a<arguments.length;a++){var l=arguments[a]!=null?arguments[a]:{};a%2?P(Object(l),!0).forEach(function(n){_(r,n,l[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):P(Object(l)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(l,n))})}return r}function _(r,a,l){return a in r?Object.defineProperty(r,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[a]=l,r}function D(r,a){return F(r)||M(r,a)||N(r,a)||L()}function L(){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 N(r,a){if(r){if(typeof r=="string")return x(r,a);var l=Object.prototype.toString.call(r).slice(8,-1);if(l==="Object"&&r.constructor&&(l=r.constructor.name),l==="Map"||l==="Set")return Array.from(r);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return x(r,a)}}function x(r,a){(a==null||a>r.length)&&(a=r.length);for(var l=0,n=new Array(a);l<a;l++)n[l]=r[l];return n}function M(r,a){var l=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(l!=null){var n=[],e=!0,o=!1,p,d;try{for(l=l.call(r);!(e=(p=l.next()).done)&&(n.push(p.value),!(a&&n.length===a));e=!0);}catch(O){o=!0,d=O}finally{try{!e&&l.return!=null&&l.return()}finally{if(o)throw d}}return n}}function F(r){if(Array.isArray(r))return r}function i(r,a){if(r==null)return{};var l=t(r,a),n,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(e=0;e<o.length;e++)n=o[e],!(a.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(l[n]=r[n])}return l}function t(r,a){if(r==null)return{};var l={},n=Object.keys(r),e,o;for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&(l[e]=r[e]);return l}var u=function(a,l){var n=a.children,e=a.title,o=a.size,p=a.color,d=a.overrides,O=d===void 0?{}:d,I=i(a,v),R=(0,h.getOverrides)(O.Svg,m.Svg),W=D(R,2),T=W[0],B=W[1],U=T.__STYLETRON__?E(E({title:e,$color:p,$size:o},I),B):E(E({title:e,color:p,size:o},(0,b.default)(I)),(0,b.default)(B));return c.createElement(T,$({"data-baseweb":"icon",ref:l},U),e?c.createElement("title",null,e):null,n)},s=c.forwardRef(u);return j.default=s,j}var oe;function qe(){if(oe)return q;oe=1;function g(t){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},g(t)}Object.defineProperty(q,"__esModule",{value:!0}),q.default=void 0;var c=f(K()),h=Y,m=ae(),b=y(Ze()),v=["title","size","color","overrides"];function y(t){return t&&t.__esModule?t:{default:t}}function S(t){if(typeof WeakMap!="function")return null;var u=new WeakMap,s=new WeakMap;return(S=function(a){return a?s:u})(t)}function f(t,u){if(t&&t.__esModule)return t;if(t===null||g(t)!=="object"&&typeof t!="function")return{default:t};var s=S(u);if(s&&s.has(t))return s.get(t);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if(l!=="default"&&Object.prototype.hasOwnProperty.call(t,l)){var n=a?Object.getOwnPropertyDescriptor(t,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=t[l]}return r.default=t,s&&s.set(t,r),r}function $(){return $=Object.assign?Object.assign.bind():function(t){for(var u=1;u<arguments.length;u++){var s=arguments[u];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},$.apply(this,arguments)}function P(t,u){if(t==null)return{};var s=E(t,u),r,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],!(u.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function E(t,u){if(t==null)return{};var s={},r=Object.keys(t),a,l;for(l=0;l<r.length;l++)a=r[l],!(u.indexOf(a)>=0)&&(s[a]=t[a]);return s}function _(t,u){return M(t)||x(t,u)||L(t,u)||D()}function D(){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 L(t,u){if(t){if(typeof t=="string")return N(t,u);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return N(t,u)}}function N(t,u){(u==null||u>t.length)&&(u=t.length);for(var s=0,r=new Array(u);s<u;s++)r[s]=t[s];return r}function x(t,u){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var r=[],a=!0,l=!1,n,e;try{for(s=s.call(t);!(a=(n=s.next()).done)&&(r.push(n.value),!(u&&r.length===u));a=!0);}catch(o){l=!0,e=o}finally{try{!a&&s.return!=null&&s.return()}finally{if(l)throw e}}return r}}function M(t){if(Array.isArray(t))return t}function F(t,u){var s=(0,h.useStyletron)(),r=_(s,2),a=r[1],l=t.title,n=l===void 0?"Delete Alt":l,e=t.size,o=t.color,p=t.overrides,d=p===void 0?{}:p,O=P(t,v),I=(0,m.mergeOverride)({component:a.icons&&a.icons.DeleteAlt?a.icons.DeleteAlt:null},d&&d.Svg?(0,m.toObjectOverride)(d.Svg):{});return c.createElement(b.default,$({viewBox:"0 0 24 24",ref:u,title:n,size:e,color:o,overrides:{Svg:I}},O),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var i=c.forwardRef(F);return q.default=i,q}var ie;function je(){if(ie)return C;ie=1,Object.defineProperty(C,"__esModule",{value:!0}),C.getRootStyles=C.getInputStyles=C.getInputContainerStyles=C.StyledMaskToggleButton=C.StyledClearIconContainer=C.StyledClearIcon=C.Root=C.InputEnhancer=C.InputContainer=C.Input=void 0;var g=Y,c=Me(),h=m(qe());function m(n){return n&&n.__esModule?n:{default:n}}function b(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(n);e&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(n,d).enumerable})),o.push.apply(o,p)}return o}function v(n){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?b(Object(o),!0).forEach(function(p){y(n,p,o[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach(function(p){Object.defineProperty(n,p,Object.getOwnPropertyDescriptor(o,p))})}return n}function y(n,e,o){return e in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}var S=(0,g.styled)("button",function(n){var e,o=n.$theme,p=n.$size,d=n.$isFocusVisible,O=(e={},y(e,c.SIZE.mini,o.sizing.scale400),y(e,c.SIZE.compact,o.sizing.scale400),y(e,c.SIZE.default,o.sizing.scale300),y(e,c.SIZE.large,o.sizing.scale200),e)[p];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:O,paddingRight:O,outline:d?"solid 3px ".concat(o.colors.accent):"none",color:o.colors.contentPrimary}});C.StyledMaskToggleButton=S,S.displayName="StyledMaskToggleButton",S.displayName="StyledMaskToggleButton";var f=(0,g.styled)("div",function(n){var e,o=n.$alignTop,p=o===void 0?!1:o,d=n.$size,O=n.$theme,I=(e={},y(e,c.SIZE.mini,O.sizing.scale200),y(e,c.SIZE.compact,O.sizing.scale200),y(e,c.SIZE.default,O.sizing.scale100),y(e,c.SIZE.large,O.sizing.scale0),e)[d];return{display:"flex",alignItems:p?"flex-start":"center",paddingLeft:I,paddingRight:I,paddingTop:p?O.sizing.scale500:"0px",color:O.colors.contentPrimary}});C.StyledClearIconContainer=f,f.displayName="StyledClearIconContainer",f.displayName="StyledClearIconContainer";var $=(0,g.styled)(h.default,function(n){var e=n.$theme,o=n.$isFocusVisible;return{cursor:"pointer",outline:o?"solid 3px ".concat(e.colors.accent):"none"}});C.StyledClearIcon=$,$.displayName="StyledClearIcon",$.displayName="StyledClearIcon";function P(n,e){var o;return(o={},y(o,c.SIZE.mini,{paddingTop:e.scale100,paddingBottom:e.scale100,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.compact,{paddingTop:e.scale200,paddingBottom:e.scale200,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.default,{paddingTop:e.scale400,paddingBottom:e.scale400,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.large,{paddingTop:e.scale550,paddingBottom:e.scale550,paddingLeft:e.scale550,paddingRight:e.scale550}),o)[n]}function E(n,e,o,p,d){var O=n===c.ADJOINED.both||n===c.ADJOINED.left&&p!=="rtl"||n===c.ADJOINED.right&&p==="rtl"||d&&p==="rtl",I=n===c.ADJOINED.both||n===c.ADJOINED.right&&p!=="rtl"||n===c.ADJOINED.left&&p==="rtl"||d&&p!=="rtl";return{paddingLeft:O?o.scale550:"0px",paddingRight:I?o.scale550:"0px"}}function _(n,e){var o;return(o={},y(o,c.SIZE.mini,e.font100),y(o,c.SIZE.compact,e.font200),y(o,c.SIZE.default,e.font300),y(o,c.SIZE.large,e.font400),o)[n]}function D(n,e,o){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,d=arguments.length>4?arguments[4]:void 0;return n?{borderLeftColor:d.inputFillDisabled,borderRightColor:d.inputFillDisabled,borderTopColor:d.inputFillDisabled,borderBottomColor:d.inputFillDisabled,backgroundColor:d.inputFillDisabled}:e?{borderLeftColor:d.borderSelected,borderRightColor:d.borderSelected,borderTopColor:d.borderSelected,borderBottomColor:d.borderSelected,backgroundColor:d.inputFillActive}:o?{borderLeftColor:d.inputBorderError,borderRightColor:d.inputBorderError,borderTopColor:d.inputBorderError,borderBottomColor:d.inputBorderError,backgroundColor:d.inputFillError}:p?{borderLeftColor:d.inputBorderPositive,borderRightColor:d.inputBorderPositive,borderTopColor:d.inputBorderPositive,borderBottomColor:d.inputBorderPositive,backgroundColor:d.inputFillPositive}:{borderLeftColor:d.inputBorder,borderRightColor:d.inputBorder,borderTopColor:d.inputBorder,borderBottomColor:d.inputBorder,backgroundColor:d.inputFill}}function L(n,e){var o=e.inputBorderRadius;return n===c.SIZE.mini&&(o=e.inputBorderRadiusMini),{borderTopLeftRadius:o,borderBottomLeftRadius:o,borderTopRightRadius:o,borderBottomRightRadius:o}}var N=function(e){var o=e.$isFocused,p=e.$adjoined,d=e.$error,O=e.$disabled,I=e.$positive,R=e.$size,W=e.$theme,T=e.$theme,B=T.borders,U=T.colors,le=T.sizing,ue=T.typography,G=T.animation,se=e.$hasIconTrailing;return v(v(v(v({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:G.timing200,transitionTimingFunction:G.easeOutCurve},L(R,B)),_(R,ue)),D(O,o,d,I,U)),E(p,R,le,W.direction,se))};C.getRootStyles=N;var x=(0,g.styled)("div",N);C.Root=x,x.displayName="Root",x.displayName="Root";function M(n,e){var o;return(o={},y(o,c.SIZE.mini,{paddingRight:e.scale400,paddingLeft:e.scale400}),y(o,c.SIZE.compact,{paddingRight:e.scale400,paddingLeft:e.scale400}),y(o,c.SIZE.default,{paddingRight:e.scale300,paddingLeft:e.scale300}),y(o,c.SIZE.large,{paddingRight:e.scale200,paddingLeft:e.scale200}),o)[n]}function F(n,e,o,p,d){return n?{color:d.inputEnhancerTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var i=(0,g.styled)("div",function(n){var e=n.$size,o=n.$disabled,p=n.$isFocused,d=n.$error,O=n.$positive,I=n.$theme,R=I.colors,W=I.sizing,T=I.typography,B=I.animation;return v(v(v({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:B.timing200,transitionTimingFunction:B.easeOutCurve},_(e,T)),M(e,W)),F(o,p,d,O,R))});C.InputEnhancer=i,i.displayName="InputEnhancer",i.displayName="InputEnhancer";function t(n,e,o,p,d){return n?{color:d.inputTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var u=function(e){var o=e.$isFocused,p=e.$error,d=e.$disabled,O=e.$positive,I=e.$size,R=e.$theme,W=R.colors,T=R.typography,B=R.animation;return v(v({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:B.timing200,transitionTimingFunction:B.easeOutCurve},_(I,T)),t(d,o,p,O,W))};C.getInputContainerStyles=u;var s=(0,g.styled)("div",u);C.InputContainer=s,s.displayName="InputContainer",s.displayName="InputContainer";function r(n,e,o,p){return n?{color:p.inputTextDisabled,"-webkit-text-fill-color":p.inputTextDisabled,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholderDisabled}}:{color:p.contentPrimary,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholder}}}var a=function(e){var o=e.$disabled,p=e.$isFocused,d=e.$error,O=e.$size,I=e.$theme,R=I.colors,W=I.sizing,T=I.typography;return v(v(v({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:o?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},_(O,T)),P(O,W)),r(o,p,d,R))};C.getInputStyles=a;var l=(0,g.styled)("input",a);return C.Input=l,l.displayName="Input",l.displayName="Input",C}var He=je();const ke=Ie("div",{target:"e1ybf61d0"})({position:"absolute",top:"50%",right:"2.05em"});function Ve({disabled:g,element:c,widgetMgr:h,fragmentId:m}){const[b,v]=Ae({getStateFromWidgetMgr:Ue,getDefaultStateFromProto:Je,getCurrStateFromProto:Ke,updateWidgetMgrState:Ye,element:c,widgetMgr:h,fragmentId:m}),y=V.useContext(Pe),S=J(c.default)&&!g,f=$e(),$={Select:{props:{disabled:g,overrides:{ControlContainer:{style:{height:f.sizes.minElementHeight,borderLeftWidth:f.sizes.borderWidth,borderRightWidth:f.sizes.borderWidth,borderTopWidth:f.sizes.borderWidth,borderBottomWidth:f.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:f.spacing.sm})},ValueContainer:{style:()=>({lineHeight:f.lineHeights.inputWidget,paddingRight:f.spacing.sm,paddingLeft:f.spacing.md,paddingBottom:f.spacing.sm,paddingTop:f.spacing.sm})},SingleValue:{style:{fontWeight:f.fontWeights.normal},props:{"data-testid":"stTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:f.spacing.none,paddingBottom:f.spacing.none,boxShadow:"none",maxHeight:f.sizes.maxDropdownHeight})},DropdownListItem:{style:()=>({paddingRight:f.spacing.lg,paddingLeft:f.spacing.lg,paddingTop:f.spacing.sm,paddingBottom:f.spacing.sm})},Popover:{props:{ignoreBoundary:y,overrides:{Body:{style:()=>({marginTop:f.spacing.px})}}}},Placeholder:{style:()=>({color:f.colors.fadedText60})},SelectArrow:{component:xe,props:{overrides:{Svg:{style:()=>({width:f.iconSizes.xl,height:f.iconSizes.xl})}}}}}}}},P=V.useCallback(_=>{const D=_===null?null:Ge(_);v({value:D,fromUi:!0})},[v]),E=V.useCallback(()=>{P(null)},[P]);return _e("div",{className:"stTimeInput","data-testid":"stTimeInput",children:[z(De,{label:c.label,disabled:g,labelVisibility:Te(c.labelVisibility?.value),children:c.help&&z(Ee,{children:z(Re,{content:c.help,placement:we.TOP_RIGHT})})}),z(We,{format:"24",step:c.step?Number(c.step):900,value:J(b)?void 0:Xe(b),onChange:P,overrides:$,nullable:S,creatable:!0,"aria-label":c.label}),S&&!J(b)&&z(ke,{onClick:E,"data-testid":"stTimeInputClearButton",children:z(He.StyledClearIcon,{overrides:{Svg:{style:{color:f.colors.darkGray,padding:f.spacing.threeXS,height:f.sizes.clearIconSize,width:f.sizes.clearIconSize,":hover":{fill:f.colors.bodyText}}}},$isFocusVisible:!1})})]})}function Ue(g,c){return g.getStringValue(c)??null}function Je(g){return g.default??null}function Ke(g){return g.value??null}function Ye(g,c,h,m){c.setStringValue(g,h.value,{fromUi:h.fromUi},m)}function Ge(g){const c=g.getHours().toString().padStart(2,"0"),h=g.getMinutes().toString().padStart(2,"0");return`${c}:${h}`}function Xe(g){if(g===null)return null;const[c,h]=g.split(":").map(Number),m=new Date;return m.setHours(c),m.setMinutes(h),m}const it=V.memo(Ve);export{it as default};
@@ -0,0 +1,73 @@
1
+ import{r as h,E as $,_ as H,ba as ut,bj as zt,bk as _t,bl as $t,M as X,O as q,aI as Ht,s as x,bm as Vt,C as N,j as v,bn as jt,b4 as Gt,bo as Xt,bp as qt,l as Yt,z as Kt,bq as tt,H as Jt,aE as Qt,br as Zt,bs as te,b9 as ee,bt as ie}from"./index.D_0R5OBc.js";import{u as se,F as ne}from"./FormClearHelper.BYxFNamA.js";import{T as re,a as pt}from"./Toolbar.CXl8zpFb.js";import{u as oe}from"./Hooks.Bf489OB5.js";import{c as ae}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as le,D as ce}from"./FileDownload.esm.jHGWeFoc.js";var vt=h.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});vt.displayName="Mic";var bt=h.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});bt.displayName="Pause";var yt=h.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});yt.displayName="PlayArrow";var wt=h.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});wt.displayName="Refresh";var St=h.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});St.displayName="StopCircle";function P(s,t,e,i){return new(e||(e=Promise))(function(n,r){function o(c){try{d(i.next(c))}catch(l){r(l)}}function a(c){try{d(i.throw(c))}catch(l){r(l)}}function d(c){var l;c.done?n(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(o,a)}d((i=i.apply(s,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i?.once){const n=()=>{this.un(t,n),this.un(t,e)};return this.on(t,n),n}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const j={decode:function(s,t){return P(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(n=>n>1||n<-1)){const n=i.length;let r=0;for(let o=0;o<n;o++){const a=Math.abs(i[o]);a>r&&(r=a)}for(const o of e)for(let a=0;a<n;a++)o[a]/=r}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s?.[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Ct(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,n]of Object.entries(t))if(i==="children"&&n)for(const[r,o]of Object.entries(n))o instanceof Node?e.appendChild(o):typeof o=="string"?e.appendChild(document.createTextNode(o)):e.appendChild(Ct(r,o));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function mt(s,t,e){const i=Ct(s,t||{});return e?.appendChild(i),i}var de=Object.freeze({__proto__:null,createElement:mt,default:mt});const he={fetchBlob:function(s,t,e){return P(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(n,r){P(this,void 0,void 0,function*(){if(!n.body||!n.headers)return;const o=n.body.getReader(),a=Number(n.headers.get("Content-Length"))||0;let d=0;const c=p=>P(this,void 0,void 0,function*(){d+=p?.length||0;const u=Math.round(d/a*100);r(u)}),l=()=>P(this,void 0,void 0,function*(){let p;try{p=yield o.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class ue extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;if(i&&this.media.removeAttribute("src"),n||t)try{this.media.src=n}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load())}setMediaElement(t){this.media=t}play(){return P(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class U extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,r]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),n=e.clientX-i.left,r=e.clientY-i.top;return[n/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,n]=t(e);this.emit("click",i,n)}),this.wrapper.addEventListener("dblclick",e=>{const[i,n]=t(e);this.emit("dblclick",i,n)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:n}=this.scrollContainer,r=e/i,o=(e+n)/i;this.emit("scroll",r,o,e,e+n)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,n,r=3,o=0,a=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==o)return;p.preventDefault(),p.stopPropagation();let u=p.clientX,m=p.clientY,f=!1;const y=Date.now(),g=w=>{if(w.preventDefault(),w.stopPropagation(),d&&Date.now()-y<a)return;const T=w.clientX,D=w.clientY,k=T-u,W=D-m;if(f||Math.abs(k)>r||Math.abs(W)>r){const O=t.getBoundingClientRect(),{left:F,top:L}=O;f||(i?.(u-F,m-L),f=!0),e(k,W,T-F,D-L),u=T,m=D}},S=w=>{if(f){const T=w.clientX,D=w.clientY,k=t.getBoundingClientRect(),{left:W,top:O}=k;n?.(T-W,D-O)}c()},b=w=>{w.relatedTarget&&w.relatedTarget!==document.documentElement||S(w)},A=w=>{f&&(w.stopPropagation(),w.preventDefault())},R=w=>{f&&w.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",S),document.addEventListener("pointerout",b),document.addEventListener("pointercancel",b),document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("click",A,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",S),document.removeEventListener("pointerout",b),document.removeEventListener("pointercancel",b),document.removeEventListener("touchmove",R),setTimeout(()=>{document.removeEventListener("click",A,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const n=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e?.every(o=>!o.overlay)?r/n:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
2
+ <style${i?` nonce="${i}"`:""}>
3
+ :host {
4
+ user-select: none;
5
+ min-width: 1px;
6
+ }
7
+ :host audio {
8
+ display: block;
9
+ width: 100%;
10
+ }
11
+ :host .scroll {
12
+ overflow-x: auto;
13
+ overflow-y: hidden;
14
+ width: 100%;
15
+ position: relative;
16
+ }
17
+ :host .noScrollbar {
18
+ scrollbar-color: transparent;
19
+ scrollbar-width: none;
20
+ }
21
+ :host .noScrollbar::-webkit-scrollbar {
22
+ display: none;
23
+ -webkit-appearance: none;
24
+ }
25
+ :host .wrapper {
26
+ position: relative;
27
+ overflow: visible;
28
+ z-index: 2;
29
+ }
30
+ :host .canvases {
31
+ min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;
32
+ }
33
+ :host .canvases > div {
34
+ position: relative;
35
+ }
36
+ :host canvas {
37
+ display: block;
38
+ position: absolute;
39
+ top: 0;
40
+ image-rendering: pixelated;
41
+ }
42
+ :host .progress {
43
+ pointer-events: none;
44
+ position: absolute;
45
+ z-index: 2;
46
+ top: 0;
47
+ left: 0;
48
+ width: 0;
49
+ height: 100%;
50
+ overflow: hidden;
51
+ }
52
+ :host .progress > div {
53
+ position: relative;
54
+ }
55
+ :host .cursor {
56
+ pointer-events: none;
57
+ position: absolute;
58
+ z-index: 5;
59
+ top: 0;
60
+ left: 0;
61
+ height: 100%;
62
+ border-radius: 2px;
63
+ }
64
+ </style>
65
+
66
+ <div class="scroll" part="scroll">
67
+ <div class="wrapper" part="wrapper">
68
+ <div class="canvases" part="canvases"></div>
69
+ <div class="progress" part="progress"></div>
70
+ <div class="cursor" part="cursor"></div>
71
+ </div>
72
+ </div>
73
+ `,[t,e]}setOptions(t){if(this.options.container!==t.container){const e=this.parentFromOptionsContainer(t.container);e.appendChild(this.container),this.parent=e}t.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=t,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:e}=this.scrollContainer,i=e*t;this.setScroll(i)}destroy(){var t,e;this.subscriptions.forEach(i=>i()),this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.unsubscribeOnScroll)===null||e===void 0||e.forEach(i=>i()),this.unsubscribeOnScroll=[]}createDelay(t=10){let e,i;const n=()=>{e&&clearTimeout(e),i&&i()};return this.timeouts.push(n),()=>new Promise((r,o)=>{n(),i=o,e=setTimeout(()=>{e=void 0,i=void 0,r()},t)})}convertColorValues(t){if(!Array.isArray(t))return t||"";if(t.length<2)return t[0]||"";const e=document.createElement("canvas"),i=e.getContext("2d"),n=e.height*(window.devicePixelRatio||1),r=i.createLinearGradient(0,0,0,n),o=1/(t.length-1);return t.forEach((a,d)=>{const c=d*o;r.addColorStop(c,a)}),r}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(t,e,i,n){const r=t[0],o=t[1]||t[0],a=r.length,{width:d,height:c}=i.canvas,l=c/2,p=this.getPixelRatio(),u=e.barWidth?e.barWidth*p:1,m=e.barGap?e.barGap*p:e.barWidth?u/2:0,f=e.barRadius||0,y=d/(u+m)/a,g=f&&"roundRect"in i?"roundRect":"rect";i.beginPath();let S=0,b=0,A=0;for(let R=0;R<=a;R++){const w=Math.round(R*y);if(w>S){const k=Math.round(b*l*n),W=k+Math.round(A*l*n)||1;let O=l-k;e.barAlign==="top"?O=0:e.barAlign==="bottom"&&(O=c-W),i[g](S*(u+m),O,u,W,f),S=w,b=0,A=0}const T=Math.abs(r[R]||0),D=Math.abs(o[R]||0);T>b&&(b=T),D>A&&(A=D)}i.fill(),i.closePath()}renderLineWaveform(t,e,i,n){const r=o=>{const a=t[o]||t[0],d=a.length,{height:c}=i.canvas,l=c/2,p=i.canvas.width/d;i.moveTo(0,l);let u=0,m=0;for(let f=0;f<=d;f++){const y=Math.round(f*p);if(y>u){const S=l+(Math.round(m*l*n)||1)*(o===0?-1:1);i.lineTo(u,S),u=y,m=0}const g=Math.abs(a[f]||0);g>m&&(m=g)}i.lineTo(u,l)};i.beginPath(),r(0),r(1),i.fill(),i.closePath()}renderWaveform(t,e,i){if(i.fillStyle=this.convertColorValues(e.waveColor),e.renderFunction)return void e.renderFunction(t,i);let n=e.barHeight||1;if(e.normalize){const r=Array.from(t[0]).reduce((o,a)=>Math.max(o,Math.abs(a)),0);n=r?1/r:1}e.barWidth||e.barGap||e.barAlign?this.renderBarWaveform(t,e,i,n):this.renderLineWaveform(t,e,i,n)}renderSingleCanvas(t,e,i,n,r,o,a){const d=this.getPixelRatio(),c=document.createElement("canvas");c.width=Math.round(i*d),c.height=Math.round(n*d),c.style.width=`${i}px`,c.style.height=`${n}px`,c.style.left=`${Math.round(r)}px`,o.appendChild(c);const l=c.getContext("2d");if(this.renderWaveform(t,e,l),c.width>0&&c.height>0){const p=c.cloneNode(),u=p.getContext("2d");u.drawImage(c,0,0),u.globalCompositeOperation="source-in",u.fillStyle=this.convertColorValues(e.progressColor),u.fillRect(0,0,c.width,c.height),a.appendChild(p)}}renderMultiCanvas(t,e,i,n,r,o){const a=this.getPixelRatio(),{clientWidth:d}=this.scrollContainer,c=i/a;let l=Math.min(U.MAX_CANVAS_WIDTH,d,c),p={};if(e.barWidth||e.barGap){const g=e.barWidth||.5,S=g+(e.barGap||g/2);l%S!=0&&(l=Math.floor(l/S)*S)}if(l===0)return;const u=g=>{if(g<0||g>=m||p[g])return;p[g]=!0;const S=g*l;let b=Math.min(c-S,l);if(e.barWidth||e.barGap){const R=e.barWidth||.5,w=R+(e.barGap||R/2);b=Math.floor(b/w)*w}if(b<=0)return;const A=t.map(R=>{const w=Math.floor(S/c*R.length),T=Math.floor((S+b)/c*R.length);return R.slice(w,T)});this.renderSingleCanvas(A,e,b,n,S,r,o)},m=Math.ceil(c/l);if(!this.isScrollable){for(let g=0;g<m;g++)u(g);return}const f=this.scrollContainer.scrollLeft/c,y=Math.floor(f*m);if(u(y-1),u(y),u(y+1),m>1){const g=this.on("scroll",()=>{const{scrollLeft:S}=this.scrollContainer,b=Math.floor(S/c*m);Object.keys(p).length>U.MAX_NODES&&(r.innerHTML="",o.innerHTML="",p={}),u(b-1),u(b),u(b+1)});this.unsubscribeOnScroll.push(g)}}renderChannel(t,e,i,n){var{overlay:r}=e,o=function(l,p){var u={};for(var m in l)Object.prototype.hasOwnProperty.call(l,m)&&p.indexOf(m)<0&&(u[m]=l[m]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(m=Object.getOwnPropertySymbols(l);f<m.length;f++)p.indexOf(m[f])<0&&Object.prototype.propertyIsEnumerable.call(l,m[f])&&(u[m[f]]=l[m[f]])}return u}(e,["overlay"]);const a=document.createElement("div"),d=this.getHeight(o.height,o.splitChannels);a.style.height=`${d}px`,r&&n>0&&(a.style.marginTop=`-${d}px`),this.canvasWrapper.style.minHeight=`${d}px`,this.canvasWrapper.appendChild(a);const c=a.cloneNode();this.progressWrapper.appendChild(c),this.renderMultiCanvas(t,o,i,d,a,c)}render(t){return P(this,void 0,void 0,function*(){var e;this.timeouts.forEach(d=>d()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const i=this.getPixelRatio(),n=this.scrollContainer.clientWidth,r=Math.ceil(t.duration*(this.options.minPxPerSec||0));this.isScrollable=r>n;const o=this.options.fillParent&&!this.isScrollable,a=(o?n:r)*i;if(this.wrapper.style.width=o?"100%":`${r}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=t,this.emit("render"),this.options.splitChannels)for(let d=0;d<t.numberOfChannels;d++){const c=Object.assign(Object.assign({},this.options),(e=this.options.splitChannels)===null||e===void 0?void 0:e[d]);this.renderChannel([t.getChannelData(d)],c,a,d)}else{const d=[t.getChannelData(0)];t.numberOfChannels>1&&d.push(t.getChannelData(1)),this.renderChannel(d,this.options,a,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){if(this.unsubscribeOnScroll.forEach(i=>i()),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:e}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let n=i-e;n*=2,n=n<0?Math.floor(n):Math.ceil(n),n/=2,this.scrollContainer.scrollLeft+=n}}zoom(t){this.options.minPxPerSec=t,this.reRender()}scrollIntoView(t,e=!1){const{scrollLeft:i,scrollWidth:n,clientWidth:r}=this.scrollContainer,o=t*n,a=i,d=i+r,c=r/2;if(this.isDragging)o+30>d?this.scrollContainer.scrollLeft+=30:o-30<a&&(this.scrollContainer.scrollLeft-=30);else{(o<a||o>d)&&(this.scrollContainer.scrollLeft=o-(this.options.autoCenter?c:0));const l=o-i-c;e&&this.options.autoCenter&&l>0&&(this.scrollContainer.scrollLeft+=Math.min(l,10))}{const l=this.scrollContainer.scrollLeft,p=l/n,u=(l+r)/n;this.emit("scroll",p,u,l,l+r)}}renderProgress(t,e){if(isNaN(t))return;const i=100*t;this.canvasWrapper.style.clipPath=`polygon(${i}% 0%, 100% 0%, 100% 100%, ${i}% 100%)`,this.progressWrapper.style.width=`${i}%`,this.cursor.style.left=`${i}%`,this.cursor.style.transform=`translateX(-${Math.round(i)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(t,e)}exportImage(t,e,i){return P(this,void 0,void 0,function*(){const n=this.canvasWrapper.querySelectorAll("canvas");if(!n.length)throw new Error("No waveform data");if(i==="dataURL"){const r=Array.from(n).map(o=>o.toDataURL(t,e));return Promise.resolve(r)}return Promise.all(Array.from(n).map(r=>new Promise((o,a)=>{r.toBlob(d=>{d?o(d):a(new Error("Could not export image"))},t,e)})))})}}U.MAX_CANVAS_WIDTH=8e3,U.MAX_NODES=10;class pe extends V{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class et extends V{constructor(t=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=t,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return P(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(t){if(this.currentSrc=t,this._duration=void 0,!t)return this.buffer=null,void this.emit("emptied");fetch(t).then(e=>{if(e.status>=400)throw new Error(`Failed to fetch ${t}: ${e.status} (${e.statusText})`);return e.arrayBuffer()}).then(e=>this.currentSrc!==t?null:this.audioContext.decodeAudioData(e)).then(e=>{this.currentSrc===t&&(this.buffer=e,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var t;if(!this.paused)return;this.paused=!1,(t=this.bufferNode)===null||t===void 0||t.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let e=this.playedDuration*this._playbackRate;(e>=this.duration||e<0)&&(e=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,e),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var t;this.paused=!0,(t=this.bufferNode)===null||t===void 0||t.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return P(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(t){const e=t-this.currentTime,i=this.bufferNode;i?.stop(this.audioContext.currentTime+e),i?.addEventListener("ended",()=>{i===this.bufferNode&&(this.bufferNode=null,this.pause())},{once:!0})}setSinkId(t){return P(this,void 0,void 0,function*(){return this.audioContext.setSinkId(t)})}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this.bufferNode&&(this.bufferNode.playbackRate.value=t)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(t){const e=!this.paused;e&&this._pause(),this.playedDuration=t/this._playbackRate,e&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var t,e;return(t=this._duration)!==null&&t!==void 0?t:((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t,this.emit("volumechange")}get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const e=this.buffer.numberOfChannels;for(let i=0;i<e;i++)t.push(this.buffer.getChannelData(i));return t}}const me={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class z extends ue{static create(t){return new z(t)}constructor(t){const e=t.media||(t.backend==="WebAudio"?new et:void 0);super({media:e,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate}),this.plugins=[],this.decodedData=null,this.stopAtPosition=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},me,t),this.timer=new pe;const i=e?void 0:this.getMediaElement();this.renderer=new U(this.options,i),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const n=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:r,duration:o}=this.options;(n||r&&o)&&this.load(n,r,o).catch(()=>null)})}updateProgress(t=this.getCurrentTime()){return this.renderer.renderProgress(t/this.getDuration(),this.isPlaying()),t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t),this.emit("audioprocess",t),this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition&&this.pause()}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const t=this.updateProgress();this.emit("timeupdate",t)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("emptied",()=>{this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("ended",()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error")),this.stopAtPosition=null}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(t,e)=>{this.options.interact&&(this.seekTo(t),this.emit("interaction",t*this.getDuration()),this.emit("click",t,e))}),this.renderer.on("dblclick",(t,e)=>{this.emit("dblclick",t,e)}),this.renderer.on("scroll",(t,e,i,n)=>{const r=this.getDuration();this.emit("scroll",t*r,e*r,i,n)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",t=>{this.emit("dragstart",t)}),this.renderer.on("dragend",t=>{this.emit("dragend",t)}));{let t;this.subscriptions.push(this.renderer.on("drag",e=>{if(!this.options.interact)return;let i;this.renderer.renderProgress(e),clearTimeout(t),this.isPlaying()?i=0:this.options.dragToSeek===!0?i=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(i=this.options.dragToSeek.debounceTime),t=setTimeout(()=>{this.seekTo(e)},i),this.emit("interaction",e*this.getDuration()),this.emit("drag",e)}))}}initPlugins(){var t;!((t=this.options.plugins)===null||t===void 0)&&t.length&&this.options.plugins.forEach(e=>{this.registerPlugin(e)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(t=>t()),this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t),t.duration&&!t.peaks&&(this.decodedData=j.createBuffer(this.exportPeaks(),t.duration)),t.peaks&&t.duration&&(this.decodedData=j.createBuffer(t.peaks,t.duration)),this.renderer.setOptions(this.options),t.audioRate&&this.setPlaybackRate(t.audioRate),t.mediaControls!=null&&(this.getMediaElement().controls=t.mediaControls)}registerPlugin(t){t._init(this),this.plugins.push(t);const e=t.once("destroy",()=>{this.plugins=this.plugins.filter(i=>i!==t),this.subscriptions=this.subscriptions.filter(i=>i!==e)});return this.subscriptions.push(e),t}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const e=t/this.getDuration();this.renderer.setScrollPercentage(e)}getActivePlugins(){return this.plugins}loadAudio(t,e,i,n){return P(this,void 0,void 0,function*(){var r;if(this.emit("load",t),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,!e&&!i){const a=this.options.fetchParams||{};window.AbortController&&!a.signal&&(this.abortController=new AbortController,a.signal=(r=this.abortController)===null||r===void 0?void 0:r.signal);const d=l=>this.emit("loading",l);e=yield he.fetchBlob(t,d,a);const c=this.options.blobMimeType;c&&(e=new Blob([e],{type:c}))}this.setSrc(t,e);const o=yield new Promise(a=>{const d=n||this.getDuration();d?a(d):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>a(this.getDuration()),{once:!0}))});if(!t&&!e){const a=this.getMediaElement();a instanceof et&&(a.duration=o)}if(i)this.decodedData=j.createBuffer(i,o||0);else if(e){const a=yield e.arrayBuffer();this.decodedData=yield j.decode(a,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(t,e,i){return P(this,void 0,void 0,function*(){try{return yield this.loadAudio(t,void 0,e,i)}catch(n){throw this.emit("error",n),n}})}loadBlob(t,e,i){return P(this,void 0,void 0,function*(){try{return yield this.loadAudio("",t,e,i)}catch(n){throw this.emit("error",n),n}})}zoom(t){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(t),this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:e=8e3,precision:i=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const n=Math.min(t,this.decodedData.numberOfChannels),r=[];for(let o=0;o<n;o++){const a=this.decodedData.getChannelData(o),d=[],c=a.length/e;for(let l=0;l<e;l++){const p=a.slice(Math.floor(l*c),Math.ceil((l+1)*c));let u=0;for(let m=0;m<p.length;m++){const f=p[m];Math.abs(f)>Math.abs(u)&&(u=f)}d.push(Math.round(u*i)/i)}r.push(d)}return r}getDuration(){let t=super.getDuration()||0;return t!==0&&t!==1/0||!this.decodedData||(t=this.decodedData.duration),t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null,super.setTime(t),this.updateProgress(t),this.emit("timeupdate",t)}seekTo(t){const e=this.getDuration()*t;this.setTime(e)}play(t,e){const i=Object.create(null,{play:{get:()=>super.play}});return P(this,void 0,void 0,function*(){t!=null&&this.setTime(t);const n=yield i.play.call(this);return e!=null&&(this.media instanceof et?this.media.stopAt(e):this.stopAtPosition=e),n})}playPause(){return P(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents(),super.setMediaElement(t),this.initPlayerEvents()}exportImage(){return P(this,arguments,void 0,function*(t="image/png",e=1,i="dataURL"){return this.renderer.exportImage(t,e,i)})}destroy(){var t;this.emit("destroy"),(t=this.abortController)===null||t===void 0||t.abort(),this.plugins.forEach(e=>e.destroy()),this.subscriptions.forEach(e=>e()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}z.BasePlugin=class extends V{constructor(s){super(),this.subscriptions=[],this.options=s}onInit(){}_init(s){this.wavesurfer=s,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(s=>s())}},z.dom=de;function it(s,t,e,i){return new(e||(e=Promise))(function(n,r){function o(c){try{d(i.next(c))}catch(l){r(l)}}function a(c){try{d(i.throw(c))}catch(l){r(l)}}function d(c){var l;c.done?n(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(o,a)}d((i=i.apply(s,[])).next())})}class Et{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i?.once){const n=()=>{this.un(t,n),this.un(t,e)};return this.on(t,n),n}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}}class fe extends Et{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}}class ge extends Et{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}const ve=["audio/webm","audio/wav","audio/mpeg","audio/mp4","audio/mp3"];class Y extends fe{constructor(t){var e,i,n,r,o,a;super(Object.assign(Object.assign({},t),{audioBitsPerSecond:(e=t.audioBitsPerSecond)!==null&&e!==void 0?e:128e3,scrollingWaveform:(i=t.scrollingWaveform)!==null&&i!==void 0&&i,scrollingWaveformWindow:(n=t.scrollingWaveformWindow)!==null&&n!==void 0?n:5,continuousWaveform:(r=t.continuousWaveform)!==null&&r!==void 0&&r,renderRecordedAudio:(o=t.renderRecordedAudio)===null||o===void 0||o,mediaRecorderTimeslice:(a=t.mediaRecorderTimeslice)!==null&&a!==void 0?a:void 0})),this.stream=null,this.mediaRecorder=null,this.dataWindow=null,this.isWaveformPaused=!1,this.lastStartTime=0,this.lastDuration=0,this.duration=0,this.timer=new ge,this.subscriptions.push(this.timer.on("tick",()=>{const d=performance.now()-this.lastStartTime;this.duration=this.isPaused()?this.duration:this.lastDuration+d,this.emit("record-progress",this.duration)}))}static create(t){return new Y(t||{})}renderMicStream(t){var e;const i=new AudioContext,n=i.createMediaStreamSource(t),r=i.createAnalyser();n.connect(r),this.options.continuousWaveform&&(r.fftSize=32);const o=r.frequencyBinCount,a=new Float32Array(o);let d=0;this.wavesurfer&&((e=this.originalOptions)!==null&&e!==void 0||(this.originalOptions=Object.assign({},this.wavesurfer.options)),this.wavesurfer.options.interact=!1,this.options.scrollingWaveform&&(this.wavesurfer.options.cursorWidth=0));const c=setInterval(()=>{var l,p,u,m;if(!this.isWaveformPaused){if(r.getFloatTimeDomainData(a),this.options.scrollingWaveform){const f=Math.floor((this.options.scrollingWaveformWindow||0)*i.sampleRate),y=Math.min(f,this.dataWindow?this.dataWindow.length+o:o),g=new Float32Array(f);if(this.dataWindow){const S=Math.max(0,f-this.dataWindow.length);g.set(this.dataWindow.slice(-y+o),S)}g.set(a,f-o),this.dataWindow=g}else if(this.options.continuousWaveform){if(!this.dataWindow){const y=this.options.continuousWaveformDuration?Math.round(100*this.options.continuousWaveformDuration):((p=(l=this.wavesurfer)===null||l===void 0?void 0:l.getWidth())!==null&&p!==void 0?p:0)*window.devicePixelRatio;this.dataWindow=new Float32Array(y)}let f=0;for(let y=0;y<o;y++){const g=Math.abs(a[y]);g>f&&(f=g)}if(d+1>this.dataWindow.length){const y=new Float32Array(2*this.dataWindow.length);y.set(this.dataWindow,0),this.dataWindow=y}this.dataWindow[d]=f,d++}else this.dataWindow=a;if(this.wavesurfer){const f=((m=(u=this.dataWindow)===null||u===void 0?void 0:u.length)!==null&&m!==void 0?m:0)/100;this.wavesurfer.load("",[this.dataWindow],this.options.scrollingWaveform?this.options.scrollingWaveformWindow:f).then(()=>{this.wavesurfer&&this.options.continuousWaveform&&(this.wavesurfer.setTime(this.getDuration()/1e3),this.wavesurfer.options.minPxPerSec||this.wavesurfer.setOptions({minPxPerSec:this.wavesurfer.getWidth()/this.wavesurfer.getDuration()}))}).catch(y=>{console.error("Error rendering real-time recording data:",y)})}}},10);return{onDestroy:()=>{clearInterval(c),n?.disconnect(),i?.close()},onEnd:()=>{this.isWaveformPaused=!0,clearInterval(c),this.stopMic()}}}startMic(t){return it(this,void 0,void 0,function*(){let e;try{e=yield navigator.mediaDevices.getUserMedia({audio:t==null||t})}catch(r){throw new Error("Error accessing the microphone: "+r.message)}const{onDestroy:i,onEnd:n}=this.renderMicStream(e);return this.subscriptions.push(this.once("destroy",i)),this.subscriptions.push(this.once("record-end",n)),this.stream=e,e})}stopMic(){this.stream&&(this.stream.getTracks().forEach(t=>t.stop()),this.stream=null,this.mediaRecorder=null)}startRecording(t){return it(this,void 0,void 0,function*(){const e=this.stream||(yield this.startMic(t));this.dataWindow=null;const i=this.mediaRecorder||new MediaRecorder(e,{mimeType:this.options.mimeType||ve.find(o=>MediaRecorder.isTypeSupported(o)),audioBitsPerSecond:this.options.audioBitsPerSecond});this.mediaRecorder=i,this.stopRecording();const n=[];i.ondataavailable=o=>{o.data.size>0&&n.push(o.data),this.emit("record-data-available",o.data)};const r=o=>{var a;const d=new Blob(n,{type:i.mimeType});this.emit(o,d),this.options.renderRecordedAudio&&(this.applyOriginalOptionsIfNeeded(),(a=this.wavesurfer)===null||a===void 0||a.load(URL.createObjectURL(d)))};i.onpause=()=>r("record-pause"),i.onstop=()=>r("record-end"),i.start(this.options.mediaRecorderTimeslice),this.lastStartTime=performance.now(),this.lastDuration=0,this.duration=0,this.isWaveformPaused=!1,this.timer.start(),this.emit("record-start")})}getDuration(){return this.duration}isRecording(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)==="recording"}isPaused(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)==="paused"}isActive(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)!=="inactive"}stopRecording(){var t;this.isActive()&&((t=this.mediaRecorder)===null||t===void 0||t.stop(),this.timer.stop())}pauseRecording(){var t,e;this.isRecording()&&(this.isWaveformPaused=!0,(t=this.mediaRecorder)===null||t===void 0||t.requestData(),(e=this.mediaRecorder)===null||e===void 0||e.pause(),this.timer.stop(),this.lastDuration=this.duration)}resumeRecording(){var t;this.isPaused()&&(this.isWaveformPaused=!1,(t=this.mediaRecorder)===null||t===void 0||t.resume(),this.timer.start(),this.lastStartTime=performance.now(),this.emit("record-resume"))}static getAvailableAudioDevices(){return it(this,void 0,void 0,function*(){return navigator.mediaDevices.enumerateDevices().then(t=>t.filter(e=>e.kind==="audioinput"))})}destroy(){this.applyOriginalOptionsIfNeeded(),super.destroy(),this.stopRecording(),this.stopMic()}applyOriginalOptionsIfNeeded(){this.wavesurfer&&this.originalOptions&&(this.wavesurfer.setOptions(this.originalOptions),delete this.originalOptions)}}const be=async({files:s,uploadClient:t,widgetMgr:e,widgetInfo:i,fragmentId:n})=>{let r=[];try{r=await t.fetchFileURLs(s)}catch(c){return{successfulUploads:[],failedUploads:s.map(l=>({file:l,error:ut(c)}))}}const o=zt(s,r),a=[],d=[];return await Promise.all(o.map(async([c,l])=>{if(!c||!l||!l.uploadUrl||!l.fileId)return{file:c,fileUrl:l,error:new Error("No upload URL found")};try{await t.uploadFile({id:l.fileId,formId:i.formId||""},l.uploadUrl,c),a.push({fileUrl:l,file:c})}catch(p){const u=ut(p);d.push({file:c,error:u})}})),e.setFileUploaderStateValue(i,new _t({uploadedFileInfo:a.map(({file:c,fileUrl:l})=>new $t({fileId:l.fileId,fileUrls:l,name:c.name,size:c.size}))}),{fromUi:!0},n),{successfulUploads:a,failedUploads:d}},st=({widgetMgr:s,id:t,formId:e,key:i,defaultValue:n})=>{h.useEffect(()=>{const l=s.getElementState(t,i);X(l)&&q(n)&&s.setElementState(t,i,n)},[s,t,i,n]);const[r,o]=h.useState(s.getElementState(t,i)??n),a=h.useCallback(l=>{s.setElementState(t,i,l),o(l)},[s,t,i]),d=h.useMemo(()=>({formId:e||""}),[e]),c=h.useCallback(()=>a(n),[n,a]);return se({element:d,widgetMgr:s,onFormCleared:c}),[r,a]},ye=(s,t)=>{const{libConfig:{enforceDownloadInNewTab:e=!1}}=h.useContext(Ht);return h.useCallback(()=>{if(!s)return;const n=ae({enforceDownloadInNewTab:e,url:s,filename:t});n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)},[s,e,t])},we=x("div",{target:"e45nyo0"})(),ft=x("div",{target:"e45nyo1"})(({theme:s})=>({height:s.sizes.largestElementHeight,width:"100%",background:s.colors.secondaryBg,borderRadius:s.radii.default,marginBottom:s.spacing.twoXS,display:"flex",alignItems:"center",position:"relative",paddingLeft:s.spacing.xs,paddingRight:s.spacing.sm,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0})),Se=x("div",{target:"e45nyo2"})({flex:1}),Ce=x("div",{target:"e45nyo3"})(({show:s})=>({display:s?"block":"none"})),Ee=x("span",{target:"e45nyo4"})(({theme:s,isPlayingOrRecording:t})=>({margin:s.spacing.sm,fontFamily:s.fonts.monospace,color:t?s.colors.bodyText:s.colors.fadedText60,backgroundColor:s.colors.secondaryBg,fontSize:s.fontSizes.sm})),Rt=x("div",{target:"e45nyo5"})({width:"100%",textAlign:"center",overflow:"hidden"}),Pt=x("span",{target:"e45nyo6"})(({theme:s})=>({color:s.colors.bodyText})),Re=x("a",{target:"e45nyo7"})(({theme:s})=>({color:s.colors.link,textDecoration:s.linkUnderline?"underline":"none"})),Pe=x("div",{target:"e45nyo8"})(({theme:s})=>({height:s.sizes.largestElementHeight,display:"flex",justifyContent:"center",alignItems:"center"})),xe=x("div",{target:"e45nyo9"})(({theme:s})=>{const t="0.625em";return{opacity:.2,width:"100%",height:t,backgroundSize:t,backgroundImage:`radial-gradient(${s.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:"repeat"}}),Ae=x("span",{target:"e45nyo10"})(({theme:s})=>({"& > button":{color:s.colors.primary,padding:s.spacing.threeXS},"& > button:hover, & > button:focus":{color:s.colors.red}})),Te=x("span",{target:"e45nyo11"})(({theme:s})=>({"& > button":{padding:s.spacing.threeXS,color:s.colors.fadedText60},"& > button:hover, & > button:focus":{color:s.colors.bodyText}})),xt=x("span",{target:"e45nyo12"})(({theme:s})=>({"& > button":{padding:s.spacing.threeXS,color:s.colors.fadedText60},"& > button:hover, & > button:focus":{color:s.colors.bodyText}})),nt=x("div",{target:"e45nyo13"})(({theme:s})=>({display:"flex",justifyContent:"center",alignItems:"center",flexGrow:0,flexShrink:1,padding:s.spacing.xs,gap:s.spacing.twoXS,marginRight:s.spacing.twoXS})),De=x("div",{target:"e45nyo14"})(({theme:s})=>({marginLeft:s.spacing.sm})),We=x(Vt,{target:"e45nyo15"})(({theme:s})=>({fontSize:s.fontSizes.sm,width:s.sizes.spinnerSize,height:s.sizes.spinnerSize,borderWidth:s.sizes.spinnerThickness,justifyContents:"center",padding:s.spacing.none,margin:s.spacing.none,borderColor:s.colors.borderColor,borderTopColor:s.colors.secondary,flexGrow:0,flexShrink:0})),Me=()=>N(Rt,{children:[v(Pt,{children:"This app would like to use your microphone."})," ",v(Re,{href:jt,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]}),ke=h.memo(Me),Oe=()=>v(Pe,{children:v(xe,{})}),Ie=h.memo(Oe),Le=4,Be=4,Ne=4,Ue=8,Fe=0,G="00:00",gt=s=>{const t=Math.floor(s/1e3),e=Math.floor(t/60),i=Math.floor(e/60),n=t%60,r=e%60,o=n.toString().padStart(2,"0"),a=r.toString().padStart(2,"0"),d=i.toString().padStart(2,"0");return e<60?`${a}:${o}`:`${d}:${a}:${o}`},_=({onClick:s,disabled:t,ariaLabel:e,iconContent:i})=>v(qt,{kind:Gt.BORDERLESS_ICON,onClick:s,disabled:t,"aria-label":e,containerWidth:!0,"data-testid":"stAudioInputActionButton",children:v(Xt,{content:i,size:"lg",color:"inherit"})}),ze=({disabled:s,stopRecording:t})=>v(Ae,{children:v(_,{onClick:t,disabled:s,ariaLabel:"Stop recording",iconContent:St})}),_e=({disabled:s,isPlaying:t,onClickPlayPause:e})=>v(xt,{children:t?v(_,{onClick:e,disabled:s,ariaLabel:"Pause",iconContent:bt}):v(_,{onClick:e,disabled:s,ariaLabel:"Play",iconContent:yt})}),$e=({disabled:s,startRecording:t})=>v(Te,{children:v(_,{onClick:t,disabled:s,ariaLabel:"Record",iconContent:vt})}),He=({onClick:s})=>v(xt,{children:v(_,{disabled:!1,onClick:s,ariaLabel:"Reset",iconContent:wt})}),Ve=({disabled:s,isRecording:t,isPlaying:e,isUploading:i,isError:n,recordingUrlExists:r,startRecording:o,stopRecording:a,onClickPlayPause:d,onClear:c})=>n?v(nt,{children:v(He,{onClick:c})}):i?v(nt,{children:v(We,{"aria-label":"Uploading"})}):N(nt,{children:[t?v(ze,{disabled:s,stopRecording:a}):v($e,{disabled:s,startRecording:o}),r&&v(_e,{disabled:s,isPlaying:e,onClickPlayPause:d})]}),je=h.memo(Ve),Ge=Yt.getLogger("convertAudioToWav");async function Xe(s){const t=new window.AudioContext,e=await s.arrayBuffer();let i;try{i=await t.decodeAudioData(e)}catch(m){Ge.error(m);return}const n=44,r=i.numberOfChannels,o=i.sampleRate,a=i.length*r*2+n,d=new ArrayBuffer(a),c=new DataView(d),l={0:{type:"string",value:"RIFF"},4:{type:"uint32",value:a-8},8:{type:"string",value:"WAVE"},12:{type:"string",value:"fmt "},16:{type:"uint32",value:16},20:{type:"uint16",value:1},22:{type:"uint16",value:r},24:{type:"uint32",value:o},28:{type:"uint32",value:o*r*2},32:{type:"uint16",value:r*2},34:{type:"uint16",value:16},36:{type:"string",value:"data"},40:{type:"uint32",value:i.length*r*2}};Object.entries(l).forEach(([m,{type:f,value:y}])=>{const g=parseInt(m,10);f==="string"?qe(c,g,y):f==="uint32"?c.setUint32(g,y,!0):f==="uint16"&&c.setUint16(g,y,!0)});let p=n;for(let m=0;m<i.length;m++)for(let f=0;f<r;f++){const y=Math.max(-1,Math.min(1,i.getChannelData(f)[m]));c.setInt16(p,y*32767,!0),p+=2}const u=new Uint8Array(d);return new Blob([u],{type:"audio/wav"})}function qe(s,t,e){for(let i=0;i<e.length;i++)s.setUint8(t+i,e.charCodeAt(i))}const Ye=()=>v(Rt,{children:v(Pt,{children:"An error has occurred, please try again."})}),Ke=h.memo(Ye),Je=({element:s,uploadClient:t,widgetMgr:e,fragmentId:i,disabled:n})=>{const r=Kt(),o=oe(r),[a,d]=h.useState(null),c=h.useRef(null),[l,p]=st({widgetMgr:e,id:s.id,key:"deleteFileUrl",defaultValue:null}),[u,m]=h.useState(null),[f,y]=h.useState([]),[g,S]=h.useState(null),[b,A]=st({widgetMgr:e,id:s.id,key:"recordingUrl",defaultValue:null}),[,R]=h.useState(0),w=()=>{R(C=>C+1)},[T,D]=h.useState(G),[k,W]=st({widgetMgr:e,id:s.id,formId:s.formId,key:"recordingTime",defaultValue:G}),[O,F]=h.useState(!1),[L,At]=h.useState(!1),[rt,Tt]=h.useState(!1),[Dt,ot]=h.useState(!1),[K,J]=h.useState(!1),at=s.id,I=s.formId,lt=h.useCallback(async C=>{ot(!0),q(I)&&e.setFormsWithUploadsInProgress(new Set([I]));let E;if(C.type==="audio/wav"?E=C:E=await Xe(C),!E){J(!0);return}const M=URL.createObjectURL(E),Bt=new Date().toISOString().slice(0,16).replace(":","-"),Nt=new File([E],`${Bt}_audio.wav`,{type:E.type});A(M),be({files:[Nt],uploadClient:t,widgetMgr:e,widgetInfo:{id:at,formId:I},fragmentId:i}).then(({successfulUploads:Ut,failedUploads:Ft})=>{if(Ft.length>0){J(!0);return}const Z=Ut[0];Z&&Z.fileUrl.deleteUrl&&p(Z.fileUrl.deleteUrl)}).finally(()=>{q(I)&&e.setFormsWithUploadsInProgress(new Set),ot(!1)})},[A,t,e,at,I,i,p]),B=h.useCallback(({updateWidgetManager:C,deleteFile:E})=>{X(a)||X(l)||(A(null),a.empty(),E&&t.deleteFile(l),p(null),D(G),W(G),C&&e.setFileUploaderStateValue(s,{},{fromUi:!0},i),F(!1),q(b)&&URL.revokeObjectURL(b))},[l,b,t,a,s,e,i,W,A,p]);h.useEffect(()=>{if(X(I))return;const C=new ne;return C.manageFormClearListener(e,I,()=>B({updateWidgetManager:!0,deleteFile:!1})),()=>C.disconnect()},[I,B,e]);const ct=h.useCallback(()=>{if(c.current===null)return;const C=z.create({container:c.current,waveColor:b?tt(r.colors.fadedText40,r.colors.secondaryBg):r.colors.primary,progressColor:r.colors.bodyText,height:Jt(r.sizes.largestElementHeight)-2*Le,barWidth:Be,barGap:Ne,barRadius:Ue,cursorWidth:Fe,url:b??void 0});C.on("timeupdate",M=>{D(gt(M*1e3))}),C.on("pause",()=>{w()});const E=C.registerPlugin(Y.create({scrollingWaveform:!1,renderRecordedAudio:!0}));return E.on("record-end",M=>{lt(M)}),E.on("record-progress",M=>{W(gt(M))}),d(C),m(E),()=>{C&&C.destroy(),E&&E.destroy()}},[lt]);h.useEffect(()=>ct(),[ct]),h.useEffect(()=>{Qt(o,r)||a?.setOptions({waveColor:b?tt(r.colors.fadedText40,r.colors.secondaryBg):r.colors.primary,progressColor:r.colors.bodyText})},[r,o,b,a]);const Wt=h.useCallback(()=>{a&&(a.playPause(),F(!0),w())},[a]),Mt=h.useCallback(async()=>{let C=g;rt||(await navigator.mediaDevices.getUserMedia({audio:!0}).then(()=>Y.getAvailableAudioDevices().then(E=>{if(y(E),E.length>0){const{deviceId:M}=E[0];S(M),C=M}})).catch(E=>{At(!0)}),Tt(!0)),!(!u||!C||!a)&&(a.setOptions({waveColor:r.colors.primary}),b&&B({updateWidgetManager:!1,deleteFile:!0}),u.startRecording({deviceId:C}).then(()=>{w()}))},[g,u,r,a,b,B,rt]),kt=h.useCallback(()=>{u&&(u.stopRecording(),a?.setOptions({waveColor:tt(r.colors.fadedText40,r.colors.secondaryBg)}))},[u,a,r]),Ot=ye(b,"recording.wav"),Q=!!u?.isRecording(),dt=!!a?.isPlaying(),It=Q||dt,ht=!Q&&!b&&!L,Lt=L||ht||K;return N(we,{className:"stAudioInput","data-testid":"stAudioInput",children:[v(ie,{label:s.label,disabled:n,labelVisibility:Zt(s.labelVisibility?.value),children:s.help&&v(De,{children:v(te,{content:s.help,placement:ee.TOP})})}),N(ft,{children:[N(re,{isFullScreen:!1,disableFullscreenMode:!0,target:ft,children:[b&&v(pt,{label:"Download as WAV",icon:le,onClick:()=>Ot()}),l&&v(pt,{label:"Clear recording",icon:ce,onClick:()=>B({updateWidgetManager:!0,deleteFile:!0})})]}),v(je,{isRecording:Q,isPlaying:dt,isUploading:Dt,isError:K,recordingUrlExists:!!b,startRecording:Mt,stopRecording:kt,onClickPlayPause:Wt,onClear:()=>{B({updateWidgetManager:!1,deleteFile:!0}),J(!1)},disabled:n||L}),N(Se,{children:[K&&v(Ke,{}),ht&&v(Ie,{}),L&&v(ke,{}),v(Ce,{"data-testid":"stAudioInputWaveSurfer",ref:c,show:!Lt})]}),v(Ee,{isPlayingOrRecording:It,"data-testid":"stAudioInputWaveformTimeCode",children:O?T:k})]})]})},ri=h.memo(Je);export{ri as default};