From 0a68a242970df60fcee28ba21ff3171e6a803056 Mon Sep 17 00:00:00 2001 From: serjonya-trili Date: Sun, 26 May 2024 22:01:15 +0000 Subject: [PATCH] deploy: 9f32ca010026623ca4f4208d653cb4f2bcd68ddc --- assets/{DailyMotion-CteX4E3j.js => DailyMotion-psE6EPNS.js} | 2 +- assets/{Facebook-DXJhKi1H.js => Facebook-BCodjFGZ.js} | 2 +- assets/{FilePlayer-l0jhCgoe.js => FilePlayer-zPq4b6iW.js} | 2 +- assets/{Kaltura-Kwks3p2E.js => Kaltura-DnjjUfug.js} | 2 +- assets/{Mixcloud-BcC5g1Wh.js => Mixcloud-Clr1DSie.js} | 2 +- assets/{Mux-BMhgBc2q.js => Mux-CzqAh8mF.js} | 2 +- assets/{Preview-jzdirRGw.js => Preview-BnlASUAm.js} | 2 +- assets/{SoundCloud-DyFw8PPp.js => SoundCloud-B6VMkdza.js} | 2 +- assets/{Streamable-EfsHeeCs.js => Streamable-BilJxTCo.js} | 2 +- assets/{Twitch-T6QqMvoo.js => Twitch-DaMRzaQ-.js} | 2 +- assets/{Vidyard-CsuXaKoc.js => Vidyard-Cd1bhxMy.js} | 2 +- assets/{Vimeo-OM6omvoU.js => Vimeo-CeCS8etw.js} | 2 +- assets/{Wistia-Bl5F6sjb.js => Wistia-B44VEAYA.js} | 2 +- assets/{YouTube-rN4jOR1J.js => YouTube-BPBIdu0x.js} | 2 +- assets/{index-DoBafr3Z.js => index-WzDQ4oNm.js} | 6 +++--- index.html | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) rename assets/{DailyMotion-CteX4E3j.js => DailyMotion-psE6EPNS.js} (97%) rename assets/{Facebook-DXJhKi1H.js => Facebook-BCodjFGZ.js} (98%) rename assets/{FilePlayer-l0jhCgoe.js => FilePlayer-zPq4b6iW.js} (99%) rename assets/{Kaltura-Kwks3p2E.js => Kaltura-DnjjUfug.js} (97%) rename assets/{Mixcloud-BcC5g1Wh.js => Mixcloud-Clr1DSie.js} (97%) rename assets/{Mux-BMhgBc2q.js => Mux-CzqAh8mF.js} (98%) rename assets/{Preview-jzdirRGw.js => Preview-BnlASUAm.js} (97%) rename assets/{SoundCloud-DyFw8PPp.js => SoundCloud-B6VMkdza.js} (97%) rename assets/{Streamable-EfsHeeCs.js => Streamable-BilJxTCo.js} (97%) rename assets/{Twitch-T6QqMvoo.js => Twitch-DaMRzaQ-.js} (97%) rename assets/{Vidyard-CsuXaKoc.js => Vidyard-Cd1bhxMy.js} (97%) rename assets/{Vimeo-OM6omvoU.js => Vimeo-CeCS8etw.js} (98%) rename assets/{Wistia-Bl5F6sjb.js => Wistia-B44VEAYA.js} (98%) rename assets/{YouTube-rN4jOR1J.js => YouTube-BPBIdu0x.js} (98%) rename assets/{index-DoBafr3Z.js => index-WzDQ4oNm.js} (98%) diff --git a/assets/DailyMotion-CteX4E3j.js b/assets/DailyMotion-psE6EPNS.js similarity index 97% rename from assets/DailyMotion-CteX4E3j.js rename to assets/DailyMotion-psE6EPNS.js index 49b54476f8..0f8385a5d9 100644 --- a/assets/DailyMotion-CteX4E3j.js +++ b/assets/DailyMotion-psE6EPNS.js @@ -1 +1 @@ -import{g as P,r as v,u as D,p as O}from"./index-DoBafr3Z.js";function b(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?M(j(t)):{},h(!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};A(d,{default:()=>p});var _=C(d),c=L(v),l=D,f=O;const N="https://api.dmcdn.net/all.js",x="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(N,x,K,u=>u.player).then(u=>{if(!this.container)return;const g=u.player;this.player=new g(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:m=>a(m)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),I=b({__proto__:null,default:R},[_]);export{I as D}; +import{g as P,r as v,u as D,p as O}from"./index-WzDQ4oNm.js";function b(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?M(j(t)):{},h(!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};A(d,{default:()=>p});var _=C(d),c=L(v),l=D,f=O;const N="https://api.dmcdn.net/all.js",x="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(N,x,K,u=>u.player).then(u=>{if(!this.container)return;const g=u.player;this.player=new g(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:m=>a(m)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),I=b({__proto__:null,default:R},[_]);export{I as D}; diff --git a/assets/Facebook-DXJhKi1H.js b/assets/Facebook-BCodjFGZ.js similarity index 98% rename from assets/Facebook-DXJhKi1H.js rename to assets/Facebook-BCodjFGZ.js index 00b5f9f9fa..1351b48e07 100644 --- a/assets/Facebook-DXJhKi1H.js +++ b/assets/Facebook-BCodjFGZ.js @@ -1 +1 @@ -import{g as _,r as g,u as P,p as m}from"./index-DoBafr3Z.js";function v(t,e){for(var r=0;ra[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",y="FB",f="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,y,f).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,y,f).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",x.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),B=v({__proto__:null,default:M},[d]);export{B as F}; +import{g as _,r as g,u as P,p as m}from"./index-WzDQ4oNm.js";function v(t,e){for(var r=0;ra[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",y="FB",f="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,y,f).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,y,f).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",x.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),B=v({__proto__:null,default:M},[d]);export{B as F}; diff --git a/assets/FilePlayer-l0jhCgoe.js b/assets/FilePlayer-zPq4b6iW.js similarity index 99% rename from assets/FilePlayer-l0jhCgoe.js rename to assets/FilePlayer-zPq4b6iW.js index 0a6ebe5a01..5c5fe9197e 100644 --- a/assets/FilePlayer-l0jhCgoe.js +++ b/assets/FilePlayer-zPq4b6iW.js @@ -1 +1 @@ -import{g as b,r as _,u as O,p as A}from"./index-DoBafr3Z.js";function R(s,e){for(var t=0;ti[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),d=j(_),a=O,c=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends d.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?d.default.createElement("source",{key:t,src:e}):d.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>d.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:c.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:c.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return c.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return c.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return d.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",c.canPlay.file);const z=b(g),J=R({__proto__:null,default:z},[g]);export{J as F}; +import{g as b,r as _,u as O,p as A}from"./index-WzDQ4oNm.js";function R(s,e){for(var t=0;ti[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),d=j(_),a=O,c=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends d.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?d.default.createElement("source",{key:t,src:e}):d.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>d.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:c.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:c.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return c.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return c.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return d.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",c.canPlay.file);const z=b(g),J=R({__proto__:null,default:z},[g]);export{J as F}; diff --git a/assets/Kaltura-Kwks3p2E.js b/assets/Kaltura-DnjjUfug.js similarity index 97% rename from assets/Kaltura-Kwks3p2E.js rename to assets/Kaltura-DnjjUfug.js index 0a8cc2e9c4..c9c951cc5b 100644 --- a/assets/Kaltura-Kwks3p2E.js +++ b/assets/Kaltura-DnjjUfug.js @@ -1 +1 @@ -import{g as y,r as f,u as _,p as m}from"./index-DoBafr3Z.js";function P(r,e){for(var t=0;to[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(o=b(e,a))||o.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),s=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),d={};L(d,{default:()=>i});var h=D(d),u=K(f),p=_,M=m;const S="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends u.Component{constructor(){super(...arguments),s(this,"callPlayer",p.callPlayer),s(this,"duration",null),s(this,"currentTime",null),s(this,"secondsLoaded",null),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unmute")}),s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(S,T).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:o,seconds:a})=>{this.duration=o,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}s(i,"displayName","Kaltura");s(i,"canPlay",M.canPlay.kaltura);const E=y(h),N=P({__proto__:null,default:E},[h]);export{N as K}; +import{g as y,r as f,u as _,p as m}from"./index-WzDQ4oNm.js";function P(r,e){for(var t=0;to[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(o=b(e,a))||o.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),s=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),d={};L(d,{default:()=>i});var h=D(d),u=K(f),p=_,M=m;const S="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends u.Component{constructor(){super(...arguments),s(this,"callPlayer",p.callPlayer),s(this,"duration",null),s(this,"currentTime",null),s(this,"secondsLoaded",null),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unmute")}),s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(S,T).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:o,seconds:a})=>{this.duration=o,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}s(i,"displayName","Kaltura");s(i,"canPlay",M.canPlay.kaltura);const E=y(h),N=P({__proto__:null,default:E},[h]);export{N as K}; diff --git a/assets/Mixcloud-BcC5g1Wh.js b/assets/Mixcloud-Clr1DSie.js similarity index 97% rename from assets/Mixcloud-BcC5g1Wh.js rename to assets/Mixcloud-Clr1DSie.js index 762cf12669..3041f94727 100644 --- a/assets/Mixcloud-BcC5g1Wh.js +++ b/assets/Mixcloud-Clr1DSie.js @@ -1 +1 @@ -import{g as _,r as f,u as m,p as g}from"./index-DoBafr3Z.js";function v(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),p=D(f),u=m,y=g;const E="https://widget.mixcloud.com/media/js/widgetApi.js",L="Mixcloud";class l extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",u.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,L).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,u.queryString)({...r.options,feed:`/${s}/`});return p.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),N=v({__proto__:null,default:T},[h]);export{N as M}; +import{g as _,r as f,u as m,p as g}from"./index-WzDQ4oNm.js";function v(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),p=D(f),u=m,y=g;const E="https://widget.mixcloud.com/media/js/widgetApi.js",L="Mixcloud";class l extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",u.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,L).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,u.queryString)({...r.options,feed:`/${s}/`});return p.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),N=v({__proto__:null,default:T},[h]);export{N as M}; diff --git a/assets/Mux-BMhgBc2q.js b/assets/Mux-CzqAh8mF.js similarity index 98% rename from assets/Mux-BMhgBc2q.js rename to assets/Mux-CzqAh8mF.js index 9b1cbf02e8..cf5d2b22dd 100644 --- a/assets/Mux-BMhgBc2q.js +++ b/assets/Mux-CzqAh8mF.js @@ -1 +1 @@ -import{g as P,_ as E,r as g,p as _}from"./index-DoBafr3Z.js";function b(r,e){for(var t=0;ti[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var L=Object.create,u=Object.defineProperty,I=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,O=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,M=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,R=(r,e)=>{for(var t in e)u(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of k(e))!x.call(r,s)&&s!==t&&u(r,s,{get:()=>e[s],enumerable:!(i=I(e,s))||i.enumerable});return r},w=(r,e,t)=>(t=r!=null?L(O(r)):{},f(!r||!r.__esModule?u(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>f(u({},"__esModule",{value:!0}),r),n=(r,e,t)=>(M(r,typeof e!="symbol"?e+"":e,t),t),y={};R(y,{default:()=>l});var m=D(y),v=w(g),p=_;const j="https://cdn.jsdelivr.net/npm/@mux/mux-player@VERSION/dist/mux-player.mjs";class l extends v.Component{constructor(){super(...arguments),n(this,"onReady",(...e)=>this.props.onReady(...e)),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),n(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onError",(...e)=>this.props.onError(...e)),n(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),n(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),n(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.player.muted=!0}),n(this,"unmute",()=>{this.player.muted=!1}),n(this,"ref",e=>{this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getPlaybackId(this.props.url);e&&(this.player.playbackId=e)}componentWillUnmount(){this.player.playbackId=null,this.removeListeners(this.player)}addListeners(e){const{playsinline:t}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),e.addEventListener("canplay",this.onReady),t&&e.setAttribute("playsinline","")}removeListeners(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("canplay",this.onReady)}async load(e){var t;const{onError:i,config:s}=this.props;if(!((t=globalThis.customElements)!=null&&t.get("mux-player")))try{const a=j.replace("VERSION",s.version);await E(()=>import(`${a}`),[],import.meta.url),this.props.onLoaded()}catch(a){i(a)}const[,o]=e.match(p.MATCH_URL_MUX);this.player.playbackId=o}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.playbackId=null}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getPlaybackId(e){const[,t]=e.match(p.MATCH_URL_MUX);return t}render(){const{url:e,playing:t,loop:i,controls:s,muted:o,config:a,width:h,height:c}=this.props,d={width:h==="auto"?h:"100%",height:c==="auto"?c:"100%"};return s===!1&&(d["--controls"]="none"),v.default.createElement("mux-player",{ref:this.ref,"playback-id":this.getPlaybackId(e),style:d,preload:"auto",autoPlay:t||void 0,muted:o?"":void 0,loop:i?"":void 0,...a.attributes})}}n(l,"displayName","Mux");n(l,"canPlay",p.canPlay.mux);const C=P(m),B=b({__proto__:null,default:C},[m]);export{B as M}; +import{g as P,_ as E,r as g,p as _}from"./index-WzDQ4oNm.js";function b(r,e){for(var t=0;ti[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var L=Object.create,u=Object.defineProperty,I=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,O=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,M=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,R=(r,e)=>{for(var t in e)u(r,t,{get:e[t],enumerable:!0})},f=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of k(e))!x.call(r,s)&&s!==t&&u(r,s,{get:()=>e[s],enumerable:!(i=I(e,s))||i.enumerable});return r},w=(r,e,t)=>(t=r!=null?L(O(r)):{},f(!r||!r.__esModule?u(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>f(u({},"__esModule",{value:!0}),r),n=(r,e,t)=>(M(r,typeof e!="symbol"?e+"":e,t),t),y={};R(y,{default:()=>l});var m=D(y),v=w(g),p=_;const j="https://cdn.jsdelivr.net/npm/@mux/mux-player@VERSION/dist/mux-player.mjs";class l extends v.Component{constructor(){super(...arguments),n(this,"onReady",(...e)=>this.props.onReady(...e)),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),n(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onError",(...e)=>this.props.onError(...e)),n(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),n(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),n(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.player.muted=!0}),n(this,"unmute",()=>{this.player.muted=!1}),n(this,"ref",e=>{this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getPlaybackId(this.props.url);e&&(this.player.playbackId=e)}componentWillUnmount(){this.player.playbackId=null,this.removeListeners(this.player)}addListeners(e){const{playsinline:t}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),e.addEventListener("canplay",this.onReady),t&&e.setAttribute("playsinline","")}removeListeners(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("canplay",this.onReady)}async load(e){var t;const{onError:i,config:s}=this.props;if(!((t=globalThis.customElements)!=null&&t.get("mux-player")))try{const a=j.replace("VERSION",s.version);await E(()=>import(`${a}`),[],import.meta.url),this.props.onLoaded()}catch(a){i(a)}const[,o]=e.match(p.MATCH_URL_MUX);this.player.playbackId=o}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.playbackId=null}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getPlaybackId(e){const[,t]=e.match(p.MATCH_URL_MUX);return t}render(){const{url:e,playing:t,loop:i,controls:s,muted:o,config:a,width:h,height:c}=this.props,d={width:h==="auto"?h:"100%",height:c==="auto"?c:"100%"};return s===!1&&(d["--controls"]="none"),v.default.createElement("mux-player",{ref:this.ref,"playback-id":this.getPlaybackId(e),style:d,preload:"auto",autoPlay:t||void 0,muted:o?"":void 0,loop:i?"":void 0,...a.attributes})}}n(l,"displayName","Mux");n(l,"canPlay",p.canPlay.mux);const C=P(m),B=b({__proto__:null,default:C},[m]);export{B as M}; diff --git a/assets/Preview-jzdirRGw.js b/assets/Preview-BnlASUAm.js similarity index 97% rename from assets/Preview-jzdirRGw.js rename to assets/Preview-BnlASUAm.js index e3ec7c043c..3ebe93d86c 100644 --- a/assets/Preview-jzdirRGw.js +++ b/assets/Preview-BnlASUAm.js @@ -1 +1 @@ -import{g as y,r as v}from"./index-DoBafr3Z.js";function w(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,s=Object.defineProperty,O=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,I=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,E=(r,e,t)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,S=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},_=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of x(e))!j.call(r,a)&&a!==t&&s(r,a,{get:()=>e[a],enumerable:!(n=O(e,a))||n.enumerable});return r},C=(r,e,t)=>(t=r!=null?P(I(r)):{},_(!r||!r.__esModule?s(t,"default",{value:r,enumerable:!0}):t,r)),N=r=>_(s({},"__esModule",{value:!0}),r),p=(r,e,t)=>(E(r,typeof e!="symbol"?e+"":e,t),t),g={};S(g,{default:()=>k});var m=N(g),i=C(v);const u="64px",d={};class k extends i.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!i.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a,previewAriaLabel:o}=this.props,{image:f}=this.state,l=i.default.isValidElement(e),h={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:f&&!l?`url(${f})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...h},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...h},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},b=i.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},i.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return i.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress,...o?{"aria-label":o}:{}},l?e:null,n||b)}}const D=y(m),A=w({__proto__:null,default:D},[m]);export{A as P}; +import{g as y,r as v}from"./index-WzDQ4oNm.js";function w(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,s=Object.defineProperty,O=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,I=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,E=(r,e,t)=>e in r?s(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,S=(r,e)=>{for(var t in e)s(r,t,{get:e[t],enumerable:!0})},_=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of x(e))!j.call(r,a)&&a!==t&&s(r,a,{get:()=>e[a],enumerable:!(n=O(e,a))||n.enumerable});return r},C=(r,e,t)=>(t=r!=null?P(I(r)):{},_(!r||!r.__esModule?s(t,"default",{value:r,enumerable:!0}):t,r)),N=r=>_(s({},"__esModule",{value:!0}),r),p=(r,e,t)=>(E(r,typeof e!="symbol"?e+"":e,t),t),g={};S(g,{default:()=>k});var m=N(g),i=C(v);const u="64px",d={};class k extends i.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!i.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a,previewAriaLabel:o}=this.props,{image:f}=this.state,l=i.default.isValidElement(e),h={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:f&&!l?`url(${f})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...h},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...h},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},b=i.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},i.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return i.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress,...o?{"aria-label":o}:{}},l?e:null,n||b)}}const D=y(m),A=w({__proto__:null,default:D},[m]);export{A as P}; diff --git a/assets/SoundCloud-DyFw8PPp.js b/assets/SoundCloud-B6VMkdza.js similarity index 97% rename from assets/SoundCloud-DyFw8PPp.js rename to assets/SoundCloud-B6VMkdza.js index 1755fdd117..581e72c32a 100644 --- a/assets/SoundCloud-DyFw8PPp.js +++ b/assets/SoundCloud-B6VMkdza.js @@ -1 +1 @@ -import{g as P,r as g,u as b,p as v}from"./index-DoBafr3Z.js";function O(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},M=(t,e,r)=>(r=t!=null?S(C(t)):{},d(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=R(h),p=M(g),c=b,T=v;const N="https://w.soundcloud.com/player/api.js",x="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(N,x).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",T.canPlay.soundcloud);a(u,"loopOnEnded",!0);const A=P(f),F=O({__proto__:null,default:A},[f]);export{F as S}; +import{g as P,r as g,u as b,p as v}from"./index-WzDQ4oNm.js";function O(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},M=(t,e,r)=>(r=t!=null?S(C(t)):{},d(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=R(h),p=M(g),c=b,T=v;const N="https://w.soundcloud.com/player/api.js",x="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(N,x).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",T.canPlay.soundcloud);a(u,"loopOnEnded",!0);const A=P(f),F=O({__proto__:null,default:A},[f]);export{F as S}; diff --git a/assets/Streamable-EfsHeeCs.js b/assets/Streamable-BilJxTCo.js similarity index 97% rename from assets/Streamable-EfsHeeCs.js rename to assets/Streamable-BilJxTCo.js index 8788b075a9..8736a4ad59 100644 --- a/assets/Streamable-EfsHeeCs.js +++ b/assets/Streamable-BilJxTCo.js @@ -1 +1 @@ -import{g as m,r as f,u as _,p as b}from"./index-DoBafr3Z.js";function P(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,L=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!j.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},M=(t,e,r)=>(r=t!=null?g(S(t)):{},c(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),D=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(L(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=D(h),p=M(f),u=_,d=b;const E="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),C=P({__proto__:null,default:x},[y]);export{C as S}; +import{g as m,r as f,u as _,p as b}from"./index-WzDQ4oNm.js";function P(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,L=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!j.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},M=(t,e,r)=>(r=t!=null?g(S(t)):{},c(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),D=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(L(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=D(h),p=M(f),u=_,d=b;const E="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(E,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),C=P({__proto__:null,default:x},[y]);export{C as S}; diff --git a/assets/Twitch-T6QqMvoo.js b/assets/Twitch-DaMRzaQ-.js similarity index 97% rename from assets/Twitch-T6QqMvoo.js rename to assets/Twitch-DaMRzaQ-.js index 39b0c2fc0e..e7e4806896 100644 --- a/assets/Twitch-T6QqMvoo.js +++ b/assets/Twitch-DaMRzaQ-.js @@ -1 +1 @@ -import{g as w,r as D,u as C,p as N}from"./index-DoBafr3Z.js";function I(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,l=Object.defineProperty,S=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,A=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of j(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=S(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?M(A(t)):{},_(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),y=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends y.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),o(this,"mute",()=>{this.callPlayer("setMuted",!0)}),o(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:n,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(d=>{this.player=new d.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...n.options});const{READY:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=d.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return y.default.createElement("div",{style:e,id:this.playerID})}}o(h,"displayName","Twitch");o(h,"canPlay",u.canPlay.twitch);o(h,"loopOnEnded",!0);const W=w(f),G=I({__proto__:null,default:W},[f]);export{G as T}; +import{g as w,r as D,u as C,p as N}from"./index-WzDQ4oNm.js";function I(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,l=Object.defineProperty,S=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,A=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of j(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=S(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?M(A(t)):{},_(!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),y=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends y.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),o(this,"mute",()=>{this.callPlayer("setMuted",!0)}),o(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:n,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(d=>{this.player=new d.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...n.options});const{READY:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=d.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return y.default.createElement("div",{style:e,id:this.playerID})}}o(h,"displayName","Twitch");o(h,"canPlay",u.canPlay.twitch);o(h,"loopOnEnded",!0);const W=w(f),G=I({__proto__:null,default:W},[f]);export{G as T}; diff --git a/assets/Vidyard-CsuXaKoc.js b/assets/Vidyard-Cd1bhxMy.js similarity index 97% rename from assets/Vidyard-CsuXaKoc.js rename to assets/Vidyard-Cd1bhxMy.js index ac73cf93a7..d444e449ac 100644 --- a/assets/Vidyard-CsuXaKoc.js +++ b/assets/Vidyard-Cd1bhxMy.js @@ -1 +1 @@ -import{g as m,r as v,u as b,p as O}from"./index-DoBafr3Z.js";function V(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},L=(t,e,r)=>(r=t!=null?D(S(t)):{},h(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),o(this,"callPlayer",d.callPlayer),o(this,"mute",()=>{this.setVolume(0)}),o(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:s,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,g)=>{this.player||(this.player=g,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...s.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}o(y,"displayName","Vidyard");o(y,"canPlay",P.canPlay.vidyard);const T=m(f),K=V({__proto__:null,default:T},[f]);export{K as V}; +import{g as m,r as v,u as b,p as O}from"./index-WzDQ4oNm.js";function V(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},L=(t,e,r)=>(r=t!=null?D(S(t)):{},h(!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),o(this,"callPlayer",d.callPlayer),o(this,"mute",()=>{this.setVolume(0)}),o(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:s,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,g)=>{this.player||(this.player=g,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...s.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}o(y,"displayName","Vidyard");o(y,"canPlay",P.canPlay.vidyard);const T=m(f),K=V({__proto__:null,default:T},[f]);export{K as V}; diff --git a/assets/Vimeo-OM6omvoU.js b/assets/Vimeo-CeCS8etw.js similarity index 98% rename from assets/Vimeo-OM6omvoU.js rename to assets/Vimeo-CeCS8etw.js index 2fc663bef2..9ec52f1bd7 100644 --- a/assets/Vimeo-OM6omvoU.js +++ b/assets/Vimeo-CeCS8etw.js @@ -1 +1 @@ -import{g as d,r as f,u as m,p as _}from"./index-DoBafr3Z.js";function P(t,e){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},j=(t,e,r)=>(r=t!=null?g(O(t)):{},h(!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};M(c,{default:()=>l});var y=E(c),p=j(f),u=m,L=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",L.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),C=P({__proto__:null,default:T},[y]);export{C as V}; +import{g as d,r as f,u as m,p as _}from"./index-WzDQ4oNm.js";function P(t,e){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},j=(t,e,r)=>(r=t!=null?g(O(t)):{},h(!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};M(c,{default:()=>l});var y=E(c),p=j(f),u=m,L=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",L.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),C=P({__proto__:null,default:T},[y]);export{C as V}; diff --git a/assets/Wistia-Bl5F6sjb.js b/assets/Wistia-B44VEAYA.js similarity index 98% rename from assets/Wistia-Bl5F6sjb.js rename to assets/Wistia-B44VEAYA.js index 9aa31cf5c9..7e42330262 100644 --- a/assets/Wistia-Bl5F6sjb.js +++ b/assets/Wistia-B44VEAYA.js @@ -1 +1 @@ -import{g,r as m,u as v,p as w}from"./index-DoBafr3Z.js";function O(t,e){for(var a=0;as[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),M=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=M(d),y=I(m),c=v,P=w;const W="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(W,x).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const L=g(_),T=O({__proto__:null,default:L},[_]);export{T as W}; +import{g,r as m,u as v,p as w}from"./index-WzDQ4oNm.js";function O(t,e){for(var a=0;as[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),M=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=M(d),y=I(m),c=v,P=w;const W="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(W,x).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const L=g(_),T=O({__proto__:null,default:L},[_]);export{T as W}; diff --git a/assets/YouTube-rN4jOR1J.js b/assets/YouTube-BPBIdu0x.js similarity index 98% rename from assets/YouTube-rN4jOR1J.js rename to assets/YouTube-BPBIdu0x.js index 3ceba77417..46c631ff1f 100644 --- a/assets/YouTube-rN4jOR1J.js +++ b/assets/YouTube-BPBIdu0x.js @@ -1 +1 @@ -import{g as U,r as I,u as L,p as M}from"./index-DoBafr3Z.js";function Y(a,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var k=Object.create,u=Object.defineProperty,N=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of j(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=N(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?k(V(a)):{},v(!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),b=F(I),p=L,D=M;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends b.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(m.test(e)){const[,t]=e.match(m);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:c,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===c&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const R=!!this.callPlayer("getPlaylist");y&&!R&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||m.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||l.start,endSeconds:(0,p.parseEndTime)(e)||l.end});return}(0,p.getSDK)(G,T,z,c=>c.loaded).then(c=>{this.container&&(this.player=new c.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return b.default.createElement("div",{style:t},b.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),q=Y({__proto__:null,default:$},[S]);export{q as Y}; +import{g as U,r as I,u as L,p as M}from"./index-WzDQ4oNm.js";function Y(a,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var k=Object.create,u=Object.defineProperty,N=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of j(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=N(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?k(V(a)):{},v(!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),b=F(I),p=L,D=M;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends b.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(m.test(e)){const[,t]=e.match(m);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:c,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===c&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const R=!!this.callPlayer("getPlaylist");y&&!R&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||m.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||l.start,endSeconds:(0,p.parseEndTime)(e)||l.end});return}(0,p.getSDK)(G,T,z,c=>c.loaded).then(c=>{this.container&&(this.player=new c.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return b.default.createElement("div",{style:t},b.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),q=Y({__proto__:null,default:$},[S]);export{q as Y}; diff --git a/assets/index-DoBafr3Z.js b/assets/index-WzDQ4oNm.js similarity index 98% rename from assets/index-DoBafr3Z.js rename to assets/index-WzDQ4oNm.js index a6e5201951..7022542d65 100644 --- a/assets/index-DoBafr3Z.js +++ b/assets/index-WzDQ4oNm.js @@ -533,12 +533,12 @@ Please pass a 2048 word array explicitly.`;function normalize(_){return(_||"").n `)},getCurrentUseCounter=function(){var _=parseInt(document.body.getAttribute(lockAttribute)||"0",10);return isFinite(_)?_:0},useLockAttribute=function(){reactExports.useEffect(function(){return document.body.setAttribute(lockAttribute,(getCurrentUseCounter()+1).toString()),function(){var _=getCurrentUseCounter()-1;_<=0?document.body.removeAttribute(lockAttribute):document.body.setAttribute(lockAttribute,_.toString())}},[])},RemoveScrollBar=function(_){var a=_.noRelative,$=_.noImportant,j=_.gapMode,et=j===void 0?"margin":j;useLockAttribute();var tt=reactExports.useMemo(function(){return getGapWidth(et)},[et]);return reactExports.createElement(Style,{styles:getStyles(tt,!a,et,$?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(_){return _.tagName==="TEXTAREA"},elementCanBeScrolled=function(_,a){if(!(_ instanceof Element))return!1;var $=window.getComputedStyle(_);return $[a]!=="hidden"&&!($.overflowY===$.overflowX&&!alwaysContainsScroll(_)&&$[a]==="visible")},elementCouldBeVScrolled=function(_){return elementCanBeScrolled(_,"overflowY")},elementCouldBeHScrolled=function(_){return elementCanBeScrolled(_,"overflowX")},locationCouldBeScrolled=function(_,a){var $=a.ownerDocument,j=a;do{typeof ShadowRoot<"u"&&j instanceof ShadowRoot&&(j=j.host);var et=elementCouldBeScrolled(_,j);if(et){var tt=getScrollVariables(_,j),rt=tt[1],nt=tt[2];if(rt>nt)return!0}j=j.parentNode}while(j&&j!==$.body);return!1},getVScrollVariables=function(_){var a=_.scrollTop,$=_.scrollHeight,j=_.clientHeight;return[a,$,j]},getHScrollVariables=function(_){var a=_.scrollLeft,$=_.scrollWidth,j=_.clientWidth;return[a,$,j]},elementCouldBeScrolled=function(_,a){return _==="v"?elementCouldBeVScrolled(a):elementCouldBeHScrolled(a)},getScrollVariables=function(_,a){return _==="v"?getVScrollVariables(a):getHScrollVariables(a)},getDirectionFactor=function(_,a){return _==="h"&&a==="rtl"?-1:1},handleScroll=function(_,a,$,j,et){var tt=getDirectionFactor(_,window.getComputedStyle(a).direction),rt=tt*j,nt=$.target,it=a.contains(nt),at=!1,st=rt>0,ot=0,ut=0;do{var dt=getScrollVariables(_,nt),mt=dt[0],xt=dt[1],Ct=dt[2],Pt=xt-Ct-tt*mt;(mt||Pt)&&elementCouldBeScrolled(_,nt)&&(ot+=Pt,ut+=mt),nt instanceof ShadowRoot?nt=nt.host:nt=nt.parentNode}while(!it&&nt!==document.body||it&&(a.contains(nt)||a===nt));return(st&&(Math.abs(ot)<1||!et)||!st&&(Math.abs(ut)<1||!et))&&(at=!0),at},getTouchXY=function(_){return"changedTouches"in _?[_.changedTouches[0].clientX,_.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(_){return[_.deltaX,_.deltaY]},extractRef=function(_){return _&&"current"in _?_.current:_},deltaCompare=function(_,a){return _[0]===a[0]&&_[1]===a[1]},generateStyle=function(_){return` .block-interactivity-`.concat(_,` {pointer-events: none;} .allow-interactivity-`).concat(_,` {pointer-events: all;} -`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(_){var a=reactExports.useRef([]),$=reactExports.useRef([0,0]),j=reactExports.useRef(),et=reactExports.useState(idCounter++)[0],tt=reactExports.useState(styleSingleton)[0],rt=reactExports.useRef(_);reactExports.useEffect(function(){rt.current=_},[_]),reactExports.useEffect(function(){if(_.inert){document.body.classList.add("block-interactivity-".concat(et));var xt=__spreadArray([_.lockRef.current],(_.shards||[]).map(extractRef),!0).filter(Boolean);return xt.forEach(function(Ct){return Ct.classList.add("allow-interactivity-".concat(et))}),function(){document.body.classList.remove("block-interactivity-".concat(et)),xt.forEach(function(Ct){return Ct.classList.remove("allow-interactivity-".concat(et))})}}},[_.inert,_.lockRef.current,_.shards]);var nt=reactExports.useCallback(function(xt,Ct){if("touches"in xt&&xt.touches.length===2)return!rt.current.allowPinchZoom;var Pt=getTouchXY(xt),Tt=$.current,kt="deltaX"in xt?xt.deltaX:Tt[0]-Pt[0],Lt="deltaY"in xt?xt.deltaY:Tt[1]-Pt[1],Nt,zt=xt.target,jt=Math.abs(kt)>Math.abs(Lt)?"h":"v";if("touches"in xt&&jt==="h"&&zt.type==="range")return!1;var Mt=locationCouldBeScrolled(jt,zt);if(!Mt)return!0;if(Mt?Nt=jt:(Nt=jt==="v"?"h":"v",Mt=locationCouldBeScrolled(jt,zt)),!Mt)return!1;if(!j.current&&"changedTouches"in xt&&(kt||Lt)&&(j.current=Nt),!Nt)return!0;var Dt=j.current||Nt;return handleScroll(Dt,Ct,xt,Dt==="h"?kt:Lt,!0)},[]),it=reactExports.useCallback(function(xt){var Ct=xt;if(!(!lockStack.length||lockStack[lockStack.length-1]!==tt)){var Pt="deltaY"in Ct?getDeltaXY(Ct):getTouchXY(Ct),Tt=a.current.filter(function(Nt){return Nt.name===Ct.type&&(Nt.target===Ct.target||Ct.target===Nt.shadowParent)&&deltaCompare(Nt.delta,Pt)})[0];if(Tt&&Tt.should){Ct.cancelable&&Ct.preventDefault();return}if(!Tt){var kt=(rt.current.shards||[]).map(extractRef).filter(Boolean).filter(function(Nt){return Nt.contains(Ct.target)}),Lt=kt.length>0?nt(Ct,kt[0]):!rt.current.noIsolation;Lt&&Ct.cancelable&&Ct.preventDefault()}}},[]),at=reactExports.useCallback(function(xt,Ct,Pt,Tt){var kt={name:xt,delta:Ct,target:Pt,should:Tt,shadowParent:getOutermostShadowParent(Pt)};a.current.push(kt),setTimeout(function(){a.current=a.current.filter(function(Lt){return Lt!==kt})},1)},[]),st=reactExports.useCallback(function(xt){$.current=getTouchXY(xt),j.current=void 0},[]),ot=reactExports.useCallback(function(xt){at(xt.type,getDeltaXY(xt),xt.target,nt(xt,_.lockRef.current))},[]),ut=reactExports.useCallback(function(xt){at(xt.type,getTouchXY(xt),xt.target,nt(xt,_.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(tt),_.setCallbacks({onScrollCapture:ot,onWheelCapture:ot,onTouchMoveCapture:ut}),document.addEventListener("wheel",it,nonPassive),document.addEventListener("touchmove",it,nonPassive),document.addEventListener("touchstart",st,nonPassive),function(){lockStack=lockStack.filter(function(xt){return xt!==tt}),document.removeEventListener("wheel",it,nonPassive),document.removeEventListener("touchmove",it,nonPassive),document.removeEventListener("touchstart",st,nonPassive)}},[]);var dt=_.removeScrollBar,mt=_.inert;return reactExports.createElement(reactExports.Fragment,null,mt?reactExports.createElement(tt,{styles:generateStyle(et)}):null,dt?reactExports.createElement(RemoveScrollBar,{gapMode:_.gapMode}):null)}function getOutermostShadowParent(_){for(var a=null;_!==null;)_ instanceof ShadowRoot&&(a=_.host,_=_.host),_=_.parentNode;return a}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(_,a){return reactExports.createElement(RemoveScroll,__assign({},_,{ref:a,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;const DynamicModalContext=reactExports.createContext({openWith:_=>Promise.resolve(),onClose:()=>{},isOpen:!1}),useDynamicModal=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1(),[j,et]=reactExports.useState(null),[tt,rt]=reactExports.useState("md");return{isOpen:_,onClose:a,openWith:async(it,at="md")=>(rt(at),et(it),$(),Promise.resolve()),content:jsxRuntimeExports.jsxs(Modal,{autoFocus:!1,blockScrollOnMount:!1,closeOnOverlayClick:!1,isCentered:!0,isOpen:_,motionPreset:localStorage.getItem("chakra-modal-motion-preset")||void 0,onClose:a,size:tt,children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(ReactRemoveScroll,{enabled:_,children:j})]})}},JsValueWrap=({value:_,space:a=2,...$})=>jsxRuntimeExports.jsx(Card,{background:colors.gray[700],borderRadius:"5px",...$,children:jsxRuntimeExports.jsx(CardBody,{children:jsxRuntimeExports.jsx("pre",{style:{whiteSpace:"pre-wrap",fontSize:"12px",lineHeight:"18px"},children:JSON.stringify(_,null,a)})})});var md5$1={exports:{}},crypt={exports:{}};(function(){var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function($,j){return $<>>32-j},rotr:function($,j){return $<<32-j|$>>>j},endian:function($){if($.constructor==Number)return a.rotl($,8)&16711935|a.rotl($,24)&4278255360;for(var j=0;j<$.length;j++)$[j]=a.endian($[j]);return $},randomBytes:function($){for(var j=[];$>0;$--)j.push(Math.floor(Math.random()*256));return j},bytesToWords:function($){for(var j=[],et=0,tt=0;et<$.length;et++,tt+=8)j[tt>>>5]|=$[et]<<24-tt%32;return j},wordsToBytes:function($){for(var j=[],et=0;et<$.length*32;et+=8)j.push($[et>>>5]>>>24-et%32&255);return j},bytesToHex:function($){for(var j=[],et=0;et<$.length;et++)j.push(($[et]>>>4).toString(16)),j.push(($[et]&15).toString(16));return j.join("")},hexToBytes:function($){for(var j=[],et=0;et<$.length;et+=2)j.push(parseInt($.substr(et,2),16));return j},bytesToBase64:function($){for(var j=[],et=0;et<$.length;et+=3)for(var tt=$[et]<<16|$[et+1]<<8|$[et+2],rt=0;rt<4;rt++)et*8+rt*6<=$.length*8?j.push(_.charAt(tt>>>6*(3-rt)&63)):j.push("=");return j.join("")},base64ToBytes:function($){$=$.replace(/[^A-Z0-9+\/]/ig,"");for(var j=[],et=0,tt=0;et<$.length;tt=++et%4)tt!=0&&j.push((_.indexOf($.charAt(et-1))&Math.pow(2,-2*tt+8)-1)<>>6-tt*2);return j}};crypt.exports=a})();var cryptExports=crypt.exports,charenc={utf8:{stringToBytes:function(_){return charenc.bin.stringToBytes(unescape(encodeURIComponent(_)))},bytesToString:function(_){return decodeURIComponent(escape(charenc.bin.bytesToString(_)))}},bin:{stringToBytes:function(_){for(var a=[],$=0;$<_.length;$++)a.push(_.charCodeAt($)&255);return a},bytesToString:function(_){for(var a=[],$=0;$<_.length;$++)a.push(String.fromCharCode(_[$]));return a.join("")}}},charenc_1=charenc;/*! +`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(_){var a=reactExports.useRef([]),$=reactExports.useRef([0,0]),j=reactExports.useRef(),et=reactExports.useState(idCounter++)[0],tt=reactExports.useState(styleSingleton)[0],rt=reactExports.useRef(_);reactExports.useEffect(function(){rt.current=_},[_]),reactExports.useEffect(function(){if(_.inert){document.body.classList.add("block-interactivity-".concat(et));var xt=__spreadArray([_.lockRef.current],(_.shards||[]).map(extractRef),!0).filter(Boolean);return xt.forEach(function(Ct){return Ct.classList.add("allow-interactivity-".concat(et))}),function(){document.body.classList.remove("block-interactivity-".concat(et)),xt.forEach(function(Ct){return Ct.classList.remove("allow-interactivity-".concat(et))})}}},[_.inert,_.lockRef.current,_.shards]);var nt=reactExports.useCallback(function(xt,Ct){if("touches"in xt&&xt.touches.length===2)return!rt.current.allowPinchZoom;var Pt=getTouchXY(xt),Tt=$.current,kt="deltaX"in xt?xt.deltaX:Tt[0]-Pt[0],Lt="deltaY"in xt?xt.deltaY:Tt[1]-Pt[1],Nt,zt=xt.target,jt=Math.abs(kt)>Math.abs(Lt)?"h":"v";if("touches"in xt&&jt==="h"&&zt.type==="range")return!1;var Mt=locationCouldBeScrolled(jt,zt);if(!Mt)return!0;if(Mt?Nt=jt:(Nt=jt==="v"?"h":"v",Mt=locationCouldBeScrolled(jt,zt)),!Mt)return!1;if(!j.current&&"changedTouches"in xt&&(kt||Lt)&&(j.current=Nt),!Nt)return!0;var Dt=j.current||Nt;return handleScroll(Dt,Ct,xt,Dt==="h"?kt:Lt,!0)},[]),it=reactExports.useCallback(function(xt){var Ct=xt;if(!(!lockStack.length||lockStack[lockStack.length-1]!==tt)){var Pt="deltaY"in Ct?getDeltaXY(Ct):getTouchXY(Ct),Tt=a.current.filter(function(Nt){return Nt.name===Ct.type&&(Nt.target===Ct.target||Ct.target===Nt.shadowParent)&&deltaCompare(Nt.delta,Pt)})[0];if(Tt&&Tt.should){Ct.cancelable&&Ct.preventDefault();return}if(!Tt){var kt=(rt.current.shards||[]).map(extractRef).filter(Boolean).filter(function(Nt){return Nt.contains(Ct.target)}),Lt=kt.length>0?nt(Ct,kt[0]):!rt.current.noIsolation;Lt&&Ct.cancelable&&Ct.preventDefault()}}},[]),at=reactExports.useCallback(function(xt,Ct,Pt,Tt){var kt={name:xt,delta:Ct,target:Pt,should:Tt,shadowParent:getOutermostShadowParent(Pt)};a.current.push(kt),setTimeout(function(){a.current=a.current.filter(function(Lt){return Lt!==kt})},1)},[]),st=reactExports.useCallback(function(xt){$.current=getTouchXY(xt),j.current=void 0},[]),ot=reactExports.useCallback(function(xt){at(xt.type,getDeltaXY(xt),xt.target,nt(xt,_.lockRef.current))},[]),ut=reactExports.useCallback(function(xt){at(xt.type,getTouchXY(xt),xt.target,nt(xt,_.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(tt),_.setCallbacks({onScrollCapture:ot,onWheelCapture:ot,onTouchMoveCapture:ut}),document.addEventListener("wheel",it,nonPassive),document.addEventListener("touchmove",it,nonPassive),document.addEventListener("touchstart",st,nonPassive),function(){lockStack=lockStack.filter(function(xt){return xt!==tt}),document.removeEventListener("wheel",it,nonPassive),document.removeEventListener("touchmove",it,nonPassive),document.removeEventListener("touchstart",st,nonPassive)}},[]);var dt=_.removeScrollBar,mt=_.inert;return reactExports.createElement(reactExports.Fragment,null,mt?reactExports.createElement(tt,{styles:generateStyle(et)}):null,dt?reactExports.createElement(RemoveScrollBar,{gapMode:_.gapMode}):null)}function getOutermostShadowParent(_){for(var a=null;_!==null;)_ instanceof ShadowRoot&&(a=_.host,_=_.host),_=_.parentNode;return a}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(_,a){return reactExports.createElement(RemoveScroll,__assign({},_,{ref:a,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;const DynamicModalContext=reactExports.createContext({openWith:_=>Promise.resolve(),onClose:()=>{},isOpen:!1}),useDynamicModal=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1(),[j,et]=reactExports.useState(null),[tt,rt]=reactExports.useState("md");return{isOpen:_,onClose:a,openWith:async(it,at="md")=>(rt(at),et(it),$(),Promise.resolve()),content:jsxRuntimeExports.jsxs(Modal,{autoFocus:!1,blockScrollOnMount:!1,closeOnOverlayClick:!1,isCentered:!0,isOpen:_,motionPreset:localStorage.getItem("chakra-modal-motion-preset")||void 0,onClose:a,size:tt,children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(ReactRemoveScroll,{enabled:_,children:j})]})}},JsValueWrap=({value:_,space:a=2,...$})=>jsxRuntimeExports.jsx(Card,{background:colors.gray[700],borderRadius:"5px",...$,children:jsxRuntimeExports.jsx(CardBody,{children:jsxRuntimeExports.jsx("pre",{style:{whiteSpace:"pre-wrap",fontSize:"12px",lineHeight:"18px"},children:JSON.stringify(_,null,a)})})}),getSuggestions=(_,a)=>a.filter($=>!_.trim()||$.name.toLowerCase().includes(_.trim().toLowerCase()));var md5$1={exports:{}},crypt={exports:{}};(function(){var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function($,j){return $<>>32-j},rotr:function($,j){return $<<32-j|$>>>j},endian:function($){if($.constructor==Number)return a.rotl($,8)&16711935|a.rotl($,24)&4278255360;for(var j=0;j<$.length;j++)$[j]=a.endian($[j]);return $},randomBytes:function($){for(var j=[];$>0;$--)j.push(Math.floor(Math.random()*256));return j},bytesToWords:function($){for(var j=[],et=0,tt=0;et<$.length;et++,tt+=8)j[tt>>>5]|=$[et]<<24-tt%32;return j},wordsToBytes:function($){for(var j=[],et=0;et<$.length*32;et+=8)j.push($[et>>>5]>>>24-et%32&255);return j},bytesToHex:function($){for(var j=[],et=0;et<$.length;et++)j.push(($[et]>>>4).toString(16)),j.push(($[et]&15).toString(16));return j.join("")},hexToBytes:function($){for(var j=[],et=0;et<$.length;et+=2)j.push(parseInt($.substr(et,2),16));return j},bytesToBase64:function($){for(var j=[],et=0;et<$.length;et+=3)for(var tt=$[et]<<16|$[et+1]<<8|$[et+2],rt=0;rt<4;rt++)et*8+rt*6<=$.length*8?j.push(_.charAt(tt>>>6*(3-rt)&63)):j.push("=");return j.join("")},base64ToBytes:function($){$=$.replace(/[^A-Z0-9+\/]/ig,"");for(var j=[],et=0,tt=0;et<$.length;tt=++et%4)tt!=0&&j.push((_.indexOf($.charAt(et-1))&Math.pow(2,-2*tt+8)-1)<>>6-tt*2);return j}};crypt.exports=a})();var cryptExports=crypt.exports,charenc={utf8:{stringToBytes:function(_){return charenc.bin.stringToBytes(unescape(encodeURIComponent(_)))},bytesToString:function(_){return decodeURIComponent(escape(charenc.bin.bytesToString(_)))}},bin:{stringToBytes:function(_){for(var a=[],$=0;$<_.length;$++)a.push(_.charCodeAt($)&255);return a},bytesToString:function(_){for(var a=[],$=0;$<_.length;$++)a.push(String.fromCharCode(_[$]));return a.join("")}}},charenc_1=charenc;/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT - */var isBuffer_1=function(_){return _!=null&&(isBuffer(_)||isSlowBuffer(_)||!!_._isBuffer)};function isBuffer(_){return!!_.constructor&&typeof _.constructor.isBuffer=="function"&&_.constructor.isBuffer(_)}function isSlowBuffer(_){return typeof _.readFloatLE=="function"&&typeof _.slice=="function"&&isBuffer(_.slice(0,0))}(function(){var _=cryptExports,a=charenc_1.utf8,$=isBuffer_1,j=charenc_1.bin,et=function(tt,rt){tt.constructor==String?rt&&rt.encoding==="binary"?tt=j.stringToBytes(tt):tt=a.stringToBytes(tt):$(tt)?tt=Array.prototype.slice.call(tt,0):!Array.isArray(tt)&&tt.constructor!==Uint8Array&&(tt=tt.toString());for(var nt=_.bytesToWords(tt),it=tt.length*8,at=1732584193,st=-271733879,ot=-1732584194,ut=271733878,dt=0;dt>>24)&16711935|(nt[dt]<<24|nt[dt]>>>8)&4278255360;nt[it>>>5]|=128<>>9<<4)+14]=it;for(var mt=et._ff,xt=et._gg,Ct=et._hh,Pt=et._ii,dt=0;dt>>0,st=st+kt>>>0,ot=ot+Lt>>>0,ut=ut+Nt>>>0}return _.endian([at,st,ot,ut])};et._ff=function(tt,rt,nt,it,at,st,ot){var ut=tt+(rt&nt|~rt&it)+(at>>>0)+ot;return(ut<>>32-st)+rt},et._gg=function(tt,rt,nt,it,at,st,ot){var ut=tt+(rt&it|nt&~it)+(at>>>0)+ot;return(ut<>>32-st)+rt},et._hh=function(tt,rt,nt,it,at,st,ot){var ut=tt+(rt^nt^it)+(at>>>0)+ot;return(ut<>>32-st)+rt},et._ii=function(tt,rt,nt,it,at,st,ot){var ut=tt+(nt^(rt|~it))+(at>>>0)+ot;return(ut<>>32-st)+rt},et._blocksize=16,et._digestsize=16,md5$1.exports=function(tt,rt){if(tt==null)throw new Error("Illegal argument "+tt);var nt=_.wordsToBytes(et(tt,rt));return rt&&rt.asBytes?nt:rt&&rt.asString?j.bytesToString(nt):_.bytesToHex(nt)}})();var md5Exports=md5$1.exports;const md5=getDefaultExportFromCjs$1(md5Exports),ReactIdenticon=React$2.memo(({count:_=5,background:a,string:$,size:j})=>{const et=reactExports.useRef(null);reactExports.useEffect(()=>{tt()});const tt=()=>{const rt=md5($),nt=Math.floor(j/_),it=rt.slice(0,6),at=et.current;at.width=nt*_,at.height=nt*_;const st=rt.split("").map(dt=>parseInt(dt,16)).map(dt=>dt<8?0:1),ot=[];ot[0]=ot[4]=st.slice(0,5),ot[1]=ot[3]=st.slice(5,10),ot[2]=st.slice(10,15);const ut=at.getContext("2d");ut.imageSmoothingEnabled=!1,ut.clearRect(0,0,at.width,at.height),ot.forEach((dt,mt)=>{dt.forEach((xt,Ct)=>{xt?(ut.fillStyle="#"+it,ut.fillRect(nt*mt,nt*Ct,nt,nt)):(ut.fillStyle=a,ut.fillRect(nt*mt,nt*Ct,nt,nt))})})};return jsxRuntimeExports.jsx("canvas",{ref:et,style:{width:j,height:j}})}),color=_=>`#${md5(_).slice(0,6)}`,Identicon=({address:_,identiconSize:a,...$})=>jsxRuntimeExports.jsx(Box,{sx:{canvas:{borderRadius:"4px"}},zIndex:3,background:"white",borderRadius:"4px","data-testid":"identicon",...$,children:jsxRuntimeExports.jsx(ReactIdenticon,{background:"white",size:a,string:_.pkh,style:{borderRadius:4}})}),SIZES$1={lg:{defaults:{width:"48px",height:"48px",borderRadius:"4px"},mnemonic:{padding:"8px",identiconSize:32},ledger:{padding:"10px"},secret_key:{padding:"8px",identiconSize:32},multisig:{padding:"10px"},social:{google:{paddingX:"10.28px",paddingY:"10px"},facebook:{padding:"9px"},twitter:{paddingX:"12.78px",paddingY:"13.5px"},reddit:{padding:"10px"},email:{padding:"10px"}}},sm:{defaults:{width:"30px",height:"30px",borderRadius:"4px"},mnemonic:{padding:"5px",identiconSize:20},ledger:{padding:"5px"},secret_key:{padding:"5px",identiconSize:20},multisig:{padding:"5px"},social:{google:{paddingX:"6.425px",paddingY:"6.25px"},facebook:{padding:"6px"},twitter:{paddingX:"7.5px",paddingY:"8px"},reddit:{padding:"6px"},email:{padding:"6px"}}}},AccountTileIcon=reactExports.memo(({account:_,size:a})=>{const $=SIZES$1[a],j=$.defaults;switch(_.type){case"secret_key":return jsxRuntimeExports.jsx(Identicon,{address:_.address,...j,...$.secret_key});case"mnemonic":return jsxRuntimeExports.jsx(Identicon,{address:_.address,...j,...$.mnemonic});case"ledger":return jsxRuntimeExports.jsx(LedgerIcon,{...j,...$.ledger,background:colors.gray[500]});case"multisig":return jsxRuntimeExports.jsx(KeyIcon,{...j,...$.multisig,stroke:colors.gray[400],background:colors.gray[500]});case"social":switch(_.idp){case"google":return jsxRuntimeExports.jsx(GoogleIcon,{...j,...$.social.google,background:"white"});case"facebook":return jsxRuntimeExports.jsx(FacebookIcon,{...j,...$.social.facebook,background:"white"});case"twitter":return jsxRuntimeExports.jsx(TwitterIcon,{...j,...$.social.twitter,background:"white"});case"reddit":return jsxRuntimeExports.jsx(RedditIcon,{...j,...$.social.reddit,background:"white"});case"email":return jsxRuntimeExports.jsx(EmailIcon,{...j,...$.social.email,color:"black",background:"white"})}}}),baseIconProps={stroke:colors.gray[400],borderRadius:"4px",background:colors.gray[500]},AddressTileIcon=reactExports.memo(({addressKind:_,size:a})=>{const j=useGetOwnedAccountSafe()(_.pkh);if(j)return jsxRuntimeExports.jsx(AccountTileIcon,{account:j,size:a});let et,tt;switch(a){case"sm":et="30px",tt="5px";break;case"lg":et="48px",tt="10px"}switch(_.type){case"contact":return jsxRuntimeExports.jsx(ContactIcon,{width:et,height:et,padding:tt,...baseIconProps});case"unknown":return jsxRuntimeExports.jsx(UnknownContactIcon,{width:et,height:et,padding:tt,...baseIconProps});case"baker":return jsxRuntimeExports.jsx(Image$1,{height:et,"data-testid":"baker-icon",src:`https://services.tzkt.io/v1/avatars/${_.pkh}`});case"secret_key":case"mnemonic":case"social":case"ledger":case"multisig":return null}}),useAddressKind$1=_=>{const a=useOwnedAccountAddressKind$1(_),$=useBakerAddressKind(_),j=useContactAddressKind(_);return a||$||j||{pkh:_.pkh,type:"unknown",label:null}},useOwnedAccountAddressKind$1=({pkh:_})=>{const $=useGetOwnedAccountSafe()(_);return $?{type:$.type,pkh:_,label:$.label}:null},useBakerAddressKind=({pkh:_})=>{const $=useGetBaker()(_);return $?{pkh:_,type:"baker",label:$.name}:null},useContactAddressKind=({pkh:_})=>{const $=useGetContactName()(_);return $?{pkh:_,type:"contact",label:$}:null},splitNumber=_=>{const[a,$]=_.split(".");return{integer:a,decimal:$}},PrettyNumber=({number:_,size:a="md",...$})=>{const j=a==="md"?"md":"lg",et=a==="md"?"sm":"md",{integer:tt,decimal:rt}=splitNumber(_);return jsxRuntimeExports.jsxs(Flex,{alignItems:"end","data-testid":"pretty-number",...$,children:[jsxRuntimeExports.jsx(Heading,{size:j,children:tt}),rt&&jsxRuntimeExports.jsxs(Heading,{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",size:et,children:[".",rt]})]})},AccountBalance=({address:_,size:a,numberProps:$,...j})=>{const tt=useGetAccountBalance()(_);if(!tt)return null;const rt=prettyTezAmount(tt);return jsxRuntimeExports.jsx(Box,{overflow:"hidden",textAlign:"right","data-testid":"account-balance",...j,children:jsxRuntimeExports.jsx(PrettyNumber,{number:rt,size:a,...$})})},AddressTile=({address:_,hideBalance:a=!1,...$})=>{const j=useAddressKind$1(_);return jsxRuntimeExports.jsx(Tooltip,{background:colors.white,hasArrow:!0,label:j.label,placement:"left",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",width:"100%",padding:"9px 10px",background:colors.gray[800],borderRadius:"4px","data-testid":"address-tile",...$,children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",width:a?"100%":"calc(100% - 95px)",children:[jsxRuntimeExports.jsx(AddressTileIcon,{addressKind:j,size:"sm"}),j.type==="unknown"?jsxRuntimeExports.jsx(Text,{marginLeft:"10px",color:colors.gray[300],size:"sm",children:_.pkh}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{overflow:"hidden",width:"100%",marginLeft:"10px",whiteSpace:"nowrap",children:jsxRuntimeExports.jsx(Heading,{overflow:"hidden",textOverflow:"ellipsis",size:"sm",children:j.label})}),jsxRuntimeExports.jsx(Text,{width:"89px",marginLeft:"10px",color:colors.gray[300],size:"xs",children:formatPkh(j.pkh)})]})]}),!a&&jsxRuntimeExports.jsx(AccountBalance,{overflow:"hidden",marginLeft:"10px",textAlign:"right",address:_.pkh,numberProps:{maxWidth:"85px"}})]})})},Suggestions=({contacts:_,hideBalance:a,onChange:$})=>_.length===0?null:jsxRuntimeExports.jsx(UnorderedList,{position:"absolute",zIndex:2,overflowY:"auto",width:"100%",maxHeight:"300px",marginTop:"8px",marginLeft:0,background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"suggestions-list",listStyleType:"none",children:_.map((j,et)=>jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(ListItem,{marginBottom:et===_.length-1?"5px":0,padding:"5px 15px 0 5px",onMouseDown:()=>{$(j.name)},children:jsxRuntimeExports.jsx(AddressTile,{height:"40px",padding:"10px 8px 10px 5px",background:colors.gray[700],borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",address:parsePkh(j.pkh),hideBalance:a})})},j.pkh))}),getSuggestions=(_,a)=>a.filter($=>!_.trim()||$.name.toLowerCase().includes(_.trim().toLowerCase())),AddressAutocomplete=({contacts:_,isDisabled:a,isLoading:$=!1,allowUnknown:j,inputName:et,onUpdate:tt,validate:rt,label:nt,keepValid:it,style:at,size:st,hideBalance:ot=!1})=>{const{register:ut,setValue:dt,formState:{defaultValues:mt},getValues:xt}=useFormContext(),Ct=dt,Pt=reactExports.useId(),[Tt,kt]=reactExports.useState(()=>{var bt;if(it||!mt)return"";const yt=lodashExports.get(mt,et);return yt?((bt=_.find(ct=>ct.pkh===yt))==null?void 0:bt.name)||yt:""}),[Lt,Nt]=reactExports.useState(!0),[zt,jt]=reactExports.useState(getSuggestions("",_)),Mt=xt(et),Dt=yt=>{kt(yt),jt(getSuggestions(yt,_));const bt=_.find(ht=>ht.name===yt||ht.pkh===yt);let ct;if(bt!==void 0)ct=bt.pkh,Nt(!0);else if(j&&isAddressValid(yt))ct=yt;else{if(it)return;ct=""}Ct(et,ct,{shouldValidate:!0}),tt&&tt(ct)};let Ft="raw_input";$?Ft="selected_tile":a?Ft="disabled_tile":Mt&&(Ft="selected_tile");const Bt=()=>{Dt(""),Nt(!1)};return jsxRuntimeExports.jsxs(Box,{"data-testid":`address-autocomplete-${et}`,children:[jsxRuntimeExports.jsx(FormLabel,{htmlFor:Pt,children:nt}),Ft==="disabled_tile"&&jsxRuntimeExports.jsx(AddressTile,{address:parsePkh(Mt)}),Ft==="selected_tile"&&jsxRuntimeExports.jsx(Box,{height:"48px",background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px","data-testid":`selected-address-tile-${Mt}`,onClick:Bt,paddingY:0,children:jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",cursor:"pointer","data-testid":"clear-selected-button",children:[jsxRuntimeExports.jsx(AddressTile,{width:st==="short"?"338px":"365px",paddingTop:"8px",background:"transparent",address:parsePkh(Mt)}),it?jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginRight:"12px","data-testid":"chevron-icon"}):jsxRuntimeExports.jsx(CrossButton,{marginRight:"14px"})]})}),Ft==="raw_input"&&jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{...at,"aria-label":et,autoComplete:"off",id:Pt,onBlur:yt=>{if(yt.preventDefault(),Nt(!0),it&&Mt!==yt.target.value)return Dt(Mt);Dt(yt.target.value)},onChange:yt=>Dt(yt.target.value),onFocus:()=>Nt(!1),placeholder:"Enter address or contact name",value:Tt}),jsxRuntimeExports.jsx(InputRightElement,{children:Tt?jsxRuntimeExports.jsx(CrossButton,{marginRight:"0px",onClick:Bt}):jsxRuntimeExports.jsx(ChevronDownIcon$1,{"data-testid":"chevron-icon"})})]}),jsxRuntimeExports.jsx(Input,{...ut(et,{required:"Invalid address or contact name",validate:rt}),marginBottom:0,"data-testid":`real-address-input-${et}`,name:et,type:"hidden"}),!Lt&&jsxRuntimeExports.jsx(Suggestions,{contacts:zt,hideBalance:ot,onChange:Dt})]})},CrossButton=_=>jsxRuntimeExports.jsx(XMark,{marginRight:"16px",stroke:colors.gray[450],cursor:"pointer","data-testid":"clear-input-button",..._}),KnownAccountsAutocomplete=_=>{const a=useContactsForSelectedNetwork(),$=useAllAccounts().map(j=>({name:j.label,pkh:j.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{..._,contacts:a.concat($)})},OwnedImplicitAccountsAutocomplete=_=>{const a=useImplicitAccounts().map($=>({name:$.label,pkh:$.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{..._,contacts:a})},OwnedAccountsAutocomplete=_=>{const a=useAllAccounts().map($=>({name:$.label,pkh:$.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{..._,contacts:a})},BakersAutocomplete=_=>{const a=useBakerList().map($=>({name:$.name,pkh:$.address}));return jsxRuntimeExports.jsx(AddressAutocomplete,{..._,contacts:a,hideBalance:!0})},AvailableSignersAutocomplete=_=>{const $=useGetOwnedSignersForAccount()(_.account).map(j=>({name:j.label,pkh:j.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{allowUnknown:!1,contacts:$,isDisabled:$.length===1,..._})},getErrorContext=_=>{let a="Something went wrong";typeof _=="object"&&"message"in _?a=_.message:typeof _=="string"&&(a=_);let $="";return typeof _=="object"&&"stack"in _&&($=_.stack),{timestamp:new Date().toISOString(),description:a,stacktrace:$}},useAsyncActionHandler=()=>{const[_,a]=reactExports.useState(!1),$=reactExports.useRef(_),j=useToast(),et=useAppDispatch(),tt=reactExports.useCallback(async(nt,it)=>{if(!$.current){$.current=!0,a(!0);try{return await nt()}catch(at){const st=getErrorContext(at);throw j({description:st.description,status:"error",...typeof it=="function"?it(at):it}),et(errorsSlice.actions.add(st)),at}finally{$.current=!1,a(!1)}}},[et,j]),rt=reactExports.useCallback(async(nt,it)=>tt(nt,it).catch(()=>{}),[tt]);return{isLoading:_,handleAsyncAction:rt,handleAsyncActionUnsafe:tt}},PermissionRequestModal=({request:_})=>{const a=useAddConnection(),$=useGetImplicitAccount(),{onClose:j}=reactExports.useContext(DynamicModalContext),{handleAsyncAction:et}=useAsyncActionHandler(),tt=useForm({mode:"onBlur"}),{getValues:rt,formState:{errors:nt,isValid:it}}=tt,at=useRemovePeerBySenderId(),st=()=>{at(_.senderId),WalletClient.respond({id:_.id,type:BeaconMessageType.Error,errorType:BeaconErrorType.NOT_GRANTED_ERROR})},ot=()=>et(async()=>{const ut=$(rt().address),dt={type:BeaconMessageType.PermissionResponse,network:_.network,scopes:_.scopes,id:_.id,publicKey:ut.pk,walletType:"implicit"};await WalletClient.respond(dt),a(_.senderId,ut.address.pkh,_.network.type)}).finally(j);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{marginBottom:"24px",children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"center",children:"Permission Request"}),jsxRuntimeExports.jsxs(Text,{marginTop:"10px",color:colors.gray[400],textAlign:"center",size:"sm",children:[_.appMetadata.name," is requesting permission to sign this operation."]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"center",marginTop:"10px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Network:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:lodashExports.capitalize(_.network.type)})]})]}),jsxRuntimeExports.jsx(ModalCloseButton,{onClick:st}),jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"beacon-request-body",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"16px",padding:"15px",borderRadius:"4px",backgroundColor:colors.gray[800],children:[jsxRuntimeExports.jsx(AspectRatio,{width:"60px",marginRight:"12px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{borderRadius:"4px",src:_.appMetadata.icon})}),jsxRuntimeExports.jsx(Heading,{size:"sm",children:_.appMetadata.name})]}),jsxRuntimeExports.jsx(Accordion,{marginTop:"16px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],border:"none",borderRadius:"8px",children:[jsxRuntimeExports.jsxs(AccordionButton,{children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",marginY:"10px",size:"md",children:"Request"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(JsValueWrap,{overflow:"auto",maxHeight:"250px",value:_})})]})}),jsxRuntimeExports.jsx(FormProvider,{...tt,children:jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!nt.address,children:[jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!1,inputName:"address",label:"Select Account"}),nt.address&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:nt.address.message})]})})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!it,onClick:ot,size:"lg",children:"Allow"})})]})},PAYLOAD_PADDING="0501",getPayloadHexBytes=_=>{let a=0;if(_.startsWith(PAYLOAD_PADDING)){for(a=4;a<_.length&&_[a]==="0";)a+=1;let $="",j=0;const et=a;for(;a<_.length&&_[a]!=="0";){$+=_[a],j=parseInt($,16);const tt=_.length-$.length-et;if(j*2===tt){a+=1;break}if(j*2>tt)throw new Error("Invalid payload length");a+=1}}return _.slice(a)},decodePayload$1=_=>{try{return new TextDecoder("utf-8").decode(hex2buf(getPayloadHexBytes(_)))||_}catch{return _}};function _typeof$3(_){"@babel/helpers - typeof";return _typeof$3=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},_typeof$3(_)}function toPrimitive(_,a){if(_typeof$3(_)!="object"||!_)return _;var $=_[Symbol.toPrimitive];if($!==void 0){var j=$.call(_,a||"default");if(_typeof$3(j)!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(_)}function toPropertyKey(_){var a=toPrimitive(_,"string");return _typeof$3(a)=="symbol"?a:a+""}function _defineProperty$4(_,a,$){return(a=toPropertyKey(a))in _?Object.defineProperty(_,a,{value:$,enumerable:!0,configurable:!0,writable:!0}):_[a]=$,_}function ownKeys$2(_,a){var $=Object.keys(_);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(_);a&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(_,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread2(_){for(var a=1;a-1}function Gr(Xt,cr){var gr=this.__data__,Dr=Jn(gr,Xt);return Dr<0?(++this.size,gr.push([Xt,cr])):gr[Dr][1]=cr,this}hn.prototype.clear=fn,hn.prototype.delete=Kr,hn.prototype.get=$n,hn.prototype.has=dn,hn.prototype.set=Gr;function gn(Xt){var cr=-1,gr=Xt==null?0:Xt.length;for(this.clear();++cr1?gr[rn-1]:void 0,Pn=rn>2?gr[2]:void 0;for(xn=Xt.length>3&&typeof xn=="function"?(rn--,xn):void 0,Pn&&Yl(gr[0],gr[1],Pn)&&(xn=rn<3?void 0:xn,rn=1),cr=Object(cr);++Dr-1&&Xt%1==0&&Xt0){if(++cr>=et)return arguments[0]}else cr=0;return Xt.apply(void 0,arguments)}}function Al(Xt){if(Xt!=null){try{return Pr.call(Xt)}catch{}try{return Xt+""}catch{}}return""}function Xs(Xt,cr){return Xt===cr||Xt!==Xt&&cr!==cr}var Eo=es(function(){return arguments}())?es:function(Xt){return Ms(Xt)&&Rr.call(Xt,"callee")&&!or.call(Xt,"callee")},Ls=Array.isArray;function so(Xt){return Xt!=null&&_o(Xt.length)&&!wo(Xt)}function Pl(Xt){return Ms(Xt)&&so(Xt)}var ao=Wr||_r;function wo(Xt){if(!Ts(Xt))return!1;var cr=Qn(Xt);return cr==dt||cr==mt||cr==at||cr==kt}function _o(Xt){return typeof Xt=="number"&&Xt>-1&&Xt%1==0&&Xt<=rt}function Ts(Xt){var cr=typeof Xt;return Xt!=null&&(cr=="object"||cr=="function")}function Ms(Xt){return Xt!=null&&typeof Xt=="object"}function Tl(Xt){if(!Ms(Xt)||Qn(Xt)!=Tt)return!1;var cr=qt(Xt);if(cr===null)return!0;var gr=Rr.call(cr,"constructor")&&cr.constructor;return typeof gr=="function"&&gr instanceof gr&&Pr.call(gr)==Lr}var Io=Qt?pr(Qt):us;function So(Xt){return vo(Xt,ko(Xt))}function ko(Xt){return so(Xt)?ps(Xt):Wn(Xt)}var Xl=Ho(function(Xt,cr,gr){os(Xt,cr,gr)});function rs(Xt){return function(){return Xt}}function Xn(Xt){return Xt}function _r(){return!1}_.exports=Xl})(lodash_merge,lodash_merge.exports);var lodash_mergeExports=lodash_merge.exports;const deepmerge$1=getDefaultExportFromCjs$1(lodash_mergeExports);var loglevel={exports:{}};(function(_){(function(a,$){_.exports?_.exports=$():a.log=$()})(commonjsGlobal,function(){var a=function(){},$="undefined",j=typeof window!==$&&typeof window.navigator!==$&&/Trident\/|MSIE /.test(window.navigator.userAgent),et=["trace","debug","info","warn","error"],tt={},rt=null;function nt(xt,Ct){var Pt=xt[Ct];if(typeof Pt.bind=="function")return Pt.bind(xt);try{return Function.prototype.bind.call(Pt,xt)}catch{return function(){return Function.prototype.apply.apply(Pt,[xt,arguments])}}}function it(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function at(xt){return xt==="debug"&&(xt="log"),typeof console===$?!1:xt==="trace"&&j?it:console[xt]!==void 0?nt(console,xt):console.log!==void 0?nt(console,"log"):a}function st(){for(var xt=this.getLevel(),Ct=0;Ct=0&&yt<=Pt.levels.SILENT)return yt;throw new TypeError("log.setLevel() called with invalid level: "+Bt)}Pt.name=xt,Pt.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},Pt.methodFactory=Ct||ut,Pt.getLevel=function(){return Lt??kt??Tt},Pt.setLevel=function(Bt,yt){return Lt=Dt(Bt),yt!==!1&&zt(Lt),st.call(Pt)},Pt.setDefaultLevel=function(Bt){kt=Dt(Bt),jt()||Pt.setLevel(Bt,!1)},Pt.resetLevel=function(){Lt=null,Mt(),st.call(Pt)},Pt.enableAll=function(Bt){Pt.setLevel(Pt.levels.TRACE,Bt)},Pt.disableAll=function(Bt){Pt.setLevel(Pt.levels.SILENT,Bt)},Pt.rebuild=function(){if(rt!==Pt&&(Tt=Dt(rt.getLevel())),st.call(Pt),rt===Pt)for(var Bt in tt)tt[Bt].rebuild()},Tt=Dt(rt?rt.getLevel():"WARN");var Ft=jt();Ft!=null&&(Lt=Dt(Ft)),st.call(Pt)}rt=new dt,rt.getLogger=function(Ct){if(typeof Ct!="symbol"&&typeof Ct!="string"||Ct==="")throw new TypeError("You must supply a name when creating a logger.");var Pt=tt[Ct];return Pt||(Pt=tt[Ct]=new dt(Ct,rt.methodFactory)),Pt};var mt=typeof window!==$?window.log:void 0;return rt.noConflict=function(){return typeof window!==$&&window.log===rt&&(window.log=mt),rt},rt.getLoggers=function(){return tt},rt.default=rt,rt})})(loglevel);var loglevelExports=loglevel.exports;const log$1$1=getDefaultExportFromCjs$1(loglevelExports),log$7=log$1$1.getLogger("http-helpers");log$7.setLevel(loglevelExports.levels.INFO);let apiKey$2="torus-default";const gatewayAuthHeader$2="x-api-key";async function fetchAndTrace$2(_,a){let $=null;try{$=new URL(_)}catch{}return fetch(_,a)}function getApiKeyHeaders$2(){const _={};return _[gatewayAuthHeader$2]=apiKey$2,_}function debugLogResponse$2(_){log$7.info(`Response: ${_.status} ${_.statusText}`),log$7.info(`Url: ${_.url}`)}function logTracingHeader$1(_){log$7.info(`Request tracing with traceID=${_.headers.get("x-web3-correlation-id")}`)}const promiseTimeout$1=(_,a)=>{const $=new Promise((j,et)=>{const tt=setTimeout(()=>{clearTimeout(tt),et(new Error(`Timed out in ${_}ms`))},_)});return Promise.race([a,$])},get$2=async function(_){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const j={mode:"cors",headers:{}};$.useAPIKey&&(j.headers=_objectSpread2(_objectSpread2({},j.headers),getApiKeyHeaders$2()));const et=deepmerge$1(j,a,{method:"GET"}),tt=await fetchAndTrace$2(_,et);if(tt.ok){const rt=tt.headers.get("content-type");return rt!=null&&rt.includes("application/json")?tt.json():tt.text()}throw debugLogResponse$2(tt),tt},post$1=function(_){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const et={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};j.useAPIKey&&(et.headers=_objectSpread2(_objectSpread2({},et.headers),getApiKeyHeaders$2()));const tt=deepmerge$1(et,$,{method:"POST"});return j.isUrlEncodedData?(tt.body=a,tt.headers["Content-Type"]==="application/json; charset=utf-8"&&delete tt.headers["Content-Type"]):tt.body=JSON.stringify(a),promiseTimeout$1(j.timeout||6e4,fetchAndTrace$2(_,tt).then(rt=>{if(j.logTracingHeader&&logTracingHeader$1(rt),rt.ok){const nt=rt.headers.get("content-type");return nt!=null&&nt.includes("application/json")?rt.json():rt.text()}throw debugLogResponse$2(rt),rt}))};function _objectWithoutPropertiesLoose(_,a){if(_==null)return{};var $={};for(var j in _)if({}.hasOwnProperty.call(_,j)){if(a.indexOf(j)>=0)continue;$[j]=_[j]}return $}function _objectWithoutProperties(_,a){if(_==null)return{};var $,j,et=_objectWithoutPropertiesLoose(_,a);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(_);for(j=0;j=0||{}.propertyIsEnumerable.call(_,$)&&(et[$]=_[$])}return et}const BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Utils{static getFirstMatch(a,$){const j=$.match(a);return j&&j.length>0&&j[1]||""}static getSecondMatch(a,$){const j=$.match(a);return j&&j.length>1&&j[2]||""}static matchAndReturnConst(a,$,j){if(a.test($))return j}static getWindowsVersionName(a){switch(a){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(a){const $=a.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),$[0]===10)switch($[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(a){const $=a.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),!($[0]===1&&$[1]<5)){if($[0]===1&&$[1]<6)return"Cupcake";if($[0]===1&&$[1]>=6)return"Donut";if($[0]===2&&$[1]<2)return"Eclair";if($[0]===2&&$[1]===2)return"Froyo";if($[0]===2&&$[1]>2)return"Gingerbread";if($[0]===3)return"Honeycomb";if($[0]===4&&$[1]<1)return"Ice Cream Sandwich";if($[0]===4&&$[1]<4)return"Jelly Bean";if($[0]===4&&$[1]>=4)return"KitKat";if($[0]===5)return"Lollipop";if($[0]===6)return"Marshmallow";if($[0]===7)return"Nougat";if($[0]===8)return"Oreo";if($[0]===9)return"Pie"}}static getVersionPrecision(a){return a.split(".").length}static compareVersions(a,$,j=!1){const et=Utils.getVersionPrecision(a),tt=Utils.getVersionPrecision($);let rt=Math.max(et,tt),nt=0;const it=Utils.map([a,$],at=>{const st=rt-Utils.getVersionPrecision(at),ot=at+new Array(st+1).join(".0");return Utils.map(ot.split("."),ut=>new Array(20-ut.length).join("0")+ut).reverse()});for(j&&(nt=rt-Math.min(et,tt)),rt-=1;rt>=nt;){if(it[0][rt]>it[1][rt])return 1;if(it[0][rt]===it[1][rt]){if(rt===nt)return 0;rt-=1}else if(it[0][rt]{j[it]=rt[it]})}return a}static getBrowserAlias(a){return BROWSER_ALIASES_MAP[a]}static getBrowserTypeByAlias(a){return BROWSER_MAP[a]||""}}const commonVersionIdentifier=/version\/(\d+(\.?_?\d+)+)/i,browsersList=[{test:[/googlebot/i],describe(_){const a={name:"Googlebot"},$=Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/opera/i],describe(_){const a={name:"Opera"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/opr\/|opios/i],describe(_){const a={name:"Opera"},$=Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/SamsungBrowser/i],describe(_){const a={name:"Samsung Internet for Android"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/Whale/i],describe(_){const a={name:"NAVER Whale Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/MZBrowser/i],describe(_){const a={name:"MZ Browser"},$=Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/focus/i],describe(_){const a={name:"Focus"},$=Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/swing/i],describe(_){const a={name:"Swing"},$=Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/coast/i],describe(_){const a={name:"Opera Coast"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(_){const a={name:"Opera Touch"},$=Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/yabrowser/i],describe(_){const a={name:"Yandex Browser"},$=Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/ucbrowser/i],describe(_){const a={name:"UC Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/Maxthon|mxios/i],describe(_){const a={name:"Maxthon"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/epiphany/i],describe(_){const a={name:"Epiphany"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/puffin/i],describe(_){const a={name:"Puffin"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/sleipnir/i],describe(_){const a={name:"Sleipnir"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/k-meleon/i],describe(_){const a={name:"K-Meleon"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/micromessenger/i],describe(_){const a={name:"WeChat"},$=Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/qqbrowser/i],describe(_){const a={name:/qqbrowserlite/i.test(_)?"QQ Browser Lite":"QQ Browser"},$=Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/msie|trident/i],describe(_){const a={name:"Internet Explorer"},$=Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/\sedg\//i],describe(_){const a={name:"Microsoft Edge"},$=Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/edg([ea]|ios)/i],describe(_){const a={name:"Microsoft Edge"},$=Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/vivaldi/i],describe(_){const a={name:"Vivaldi"},$=Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/seamonkey/i],describe(_){const a={name:"SeaMonkey"},$=Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/sailfish/i],describe(_){const a={name:"Sailfish"},$=Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,_);return $&&(a.version=$),a}},{test:[/silk/i],describe(_){const a={name:"Amazon Silk"},$=Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/phantom/i],describe(_){const a={name:"PhantomJS"},$=Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/slimerjs/i],describe(_){const a={name:"SlimerJS"},$=Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(_){const a={name:"BlackBerry"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/(web|hpw)[o0]s/i],describe(_){const a={name:"WebOS Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/bada/i],describe(_){const a={name:"Bada"},$=Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/tizen/i],describe(_){const a={name:"Tizen"},$=Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/qupzilla/i],describe(_){const a={name:"QupZilla"},$=Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/firefox|iceweasel|fxios/i],describe(_){const a={name:"Firefox"},$=Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/electron/i],describe(_){const a={name:"Electron"},$=Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/MiuiBrowser/i],describe(_){const a={name:"Miui"},$=Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/chromium/i],describe(_){const a={name:"Chromium"},$=Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/chrome|crios|crmo/i],describe(_){const a={name:"Chrome"},$=Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/GSA/i],describe(_){const a={name:"Google Search"},$=Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test(_){const a=!_.test(/like android/i),$=_.test(/android/i);return a&&$},describe(_){const a={name:"Android Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/playstation 4/i],describe(_){const a={name:"PlayStation 4"},$=Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/safari|applewebkit/i],describe(_){const a={name:"Safari"},$=Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/.*/i],describe(_){const a=/^(.*)\/(.*) /,$=/^(.*)\/(.*)[ \t]\((.*)/,et=_.search("\\(")!==-1?$:a;return{name:Utils.getFirstMatch(et,_),version:Utils.getSecondMatch(et,_)}}}],osParsersList=[{test:[/Roku\/DVP/],describe(_){const a=Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,_);return{name:OS_MAP.Roku,version:a}}},{test:[/windows phone/i],describe(_){const a=Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,_);return{name:OS_MAP.WindowsPhone,version:a}}},{test:[/windows /i],describe(_){const a=Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,_),$=Utils.getWindowsVersionName(a);return{name:OS_MAP.Windows,version:a,versionName:$}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(_){const a={name:OS_MAP.iOS},$=Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/,_);return $&&(a.version=$),a}},{test:[/macintosh/i],describe(_){const a=Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,_).replace(/[_\s]/g,"."),$=Utils.getMacOSVersionName(a),j={name:OS_MAP.MacOS,version:a};return $&&(j.versionName=$),j}},{test:[/(ipod|iphone|ipad)/i],describe(_){const a=Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,_).replace(/[_\s]/g,".");return{name:OS_MAP.iOS,version:a}}},{test(_){const a=!_.test(/like android/i),$=_.test(/android/i);return a&&$},describe(_){const a=Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,_),$=Utils.getAndroidVersionName(a),j={name:OS_MAP.Android,version:a};return $&&(j.versionName=$),j}},{test:[/(web|hpw)[o0]s/i],describe(_){const a=Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,_),$={name:OS_MAP.WebOS};return a&&a.length&&($.version=a),$}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(_){const a=Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,_)||Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,_)||Utils.getFirstMatch(/\bbb(\d+)/i,_);return{name:OS_MAP.BlackBerry,version:a}}},{test:[/bada/i],describe(_){const a=Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,_);return{name:OS_MAP.Bada,version:a}}},{test:[/tizen/i],describe(_){const a=Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,_);return{name:OS_MAP.Tizen,version:a}}},{test:[/linux/i],describe(){return{name:OS_MAP.Linux}}},{test:[/CrOS/],describe(){return{name:OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe(_){const a=Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,_);return{name:OS_MAP.PlayStation4,version:a}}}],platformParsersList=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(_){const a=Utils.getFirstMatch(/(can-l01)/i,_)&&"Nova",$={type:PLATFORMS_MAP.mobile,vendor:"Huawei"};return a&&($.model=a),$}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:PLATFORMS_MAP.tablet}}},{test(_){const a=_.test(/ipod|iphone/i),$=_.test(/like (ipod|iphone)/i);return a&&!$},describe(_){const a=Utils.getFirstMatch(/(ipod|iphone)/i,_);return{type:PLATFORMS_MAP.mobile,vendor:"Apple",model:a}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:PLATFORMS_MAP.mobile}}},{test(_){return _.getBrowserName(!0)==="blackberry"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test(_){return _.getBrowserName(!0)==="bada"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(_){return _.getBrowserName()==="windows phone"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test(_){const a=Number(String(_.getOSVersion()).split(".")[0]);return _.getOSName(!0)==="android"&&a>=3},describe(){return{type:PLATFORMS_MAP.tablet}}},{test(_){return _.getOSName(!0)==="android"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(_){return _.getOSName(!0)==="macos"},describe(){return{type:PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test(_){return _.getOSName(!0)==="windows"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(_){return _.getOSName(!0)==="linux"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(_){return _.getOSName(!0)==="playstation 4"},describe(){return{type:PLATFORMS_MAP.tv}}},{test(_){return _.getOSName(!0)==="roku"},describe(){return{type:PLATFORMS_MAP.tv}}}],enginesParsersList=[{test(_){return _.getBrowserName(!0)==="microsoft edge"},describe(_){if(/\sedg\//i.test(_))return{name:ENGINE_MAP.Blink};const $=Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,_);return{name:ENGINE_MAP.EdgeHTML,version:$}}},{test:[/trident/i],describe(_){const a={name:ENGINE_MAP.Trident},$=Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test(_){return _.test(/presto/i)},describe(_){const a={name:ENGINE_MAP.Presto},$=Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test(_){const a=_.test(/gecko/i),$=_.test(/like gecko/i);return a&&!$},describe(_){const a={name:ENGINE_MAP.Gecko},$=Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe(_){const a={name:ENGINE_MAP.WebKit},$=Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}}];class Parser{constructor(a,$=!1){if(a==null||a==="")throw new Error("UserAgent parameter can't be empty");this._ua=a,this.parsedResult={},$!==!0&&this.parse()}getUA(){return this._ua}test(a){return a.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const a=Utils.find(browsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.browser=a.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(a){return a?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const a=Utils.find(osParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.os=a.describe(this.getUA())),this.parsedResult.os}getOSName(a){const{name:$}=this.getOS();return a?String($).toLowerCase()||"":$||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(a=!1){const{type:$}=this.getPlatform();return a?String($).toLowerCase()||"":$||""}parsePlatform(){this.parsedResult.platform={};const a=Utils.find(platformParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.platform=a.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(a){return a?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const a=Utils.find(enginesParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.engine=a.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Utils.assign({},this.parsedResult)}satisfies(a){const $={};let j=0;const et={};let tt=0;if(Object.keys(a).forEach(nt=>{const it=a[nt];typeof it=="string"?(et[nt]=it,tt+=1):typeof it=="object"&&($[nt]=it,j+=1)}),j>0){const nt=Object.keys($),it=Utils.find(nt,st=>this.isOS(st));if(it){const st=this.satisfies($[it]);if(st!==void 0)return st}const at=Utils.find(nt,st=>this.isPlatform(st));if(at){const st=this.satisfies($[at]);if(st!==void 0)return st}}if(tt>0){const nt=Object.keys(et),it=Utils.find(nt,at=>this.isBrowser(at,!0));if(it!==void 0)return this.compareVersion(et[it])}}isBrowser(a,$=!1){const j=this.getBrowserName().toLowerCase();let et=a.toLowerCase();const tt=Utils.getBrowserTypeByAlias(et);return $&&tt&&(et=tt.toLowerCase()),et===j}compareVersion(a){let $=[0],j=a,et=!1;const tt=this.getBrowserVersion();if(typeof tt=="string")return a[0]===">"||a[0]==="<"?(j=a.substr(1),a[1]==="="?(et=!0,j=a.substr(2)):$=[],a[0]===">"?$.push(1):$.push(-1)):a[0]==="="?j=a.substr(1):a[0]==="~"&&(et=!0,j=a.substr(1)),$.indexOf(Utils.compareVersions(tt,j,et))>-1}isOS(a){return this.getOSName(!0)===String(a).toLowerCase()}isPlatform(a){return this.getPlatformType(!0)===String(a).toLowerCase()}isEngine(a){return this.getEngineName(!0)===String(a).toLowerCase()}is(a,$=!1){return this.isBrowser(a,$)||this.isOS(a)||this.isPlatform(a)}some(a=[]){return a.some($=>this.is($))}}/*! + */var isBuffer_1=function(_){return _!=null&&(isBuffer(_)||isSlowBuffer(_)||!!_._isBuffer)};function isBuffer(_){return!!_.constructor&&typeof _.constructor.isBuffer=="function"&&_.constructor.isBuffer(_)}function isSlowBuffer(_){return typeof _.readFloatLE=="function"&&typeof _.slice=="function"&&isBuffer(_.slice(0,0))}(function(){var _=cryptExports,a=charenc_1.utf8,$=isBuffer_1,j=charenc_1.bin,et=function(tt,rt){tt.constructor==String?rt&&rt.encoding==="binary"?tt=j.stringToBytes(tt):tt=a.stringToBytes(tt):$(tt)?tt=Array.prototype.slice.call(tt,0):!Array.isArray(tt)&&tt.constructor!==Uint8Array&&(tt=tt.toString());for(var nt=_.bytesToWords(tt),it=tt.length*8,at=1732584193,st=-271733879,ot=-1732584194,ut=271733878,dt=0;dt>>24)&16711935|(nt[dt]<<24|nt[dt]>>>8)&4278255360;nt[it>>>5]|=128<>>9<<4)+14]=it;for(var mt=et._ff,xt=et._gg,Ct=et._hh,Pt=et._ii,dt=0;dt>>0,st=st+kt>>>0,ot=ot+Lt>>>0,ut=ut+Nt>>>0}return _.endian([at,st,ot,ut])};et._ff=function(tt,rt,nt,it,at,st,ot){var ut=tt+(rt&nt|~rt&it)+(at>>>0)+ot;return(ut<>>32-st)+rt},et._gg=function(tt,rt,nt,it,at,st,ot){var ut=tt+(rt&it|nt&~it)+(at>>>0)+ot;return(ut<>>32-st)+rt},et._hh=function(tt,rt,nt,it,at,st,ot){var ut=tt+(rt^nt^it)+(at>>>0)+ot;return(ut<>>32-st)+rt},et._ii=function(tt,rt,nt,it,at,st,ot){var ut=tt+(nt^(rt|~it))+(at>>>0)+ot;return(ut<>>32-st)+rt},et._blocksize=16,et._digestsize=16,md5$1.exports=function(tt,rt){if(tt==null)throw new Error("Illegal argument "+tt);var nt=_.wordsToBytes(et(tt,rt));return rt&&rt.asBytes?nt:rt&&rt.asString?j.bytesToString(nt):_.bytesToHex(nt)}})();var md5Exports=md5$1.exports;const md5=getDefaultExportFromCjs$1(md5Exports),ReactIdenticon=React$2.memo(({count:_=5,background:a,string:$,size:j})=>{const et=reactExports.useRef(null);reactExports.useEffect(()=>{tt()});const tt=()=>{const rt=md5($),nt=Math.floor(j/_),it=rt.slice(0,6),at=et.current;at.width=nt*_,at.height=nt*_;const st=rt.split("").map(dt=>parseInt(dt,16)).map(dt=>dt<8?0:1),ot=[];ot[0]=ot[4]=st.slice(0,5),ot[1]=ot[3]=st.slice(5,10),ot[2]=st.slice(10,15);const ut=at.getContext("2d");ut.imageSmoothingEnabled=!1,ut.clearRect(0,0,at.width,at.height),ot.forEach((dt,mt)=>{dt.forEach((xt,Ct)=>{xt?(ut.fillStyle="#"+it,ut.fillRect(nt*mt,nt*Ct,nt,nt)):(ut.fillStyle=a,ut.fillRect(nt*mt,nt*Ct,nt,nt))})})};return jsxRuntimeExports.jsx("canvas",{ref:et,style:{width:j,height:j}})}),color=_=>`#${md5(_).slice(0,6)}`,Identicon=({address:_,identiconSize:a,...$})=>jsxRuntimeExports.jsx(Box,{sx:{canvas:{borderRadius:"4px"}},zIndex:3,background:"white",borderRadius:"4px","data-testid":"identicon",...$,children:jsxRuntimeExports.jsx(ReactIdenticon,{background:"white",size:a,string:_.pkh,style:{borderRadius:4}})}),SIZES$1={lg:{defaults:{width:"48px",height:"48px",borderRadius:"4px"},mnemonic:{padding:"8px",identiconSize:32},ledger:{padding:"10px"},secret_key:{padding:"8px",identiconSize:32},multisig:{padding:"10px"},social:{google:{paddingX:"10.28px",paddingY:"10px"},facebook:{padding:"9px"},twitter:{paddingX:"12.78px",paddingY:"13.5px"},reddit:{padding:"10px"},email:{padding:"10px"}}},sm:{defaults:{width:"30px",height:"30px",borderRadius:"4px"},mnemonic:{padding:"5px",identiconSize:20},ledger:{padding:"5px"},secret_key:{padding:"5px",identiconSize:20},multisig:{padding:"5px"},social:{google:{paddingX:"6.425px",paddingY:"6.25px"},facebook:{padding:"6px"},twitter:{paddingX:"7.5px",paddingY:"8px"},reddit:{padding:"6px"},email:{padding:"6px"}}}},AccountTileIcon=reactExports.memo(({account:_,size:a})=>{const $=SIZES$1[a],j=$.defaults;switch(_.type){case"secret_key":return jsxRuntimeExports.jsx(Identicon,{address:_.address,...j,...$.secret_key});case"mnemonic":return jsxRuntimeExports.jsx(Identicon,{address:_.address,...j,...$.mnemonic});case"ledger":return jsxRuntimeExports.jsx(LedgerIcon,{...j,...$.ledger,background:colors.gray[500]});case"multisig":return jsxRuntimeExports.jsx(KeyIcon,{...j,...$.multisig,stroke:colors.gray[400],background:colors.gray[500]});case"social":switch(_.idp){case"google":return jsxRuntimeExports.jsx(GoogleIcon,{...j,...$.social.google,background:"white"});case"facebook":return jsxRuntimeExports.jsx(FacebookIcon,{...j,...$.social.facebook,background:"white"});case"twitter":return jsxRuntimeExports.jsx(TwitterIcon,{...j,...$.social.twitter,background:"white"});case"reddit":return jsxRuntimeExports.jsx(RedditIcon,{...j,...$.social.reddit,background:"white"});case"email":return jsxRuntimeExports.jsx(EmailIcon,{...j,...$.social.email,color:"black",background:"white"})}}}),baseIconProps={stroke:colors.gray[400],borderRadius:"4px",background:colors.gray[500]},AddressTileIcon=reactExports.memo(({addressKind:_,size:a})=>{const j=useGetOwnedAccountSafe()(_.pkh);if(j)return jsxRuntimeExports.jsx(AccountTileIcon,{account:j,size:a});let et,tt;switch(a){case"sm":et="30px",tt="5px";break;case"lg":et="48px",tt="10px"}switch(_.type){case"contact":return jsxRuntimeExports.jsx(ContactIcon,{width:et,height:et,padding:tt,...baseIconProps});case"unknown":return jsxRuntimeExports.jsx(UnknownContactIcon,{width:et,height:et,padding:tt,...baseIconProps});case"baker":return jsxRuntimeExports.jsx(Image$1,{height:et,"data-testid":"baker-icon",src:`https://services.tzkt.io/v1/avatars/${_.pkh}`});case"secret_key":case"mnemonic":case"social":case"ledger":case"multisig":return null}}),useAddressKind$1=_=>{const a=useOwnedAccountAddressKind$1(_),$=useBakerAddressKind(_),j=useContactAddressKind(_);return a||$||j||{pkh:_.pkh,type:"unknown",label:null}},useOwnedAccountAddressKind$1=({pkh:_})=>{const $=useGetOwnedAccountSafe()(_);return $?{type:$.type,pkh:_,label:$.label}:null},useBakerAddressKind=({pkh:_})=>{const $=useGetBaker()(_);return $?{pkh:_,type:"baker",label:$.name}:null},useContactAddressKind=({pkh:_})=>{const $=useGetContactName()(_);return $?{pkh:_,type:"contact",label:$}:null},splitNumber=_=>{const[a,$]=_.split(".");return{integer:a,decimal:$}},PrettyNumber=({number:_,size:a="md",...$})=>{const j=a==="md"?"md":"lg",et=a==="md"?"sm":"md",{integer:tt,decimal:rt}=splitNumber(_);return jsxRuntimeExports.jsxs(Flex,{alignItems:"end","data-testid":"pretty-number",...$,children:[jsxRuntimeExports.jsx(Heading,{size:j,children:tt}),rt&&jsxRuntimeExports.jsxs(Heading,{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",size:et,children:[".",rt]})]})},AccountBalance=({address:_,size:a,numberProps:$,...j})=>{const tt=useGetAccountBalance()(_);if(!tt)return null;const rt=prettyTezAmount(tt);return jsxRuntimeExports.jsx(Box,{overflow:"hidden",textAlign:"right","data-testid":"account-balance",...j,children:jsxRuntimeExports.jsx(PrettyNumber,{number:rt,size:a,...$})})},AddressTile=({address:_,hideBalance:a=!1,...$})=>{const j=useAddressKind$1(_);return jsxRuntimeExports.jsx(Tooltip,{background:colors.white,hasArrow:!0,label:j.label,placement:"left",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",width:"100%",padding:"9px 10px",background:colors.gray[800],borderRadius:"4px","data-testid":"address-tile",...$,children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",width:a?"100%":"calc(100% - 95px)",children:[jsxRuntimeExports.jsx(AddressTileIcon,{addressKind:j,size:"sm"}),j.type==="unknown"?jsxRuntimeExports.jsx(Text,{marginLeft:"10px",color:colors.gray[300],size:"sm",children:_.pkh}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{overflow:"hidden",width:"100%",marginLeft:"10px",whiteSpace:"nowrap",children:jsxRuntimeExports.jsx(Heading,{overflow:"hidden",textOverflow:"ellipsis",size:"sm",children:j.label})}),jsxRuntimeExports.jsx(Text,{width:"89px",marginLeft:"10px",color:colors.gray[300],size:"xs",children:formatPkh(j.pkh)})]})]}),!a&&jsxRuntimeExports.jsx(AccountBalance,{overflow:"hidden",marginLeft:"10px",textAlign:"right",address:_.pkh,numberProps:{maxWidth:"85px"}})]})})},Suggestions=({contacts:_,hideBalance:a,onChange:$})=>_.length===0?null:jsxRuntimeExports.jsx(UnorderedList,{position:"absolute",zIndex:2,overflowY:"auto",width:"100%",maxHeight:"300px",marginTop:"8px",marginLeft:0,background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"suggestions-list",listStyleType:"none",children:_.map((j,et)=>jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(ListItem,{marginBottom:et===_.length-1?"5px":0,padding:"5px 15px 0 5px","data-testid":`suggestion-${j.pkh}`,onMouseDown:()=>{$(j.pkh)},children:jsxRuntimeExports.jsx(AddressTile,{height:"40px",padding:"10px 8px 10px 5px",background:colors.gray[700],borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",address:parsePkh(j.pkh),hideBalance:a})})},j.pkh))}),AddressAutocomplete=({contacts:_,isDisabled:a,isLoading:$=!1,allowUnknown:j,inputName:et,onUpdate:tt,validate:rt,label:nt,keepValid:it,style:at,size:st,hideBalance:ot=!1})=>{const{register:ut,setValue:dt,formState:{defaultValues:mt},getValues:xt}=useFormContext(),Ct=dt,Pt=reactExports.useId(),[Tt,kt]=reactExports.useState(()=>{var bt;if(it||!mt)return"";const yt=lodashExports.get(mt,et);return yt?((bt=_.find(ct=>ct.pkh===yt))==null?void 0:bt.name)||yt:""}),[Lt,Nt]=reactExports.useState(!0),[zt,jt]=reactExports.useState(getSuggestions("",_)),Mt=xt(et),Dt=yt=>{kt(yt),jt(getSuggestions(yt,_));const bt=_.find(ht=>ht.name===yt||ht.pkh===yt);let ct;if(bt!==void 0)ct=bt.pkh,Nt(!0);else if(j&&isAddressValid(yt))ct=yt;else{if(it)return;ct=""}Ct(et,ct,{shouldValidate:!0}),tt&&tt(ct)};let Ft="raw_input";$?Ft="selected_tile":a?Ft="disabled_tile":Mt&&(Ft="selected_tile");const Bt=()=>{Dt(""),Nt(!1)};return jsxRuntimeExports.jsxs(Box,{"data-testid":`address-autocomplete-${et}`,children:[jsxRuntimeExports.jsx(FormLabel,{htmlFor:Pt,children:nt}),Ft==="disabled_tile"&&jsxRuntimeExports.jsx(AddressTile,{address:parsePkh(Mt)}),Ft==="selected_tile"&&jsxRuntimeExports.jsx(Box,{height:"48px",background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px","data-testid":`selected-address-tile-${Mt}`,onClick:Bt,paddingY:0,children:jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",cursor:"pointer","data-testid":"clear-selected-button",children:[jsxRuntimeExports.jsx(AddressTile,{width:st==="short"?"338px":"365px",paddingTop:"8px",background:"transparent",address:parsePkh(Mt)}),it?jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginRight:"12px","data-testid":"chevron-icon"}):jsxRuntimeExports.jsx(CrossButton,{marginRight:"14px"})]})}),Ft==="raw_input"&&jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{...at,"aria-label":et,autoComplete:"off",id:Pt,onBlur:yt=>{if(yt.preventDefault(),Nt(!0),it&&Mt!==yt.target.value)return Dt(Mt);Dt(yt.target.value)},onChange:yt=>Dt(yt.target.value),onFocus:()=>Nt(!1),placeholder:"Enter address or contact name",value:Tt}),jsxRuntimeExports.jsx(InputRightElement,{children:Tt?jsxRuntimeExports.jsx(CrossButton,{marginRight:"0px",onClick:Bt}):jsxRuntimeExports.jsx(ChevronDownIcon$1,{"data-testid":"chevron-icon"})})]}),jsxRuntimeExports.jsx(Input,{...ut(et,{required:"Invalid address or contact name",validate:rt}),marginBottom:0,"data-testid":`real-address-input-${et}`,name:et,type:"hidden"}),!Lt&&jsxRuntimeExports.jsx(Suggestions,{contacts:zt,hideBalance:ot,onChange:Dt})]})},CrossButton=_=>jsxRuntimeExports.jsx(XMark,{marginRight:"16px",stroke:colors.gray[450],cursor:"pointer","data-testid":"clear-input-button",..._}),OwnedImplicitAccountsAutocomplete=_=>{const a=useImplicitAccounts().map($=>({name:$.label,pkh:$.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{..._,contacts:a})},OwnedAccountsAutocomplete=_=>{const a=useAllAccounts().map($=>({name:$.label,pkh:$.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{..._,contacts:a})},BakersAutocomplete=_=>{const a=useBakerList().map($=>({name:$.name,pkh:$.address}));return jsxRuntimeExports.jsx(AddressAutocomplete,{..._,contacts:a,hideBalance:!0})},AvailableSignersAutocomplete=_=>{const $=useGetOwnedSignersForAccount()(_.account).map(j=>({name:j.label,pkh:j.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{allowUnknown:!1,contacts:$,isDisabled:$.length===1,..._})},KnownAccountsAutocomplete=_=>{const a=useContactsForSelectedNetwork(),$=useAllAccounts().map(j=>({name:j.label,pkh:j.address.pkh}));return jsxRuntimeExports.jsx(AddressAutocomplete,{..._,contacts:a.concat($)})},getErrorContext=_=>{let a="Something went wrong";typeof _=="object"&&"message"in _?a=_.message:typeof _=="string"&&(a=_);let $="";return typeof _=="object"&&"stack"in _&&($=_.stack),{timestamp:new Date().toISOString(),description:a,stacktrace:$}},useAsyncActionHandler=()=>{const[_,a]=reactExports.useState(!1),$=reactExports.useRef(_),j=useToast(),et=useAppDispatch(),tt=reactExports.useCallback(async(nt,it)=>{if(!$.current){$.current=!0,a(!0);try{return await nt()}catch(at){const st=getErrorContext(at);throw j({description:st.description,status:"error",...typeof it=="function"?it(at):it}),et(errorsSlice.actions.add(st)),at}finally{$.current=!1,a(!1)}}},[et,j]),rt=reactExports.useCallback(async(nt,it)=>tt(nt,it).catch(()=>{}),[tt]);return{isLoading:_,handleAsyncAction:rt,handleAsyncActionUnsafe:tt}},PermissionRequestModal=({request:_})=>{const a=useAddConnection(),$=useGetImplicitAccount(),{onClose:j}=reactExports.useContext(DynamicModalContext),{handleAsyncAction:et}=useAsyncActionHandler(),tt=useForm({mode:"onBlur"}),{getValues:rt,formState:{errors:nt,isValid:it}}=tt,at=useRemovePeerBySenderId(),st=()=>{at(_.senderId),WalletClient.respond({id:_.id,type:BeaconMessageType.Error,errorType:BeaconErrorType.NOT_GRANTED_ERROR})},ot=()=>et(async()=>{const ut=$(rt().address),dt={type:BeaconMessageType.PermissionResponse,network:_.network,scopes:_.scopes,id:_.id,publicKey:ut.pk,walletType:"implicit"};await WalletClient.respond(dt),a(_.senderId,ut.address.pkh,_.network.type)}).finally(j);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{marginBottom:"24px",children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"center",children:"Permission Request"}),jsxRuntimeExports.jsxs(Text,{marginTop:"10px",color:colors.gray[400],textAlign:"center",size:"sm",children:[_.appMetadata.name," is requesting permission to sign this operation."]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"center",marginTop:"10px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Network:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:lodashExports.capitalize(_.network.type)})]})]}),jsxRuntimeExports.jsx(ModalCloseButton,{onClick:st}),jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"beacon-request-body",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"16px",padding:"15px",borderRadius:"4px",backgroundColor:colors.gray[800],children:[jsxRuntimeExports.jsx(AspectRatio,{width:"60px",marginRight:"12px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{borderRadius:"4px",src:_.appMetadata.icon})}),jsxRuntimeExports.jsx(Heading,{size:"sm",children:_.appMetadata.name})]}),jsxRuntimeExports.jsx(Accordion,{marginTop:"16px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],border:"none",borderRadius:"8px",children:[jsxRuntimeExports.jsxs(AccordionButton,{children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",marginY:"10px",size:"md",children:"Request"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(JsValueWrap,{overflow:"auto",maxHeight:"250px",value:_})})]})}),jsxRuntimeExports.jsx(FormProvider,{...tt,children:jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!nt.address,children:[jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!1,inputName:"address",label:"Select Account"}),nt.address&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:nt.address.message})]})})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!it,onClick:ot,size:"lg",children:"Allow"})})]})},PAYLOAD_PADDING="0501",getPayloadHexBytes=_=>{let a=0;if(_.startsWith(PAYLOAD_PADDING)){for(a=4;a<_.length&&_[a]==="0";)a+=1;let $="",j=0;const et=a;for(;a<_.length&&_[a]!=="0";){$+=_[a],j=parseInt($,16);const tt=_.length-$.length-et;if(j*2===tt){a+=1;break}if(j*2>tt)throw new Error("Invalid payload length");a+=1}}return _.slice(a)},decodePayload$1=_=>{try{return new TextDecoder("utf-8").decode(hex2buf(getPayloadHexBytes(_)))||_}catch{return _}};function _typeof$3(_){"@babel/helpers - typeof";return _typeof$3=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},_typeof$3(_)}function toPrimitive(_,a){if(_typeof$3(_)!="object"||!_)return _;var $=_[Symbol.toPrimitive];if($!==void 0){var j=$.call(_,a||"default");if(_typeof$3(j)!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(_)}function toPropertyKey(_){var a=toPrimitive(_,"string");return _typeof$3(a)=="symbol"?a:a+""}function _defineProperty$4(_,a,$){return(a=toPropertyKey(a))in _?Object.defineProperty(_,a,{value:$,enumerable:!0,configurable:!0,writable:!0}):_[a]=$,_}function ownKeys$2(_,a){var $=Object.keys(_);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(_);a&&(j=j.filter(function(et){return Object.getOwnPropertyDescriptor(_,et).enumerable})),$.push.apply($,j)}return $}function _objectSpread2(_){for(var a=1;a-1}function Gr(Xt,cr){var gr=this.__data__,Dr=Jn(gr,Xt);return Dr<0?(++this.size,gr.push([Xt,cr])):gr[Dr][1]=cr,this}hn.prototype.clear=fn,hn.prototype.delete=Kr,hn.prototype.get=$n,hn.prototype.has=dn,hn.prototype.set=Gr;function gn(Xt){var cr=-1,gr=Xt==null?0:Xt.length;for(this.clear();++cr1?gr[rn-1]:void 0,Pn=rn>2?gr[2]:void 0;for(xn=Xt.length>3&&typeof xn=="function"?(rn--,xn):void 0,Pn&&Yl(gr[0],gr[1],Pn)&&(xn=rn<3?void 0:xn,rn=1),cr=Object(cr);++Dr-1&&Xt%1==0&&Xt0){if(++cr>=et)return arguments[0]}else cr=0;return Xt.apply(void 0,arguments)}}function Al(Xt){if(Xt!=null){try{return Pr.call(Xt)}catch{}try{return Xt+""}catch{}}return""}function Xs(Xt,cr){return Xt===cr||Xt!==Xt&&cr!==cr}var Eo=es(function(){return arguments}())?es:function(Xt){return Ms(Xt)&&Rr.call(Xt,"callee")&&!or.call(Xt,"callee")},Ls=Array.isArray;function so(Xt){return Xt!=null&&_o(Xt.length)&&!wo(Xt)}function Pl(Xt){return Ms(Xt)&&so(Xt)}var ao=Wr||_r;function wo(Xt){if(!Ts(Xt))return!1;var cr=Qn(Xt);return cr==dt||cr==mt||cr==at||cr==kt}function _o(Xt){return typeof Xt=="number"&&Xt>-1&&Xt%1==0&&Xt<=rt}function Ts(Xt){var cr=typeof Xt;return Xt!=null&&(cr=="object"||cr=="function")}function Ms(Xt){return Xt!=null&&typeof Xt=="object"}function Tl(Xt){if(!Ms(Xt)||Qn(Xt)!=Tt)return!1;var cr=qt(Xt);if(cr===null)return!0;var gr=Rr.call(cr,"constructor")&&cr.constructor;return typeof gr=="function"&&gr instanceof gr&&Pr.call(gr)==Lr}var Io=Qt?pr(Qt):us;function So(Xt){return vo(Xt,ko(Xt))}function ko(Xt){return so(Xt)?ps(Xt):Wn(Xt)}var Xl=Ho(function(Xt,cr,gr){os(Xt,cr,gr)});function rs(Xt){return function(){return Xt}}function Xn(Xt){return Xt}function _r(){return!1}_.exports=Xl})(lodash_merge,lodash_merge.exports);var lodash_mergeExports=lodash_merge.exports;const deepmerge$1=getDefaultExportFromCjs$1(lodash_mergeExports);var loglevel={exports:{}};(function(_){(function(a,$){_.exports?_.exports=$():a.log=$()})(commonjsGlobal,function(){var a=function(){},$="undefined",j=typeof window!==$&&typeof window.navigator!==$&&/Trident\/|MSIE /.test(window.navigator.userAgent),et=["trace","debug","info","warn","error"],tt={},rt=null;function nt(xt,Ct){var Pt=xt[Ct];if(typeof Pt.bind=="function")return Pt.bind(xt);try{return Function.prototype.bind.call(Pt,xt)}catch{return function(){return Function.prototype.apply.apply(Pt,[xt,arguments])}}}function it(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function at(xt){return xt==="debug"&&(xt="log"),typeof console===$?!1:xt==="trace"&&j?it:console[xt]!==void 0?nt(console,xt):console.log!==void 0?nt(console,"log"):a}function st(){for(var xt=this.getLevel(),Ct=0;Ct=0&&yt<=Pt.levels.SILENT)return yt;throw new TypeError("log.setLevel() called with invalid level: "+Bt)}Pt.name=xt,Pt.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},Pt.methodFactory=Ct||ut,Pt.getLevel=function(){return Lt??kt??Tt},Pt.setLevel=function(Bt,yt){return Lt=Dt(Bt),yt!==!1&&zt(Lt),st.call(Pt)},Pt.setDefaultLevel=function(Bt){kt=Dt(Bt),jt()||Pt.setLevel(Bt,!1)},Pt.resetLevel=function(){Lt=null,Mt(),st.call(Pt)},Pt.enableAll=function(Bt){Pt.setLevel(Pt.levels.TRACE,Bt)},Pt.disableAll=function(Bt){Pt.setLevel(Pt.levels.SILENT,Bt)},Pt.rebuild=function(){if(rt!==Pt&&(Tt=Dt(rt.getLevel())),st.call(Pt),rt===Pt)for(var Bt in tt)tt[Bt].rebuild()},Tt=Dt(rt?rt.getLevel():"WARN");var Ft=jt();Ft!=null&&(Lt=Dt(Ft)),st.call(Pt)}rt=new dt,rt.getLogger=function(Ct){if(typeof Ct!="symbol"&&typeof Ct!="string"||Ct==="")throw new TypeError("You must supply a name when creating a logger.");var Pt=tt[Ct];return Pt||(Pt=tt[Ct]=new dt(Ct,rt.methodFactory)),Pt};var mt=typeof window!==$?window.log:void 0;return rt.noConflict=function(){return typeof window!==$&&window.log===rt&&(window.log=mt),rt},rt.getLoggers=function(){return tt},rt.default=rt,rt})})(loglevel);var loglevelExports=loglevel.exports;const log$1$1=getDefaultExportFromCjs$1(loglevelExports),log$7=log$1$1.getLogger("http-helpers");log$7.setLevel(loglevelExports.levels.INFO);let apiKey$2="torus-default";const gatewayAuthHeader$2="x-api-key";async function fetchAndTrace$2(_,a){let $=null;try{$=new URL(_)}catch{}return fetch(_,a)}function getApiKeyHeaders$2(){const _={};return _[gatewayAuthHeader$2]=apiKey$2,_}function debugLogResponse$2(_){log$7.info(`Response: ${_.status} ${_.statusText}`),log$7.info(`Url: ${_.url}`)}function logTracingHeader$1(_){log$7.info(`Request tracing with traceID=${_.headers.get("x-web3-correlation-id")}`)}const promiseTimeout$1=(_,a)=>{const $=new Promise((j,et)=>{const tt=setTimeout(()=>{clearTimeout(tt),et(new Error(`Timed out in ${_}ms`))},_)});return Promise.race([a,$])},get$2=async function(_){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const j={mode:"cors",headers:{}};$.useAPIKey&&(j.headers=_objectSpread2(_objectSpread2({},j.headers),getApiKeyHeaders$2()));const et=deepmerge$1(j,a,{method:"GET"}),tt=await fetchAndTrace$2(_,et);if(tt.ok){const rt=tt.headers.get("content-type");return rt!=null&&rt.includes("application/json")?tt.json():tt.text()}throw debugLogResponse$2(tt),tt},post$1=function(_){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const et={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};j.useAPIKey&&(et.headers=_objectSpread2(_objectSpread2({},et.headers),getApiKeyHeaders$2()));const tt=deepmerge$1(et,$,{method:"POST"});return j.isUrlEncodedData?(tt.body=a,tt.headers["Content-Type"]==="application/json; charset=utf-8"&&delete tt.headers["Content-Type"]):tt.body=JSON.stringify(a),promiseTimeout$1(j.timeout||6e4,fetchAndTrace$2(_,tt).then(rt=>{if(j.logTracingHeader&&logTracingHeader$1(rt),rt.ok){const nt=rt.headers.get("content-type");return nt!=null&&nt.includes("application/json")?rt.json():rt.text()}throw debugLogResponse$2(rt),rt}))};function _objectWithoutPropertiesLoose(_,a){if(_==null)return{};var $={};for(var j in _)if({}.hasOwnProperty.call(_,j)){if(a.indexOf(j)>=0)continue;$[j]=_[j]}return $}function _objectWithoutProperties(_,a){if(_==null)return{};var $,j,et=_objectWithoutPropertiesLoose(_,a);if(Object.getOwnPropertySymbols){var tt=Object.getOwnPropertySymbols(_);for(j=0;j=0||{}.propertyIsEnumerable.call(_,$)&&(et[$]=_[$])}return et}const BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class Utils{static getFirstMatch(a,$){const j=$.match(a);return j&&j.length>0&&j[1]||""}static getSecondMatch(a,$){const j=$.match(a);return j&&j.length>1&&j[2]||""}static matchAndReturnConst(a,$,j){if(a.test($))return j}static getWindowsVersionName(a){switch(a){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(a){const $=a.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),$[0]===10)switch($[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(a){const $=a.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),!($[0]===1&&$[1]<5)){if($[0]===1&&$[1]<6)return"Cupcake";if($[0]===1&&$[1]>=6)return"Donut";if($[0]===2&&$[1]<2)return"Eclair";if($[0]===2&&$[1]===2)return"Froyo";if($[0]===2&&$[1]>2)return"Gingerbread";if($[0]===3)return"Honeycomb";if($[0]===4&&$[1]<1)return"Ice Cream Sandwich";if($[0]===4&&$[1]<4)return"Jelly Bean";if($[0]===4&&$[1]>=4)return"KitKat";if($[0]===5)return"Lollipop";if($[0]===6)return"Marshmallow";if($[0]===7)return"Nougat";if($[0]===8)return"Oreo";if($[0]===9)return"Pie"}}static getVersionPrecision(a){return a.split(".").length}static compareVersions(a,$,j=!1){const et=Utils.getVersionPrecision(a),tt=Utils.getVersionPrecision($);let rt=Math.max(et,tt),nt=0;const it=Utils.map([a,$],at=>{const st=rt-Utils.getVersionPrecision(at),ot=at+new Array(st+1).join(".0");return Utils.map(ot.split("."),ut=>new Array(20-ut.length).join("0")+ut).reverse()});for(j&&(nt=rt-Math.min(et,tt)),rt-=1;rt>=nt;){if(it[0][rt]>it[1][rt])return 1;if(it[0][rt]===it[1][rt]){if(rt===nt)return 0;rt-=1}else if(it[0][rt]{j[it]=rt[it]})}return a}static getBrowserAlias(a){return BROWSER_ALIASES_MAP[a]}static getBrowserTypeByAlias(a){return BROWSER_MAP[a]||""}}const commonVersionIdentifier=/version\/(\d+(\.?_?\d+)+)/i,browsersList=[{test:[/googlebot/i],describe(_){const a={name:"Googlebot"},$=Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/opera/i],describe(_){const a={name:"Opera"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/opr\/|opios/i],describe(_){const a={name:"Opera"},$=Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/SamsungBrowser/i],describe(_){const a={name:"Samsung Internet for Android"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/Whale/i],describe(_){const a={name:"NAVER Whale Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/MZBrowser/i],describe(_){const a={name:"MZ Browser"},$=Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/focus/i],describe(_){const a={name:"Focus"},$=Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/swing/i],describe(_){const a={name:"Swing"},$=Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/coast/i],describe(_){const a={name:"Opera Coast"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(_){const a={name:"Opera Touch"},$=Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/yabrowser/i],describe(_){const a={name:"Yandex Browser"},$=Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/ucbrowser/i],describe(_){const a={name:"UC Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/Maxthon|mxios/i],describe(_){const a={name:"Maxthon"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/epiphany/i],describe(_){const a={name:"Epiphany"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/puffin/i],describe(_){const a={name:"Puffin"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/sleipnir/i],describe(_){const a={name:"Sleipnir"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/k-meleon/i],describe(_){const a={name:"K-Meleon"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/micromessenger/i],describe(_){const a={name:"WeChat"},$=Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/qqbrowser/i],describe(_){const a={name:/qqbrowserlite/i.test(_)?"QQ Browser Lite":"QQ Browser"},$=Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/msie|trident/i],describe(_){const a={name:"Internet Explorer"},$=Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/\sedg\//i],describe(_){const a={name:"Microsoft Edge"},$=Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/edg([ea]|ios)/i],describe(_){const a={name:"Microsoft Edge"},$=Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/vivaldi/i],describe(_){const a={name:"Vivaldi"},$=Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/seamonkey/i],describe(_){const a={name:"SeaMonkey"},$=Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/sailfish/i],describe(_){const a={name:"Sailfish"},$=Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,_);return $&&(a.version=$),a}},{test:[/silk/i],describe(_){const a={name:"Amazon Silk"},$=Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/phantom/i],describe(_){const a={name:"PhantomJS"},$=Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/slimerjs/i],describe(_){const a={name:"SlimerJS"},$=Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(_){const a={name:"BlackBerry"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/(web|hpw)[o0]s/i],describe(_){const a={name:"WebOS Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,_)||Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/bada/i],describe(_){const a={name:"Bada"},$=Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/tizen/i],describe(_){const a={name:"Tizen"},$=Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/qupzilla/i],describe(_){const a={name:"QupZilla"},$=Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/firefox|iceweasel|fxios/i],describe(_){const a={name:"Firefox"},$=Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/electron/i],describe(_){const a={name:"Electron"},$=Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/MiuiBrowser/i],describe(_){const a={name:"Miui"},$=Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/chromium/i],describe(_){const a={name:"Chromium"},$=Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,_)||Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/chrome|crios|crmo/i],describe(_){const a={name:"Chrome"},$=Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/GSA/i],describe(_){const a={name:"Google Search"},$=Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test(_){const a=!_.test(/like android/i),$=_.test(/android/i);return a&&$},describe(_){const a={name:"Android Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/playstation 4/i],describe(_){const a={name:"PlayStation 4"},$=Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/safari|applewebkit/i],describe(_){const a={name:"Safari"},$=Utils.getFirstMatch(commonVersionIdentifier,_);return $&&(a.version=$),a}},{test:[/.*/i],describe(_){const a=/^(.*)\/(.*) /,$=/^(.*)\/(.*)[ \t]\((.*)/,et=_.search("\\(")!==-1?$:a;return{name:Utils.getFirstMatch(et,_),version:Utils.getSecondMatch(et,_)}}}],osParsersList=[{test:[/Roku\/DVP/],describe(_){const a=Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,_);return{name:OS_MAP.Roku,version:a}}},{test:[/windows phone/i],describe(_){const a=Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,_);return{name:OS_MAP.WindowsPhone,version:a}}},{test:[/windows /i],describe(_){const a=Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,_),$=Utils.getWindowsVersionName(a);return{name:OS_MAP.Windows,version:a,versionName:$}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(_){const a={name:OS_MAP.iOS},$=Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/,_);return $&&(a.version=$),a}},{test:[/macintosh/i],describe(_){const a=Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,_).replace(/[_\s]/g,"."),$=Utils.getMacOSVersionName(a),j={name:OS_MAP.MacOS,version:a};return $&&(j.versionName=$),j}},{test:[/(ipod|iphone|ipad)/i],describe(_){const a=Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,_).replace(/[_\s]/g,".");return{name:OS_MAP.iOS,version:a}}},{test(_){const a=!_.test(/like android/i),$=_.test(/android/i);return a&&$},describe(_){const a=Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,_),$=Utils.getAndroidVersionName(a),j={name:OS_MAP.Android,version:a};return $&&(j.versionName=$),j}},{test:[/(web|hpw)[o0]s/i],describe(_){const a=Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,_),$={name:OS_MAP.WebOS};return a&&a.length&&($.version=a),$}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(_){const a=Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,_)||Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,_)||Utils.getFirstMatch(/\bbb(\d+)/i,_);return{name:OS_MAP.BlackBerry,version:a}}},{test:[/bada/i],describe(_){const a=Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,_);return{name:OS_MAP.Bada,version:a}}},{test:[/tizen/i],describe(_){const a=Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,_);return{name:OS_MAP.Tizen,version:a}}},{test:[/linux/i],describe(){return{name:OS_MAP.Linux}}},{test:[/CrOS/],describe(){return{name:OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe(_){const a=Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,_);return{name:OS_MAP.PlayStation4,version:a}}}],platformParsersList=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(_){const a=Utils.getFirstMatch(/(can-l01)/i,_)&&"Nova",$={type:PLATFORMS_MAP.mobile,vendor:"Huawei"};return a&&($.model=a),$}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:PLATFORMS_MAP.tablet}}},{test(_){const a=_.test(/ipod|iphone/i),$=_.test(/like (ipod|iphone)/i);return a&&!$},describe(_){const a=Utils.getFirstMatch(/(ipod|iphone)/i,_);return{type:PLATFORMS_MAP.mobile,vendor:"Apple",model:a}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:PLATFORMS_MAP.mobile}}},{test(_){return _.getBrowserName(!0)==="blackberry"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test(_){return _.getBrowserName(!0)==="bada"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(_){return _.getBrowserName()==="windows phone"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test(_){const a=Number(String(_.getOSVersion()).split(".")[0]);return _.getOSName(!0)==="android"&&a>=3},describe(){return{type:PLATFORMS_MAP.tablet}}},{test(_){return _.getOSName(!0)==="android"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(_){return _.getOSName(!0)==="macos"},describe(){return{type:PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test(_){return _.getOSName(!0)==="windows"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(_){return _.getOSName(!0)==="linux"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(_){return _.getOSName(!0)==="playstation 4"},describe(){return{type:PLATFORMS_MAP.tv}}},{test(_){return _.getOSName(!0)==="roku"},describe(){return{type:PLATFORMS_MAP.tv}}}],enginesParsersList=[{test(_){return _.getBrowserName(!0)==="microsoft edge"},describe(_){if(/\sedg\//i.test(_))return{name:ENGINE_MAP.Blink};const $=Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,_);return{name:ENGINE_MAP.EdgeHTML,version:$}}},{test:[/trident/i],describe(_){const a={name:ENGINE_MAP.Trident},$=Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test(_){return _.test(/presto/i)},describe(_){const a={name:ENGINE_MAP.Presto},$=Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test(_){const a=_.test(/gecko/i),$=_.test(/like gecko/i);return a&&!$},describe(_){const a={name:ENGINE_MAP.Gecko},$=Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe(_){const a={name:ENGINE_MAP.WebKit},$=Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,_);return $&&(a.version=$),a}}];class Parser{constructor(a,$=!1){if(a==null||a==="")throw new Error("UserAgent parameter can't be empty");this._ua=a,this.parsedResult={},$!==!0&&this.parse()}getUA(){return this._ua}test(a){return a.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const a=Utils.find(browsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.browser=a.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(a){return a?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const a=Utils.find(osParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.os=a.describe(this.getUA())),this.parsedResult.os}getOSName(a){const{name:$}=this.getOS();return a?String($).toLowerCase()||"":$||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(a=!1){const{type:$}=this.getPlatform();return a?String($).toLowerCase()||"":$||""}parsePlatform(){this.parsedResult.platform={};const a=Utils.find(platformParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.platform=a.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(a){return a?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const a=Utils.find(enginesParsersList,$=>{if(typeof $.test=="function")return $.test(this);if($.test instanceof Array)return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return a&&(this.parsedResult.engine=a.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Utils.assign({},this.parsedResult)}satisfies(a){const $={};let j=0;const et={};let tt=0;if(Object.keys(a).forEach(nt=>{const it=a[nt];typeof it=="string"?(et[nt]=it,tt+=1):typeof it=="object"&&($[nt]=it,j+=1)}),j>0){const nt=Object.keys($),it=Utils.find(nt,st=>this.isOS(st));if(it){const st=this.satisfies($[it]);if(st!==void 0)return st}const at=Utils.find(nt,st=>this.isPlatform(st));if(at){const st=this.satisfies($[at]);if(st!==void 0)return st}}if(tt>0){const nt=Object.keys(et),it=Utils.find(nt,at=>this.isBrowser(at,!0));if(it!==void 0)return this.compareVersion(et[it])}}isBrowser(a,$=!1){const j=this.getBrowserName().toLowerCase();let et=a.toLowerCase();const tt=Utils.getBrowserTypeByAlias(et);return $&&tt&&(et=tt.toLowerCase()),et===j}compareVersion(a){let $=[0],j=a,et=!1;const tt=this.getBrowserVersion();if(typeof tt=="string")return a[0]===">"||a[0]==="<"?(j=a.substr(1),a[1]==="="?(et=!0,j=a.substr(2)):$=[],a[0]===">"?$.push(1):$.push(-1)):a[0]==="="?j=a.substr(1):a[0]==="~"&&(et=!0,j=a.substr(1)),$.indexOf(Utils.compareVersions(tt,j,et))>-1}isOS(a){return this.getOSName(!0)===String(a).toLowerCase()}isPlatform(a){return this.getPlatformType(!0)===String(a).toLowerCase()}isEngine(a){return this.getEngineName(!0)===String(a).toLowerCase()}is(a,$=!1){return this.isBrowser(a,$)||this.isOS(a)||this.isPlatform(a)}some(a=[]){return a.some($=>this.is($))}}/*! * Bowser - a browser detector * https://github.com/lancedikson/bowser * MIT License | (c) Dustin Diaz 2012-2015 @@ -586,7 +586,7 @@ License: MIT "main main" `,height:"100%",children:[jsxRuntimeExports.jsx(GridItem,{gridArea:"header",children:jsxRuntimeExports.jsx(TopBar,{title:"Help"})}),jsxRuntimeExports.jsxs(GridItem,{gridArea:"main",marginTop:1,children:[jsxRuntimeExports.jsx(HelpCard,{title:"Learn More",children:jsxRuntimeExports.jsx(HelpLinkRow,{about:"Browse Articles",externalLink:"https://medium.com/umamiwallet"})}),jsxRuntimeExports.jsxs(HelpCard,{title:"Need Help?",children:[jsxRuntimeExports.jsx(HelpLinkRow,{about:"Contact our Support Team",externalLink:"mailto:umami-support@trili.tech",linkDescription:"umami-support@trili.tech"}),jsxRuntimeExports.jsx(HelpLinkRow,{about:"Get in touch with the Community",externalLink:"https://join.slack.com/t/tezos-dev/shared_invite/zt-1ur1ymxrp-G_X_bFHrvWXwoeiy53J8lg",linkDescription:"Slack #Umami"})]}),jsxRuntimeExports.jsxs(HelpCard,{title:"Terms",children:[jsxRuntimeExports.jsx(HelpLinkRow,{about:"Read Terms of Service",externalLink:"https://umamiwallet.com/tos.html"}),jsxRuntimeExports.jsx(HelpLinkRow,{about:"Read Privacy Policy",externalLink:"https://umamiwallet.com/privacypolicy.html"})]})]})]}),HelpLinkRow=({about:_,externalLink:a,linkDescription:$})=>jsxRuntimeExports.jsx(Link,{rel:"noopener noreferrer",target:"_blank",to:a,children:jsxRuntimeExports.jsx(ClickableCard,{cursor:"pointer",isSelected:!1,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:_}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[$&&jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[400],size:"sm",children:$}),jsxRuntimeExports.jsx(ExternalLinkIcon,{})]})]})})}),HelpCard=({title:_,children:a})=>jsxRuntimeExports.jsx(Box,{"data-testid":"help-card",marginY:"10px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(Box,{width:"550px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"16px",size:"lg",children:_}),a]})})}),ConnectOptions=({goToStep:_})=>{const a=useImplicitAccounts().length>0;return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LinkIcon,{}),title:"Connect or Import Account",children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:"16px",children:[jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"restoreMnemonic"}),size:"lg",children:"Import with Seed Phrase"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"restoreSecretKey"}),size:"lg",variant:"tertiary",children:"Import with Secret Key"}),!a&&jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"restoreBackup"}),size:"lg",variant:"tertiary",children:"Restore from Backup"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"nameAccount",account:{type:"ledger"}}),size:"lg",variant:"tertiary",children:"Connect ledger"})]})})},withTimeout=(_,a,$)=>Promise.race([_(),new Promise((j,et)=>setTimeout(()=>{et(new Error("The operation has timed out"))},a))]),LOGIN_TIMEOUT=minutesToMilliseconds(1),useOnboardWithSocial=(_,a)=>{const $=useToast(),{isLoading:j,handleAsyncAction:et}=useAsyncActionHandler(),tt=useRestoreSocial(),rt=reactExports.useCallback(()=>et(async()=>{const{secretKey:nt,name:it}=await withTimeout(()=>forIDP(_).getCredentials(),LOGIN_TIMEOUT),{pk:at,pkh:st}=await getPublicKeyPairFromSk(nt);tt(at,st,it,_),$({description:`Successfully added ${it} account`,status:"success"}),a()},{title:"Social login failed"}),[_,$,et,tt,a]);return{isLoading:j,onboard:rt}},OnboardWithEmailButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("email",_);return jsxRuntimeExports.jsx(IconButton,{color:"black",_hover:{color:"white",background:colors.gray[600]},"aria-label":"Email SSO","data-testid":"login-button-email",icon:jsxRuntimeExports.jsx(EmailIcon,{fill:"currentColor"}),isLoading:a,onClick:$,variant:"socialLogin"})},OnboardWithFacebookButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("facebook",_);return jsxRuntimeExports.jsx(IconButton,{"aria-label":"Facebook SSO","data-testid":"login-button-facebook",icon:jsxRuntimeExports.jsx(FacebookIcon,{}),isLoading:a,onClick:$,variant:"socialLogin"})},OnboardWithGoogleButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("google",_);return jsxRuntimeExports.jsx(IconButton,{"aria-label":"Google SSO","data-testid":"login-button-google",icon:jsxRuntimeExports.jsx(GoogleIcon,{}),isLoading:a,onClick:$,variant:"socialLogin"})},OnboardWithRedditButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("reddit",_);return jsxRuntimeExports.jsx(IconButton,{"aria-label":"Reddit SSO","data-testid":"login-button-reddit",icon:jsxRuntimeExports.jsx(RedditIcon,{}),isLoading:a,onClick:$,variant:"socialLogin"})},OnboardWithTwitterButton=({onAuth:_})=>{const{isLoading:a,onboard:$}=useOnboardWithSocial("twitter",_);return jsxRuntimeExports.jsx(IconButton,{color:"black",_hover:{color:"white",background:colors.gray[600]},"aria-label":"Twitter SSO","data-testid":"login-button-twitter",icon:jsxRuntimeExports.jsx(TwitterIcon,{fill:"currentColor"}),isLoading:a,onClick:$,variant:"socialLogin"})};var define_import_meta_env_default={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const IS_DEV=define_import_meta_env_default.DEBUG,ConnectOrCreate=({goToStep:_,closeModal:a})=>jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(WalletPlusIcon,{}),title:"Connect or Create Account",children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:"16px",children:[jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"notice"}),size:"lg",children:"Create a new Account"}),jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"connectOptions"}),size:"lg",variant:"tertiary",children:"I already have a wallet"}),IS_DEV&&jsxRuntimeExports.jsx(Button,{width:"100%",onClick:$=>_({type:"fakeAccount"}),size:"lg",variant:"tertiary",children:"Add a Fake Account"}),jsxRuntimeExports.jsxs(Flex,{width:"100%",paddingTop:"14px",paddingBottom:"6px",children:[jsxRuntimeExports.jsx(Divider,{marginTop:"11px"}),jsxRuntimeExports.jsx(Text,{minWidth:"160px",color:colors.gray[400],textAlign:"center",noOfLines:1,size:"sm",children:"Continue with social"}),jsxRuntimeExports.jsx(Divider,{marginTop:"11px"})]}),jsxRuntimeExports.jsxs(Flex,{gap:"12px",children:[jsxRuntimeExports.jsx(OnboardWithGoogleButton,{onAuth:a}),jsxRuntimeExports.jsx(OnboardWithFacebookButton,{onAuth:a}),jsxRuntimeExports.jsx(OnboardWithTwitterButton,{onAuth:a}),jsxRuntimeExports.jsx(OnboardWithEmailButton,{onAuth:a}),jsxRuntimeExports.jsx(OnboardWithRedditButton,{onAuth:a})]})]})}),Select=({selected:_,options:a,onChange:$})=>{const[j,et]=reactExports.useState(_),[tt,rt]=reactExports.useState(!1);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",height:"48px",padding:"12px 15px 15px 15px",color:colors.gray[300],background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px",_hover:{borderColor:colors.gray[450]},cursor:"pointer","data-testid":"select-input",onClick:()=>rt(nt=>!nt),children:[jsxRuntimeExports.jsx(Text,{size:"sm",children:j.label}),jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginTop:"2px"})]}),tt&&jsxRuntimeExports.jsx(UnorderedList,{position:"absolute",zIndex:2,width:"100%",margin:0,marginTop:"8px",padding:"15px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"select-options",listStyleType:"none",children:a.map(nt=>jsxRuntimeExports.jsx(ListItem,{marginBottom:"5px",padding:"11px",color:colors.gray[300],background:"transparent",borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",onClick:()=>{rt(!1),et(nt),$(nt.value)},children:jsxRuntimeExports.jsx(Text,{size:"sm",children:nt.label})},nt.value))})]})},DerivationPath=({goToStep:_,account:a})=>{const[$,j]=reactExports.useState(!1),{handleSubmit:et,register:tt,setValue:rt,formState:{isValid:nt,errors:it}}=useForm({mode:"onBlur",defaultValues:{derivationPathTemplate:defaultDerivationPathTemplate,derivationPath:getDefaultDerivationPath(0)}}),at=async({derivationPathTemplate:st,derivationPath:ot})=>{switch(a.type){case"ledger":return _($?{type:"restoreLedger",account:{...a,derivationPath:normalizeDerivationPath(ot)}}:{type:"restoreLedger",account:{...a,derivationPathTemplate:normalizeDerivationPath(st)}});case"mnemonic":{if($){const ut=await deriveSecretKey(a.mnemonic,ot,"ed25519");return _({type:"masterPassword",account:{type:"secret_key",secretKey:ut,label:a.label}})}return _({type:"masterPassword",account:{...a,derivationPathTemplate:st}})}}};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(SlashIcon,{}),subtitle:"Choose a custom derivation path or select the default derivation path and use the default key.",title:"Derivation Path",children:jsxRuntimeExports.jsxs("form",{onSubmit:et(at),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(Center,{width:"100%",marginBottom:"12px",children:[jsxRuntimeExports.jsx(Text,{fontWeight:$?400:600,size:"sm",children:"Default Path"}),jsxRuntimeExports.jsx(Switch,{"data-testid":"custom-path-switch",marginX:"10px",onChange:()=>j(st=>!st),variant:"danger"}),jsxRuntimeExports.jsx(Text,{fontWeight:$?600:400,size:"sm",children:"Custom Path"})]}),$&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Center,{marginTop:"16px",marginBottom:"32px",children:jsxRuntimeExports.jsx(Text,{width:"340px",color:colors.orange,textAlign:"center",size:"xs",children:"Please write down to your derivation path. You may not be able to restore your data if you lose it."})}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"20px",isInvalid:!!it.derivationPath,children:[jsxRuntimeExports.jsx(Input,{fontSize:"sm",textAlign:"center","data-testid":"custom-path-input",...tt("derivationPath",{validate:validateDerivationPath})}),it.derivationPath&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"error-message",children:it.derivationPath.message})]})]}),!$&&jsxRuntimeExports.jsx(FormControl,{marginTop:"32px",marginBottom:"20px",children:jsxRuntimeExports.jsx(Select,{onChange:st=>rt("derivationPathTemplate",st),options:AVAILABLE_DERIVATION_PATH_TEMPLATES,selected:DEFAULT_DERIVATION_PATH_TEMPLATE})}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"12px",isDisabled:!nt,size:"lg",type:"submit",children:"Continue"}),jsxRuntimeExports.jsx(ExternalLink,{display:"block",width:"100%",marginTop:"32px",textAlign:"center",href:"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki",children:jsxRuntimeExports.jsx(Tooltip,{backgroundColor:"white",defaultIsOpen:!1,hasArrow:!0,label:"Derivation path is a set of directions that helps create different secret keys; it starts from a master key or seed.",children:jsxRuntimeExports.jsx(Text,{color:colors.blue,fontWeight:600,textDecoration:"underline",_hover:{textDecoration:"underline"},size:"sm",children:"What's a Derivation Path?"})})})]})})},normalizeDerivationPath=_=>_.trim().toLowerCase().replace("m/",""),validateDerivationPath=_=>{const a=normalizeDerivationPath(_);return a.length===0?"Derivation path is required":a.startsWith("44'/1729'/")?a.match(new RegExp("^44'/1729'/([0-9]+'/)*([0-9]+')$"))?!0:"Invalid derivation path":"Derivation path must start with `44'/1729'/`"},Eula=({goToStep:_})=>{const[a,$]=React$2.useState(!1);return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(DocumentIcon,{}),title:"Accept to Continue",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Checkbox,{paddingBottom:"24px",fontWeight:"600",onChange:j=>$(j.target.checked),children:["I confirm that I have read and agreed with the"," ",jsxRuntimeExports.jsx(Link$1,{textDecoration:"underline",_hover:{color:colors.green},href:"https://umamiwallet.com/tos.html",rel:"noopener noreferrer",target:"_blank",children:"Terms of Service"})," ","and the"," ",jsxRuntimeExports.jsx(Link$1,{textDecoration:"underline",_hover:{color:colors.green},href:"https://umamiwallet.com/privacypolicy.html",rel:"noopener noreferrer",target:"_blank",children:"Privacy Policy"})]}),jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!a,onClick:()=>{_({type:"connectOrCreate"})},size:"lg",children:"Continue"})]})})},FakeAccount=({onClose:_})=>{const{register:a,handleSubmit:$,formState:{errors:j}}=useForm({mode:"onBlur"}),et=useRestoreLedger(),tt=useRestoreSocial(),rt=async({pkh:nt,name:it,idp:at})=>{if(at&&at.length>0&&!["google","facebook","twitter","reddit","email"].includes(at))throw new Error("Invalid IDP");const ot=await new RpcClient(GHOSTNET.rpcUrl).getManagerKey(nt),ut=typeof ot=="string"?ot:ot.key;at?tt(ut,nt,it,at):et(defaultDerivationPathTemplate,makeDerivationPath(defaultDerivationPathTemplate,0),ut,nt,it),_()};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(WalletPlusIcon,{}),title:"Add a Fake Account",children:jsxRuntimeExports.jsxs("form",{onSubmit:$(rt),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.pkh,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Address"}),jsxRuntimeExports.jsx(Input,{...a("pkh",{required:!0}),autoComplete:"off",placeholder:"Please enter the account address"})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"12px",isInvalid:!!j.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Name"}),jsxRuntimeExports.jsx(Input,{...a("name",{required:!0}),autoComplete:"off",placeholder:"Please enter the account name"})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"12px",isInvalid:!!j.idp,children:[jsxRuntimeExports.jsx(FormLabel,{children:"IDP (For a social account)"}),jsxRuntimeExports.jsx(Input,{...a("idp"),autoComplete:"off",placeholder:"Please enter the IDP"})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"12px",size:"lg",type:"submit",children:"Add account"})]})})},EnterAndConfirmPassword=({onSubmit:_,isLoading:a})=>{const $=useForm({mode:"onBlur"}),{handleSubmit:j,formState:{errors:et,isValid:tt},getValues:rt}=$,nt=({confirm:it})=>_(it);return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LockIcon,{}),subtitle:"Please choose a master password for Umami. You will need to use this password in order to perform any operations within Umami.",title:"Umami Master Password",children:jsxRuntimeExports.jsx(FormProvider,{...$,children:jsxRuntimeExports.jsxs("form",{onSubmit:j(nt),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!et.password,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password",inputName:"password",placeholder:"Enter master password"}),et.password&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.password.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!et.confirm,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"confirmation",inputName:"confirm",label:"Confirm Password",placeholder:"Confirm your password",required:"Confirmation is required",validate:it=>rt("password")===it||"Your passwords do no match"}),et.confirm&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.confirm.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!tt||a,isLoading:a,size:"lg",type:"submit",children:"Submit"})]})})})},EnterPassword=({onSubmit:_,isLoading:a})=>{const $=useForm({mode:"onBlur"}),{handleSubmit:j,formState:{errors:et,isValid:tt}}=$,rt=nt=>{_(nt.password)};return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(LockIcon,{}),subtitle:"Enter your master password for Umami.",title:"Umami Master Password",children:jsxRuntimeExports.jsx(FormProvider,{...$,children:jsxRuntimeExports.jsxs("form",{onSubmit:j(rt),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!et.password,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password",inputName:"password"}),et.password&&jsxRuntimeExports.jsx(FormErrorMessage,{children:et.password.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!tt,isLoading:a,size:"lg",type:"submit",children:"Submit"})]})})})},MasterPassword=({account:_,onClose:a})=>{const $=useRestoreFromMnemonic(),j=useRestoreFromSecretKey(),et=useValidateMasterPassword(),tt=et!==null,{isLoading:rt,handleAsyncAction:nt}=useAsyncActionHandler(),it=useToast(),at=st=>nt(async()=>{switch(tt&&await et(st),_.type){case"secret_key":await j(_.secretKey,st,_.label);break;case"mnemonic":await $({..._,password:st})}it({description:"Account successfully created!",status:"success"}),a()});return tt?jsxRuntimeExports.jsx(EnterPassword,{isLoading:rt,onSubmit:at}):jsxRuntimeExports.jsx(EnterAndConfirmPassword,{isLoading:rt,onSubmit:at})},Notice=({goToStep:_})=>{const a=[{content:"Write down your seed phrase and store it in a safe place."},{content:"Make sure there is no one around you or looking over your shoulder."},{content:"Do not copy and paste the Seed Phrase or store it on your device."},{content:"Do not take a screenshot of your Seed Phrase."}];return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(NoticeIcon,{}),subtitle:"Please read the following before you continue to see your secret Seed Phrase.",title:"Important Notice",children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(OrderedList,{spacing:"16px",variant:"onboardingNotice",children:a.map(($,j)=>jsxRuntimeExports.jsx(ListItem,{fontSize:"16px",fontWeight:600,children:$.content},j))}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"28px",onClick:()=>_({type:"showSeedphrase",account:{type:"mnemonic",mnemonic:generate24WordMnemonic()}}),size:"lg",children:"I understand"}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"16px",onClick:()=>_({type:"restoreMnemonic"}),size:"lg",variant:"tertiary",children:"I already have a Seed Phrase"})]})})},RestoreBackupFile=()=>{const _=useForm({mode:"onBlur"}),{handleSubmit:a,register:$,formState:{errors:j,isValid:et}}=_,{handleAsyncAction:tt}=useAsyncActionHandler(),rt=useRestoreV1BackupFile(),nt=({password:it,file:at})=>tt(async()=>{const st=await at[0].text(),ot=JSON.parse(st);if(ot.recoveryPhrases&&ot.derivationPaths)await rt(ot,it);else if(ot["persist:accounts"])await restoreV2BackupFile(ot,it),reload();else throw new Error("Invalid backup file.")});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(RotateIcon,{}),subtitle:"Select a JSON backup file and enter the password you used to encrypt it.",title:"Restore from Backup",children:jsxRuntimeExports.jsx(FormProvider,{..._,children:jsxRuntimeExports.jsx("form",{onSubmit:a(nt),style:{width:"100%"},children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!j.file,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Upload File"}),jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Input,{padding:"2px","data-testid":"file-input",...$("file",{required:"File is required"}),accept:".json",type:"file",variant:"unstyled"})}),j.file&&jsxRuntimeExports.jsx(FormErrorMessage$1,{"data-testid":"file-errors",children:j.file.message})]}),jsxRuntimeExports.jsx(FormControl,{marginTop:"24px",children:jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password-input",inputName:"password",label:"Your password (if you have one)",required:!1})}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px",isDisabled:!et,size:"lg",type:"submit",children:"Import Wallet"})]})})})})},getPk=async _=>{const a=await TransportWebUSB.create(),$=new LedgerSigner(a,_,!0),j=await $.publicKey(),et=await $.publicKeyHash();return await a.close(),{pk:j,pkh:et}},LEDGER_TIMEOUT=60*1e3,RestoreLedger=({closeModal:_,account:a})=>{const $=useRestoreLedger(),j=useToast(),{isLoading:et,handleAsyncAction:tt}=useAsyncActionHandler(),rt=[{content:"Plug your Ledger into your computer using a USB cable."},{content:"Unlock your Ledger."},{content:"Make sure your Ledger has the latest firmware version."},{content:"Install and open the Tezos Wallet app on your Ledger."},{content:"Click the button below and confirm the action on your Ledger."}],nt=()=>tt(()=>withTimeout(async()=>{const it=j({description:"Please open the Tezos app on your Ledger and approve the operation",status:"info"}),at=a.derivationPathTemplate?makeDerivationPath(a.derivationPathTemplate,0):a.derivationPath,{pk:st,pkh:ot}=await getPk(at);$(a.derivationPathTemplate,at,st,ot,a.label),j.close(it),j({description:"Account successfully created!",status:"success"}),_()},LEDGER_TIMEOUT),it=>it.name==="PublicKeyRetrievalError"?{description:"Request rejected. Please unlock your Ledger and open the Tezos app"}:it.name==="InvalidStateError"?{description:"Request pending. Check your ledger..."}:{description:`Ledger error. ${it.message||it.name}`});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(USBIcon,{}),subtitle:"Complete the steps to connect.",title:"Connect Ledger",children:jsxRuntimeExports.jsxs(VStack,{overflowY:"auto",spacing:"24px",children:[jsxRuntimeExports.jsx(OrderedList,{spacing:4,children:rt.map((it,at)=>jsxRuntimeExports.jsx(ListItem,{children:it.content},at))}),jsxRuntimeExports.jsx(Button,{width:"100%",isLoading:et,onClick:nt,size:"lg",children:"Export Public Key"})]})})},mnemonic1="glory city income swallow act garment novel fringe bread chaos club dolphin when live penalty mirror donate razor dad eyebrow powder trumpet bunker wine",MnemonicAutocomplete=({inputName:_,validate:a,inputProps:$,listProps:j})=>{const[et,tt]=reactExports.useState(!0),{register:rt,setValue:nt,watch:it}=useFormContext(),at=it(_),st=wordlists.EN.filter(ut=>at&&ut.startsWith(at)).sort(),ot=!et&&st.length>0&&(st.length>1||st[0]!==at);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Input,{zIndex:0,autoComplete:"off","data-testid":"mnemonic-input",onFocus:()=>tt(!1),placeholder:"Type here...",...rt(_,{required:"Required",validate:a,onChange:()=>tt(!1),onBlur:()=>tt(!0)}),...$}),ot&&jsxRuntimeExports.jsx(UnorderedList,{"data-testid":"suggestions",variant:"suggestions",...j,children:st.map(ut=>jsxRuntimeExports.jsx(ListItem,{paddingTop:"2px",fontSize:"14px",fontWeight:600,"data-testid":"suggestion",onMouseDown:()=>nt(_,ut),paddingX:"7px",children:ut},ut))})]})},mnemonicSizes=[12,15,18,24],RestoreMnemonic=({goToStep:_})=>{const a=useForm({mode:"onBlur"}),{handleSubmit:$,setValue:j,trigger:et,formState:{isValid:tt}}=a,{handleAsyncAction:rt}=useAsyncActionHandler(),[nt,it]=reactExports.useState(24),at=ut=>{const dt=Number(ut);if(mnemonicSizes.includes(dt))return it(mt=>(mt>dt&&lodashExports.range(dt,Math.max(...mnemonicSizes)).forEach(xt=>{j(`word${xt}`,void 0)}),dt)),et()},st=ut=>rt(async()=>{const dt=ut.split(" ");if(!mnemonicSizes.includes(dt.length))throw new Error(`the mnemonic must be ${mnemonicSizes.join(", ")} words long`);return dt.slice(0,nt).forEach((mt,xt)=>{j(`word${xt}`,mt)}),et()}),ot=ut=>rt(async()=>{const dt=Object.values(ut).join(" ").trim();if(!validateMnemonic_1(dt))throw new Error(`Invalid Mnemonic: "${dt}"`);return _({type:"nameAccount",account:{type:"mnemonic",mnemonic:dt}}),Promise.resolve()});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px"}),subtitle:"Please fill in the Seed Phrase in sequence.",title:"Import Seed Phrase",children:jsxRuntimeExports.jsx(Box,{overflowX:"hidden",children:jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx("form",{onSubmit:$(ot),style:{width:"100%"},children:jsxRuntimeExports.jsxs(VStack,{width:"100%",spacing:4,children:[jsxRuntimeExports.jsx(Select$1,{height:"48px",color:colors.gray[450],"data-testid":"select",icon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),onChange:ut=>at(ut.target.value),value:nt,children:mnemonicSizes.reverse().map(ut=>jsxRuntimeExports.jsxs("option",{value:ut,children:[ut," Words"]},ut))}),jsxRuntimeExports.jsx(Grid,{gridGap:3,gridTemplateColumns:"repeat(3, 1fr)",paddingBottom:"20px",children:lodashExports.range(nt).map(ut=>{const dt=`word${ut}`;return jsxRuntimeExports.jsxs(GridItem,{display:"flex",height:"38px",padding:"4px",fontSize:"sm",background:colors.gray[800],border:"1px solid",borderColor:colors.gray[500],borderRadius:"4px",children:[jsxRuntimeExports.jsx(Heading,{width:"19px",marginRight:"6px",paddingTop:"6px",color:colors.gray[400],textAlign:"right",size:"sm",children:ut+1}),jsxRuntimeExports.jsx(MnemonicAutocomplete,{inputName:dt,inputProps:{onPaste:async mt=>{mt.preventDefault();const xt=await navigator.clipboard.readText();return st(xt)},border:"none",size:"xsmall"},listProps:{width:"126px",marginTop:"38px",marginLeft:"-5px"}})]},ut)})}),jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!tt,size:"lg",type:"submit",children:"Continue"}),IS_DEV&&jsxRuntimeExports.jsx(Button,{width:"100%",onClick:()=>st(mnemonic1),size:"lg",children:"Enter test mnemonic (Dev only)"})]})})})})})},RestoreSecretKey=({goToStep:_})=>{const[a,$]=reactExports.useState(!1),{handleAsyncAction:j}=useAsyncActionHandler(),et=useForm({mode:"onBlur",defaultValues:{password:""}}),{register:tt,handleSubmit:rt,formState:{errors:nt,isValid:it}}=et,at=async({secretKey:st,password:ot})=>j(async()=>{try{const dt=await(await InMemorySigner.fromSecretKey(st.trim(),ot)).secretKey();_({type:"nameAccount",account:{type:"secret_key",secretKey:dt}})}catch(ut){const dt=ut.message||"";throw dt.includes("Cannot read properties of null")?new Error("Key-password pair is invalid"):dt.includes("Invalid checksum")?new Error("Invalid secret key: checksum doesn't match"):ut}});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px"}),title:"Insert Secret Key",children:jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsxs("form",{onSubmit:rt(at),style:{width:"100%"},children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!nt.secretKey,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Secret Key"}),jsxRuntimeExports.jsx(Textarea,{minHeight:"130px","data-testid":"secret-key",...tt("secretKey",{required:"Secret key is required",onChange:st=>$(isEncryptedSecretKeyPrefix(st.target.value.trim()))}),placeholder:"Your secret key"}),nt.secretKey&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:nt.secretKey.message})]}),a&&jsxRuntimeExports.jsxs(FormControl,{marginTop:"20px",isInvalid:!!nt.password,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"password",inputName:"password",minLength:0}),nt.password&&jsxRuntimeExports.jsx(FormErrorMessage$1,{children:nt.password.message})]}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"32px","data-testid":"restore-continue-button",isDisabled:!it,size:"lg",type:"submit",children:"Continue"})]})})})},ShowSeedphrase=({goToStep:_,account:a})=>jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(KeyIcon,{width:"24px",height:"24px"}),subtitle:"Please record the following 24 words in sequence in order to restore it in the future.",title:"Record Seed Phrase",children:jsxRuntimeExports.jsxs(VStack,{children:[jsxRuntimeExports.jsx(SimpleGrid,{columns:3,spacing:2,children:a.mnemonic.split(" ").map(($,j)=>jsxRuntimeExports.jsxs(Flex,{width:"126px",padding:"6px",border:"1px dashed",borderColor:colors.gray[500],borderRadius:"4px",children:[jsxRuntimeExports.jsx(Heading,{width:"18px",marginRight:"10px",paddingTop:"2px",color:colors.gray[450],textAlign:"right",size:"sm",children:j+1}),jsxRuntimeExports.jsx(Text,{"data-testid":`mnemonic-word-${j}`,size:"sm",children:$})]},j))}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"20px",onClick:$=>{_({type:"verifySeedphrase",account:a})},size:"lg",children:"OK, I've recorded it"})]})}),VerifySeedphrase=({goToStep:_,account:a})=>{const $=a.mnemonic.split(" "),j=useForm({mode:"onBlur"}),{handleSubmit:et,formState:{errors:tt,isValid:rt}}=j,[nt]=reactExports.useState(selectRandomElements($,5)),it=()=>_({type:"nameAccount",account:a});return jsxRuntimeExports.jsx(ModalContentWrapper,{icon:jsxRuntimeExports.jsx(DoubleCheckmarkIcon,{}),subtitle:"To verify, please type in the word that corresponds to each sequence number.",title:"Verify Seed Phrase",children:jsxRuntimeExports.jsx(Box,{overflowX:"hidden",overflowY:"auto",width:"100%",children:jsxRuntimeExports.jsx(FormProvider,{...j,children:jsxRuntimeExports.jsxs("form",{onSubmit:et(it),children:[nt.map((at,st)=>{const ot=`${at.index}`,ut=tt[ot];return jsxRuntimeExports.jsxs(FormControl,{marginBottom:"12px",isInvalid:!!ut,children:[jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:1,width:"26px",marginTop:"12px",marginLeft:"4px",textAlign:"right","data-testid":"mnemonic-index",children:at.index+1}),jsxRuntimeExports.jsx(Box,{width:"100%",children:jsxRuntimeExports.jsx(MnemonicAutocomplete,{inputName:ot,inputProps:{paddingLeft:"36px",size:"md"},listProps:{marginTop:"6px"},validate:dt=>{if(dt!==at.value)return"Word doesn't match"}})}),(ut==null?void 0:ut.message)&&jsxRuntimeExports.jsx(FormErrorMessage,{children:ut.message})]},st)}),jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"20px",isDisabled:!rt,size:"lg",type:"submit",children:"Continue"}),IS_DEV&&jsxRuntimeExports.jsx(Button,{width:"100%",marginTop:"12px",onClick:it,size:"lg",children:"Bypass (Dev only)"})]})})})})},useStepHistory=_=>{const[a,$]=reactExports.useState(_),[j,et]=reactExports.useState([a]),tt=j.length===1;return{reset:()=>{$(_),et([_])},goToStep:rt=>{$(rt),et([...j,rt])},currentStep:a,goBack:()=>{if(tt)return;j.pop();const rt=j[j.length-1];et(j),$(rt)},atInitialStep:tt,fullHistory:j}},useOnboardingModal=_=>{const{isOpen:a,onOpen:$,onClose:j}=useDisclosure$1(),et=useImplicitAccounts().length!==0,tt=useStepHistory({type:et?"connectOrCreate":"eula"}),{currentStep:rt,goToStep:nt}=tt,it=()=>{tt.reset(),_&&_(),j()},at=()=>{switch(rt.type){case"eula":return jsxRuntimeExports.jsx(Eula,{goToStep:nt});case"connectOrCreate":return jsxRuntimeExports.jsx(ConnectOrCreate,{closeModal:it,goToStep:nt});case"connectOptions":return jsxRuntimeExports.jsx(ConnectOptions,{goToStep:nt});case"notice":return jsxRuntimeExports.jsx(Notice,{goToStep:nt});case"restoreMnemonic":return jsxRuntimeExports.jsx(RestoreMnemonic,{goToStep:nt});case"restoreBackup":return jsxRuntimeExports.jsx(RestoreBackupFile,{});case"showSeedphrase":return jsxRuntimeExports.jsx(ShowSeedphrase,{goToStep:nt,...rt});case"verifySeedphrase":return jsxRuntimeExports.jsx(VerifySeedphrase,{goToStep:nt,...rt});case"nameAccount":return jsxRuntimeExports.jsx(NameAccount,{goToStep:nt,...rt});case"derivationPath":return jsxRuntimeExports.jsx(DerivationPath,{goToStep:nt,...rt});case"restoreLedger":return jsxRuntimeExports.jsx(RestoreLedger,{closeModal:it,...rt});case"masterPassword":return jsxRuntimeExports.jsx(MasterPassword,{onClose:it,...rt});case"fakeAccount":return jsxRuntimeExports.jsx(FakeAccount,{onClose:j});case"restoreSecretKey":return jsxRuntimeExports.jsx(RestoreSecretKey,{goToStep:nt})}};return{modalElement:jsxRuntimeExports.jsxs(Modal,{autoFocus:!1,closeOnOverlayClick:!1,isCentered:!0,isOpen:a,onClose:it,children:[et&&jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(ModalContent,{children:[!tt.atInitialStep&&jsxRuntimeExports.jsx(ModalBackButton,{onClick:tt.goBack}),jsxRuntimeExports.jsx(ModalCloseButton,{onClick:it}),at()]})]}),onOpen:$}},AccountListHeader=()=>{const{onOpen:_,modalElement:a}=useOnboardingModal();return jsxRuntimeExports.jsxs(Flex,{flexDirection:"row-reverse",marginTop:"12px",marginBottom:"16px",children:[jsxRuntimeExports.jsxs(Button,{paddingRight:"0",onClick:_,variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(AddAccountIcon,{stroke:"currentcolor"}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:"Add Account"})]}),a]})},AccountGroupPopover=({onRemove:_,onCreate:a})=>jsxRuntimeExports.jsx(PopoverMenu,{children:jsxRuntimeExports.jsxs(Box,{paddingY:"0",children:[jsxRuntimeExports.jsx(Button,{height:a?"24px":"28px","data-testid":"popover-remove",onClick:_,variant:"popover",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Remove"}),jsxRuntimeExports.jsx(TrashIcon,{stroke:"inherit"})]})}),a&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{marginY:"4px"}),jsxRuntimeExports.jsx(Button,{onClick:a,variant:"popover",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Create"}),jsxRuntimeExports.jsx(PlusIcon,{width:"18px",height:"18px",stroke:"inherit"})]})})]})]})}),DeriveMnemonicAccountModal=({onDone:_,fingerPrint:a})=>{const[$,j]=reactExports.useState(),{isLoading:et,handleAsyncAction:tt}=useAsyncActionHandler(),rt=useToast(),nt=useDeriveMnemonicAccount(),it=({name:at,password:st})=>tt(async()=>{await nt({fingerPrint:a,password:st,label:at.trim()||DEFAULT_ACCOUNT_LABEL}),_(),rt({description:`New account created! Successfully derived account from ${a}`})},{title:"Failed to derive new account"});return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),$?jsxRuntimeExports.jsx(EnterPassword,{isLoading:et,onSubmit:at=>it({name:$,password:at})}):jsxRuntimeExports.jsx(NameAccountDisplay,{onSubmit:at=>j(at.accountName),subtitle:`Name the new account derived from ${a}`})]})},getAccountGroupLabel=_=>{switch(_.type){case"mnemonic":return`Seedphrase ${_.seedFingerPrint}`;case"social":return"Social Accounts";case"ledger":return"Ledger Accounts";case"secret_key":return"Secret Key Accounts";case"multisig":return"Multisig Accounts"}},AccountGroup=({groupLabel:_,accounts:a,balances:$})=>{const j=a[0],et=j.type==="multisig",tt=j.type==="mnemonic",{openWith:rt,onClose:nt}=reactExports.useContext(DynamicModalContext),it=useRemoveMnemonic(),at=useRemoveNonMnemonic(),st=useImplicitAccounts().length===a.length,ot="Remove All Accounts";let ut,dt="Remove All";const mt=getAccountGroupLabel(j);st?(ut="Removing all your accounts will off-board you from Umami. This will remove or reset all customized settings to their defaults. Personal data (including saved contacts, password and accounts) won't be affected.",dt="Remove & Off-board"):tt?ut=`Are you sure you want to remove all accounts derived from ${mt}?`:ut=`Are you sure you want to remove all of your ${mt}?`;const xt=()=>rt(jsxRuntimeExports.jsx(ConfirmationModal,{buttonLabel:dt,description:ut,onSubmit:()=>{tt?it(j.seedFingerPrint):et||at(j.type),nt()},title:ot})),Ct=()=>{if(!tt)throw new Error("Can't derive a non mnemonic account!");return rt(jsxRuntimeExports.jsx(DeriveMnemonicAccountModal,{fingerPrint:j.seedFingerPrint,onDone:nt}))};return jsxRuntimeExports.jsxs(Box,{"data-testid":`account-group-${_}`,children:[jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",marginTop:"24px",marginBottom:"16px",children:[jsxRuntimeExports.jsx(Heading,{"data-testid":"account-group-title",size:"md",children:_}),!et&&jsxRuntimeExports.jsx(AccountGroupPopover,{onCreate:tt?Ct:void 0,onRemove:xt})]}),a.map(Pt=>jsxRuntimeExports.jsx(Box,{marginBottom:"16px",children:jsxRuntimeExports.jsx(AccountTile,{account:Pt,balance:$[Pt.address.pkh]})},Pt.address.pkh))]})},NestedScroll=_=>jsxRuntimeExports.jsx(Box,{overflowY:"auto",height:"100%",children:_.children});var indicator$1=function _(a){a=Math.abs(a);var $=a%100;if($>=10&&$<=20)return"th";var j=a%10;return j===1?"st":j===2?"nd":j===3?"rd":"th"},indicator=indicator$1;function ordinal(_){if(typeof _!="number")throw new TypeError("Expected Number, got "+typeof _+" "+_);return Number.isFinite(_)?_+indicator(_):_}ordinal.indicator=indicator;var ordinal_1=ordinal;const ordinal$1=getDefaultExportFromCjs$1(ordinal_1),SignTransactionFormPage=_=>{const a=useAppDispatch(),{isLoading:$,handleAsyncAction:j}=useAsyncActionHandler(),{mode:et,operations:tt,fee:rt,data:{threshold:nt,signers:it,name:at}}=_,{fee:st,operations:ot,estimationFailed:ut,isLoading:dt,form:mt,reEstimate:xt,signer:Ct,onSign:Pt}=useSignPageHelpers(rt,tt,et),Tt=$||dt,kt=Lt=>j(async()=>{const Nt=await Pt(Lt);if(!Nt)throw new Error("An error occurred during contract origination");const zt=(await Nt.getOriginatedContractAddresses())[0];a(multisigActions.addMultisigLabel({pkh:zt,label:at}))});return jsxRuntimeExports.jsx(FormProvider,{...mt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,description:"Please review the details and then continue to submit contract.",operationsType:ot.type,signer:Ct,title:"Review & Submit"}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Text,{marginBottom:"24px",padding:"14px",color:colors.gray[50],background:colors.gray[800],borderRadius:"6px","data-testid":"contract-name",children:at}),jsxRuntimeExports.jsx(FormLabel,{children:"Approvers"}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column",gap:"12px",marginBottom:"12px","data-testid":"approvers",children:it.map(Lt=>jsxRuntimeExports.jsx(AddressTile,{address:parsePkh(Lt.val),"data-testid":`approver-${Lt.val}`},Lt.val))}),jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",children:jsxRuntimeExports.jsx(Threshold,{signersAmount:it.length,threshold:nt})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(FormControl,{marginTop:"24px",marginBottom:"12px",children:jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!1,inputName:"signer",isLoading:Tt,keepValid:!0,label:"Creation Fee Payer",onUpdate:xt})}),jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",children:jsxRuntimeExports.jsx(SignPageFee,{fee:st})})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:ut,isLoading:Tt,onSubmit:kt,signer:Ct,text:"Submit Contract"})})]})})})},Threshold=({threshold:_,signersAmount:a})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"threshold",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"No. of approvals:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:`${_} out of ${a}`})]}),contract=[{prim:"storage",args:[{prim:"pair",args:[{prim:"address",annots:["%owner"]},{prim:"pair",args:[{prim:"set",args:[{prim:"address"}],annots:["%signers"]},{prim:"pair",args:[{prim:"nat",annots:["%threshold"]},{prim:"pair",args:[{prim:"nat",annots:["%last_op_id"]},{prim:"pair",args:[{prim:"big_map",args:[{prim:"nat"},{prim:"pair",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}],annots:["%actions"]},{prim:"set",args:[{prim:"address"}],annots:["%approvals"]}]}],annots:["%pending_ops"]},{prim:"big_map",args:[{prim:"string"},{prim:"bytes"}],annots:["%metadata"]}]}]}]}]}]}]},{prim:"parameter",args:[{prim:"or",args:[{prim:"or",args:[{prim:"or",args:[{prim:"bytes",annots:["%set_metadata_uri"]},{prim:"unit",annots:["%default"]}]},{prim:"or",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}],annots:["%propose"]},{prim:"nat",annots:["%approve"]}]}]},{prim:"nat",annots:["%execute"]}]}]},{prim:"code",args:[[{prim:"NIL",args:[{prim:"operation"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"UNPAIR"},{prim:"DIP",args:[{int:"1"},[{prim:"UNPAIR",args:[{int:"6"}]}]]},{prim:"IF_LEFT",args:[[{prim:"IF_LEFT",args:[[{prim:"IF_LEFT",args:[[{prim:"DUP",args:[{int:"2"}]},{prim:"SENDER"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID_CALLER"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"SOME"},{prim:"PUSH",args:[{prim:"string"},{string:""}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}],[{prim:"DROP",args:[{int:"1"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"SIZE"},{prim:"COMPARE"},{prim:"GE"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"FUNDING BLOCKED SINCE PARAMS ARE INVALID"}]},{prim:"FAILWITH"}],[]]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}],[{prim:"IF_LEFT",args:[[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"3"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"nat"},{int:"1"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"ADD"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"4"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"4"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"6"}]},{prim:"MEM"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"KEY_EXISTS"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[{prim:"DUP",args:[{int:"6"}]},{prim:"EMPTY_SET",args:[{prim:"address"}]},{prim:"PUSH",args:[{prim:"bool"},{prim:"True"}]},{prim:"SENDER"},{prim:"UPDATE"},{prim:"DUP",args:[{int:"3"}]},{prim:"PAIR"},{prim:"SOME"},{prim:"DUP",args:[{int:"7"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"5"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"5"}]}]]},{prim:"DROP",args:[{int:"1"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}],[{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID OP ID"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"4"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP"},{prim:"CDR"},{prim:"SENDER"},{prim:"MEM"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ALREADY APPROVED"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"8"}]},{prim:"DUP",args:[{int:"4"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"UNPAIR"},{prim:"SWAP"},{prim:"DROP",args:[{int:"1"}]},{prim:"DUP",args:[{int:"9"}]},{prim:"DUP",args:[{int:"5"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"CDR"},{prim:"PUSH",args:[{prim:"bool"},{prim:"True"}]},{prim:"SENDER"},{prim:"UPDATE"},{prim:"SWAP"},{prim:"PAIR"},{prim:"SOME"},{prim:"DUP",args:[{int:"4"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"2"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}]]}],[{prim:"DUP",args:[{int:"6"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"INVALID OP ID"}]},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]},{prim:"AMOUNT"},{prim:"COMPARE"},{prim:"EQ"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"TO FUND CONTRACT, PLEASE USE THE DEFAULT ENTRYPOINT"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"4"}]},{prim:"SENDER"},{prim:"MEM"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"ONLY FOR SIGNERS"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"5"}]},{prim:"DUP",args:[{int:"2"}]},{prim:"CDR"},{prim:"SIZE"},{prim:"COMPARE"},{prim:"GE"},{prim:"NOT"},{prim:"IF",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"NOT YET APPROVED"}]},{prim:"FAILWITH"}],[]]},{prim:"DUP",args:[{int:"7"}]},{prim:"DUP",args:[{int:"3"}]},{prim:"GET"},{prim:"IF_NONE",args:[[{prim:"PUSH",args:[{prim:"string"},{string:"pending_ops"}]},{prim:"PUSH",args:[{prim:"string"},{string:"ASSET_NOT_FOUND"}]},{prim:"PAIR"},{prim:"FAILWITH"}],[]]},{prim:"CAR"},{prim:"PUSH",args:[{prim:"unit"},{prim:"Unit"}]},{prim:"EXEC"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"8"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"8"}]},{prim:"DUP",args:[{int:"7"}]},{prim:"NONE",args:[{prim:"pair",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"list",args:[{prim:"operation"}]}]},{prim:"set",args:[{prim:"address"}]}]}]},{prim:"DUP",args:[{int:"4"}]},{prim:"UPDATE"},{prim:"DIP",args:[{int:"1"},[{prim:"DIG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"1"}]}]]},{prim:"DUG",args:[{int:"6"}]},{prim:"DROP",args:[{int:"2"}]},{prim:"PAIR",args:[{int:"6"}]},{prim:"DIG",args:[{int:"1"}]},{prim:"PAIR"}]]}]]}],makeStorageJSON=(_,a,$)=>({owner:_,signers:a,threshold:$,last_op_id:"0",pending_ops:[],metadata:[]}),toOperation$4=_=>({type:"contract_origination",sender:parsePkh(_.sender),code:contract,storage:makeStorageJSON(_.sender,_.signers.map(a=>a.val),String(_.threshold))}),SelectApproversFormPage=_=>{const{goBack:a,sender:$,...j}=_,et=useForm({mode:"onBlur",defaultValues:{sender:$.address.pkh,signers:[{val:""}],threshold:1,...formDefaultValues(j)}}),{formState:{errors:tt,isValid:rt},control:nt,register:it,handleSubmit:at,getValues:st,watch:ot}=et,ut=useFieldArray({control:nt,name:"signers",rules:{minLength:1}}),dt=ot("signers").length,mt=useOpenSignPageFormAction({SignPage:SignTransactionFormPage,signPageExtraData:ot(),FormPage:SelectApproversFormPage,defaultFormPageProps:_,toOperation:toOperation$4}),{onFormSubmitActionHandlers:[xt],isLoading:Ct}=useHandleOnSubmitFormActions([mt]);return jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalBackButton,{onClick:a}),jsxRuntimeExports.jsxs("form",{onSubmit:at(xt),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Select the participants of the contract and choose the minimum number of approvals.",title:"Select Approvers"}),jsxRuntimeExports.jsxs(ModalBody,{children:[ut.fields.map((Pt,Tt)=>{var jt;const kt=tt.signers&&tt.signers[Tt],Lt=`${Tt===0?"Select ":""}${ordinal$1(Tt+1)} approver`,Nt=dt>1?"short":"default",zt=Nt==="short"?"368px":"100%";return jsxRuntimeExports.jsxs(FormControl,{display:"inline-block",width:zt,marginBottom:"8px","data-testid":`signer-input-${Tt}`,isInvalid:!!kt,children:[jsxRuntimeExports.jsx(OwnedImplicitAccountsAutocomplete,{allowUnknown:!0,inputName:`signers.${Tt}.val`,label:Lt,size:Nt,style:{width:zt},validate:Mt=>{if(!isValidImplicitPkh(Mt))return"Signer must be valid TZ address";const Dt=st("signers").map(Ft=>Ft.val);if(Dt.length>new Set(Dt).size)return"Duplicate approver"}}),dt>1&&jsxRuntimeExports.jsx(IconButton,{position:"absolute",height:"24px",marginTop:"-36px",marginLeft:"374px",background:colors.gray[500],"aria-label":"Remove","data-testid":`remove-signer-${Tt}`,icon:jsxRuntimeExports.jsx(TrashIcon,{width:"12px",height:"14px",stroke:colors.gray[300]}),isRound:!0,onClick:()=>ut.remove(Tt),size:"xs",variant:"tertiary"}),kt&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":`signer-${Tt}-error`,children:(jt=kt.val)==null?void 0:jt.message})]},Pt.id)}),jsxRuntimeExports.jsx(Button,{paddingLeft:0,onClick:()=>ut.append({val:""}),variant:"specialCTA",children:"+ Add Approver"}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!tt.threshold,children:[jsxRuntimeExports.jsxs(FormLabel,{display:"inline",children:["Min No. of approvals:",jsxRuntimeExports.jsx(InputGroup,{display:"inline",marginLeft:"10px",children:jsxRuntimeExports.jsx(Input,{width:"60px",color:"white","data-testid":"threshold-input",step:1,type:"number",...it("threshold",{valueAsNumber:!0,required:"No. of approvals is required",max:{value:dt,message:`Max no. of approvals is ${dt}`},min:{value:1,message:"Min no. of approvals is 1"}})})})]}),jsxRuntimeExports.jsxs(Text,{display:"inline","data-testid":"max-signers",children:["out of ",dt]}),tt.threshold&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"threshold-error",children:tt.threshold.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!rt,isLoading:Ct,size:"lg",type:"submit",children:"Review"})})]})]})})},NameMultisigFormPage=({name:_})=>{const a=useForm({mode:"onBlur",defaultValues:{name:_||""}}),{formState:{errors:$,isValid:j},register:et,handleSubmit:tt}=a,rt=useImplicitAccounts(),nt=useGetMostFundedImplicitAccount(),{openWith:it}=reactExports.useContext(DynamicModalContext),at=({name:ot})=>it(jsxRuntimeExports.jsx(SelectApproversFormPage,{form:{name:ot.trim()},goBack:()=>it(jsxRuntimeExports.jsx(NameMultisigFormPage,{name:ot})),sender:nt(rt)})),st=useValidateName();return jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:tt(at),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Name your account. The account name will only appear in your local Umami app.",title:"Account Name"}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!$.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Account Name"}),jsxRuntimeExports.jsx(InputGroup,{children:jsxRuntimeExports.jsx(Input,{"data-testid":"multisig-account-name",type:"text",...et("name",{validate:st}),placeholder:"Account Name"})}),$.name&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"name-error",children:$.name.message})]})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!j,size:"lg",type:"submit",children:"Continue"})})]})})})},AccountsList=()=>{const _=useAllAccounts(),a=useAppSelector(tt=>tt.assets.balances.mutez),$=lodashExports.groupBy(_,getAccountGroupLabel),{openWith:j}=reactExports.useContext(DynamicModalContext),et=Object.entries($).map(([tt,rt])=>jsxRuntimeExports.jsx(AccountGroup,{accounts:rt,balances:a,groupLabel:tt},tt));return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box,{height:"100%",marginRight:0,children:jsxRuntimeExports.jsxs(NestedScroll,{children:[lodashExports.compact(et),jsxRuntimeExports.jsx(Button,{width:"100%",height:"90px",background:colors.black,border:"1px dashed",borderColor:colors.gray[500],onClick:()=>j(jsxRuntimeExports.jsx(NameMultisigFormPage,{})),variant:"outline",children:jsxRuntimeExports.jsxs(Text,{display:"block",width:"100%",margin:"20px",color:colors.gray[400],textAlign:"center",children:[jsxRuntimeExports.jsx(KeyIcon,{marginRight:"4px"}),"Create New Multisig"]})})]})})})},useGetDelegationPrettyDisplayValues=()=>{const _=useGetAccountBalance();return a=>{const $=_(a.sender),j=new Date,et=prettyTezAmount(a.amount),tt=$&&prettyTezAmount($),rt=`Since ${formatRelative(new Date(a.timestamp),j)}`;return{initialBalance:et,currentBalance:tt,duration:rt}}},SignPage$4=_=>{const{mode:a,operations:$,fee:j}=_,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:at,reEstimate:st,onSign:ot}=useSignPageHelpers(j,$,a),ut=tt.operations[0].recipient;return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:at.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(SignPageFee,{fee:et})})}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:ut}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:st,sender:tt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:ot,signer:at,text:headerText(tt.type,a)})})]})})})},FormPage$3=_=>{var ot;const a=(ot=_.form)==null?void 0:ot.baker,$=useOpenSignPageFormAction({SignPage:SignPage$4,signPageExtraData:void 0,FormPage:FormPage$3,defaultFormPageProps:_,toOperation:toOperation$3}),j=useAddToBatchFormAction(toOperation$3),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(_)}),{formState:{isValid:it,errors:at},handleSubmit:st}=nt;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{"data-testid":"delegate-form",children:[jsxRuntimeExports.jsxs(HeaderWrapper,{children:[jsxRuntimeExports.jsx(Text,{fontWeight:"600",size:"2xl",children:a?"Change Baker":"Delegate"}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!!_.sender,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px","data-testid":"baker",isInvalid:!!at.baker,children:[jsxRuntimeExports.jsx(BakersAutocomplete,{allowUnknown:!0,inputName:"baker",label:"Baker"}),at.baker&&jsxRuntimeExports.jsx(FormErrorMessage,{children:at.baker.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:st(tt),onSingleSubmit:st(et)})})]})})})},toOperation$3=_=>({type:"delegation",sender:parsePkh(_.sender),recipient:parseImplicitPkh(_.baker)}),SignPage$3=_=>{const{mode:a,operations:$,fee:j}=_,{fee:et,operations:tt,estimationFailed:rt,isLoading:nt,form:it,signer:at,reEstimate:st,onSign:ot}=useSignPageHelpers(j,$,a);return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:tt.type,signer:tt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{address:at.address}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",paddingX:"4px",children:jsxRuntimeExports.jsx(SignPageFee,{fee:et})}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:nt,operationType:tt.type,reEstimate:st,sender:tt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:rt,isLoading:nt,onSubmit:ot,signer:at,text:headerText(tt.type,a)})})]})})})},FormPage$2=_=>{var st;const{sender:a}=_,$=(st=_.form)==null?void 0:st.baker,j=useOpenSignPageFormAction({SignPage:SignPage$3,signPageExtraData:void 0,FormPage:FormPage$2,defaultFormPageProps:{sender:a},toOperation:toOperation$2}),et=useAddToBatchFormAction(toOperation$2),{onFormSubmitActionHandlers:[tt,rt],isLoading:nt}=useHandleOnSubmitFormActions([j,et]),it=useForm({mode:"onBlur",defaultValues:formDefaultValues({sender:a})}),{handleSubmit:at}=it;return jsxRuntimeExports.jsx(FormProvider,{...it,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{"data-testid":"undelegate-form",children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Select preview to end delegation or insert this transaction into a Batch.",title:"End Delegation"}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(FormControl,{children:jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"})}),jsxRuntimeExports.jsx(FormLabel,{marginTop:"24px",children:"Baker"}),$&&jsxRuntimeExports.jsx(AddressTile,{address:parsePkh($)})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:nt,isValid:!0,onAddToBatch:at(rt),onSingleSubmit:at(tt)})})]})})})},toOperation$2=_=>({type:"undelegation",sender:parsePkh(_.sender)}),Row=({label:_,value:a,...$})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"50px",padding:"16px","data-testid":_,...$,children:[jsxRuntimeExports.jsx(Box,{flex:1,children:jsxRuntimeExports.jsx(Heading,{color:colors.gray[400],size:"sm",children:_})}),jsxRuntimeExports.jsx(Box,{flex:1,children:typeof a=="string"?jsxRuntimeExports.jsx(Text,{size:"sm",children:a}):a})]}),DelegationDisplay=({delegation:_,account:a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext),j=useGetOwnedAccount(),et=useGetDelegationPrettyDisplayValues();if(!_)return jsxRuntimeExports.jsx(NoDelegations,{onDelegate:()=>$(jsxRuntimeExports.jsx(FormPage$3,{sender:a})),size:"md"});const{currentBalance:tt,duration:rt,initialBalance:nt}=et(_),{sender:it,delegate:{address:at}}=_,st=j(it);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Row,{borderBottom:`1px solid ${colors.gray[700]}`,borderTopRadius:"8px",_odd:{bg:colors.gray[800]},label:"Initial Balance:",value:nt}),tt&&jsxRuntimeExports.jsx(Row,{_odd:{bg:colors.gray[800]},label:"Current Balance:",value:tt}),jsxRuntimeExports.jsx(Row,{borderBottom:`1px solid ${colors.gray[700]}`,_odd:{bg:colors.gray[800]},label:"Duration:",value:rt}),jsxRuntimeExports.jsx(Row,{borderBottomRadius:"8px",_odd:{bg:colors.gray[800]},label:"Baker:",value:jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.delegate.address)})}),jsxRuntimeExports.jsxs(Flex,{marginTop:"24px",children:[jsxRuntimeExports.jsx(Button,{flex:1,marginRight:"16px",onClick:()=>$(jsxRuntimeExports.jsx(FormPage$2,{form:{sender:it,baker:at},sender:st})),variant:"warning",children:"End Delegation"}),jsxRuntimeExports.jsx(Button,{flex:1,onClick:()=>$(jsxRuntimeExports.jsx(FormPage$3,{form:{sender:it,baker:at},sender:st})),variant:"tertiary",children:"Change Baker"})]})]})},MultisigDecodedOperation=({operation:_})=>{switch(_.type){case"delegation":return jsxRuntimeExports.jsxs(Box,{"data-testid":"decoded-item-delegate",marginY:6,children:[jsxRuntimeExports.jsx(Text,{marginRight:"3px",color:colors.gray[450],fontSize:"14px",children:"Delegate to:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.recipient})]});case"undelegation":return jsxRuntimeExports.jsx(Box,{"data-testid":"decoded-item-undelegate",marginY:6,children:jsxRuntimeExports.jsx(Text,{color:colors.gray[450],fontSize:"14px",children:"End Delegation"})});case"tez":case"fa1.2":case"fa2":return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MultisigOperationAmount,{operation:_}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"8px",children:[jsxRuntimeExports.jsx(Text,{marginRight:"3px",color:colors.gray[450],fontSize:"14px",children:"Send to:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.recipient})]})]});case"contract_origination":case"contract_call":throw new Error(`${_.type} is not supported yet`)}},MultisigOperationAmount=({operation:_})=>{const a=useGetToken();switch(_.type){case"tez":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"decoded-tez-amount",children:[jsxRuntimeExports.jsx(OutgoingArrow,{}),jsxRuntimeExports.jsxs(Text,{marginLeft:"8px",color:colors.orange,fontSize:"14px",fontWeight:600,textAlign:"center",children:["-",prettyTezAmount(_.amount)]})]});case"fa1.2":case"fa2":{const $=a(_.contract.pkh,_.tokenId);if(!$)return null;const j=tokenNameSafe($),et=$.type==="nft";return jsxRuntimeExports.jsxs(Flex,{alignItems:"center","data-testid":"decoded-fa-amount",children:[jsxRuntimeExports.jsx(OutgoingArrow,{}),jsxRuntimeExports.jsx(Box,{marginLeft:"8px",color:colors.orange,textAlign:"center",children:et?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Text,{display:"inline",marginRight:"3px",fontSize:"14px",fontWeight:600,children:_.amount}),jsxRuntimeExports.jsx(Text,{display:"inline",color:"white",fontSize:"14px",fontWeight:600,children:j})]}):jsxRuntimeExports.jsxs(Text,{fontSize:"14px",fontWeight:600,children:["-",tokenPrettyAmount(_.amount,$,{showSymbol:!0})]})})]})}case"delegation":case"undelegation":case"contract_origination":case"contract_call":return null}},caseInsensitiveLiteral=_=>z.string().regex(new RegExp(`^${_}$`,"i")),prim=_=>z.object({prim:caseInsensitiveLiteral(_)}),pushKeyHashSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("key_hash")}),z.object({bytes:z.string()})])}),pushAddressSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("address")}),z.object({bytes:z.string()})])}),pair=(_,a)=>z.object({prim:z.literal("Pair"),args:z.tuple([_,a])}),contractZeroTezSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("mutez")}),z.object({int:z.literal("0")})])}),lambdaEndSchema=[prim("TRANSFER_TOKENS"),prim("CONS")],contractHeadSchema=z.object({prim:z.literal("CONTRACT")}),batchHeadSchema=z.tuple([z.object({prim:z.literal("DROP")}),z.object({prim:z.literal("NIL"),args:z.array(z.object({prim:z.literal("operation")}))})]),pushMutezSchema=z.object({prim:z.literal("PUSH"),args:z.tuple([z.object({prim:z.literal("mutez")}),z.object({int:z.string()})])}),tezSchema=z.tuple([pushKeyHashSchema,prim("IMPLICIT_ACCOUNT"),pushMutezSchema,prim("UNIT"),...lambdaEndSchema]),contractTezSchema=z.tuple([pushAddressSchema,contractHeadSchema,prim("IF_NONE"),pushMutezSchema,prim("UNIT"),...lambdaEndSchema]),setDelegateSchema=z.tuple([pushKeyHashSchema,prim("SOME"),prim("SET_DELEGATE"),prim("CONS")]),removeDelegateSchema=z.tuple([z.object({prim:z.literal("NONE"),args:z.tuple([z.object({prim:z.literal("key_hash")})])}),prim("SET_DELEGATE"),prim("CONS")]),fa2Schema=z.tuple([pushAddressSchema,contractHeadSchema,z.tuple([prim("IF_NONE")]),contractZeroTezSchema,z.object({prim:z.literal("PUSH"),args:z.tuple([prim("list"),z.array(pair(z.object({bytes:z.string({description:"from"})}),z.array(pair(z.object({bytes:z.string({description:"to"})}),pair(z.object({int:z.string({description:"token_id"})}),z.object({int:z.string({description:"amount"})}))))))])}),...lambdaEndSchema]),fa1Schema=z.tuple([pushAddressSchema,contractHeadSchema,z.tuple([prim("IF_NONE")]),contractZeroTezSchema,z.object({prim:z.literal("PUSH"),args:z.tuple([prim("Pair"),pair(z.object({bytes:z.string({description:"from"})}),pair(z.object({bytes:z.string({description:"to"})}),z.object({int:z.string({description:"amount"})})))])}),...lambdaEndSchema]);class UnrecognizedMichelsonError extends Error{}const convertToPkh=_=>(_.length===42&&(_="00"+_),encodeAddress(_)),parseTez=_=>{const a=tezSchema.parse(_),$=a[0].args[1].bytes,j=a[2].args[1].int;return{type:"tez",recipient:parseImplicitPkh(convertToPkh($)),amount:j}},parseTezContract=_=>{const a=contractTezSchema.parse(_),$=a[0].args[1].bytes,j=a[3].args[1].int;return{type:"tez",recipient:parseContractPkh(convertToPkh($)),amount:j}},parseFa2=_=>{const a=fa2Schema.parse(_),$=parseContractPkh(convertToPkh(a[0].args[1].bytes));return a[4].args[1].flatMap(et=>{const tt=et.args[0].bytes;return et.args[1].map(rt=>{const nt=rt.args[0].bytes,it=rt.args[1].args[0].int,at=rt.args[1].args[1].int;return{type:"fa2",contract:$,sender:parsePkh(convertToPkh(tt)),recipient:parsePkh(convertToPkh(nt)),tokenId:it,amount:at}})})},parseFa1=_=>{const a=fa1Schema.parse(_),$=a[0],j=a[4].args[1],et=j.args[0].bytes,tt=j.args[1].args[0].bytes;return{type:"fa1.2",amount:j.args[1].args[1].int,contract:parseContractPkh(convertToPkh($.args[1].bytes)),recipient:parsePkh(convertToPkh(tt)),sender:parsePkh(convertToPkh(et)),tokenId:"0"}},parseSetDelegate=(_,a)=>{const $=setDelegateSchema.parse(_);return{type:"delegation",sender:a.address,recipient:parseImplicitPkh(convertToPkh($[0].args[1].bytes))}},parseRemoveDelegate=(_,a)=>({type:"undelegation",sender:a.address}),parsings=[{schema:tezSchema,parsingFn:parseTez},{schema:contractTezSchema,parsingFn:parseTezContract},{schema:fa2Schema,parsingFn:parseFa2},{schema:fa1Schema,parsingFn:parseFa1},{schema:setDelegateSchema,parsingFn:parseSetDelegate},{schema:removeDelegateSchema,parsingFn:parseRemoveDelegate}],parse=(_,a,$=[])=>{if(_.length===0)return $;for(let j=0;j{batchHeadSchema.parse(_.slice(0,2))},decode=(_,a)=>(assertHead(_),parse(_.slice(2),a)),parseRawMichelson=(_,a)=>{const $=JSON.parse(_);return decode($,a)},MultisigDecodedOperations=({rawMichelson:_,sender:a})=>{try{const $=parseRawMichelson(_,a);return jsxRuntimeExports.jsx(Box,{borderRadius:"8px",backgroundColor:colors.gray[900],children:$.map((j,et)=>jsxRuntimeExports.jsxs(Box,{width:"100%",paddingTop:"10px",paddingBottom:et<$.length-1?0:"15px",paddingX:"15px",children:[jsxRuntimeExports.jsx(MultisigDecodedOperation,{operation:j}),et<$.length-1&&jsxRuntimeExports.jsx(Divider,{marginTop:"15px"})]},et))})}catch($){return $ instanceof UnrecognizedMichelsonError?jsxRuntimeExports.jsx(UnrecognizedOperation,{rawMichelson:_}):jsxRuntimeExports.jsxs(Box,{height:"50px",padding:"10px",background:colors.gray[900],borderRadius:"8px",children:["Invalid michelson code: ",$.message]})}},UnrecognizedOperation=({rawMichelson:_})=>jsxRuntimeExports.jsx(Accordion,{width:"100%",marginBottom:"8px",background:colors.gray[900],borderColor:colors.gray[900],borderRadius:"8px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{children:[jsxRuntimeExports.jsxs(AccordionButton,{children:[jsxRuntimeExports.jsx(Heading,{flex:"1",height:"30px",marginTop:"6px",textAlign:"left",size:"md",children:"Unrecognized operation"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{overflowY:"scroll",height:"400px",paddingBottom:"12px",children:jsxRuntimeExports.jsx(JsValueWrap,{space:1,value:JSON.parse(_)})})]})}),MultisigActionButton=({approveOrExecute:_,isLoading:a,signerState:$})=>{switch($){case"awaitingApprovalByExternalSigner":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",alignSelf:"flex-end","data-testid":"multisig-signer-awaiting-approval",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],children:"Awaiting Approval"}),jsxRuntimeExports.jsx(HourglassIcon,{marginTop:"2px"})]});case"approved":return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",alignSelf:"flex-end",marginBottom:"8px","data-testid":"multisig-signer-approved",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],children:"Approved"}),jsxRuntimeExports.jsx(CheckmarkIcon,{marginTop:"2px"})]});case"executable":return jsxRuntimeExports.jsx(Button,{"data-testid":"multisig-signer-button",isLoading:a,onClick:_,children:"Execute"});case"approvable":return jsxRuntimeExports.jsx(Button,{"data-testid":"multisig-signer-button",isLoading:a,onClick:_,children:"Approve"})}},SignPage$2=({signer:_,fee:a,operation:$,actionType:j,transactionCount:et})=>{const{handleAsyncAction:tt}=useAsyncActionHandler(),{openWith:rt}=reactExports.useContext(DynamicModalContext),nt=at=>tt(async()=>{const{opHash:st}=await executeOperations($,at);return rt(jsxRuntimeExports.jsx(SuccessStep,{hash:st}))},{title:`Failed ${j}`}),it=`${lodashExports.capitalize(j)} transaction`;return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(BatchModalBody,{fee:a,signer:_,title:it,transactionCount:et}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{onSubmit:nt,signer:_,text:it})})]})})},MultisigSignerTile=({pendingApprovals:_,sender:a,operation:$,signerAddress:j})=>{const et=useAddressKind$1(j),tt=useGetImplicitAccountSafe(),{isLoading:rt,handleAsyncAction:nt}=useAsyncActionHandler(),{openWith:it}=reactExports.useContext(DynamicModalContext),at=useSelectedNetwork(),st=tt(j.pkh),ot=_===0,ut=()=>nt(async()=>{if(!st)throw new Error("Can't approve or execute with an account you don't own");const mt=ot?"execute":"approve",xt=makeAccountOperations(st,st,[makeMultisigApproveOrExecuteOperation(a.address,mt,$.id)]),Ct=await estimate(xt,at);let Pt;try{Pt=parseRawMichelson($.rawActions,a).length}catch{Pt=1}return it(jsxRuntimeExports.jsx(SignPage$2,{actionType:mt,fee:Ct,operation:xt,signer:st,transactionCount:Pt}))}),dt=getMultisigSignerState({approvals:$.approvals,signerAddress:j,operationIsExecutable:ot,signerAccount:st});return jsxRuntimeExports.jsx(AccountTileBase,{height:"80px",marginTop:"10px",marginBottom:"0",padding:"15px",borderRadius:"8px",backgroundColor:colors.gray[700],icon:jsxRuntimeExports.jsx(AddressTileIcon,{addressKind:et,size:"lg"}),leftElement:jsxRuntimeExports.jsx(LabelAndAddress,{label:et.label,pkh:et.pkh}),rightElement:jsxRuntimeExports.jsx(MultisigActionButton,{approveOrExecute:ut,"data-testid":"multisig-signer-button",isLoading:rt,signerState:dt})})},getMultisigSignerState=({signerAccount:_,operationIsExecutable:a,approvals:$,signerAddress:j})=>{const et=!!$.find(tt=>tt.pkh===j.pkh);return _?et&&!a?"approved":a?"executable":"approvable":et?"approved":"awaitingApprovalByExternalSigner"},MultisigPendingOperation=({operation:_,sender:a})=>{const{signers:$,threshold:j}=a,et=Math.max(j-_.approvals.length,0);return jsxRuntimeExports.jsxs(Box,{marginBottom:"24px",background:colors.gray[800],border:"none",borderRadius:"8px","data-testid":"multisig-pending-operation-"+_.id,paddingX:"16px",paddingY:"15px",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"6px",padding:0,textAlign:"left",children:[jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Pending #",_.id]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginBottom:"6px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Pending Approvals:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"pending-approvals-count",children:et})]})]}),jsxRuntimeExports.jsxs(Box,{padding:"0",children:[jsxRuntimeExports.jsx(MultisigDecodedOperations,{rawMichelson:_.rawActions,sender:a}),$.map(tt=>jsxRuntimeExports.jsx(MultisigSignerTile,{operation:_,pendingApprovals:et,sender:a,signerAddress:tt},tt.pkh))]})]})},MultisigPendingOperations=({account:_})=>{const $=useGetPendingMultisigOperations()(_);return jsxRuntimeExports.jsx(Box,{margin:"0",padding:"0",children:$.map(j=>jsxRuntimeExports.jsx(MultisigPendingOperation,{operation:j,sender:_},j.id))})},ViewAllLink=({to:_,owner:a,...$})=>jsxRuntimeExports.jsx(Center,{...$,children:jsxRuntimeExports.jsxs(Link$1,{as:Link,color:colors.gray[300],stroke:colors.gray[450],_hover:{color:colors.green,stroke:colors.green},to:`${_}?accounts=${a}`,children:[jsxRuntimeExports.jsx(RefreshClockIcon,{display:"inline",stroke:"inherit"}),jsxRuntimeExports.jsx(Text,{display:"inline",size:"sm",children:" View All"})]})}),MAX_NFTS_SIZE=18,NFTsGrid=({owner:_,nfts:a,...$})=>{if(a.length===0)return jsxRuntimeExports.jsx(NoNFTs,{size:"md"});const j=sortedByLastUpdate(a).slice(0,MAX_NFTS_SIZE);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SimpleGrid,{marginBottom:"35px",spacing:"12px",...$,children:j.map(et=>{const tt=getIPFSurl(thumbnailUri(et)),nt={width:"100%",height:40,fallbackSrc:getIPFSurl(et.displayUri),src:tt};return jsxRuntimeExports.jsx(Link,{"data-testid":"nft-link",to:`/home/${_}/${fullId(et)}`,children:jsxRuntimeExports.jsx(Card,{background:colors.gray[800],border:"1px solid transparent",_hover:{background:colors.gray[700],borderColor:colors.gray[500]},children:jsxRuntimeExports.jsxs(CardBody,{overflow:"hidden",padding:"8px",borderRadius:"6px",children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsxs(Box,{position:"relative",width:"100%",height:"100%",children:[jsxRuntimeExports.jsx(AspectRatio,{zIndex:2,width:"100%",opacity:"0",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})}),jsxRuntimeExports.jsx(AspectRatio,{position:"absolute",zIndex:0,top:"0",width:"100%",filter:"blur(20px)",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})}),jsxRuntimeExports.jsx(AspectRatio,{position:"absolute",zIndex:1,top:"0",width:"100%",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{...nt,width:"100%",height:40})})]})}),Number(et.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"20px",marginTop:"-24px",marginLeft:"4px",padding:"0 8px",borderRadius:"100px",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",size:"xs",children:"x"+et.balance})]})})},`${_}:${fullId(et)}`)})}),a.length>MAX_NFTS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{marginBottom:"40px",owner:_,to:"/nfts"})]})},OperationTileContext=React$2.createContext({mode:"page"}),FEE_FIELDS=["bakerFee","storageFee","allocationFee"],Fee=({operation:_})=>{const a=reactExports.useContext(OperationTileContext),j=useIsOwnedAddress()(_.sender.address);if(a.mode==="drawer"||!j)return null;const et=FEE_FIELDS.reduce((tt,rt)=>rt in _?tt.plus(lodashExports.get(_,rt)||0):tt,BigNumber(0));return et.eq(0)?null:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"md",children:"Fee:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"fee",children:prettyTezAmount(et)})]})},useGetOperationDestination=(_,a)=>{const $=useIsOwnedAddress(),j=$(_),et=$(a);return!j&&!et?"unrelated":j?"outgoing":"incoming"},operationSign=_=>{switch(_){case"incoming":return"+";case"outgoing":return"-";case"unrelated":return""}},operationColor=_=>{switch(_){case"incoming":return colors.green;case"outgoing":return colors.orange;case"unrelated":return"white"}},InternalPrefix=({operation:_})=>{var et,tt,rt;let a,$;switch(_.type){case"transaction":a=(et=_.target)==null?void 0:et.address,$=_.sender.address;break;case"origination":case"delegation":a=null,$=_.sender.address;break;case"token_transfer":a=(tt=_.to)==null?void 0:tt.address,$=(rt=_.from)==null?void 0:rt.address;break}return useGetOperationDestination($,a)!=="unrelated"?null:jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],"data-testid":"internal-prefix",size:"md",children:"Internal:"})},OperationStatus=({level:_,status:a})=>{const $=useIsBlockFinalised(_);return a===void 0||a==="applied"?$?jsxRuntimeExports.jsx(CheckmarkIcon,{"data-testid":"checkmark"}):jsxRuntimeExports.jsx(HourglassIcon,{"data-testid":"hourglass"}):jsxRuntimeExports.jsx(CrossedCircleIcon,{"data-testid":"crossed-circle"})},OperationTypeWrapper=({children:_})=>reactExports.useContext(OperationTileContext).mode==="drawer"?null:jsxRuntimeExports.jsx(Text,{marginRight:"4px",color:colors.gray[300],"data-testid":"operation-type",size:"sm",children:_}),Timestamp=({timestamp:_})=>_?jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"timestamp",size:"sm",children:getDisplayTimestamp(_)}):null,getDisplayTimestamp=_=>{const a=new Date,$=new Date(_);return differenceInDays(a,$)<2?formatDistance($,a,{addSuffix:!0}):format($,"dd MMM yyyy")},TzktLink$1=({hash:_,counter:a,transactionId:$,originationId:j,migrationId:et,children:tt,...rt})=>{const{tzktExplorerUrl:nt}=useSelectedNetwork();let it=nt;return _?it=lodashExports.compact([nt,_,a]).join("/"):et?it=`${it}/migrations/${et}`:j?it=`${it}/originations/${j}`:$?it=`${it}/transactions/${$}`:console.warn("No id provided to TzktLink"),jsxRuntimeExports.jsx(Link$1,{"data-testid":"tzkt-link",href:it,isExternal:!0,...rt,children:tt})},ContractCallTile=({operation:_})=>{var a;return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-contract-call",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(ContractIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsxs(Heading,{size:"md",children:["Contract Call: ",(a=_.parameter)==null?void 0:a.entrypoint]})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:_.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[_.target&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.target})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.sender})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Contract Call"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})},DelegationTile=({operation:_})=>{const a=_.newDelegate?"Delegate":"Delegation Ended";return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-delegation",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(BakerIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsx(Heading,{size:"md",children:a})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:_.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[_.newDelegate&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.newDelegate})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.sender})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:a}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})},OriginationTile=({operation:_})=>{var j;const $=((j=_.originatedContract)==null?void 0:j.codeHash)===CODE_HASH&&_.originatedContract.typeHash===TYPE_HASH?"Multisig Account Created":"Contract Origination";return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-origination",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(ContractIcon,{marginRight:"8px"}),jsxRuntimeExports.jsx(InternalPrefix,{operation:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsx(Heading,{size:"md",children:$})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:_.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:_.sender})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Contract Origination"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})},TransactionDirectionIcon=({destination:_,...a})=>_==="outgoing"?jsxRuntimeExports.jsx(OutgoingArrow,{"data-testid":"outgoing-arrow",...a}):_==="incoming"?jsxRuntimeExports.jsx(IncomingArrow,{"data-testid":"incoming-arrow",...a}):jsxRuntimeExports.jsx(ContractIcon,{"data-testid":"unrelated-operation-icon",...a}),TokenTransferTile=({operation:_,tokenTransfer:a,token:$})=>{var ot,ut;const j=a.amount,et=useGetOperationDestination((ot=a.from)==null?void 0:ot.address,(ut=a.to)==null?void 0:ut.address),tt=$.type==="nft",rt=tokenPrettyAmount(j,$,{showSymbol:!0}),nt=operationColor(et),it=tt?"white":nt,at=operationSign(et),st=tt?jsxRuntimeExports.jsx(Tooltip,{padding:"8px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],borderRadius:"8px","data-testid":"nft-tooltip",label:jsxRuntimeExports.jsx(AspectRatio,{width:"170px",height:"170px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{src:getIPFSurl(thumbnailUri($))})}),openDelay:300,children:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(InternalPrefix,{operation:_||a}),jsxRuntimeExports.jsxs(TzktLink$1,{marginRight:"8px",color:it,"data-testid":"title",migrationId:a.migrationId,originationId:a.originationId,transactionId:a.transactionId,children:[jsxRuntimeExports.jsxs(Text,{display:"inline",color:nt,fontWeight:"600",children:[at,rt]}),jsxRuntimeExports.jsxs(Text,{display:"inline",fontWeight:"600",children:[" ",tokenNameSafe($)]})]})]})}):jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(InternalPrefix,{operation:_||a}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",color:it,"data-testid":"title",migrationId:a.migrationId,originationId:a.originationId,transactionId:a.transactionId,children:jsxRuntimeExports.jsxs(Text,{display:"inline",color:nt,fontWeight:"600",children:[at,rt]})})]});return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-token-transfer",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(TransactionDirectionIcon,{marginRight:"8px",destination:et}),st,_&&jsxRuntimeExports.jsx(Fee,{operation:_})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:a.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[a.to&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.to})]}),a.from&&jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:a.from})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Token Transfer"}),jsxRuntimeExports.jsx(OperationStatus,{level:a.level})]})]})})]})},TransactionTile=({operation:_})=>{var tt;const a=useGetOperationDestination(_.sender.address,(tt=_.target)==null?void 0:tt.address),$=prettyTezAmount(String(_.amount)),j=operationColor(a),et=operationSign(a);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",width:"100%","data-testid":"operation-tile-transaction",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",marginBottom:"10px",children:[jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(TransactionDirectionIcon,{marginRight:"8px",destination:a}),jsxRuntimeExports.jsx(InternalPrefix,{operation:_}),jsxRuntimeExports.jsx(TzktLink$1,{marginRight:"8px",color:j,counter:_.counter,"data-testid":"title",hash:_.hash,children:jsxRuntimeExports.jsxs(Text,{color:j,fontWeight:"600",children:[et," ",$]})}),jsxRuntimeExports.jsx(Fee,{operation:_})]}),jsxRuntimeExports.jsx(Flex,{alignSelf:"flex-end",children:jsxRuntimeExports.jsx(Timestamp,{timestamp:_.timestamp})})]}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Flex,{children:[_.target&&jsxRuntimeExports.jsxs(Flex,{marginRight:"15px","data-testid":"to",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"To:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.target.address)})]}),jsxRuntimeExports.jsxs(Flex,{"data-testid":"from",children:[jsxRuntimeExports.jsx(Text,{marginRight:"6px",color:colors.gray[450],children:"From:"}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.sender.address)})]})]}),jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(OperationTypeWrapper,{children:"Transaction"}),jsxRuntimeExports.jsx(OperationStatus,{..._})]})]})})]})},OperationTile=({operation:_})=>{const a=useGetTokenTransfer();switch(_.type){case"token_transfer":{const $=fromRaw$1(_.token);return $?jsxRuntimeExports.jsx(TokenTransferTile,{token:$,tokenTransfer:_}):(console.warn(`Could not parse token transfer ${_.id}`),null)}case"transaction":{const $=!!_.parameter,j=a(_.id);if(j){const et=fromRaw$1(j.token);return et?jsxRuntimeExports.jsx(TokenTransferTile,{operation:_,token:et,tokenTransfer:j}):jsxRuntimeExports.jsx(TransactionTile,{operation:_})}else return $?jsxRuntimeExports.jsx(ContractCallTile,{operation:_}):jsxRuntimeExports.jsx(TransactionTile,{operation:_})}case"delegation":return jsxRuntimeExports.jsx(DelegationTile,{operation:_});case"origination":return jsxRuntimeExports.jsx(OriginationTile,{operation:_})}},MAX_OPERATIONS_SIZE=20,OperationListDisplay=({owner:_,operations:a})=>{if(a.length===0)return jsxRuntimeExports.jsx(NoOperations,{size:"md"});const $=a.slice(0,MAX_OPERATIONS_SIZE);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[$.map((j,et)=>jsxRuntimeExports.jsxs(Box,{height:"90px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:j}),et<$.length-1&&jsxRuntimeExports.jsx(Divider,{marginY:"20px"})]},j.id)),a.length>MAX_OPERATIONS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{owner:_,to:"/operations"})]})},verifiedTokens=["KT1XnTn74bUtxHfDtBmm2bGZAQfhPbvKWR8o","KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1XRPEPXbZK25r3Htzp2o1x7xdMMmfocKNW","KT1K9gCRgaLRFKTErYt1wVxA3Frb9FjasjTV","KT1Ha4yFVeyzw6KRAdkzq6TxDHB97KG4pZe8","KT1JBNFcB5tiycHNdYGYCtR3kk6JaJysUCi8","KT1Xobej4mc6XgEjDoJoHtTKgbD1ELMvcQuL","KT1JVjgXPMMSaa6FkzeJcgb8q9cUaLmwaJUX","KT193D4vozYnhGJQVtw7CoxxqphqUEEwK6Vb","KT1LN4LPSqTMS7Sd2CJw4bbDGRkMv2t68Fy9","KT1914CUZ7EegAFPbfgQMRkw8Uz5mYkEz2ui","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT19ovJhcsUn4YU8Q5L3BGovKSixfbWcecEA","KT1TgmD7kXQzofpuc9VbTRMdZCS2e6JDuTtc","KT1F1mn2jbqQCJcsNgYKVAQjvenecNMY2oPK","KT1ErKVqEhG9jxXgUG2KGLW3bNM7zXHX8SDF","KT1A5P4ejnLix13jtadsfV9GCnXLMNnab8UT","KT1AM3PV1cwmGRw28DVTgsjjsjHvmL6z4rGh","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT1SjXiUX63QvdNMcM2m492f7kuf8JxXRLp4","KT1MZg99PxMDEENwB4Fi64xkqAVh5d1rv8Z9","KT1UsSfaXyqcjSVPeiD7U1bWgKy3taYN7NWY","KT1XTxpQvo7oRCqp85LikEZgAZ22uDxhbWJv","KT1VaEsVNiBoA56eToEK6n6BcPgh1tdx9eXi"],TokenNameWithIcon=({token:_,...a})=>{const $=verifiedTokens.includes(_.contract);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Text,{...a,marginRight:"4px",children:tokenNameSafe(_)}),$&&jsxRuntimeExports.jsx(VerifiedIcon,{})]})},MAX_TOKENS_SIZE=20,TokenList=({owner:_,tokens:a})=>{if(a.length===0)return jsxRuntimeExports.jsx(NoTokens,{size:"md"});const $=a.slice(0,MAX_TOKENS_SIZE);return jsxRuntimeExports.jsxs(Box,{children:[$.map(j=>jsxRuntimeExports.jsx(TokenTile$1,{token:j},fullId(j))),a.length>MAX_TOKENS_SIZE&&jsxRuntimeExports.jsx(ViewAllLink,{owner:_,to:"/tokens"})]})},TokenTile$1=({token:_})=>{const a=tokenPrettyAmount(_.balance,_,{showSymbol:!1});return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-around",height:20,borderBottom:`1px solid ${colors.gray[800]}`,"data-testid":"token-tile",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",flex:1,children:[jsxRuntimeExports.jsx(TokenIcon,{width:"38px",background:colors.gray[500],borderRadius:"4px",contract:_.contract}),jsxRuntimeExports.jsx(Box,{marginLeft:"16px",children:jsxRuntimeExports.jsx(TokenNameWithIcon,{fontWeight:600,"data-testid":"token-name",token:_})})]}),jsxRuntimeExports.jsx(Heading,{"data-testid":"token-balance",size:"lg",children:a})]})},buildTzktAddressUrl=(_,a)=>`${_.tzktExplorerUrl}/${a}`,useGetOperations=_=>{const a=useSelectedNetwork(),$=useAppDispatch(),j=useRefetchTrigger(),et=useReactQueryErrorHandler(),{isFetching:tt,data:rt,hasNextPage:nt,isLoading:it,fetchNextPage:at,fetchPreviousPage:st,error:ot}=useInfiniteQuery({queryFn:({pageParam:ut})=>fetchOperationsAndUpdateTokensInfo($,a,_,ut),queryKey:["operations",_,$,a],initialPageParam:{},retry:3,retryDelay:ut=>ut*2e3,gcTime:0,refetchOnWindowFocus:!1,getNextPageParam:ut=>ut.length===0?null:{lastId:ut[ut.length-1].id},getPreviousPageParam:(ut,dt)=>{var xt;const mt=(xt=lodashExports.maxBy(dt.flat(),"id"))==null?void 0:xt.id;return mt?{lastId:mt,sort:"asc"}:{}},select:({pages:ut})=>filterDuplicatedTokenTransfers([[...ut[0]].sort((dt,mt)=>dt.id{const ut=setInterval(()=>void st(),BLOCK_TIME);return()=>clearInterval(ut)},[st]),reactExports.useEffect(()=>{st()},[j,st]),{operations:rt||[],isFirstLoad:it,isLoading:tt,hasMore:nt,loadMore:at}},fetchOperationsAndUpdateTokensInfo=async(_,a,$,j)=>{const et=await getCombinedOperations($.map(at=>at.address.pkh),a,j),tt=et.filter(at=>at.type==="transaction").map(at=>at.id),rt=await getRelatedTokenTransfers(tt,a),nt=et.filter(at=>at.type==="token_transfer"),it=[...rt,...nt];return _(assetsActions.updateTokenTransfers(it)),_(tokensActions.addTokens({network:a,tokens:it.map(at=>at.token)})),et},filterDuplicatedTokenTransfers=_=>{const a=new Set(_.filter($=>$.type!=="token_transfer").map($=>$.id));return _.filter($=>$.type!=="token_transfer"||!a.has($.transactionId))},SmallTab=({children:_,...a})=>jsxRuntimeExports.jsx(Tab,{...a,fontSize:"sm",paddingX:3,children:_}),AssetsPanel=({tokens:_,nfts:a,account:$,delegation:j})=>{const et=useGetPendingMultisigOperations(),tt=$.type==="multisig"&&et($).length>0,rt=useSelectedNetwork(),{operations:nt,isFirstLoad:it}=useGetOperations([$]);return jsxRuntimeExports.jsxs(Tabs,{flexDirection:"column",display:"flex",width:"100%",marginTop:"60px","data-testid":"asset-panel",children:[jsxRuntimeExports.jsxs(TabList,{justifyContent:"space-between","data-testid":"asset-panel-tablist",children:[jsxRuntimeExports.jsxs(Flex,{children:[tt&&jsxRuntimeExports.jsxs(SmallTab,{"data-testid":"account-card-pending-tab",children:[jsxRuntimeExports.jsx(Text,{children:"Pending"}),jsxRuntimeExports.jsx(Box,{width:"6px",height:"6px",marginTop:"-7px",marginRight:"-3px",marginLeft:"3px",borderRadius:"100%",backgroundColor:colors.orangeL})]}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-operations-tab",children:"Operations"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-delegation-tab",children:"Delegation"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-nfts-tab",children:"NFTs"}),jsxRuntimeExports.jsx(SmallTab,{"data-testid":"account-card-tokens-tab",children:"Tokens"})]}),jsxRuntimeExports.jsx(ExternalLink,{href:buildTzktAddressUrl(rt,$.address.pkh),children:jsxRuntimeExports.jsxs(Button,{paddingRight:0,variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{marginRight:"7px",size:"sm",children:"View on Tzkt"}),jsxRuntimeExports.jsx(ExternalLinkIcon,{stroke:"currentcolor"})]})})]}),jsxRuntimeExports.jsxs(TabPanels,{height:"100%",children:[tt&&jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:"60px","data-testid":"account-card-pending-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(MultisigPendingOperations,{account:$})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:"60px","data-testid":"account-card-operations-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsxs(OperationTileContext.Provider,{value:{mode:"drawer",selectedAddress:$.address},children:[jsxRuntimeExports.jsx(Center,{display:it?"flex":"none",height:"50px",children:jsxRuntimeExports.jsx(Image$1,{width:"150px",height:"75px",src:"./static/media/loading-wheel.gif"})}),!it&&jsxRuntimeExports.jsx(OperationListDisplay,{operations:nt,owner:$.address.pkh})]})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",paddingTop:"24px","data-testid":"account-card-delegation-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(DelegationDisplay,{account:$,delegation:j})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px",paddingBottom:0,"data-testid":"account-card-nfts-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(NFTsGrid,{columns:3,nfts:a,owner:$.address.pkh})}),jsxRuntimeExports.jsx(TabPanel,{overflowX:"hidden",height:"100%",paddingTop:"24px","data-testid":"account-card-tokens-tab-panel",paddingX:"0",children:jsxRuntimeExports.jsx(TokenList,{owner:$.address.pkh,tokens:_})})]})]})},MultisigApprovers=({signers:_})=>jsxRuntimeExports.jsx(Box,{width:"100%",marginTop:"40px",marginBottom:"-20px",background:colors.gray[800],borderRadius:"8px",children:jsxRuntimeExports.jsx(Accordion,{padding:"15px",allowToggle:!0,children:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],border:"none",borderRadius:"8px",children:[jsxRuntimeExports.jsxs(AccordionButton,{as:"span",flex:"1",padding:"0",textAlign:"left",cursor:"pointer",children:[jsxRuntimeExports.jsx(Heading,{width:"100%",size:"md",children:"Approvers"}),jsxRuntimeExports.jsx(AccordionIcon,{cursor:"pointer"})]}),jsxRuntimeExports.jsx(AccordionPanel,{padding:"0",children:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"multisig-tag-section",spacingX:"0",spacingY:"12px",children:_.map(a=>jsxRuntimeExports.jsx(AddressPill,{marginRight:"12px",address:a},a.pkh))})})]})})}),renameAccount=(_,a)=>($,j)=>{const{accounts:et,multisigs:tt,contacts:rt}=j(),nt=_.type==="multisig",it=et.items.map(ot=>ot.label),at=tt.items.map(ot=>ot.label),st=Object.values(rt).map(ot=>ot.name);[it,at,st].flat().includes(a)||$(nt?multisigsSlice.actions.setName({newName:a,account:_}):accountsSlice.actions.renameAccount({newName:a,account:_}))},RenameAccountModal=({account:_})=>{const a=useAppDispatch(),{onClose:$}=reactExports.useContext(DynamicModalContext),j=({name:ot})=>{a(renameAccount(_,ot)),$()},{handleSubmit:et,formState:{isValid:tt,errors:rt},register:nt,reset:it}=useForm({mode:"onBlur",defaultValues:{name:_.label}}),at=({name:ot})=>{j({name:ot.trim()}),it()},st=useValidateName(_.label);return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:et(at),children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"Edit your account name here.",title:"Edit Name"}),jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!rt.name,marginY:"20px",children:[jsxRuntimeExports.jsx(FormLabel,{children:"Account name"}),jsxRuntimeExports.jsx(Input,{type:"text",...nt("name",{required:"Name is required",validate:st}),placeholder:"Enter contact's name"}),rt.name&&jsxRuntimeExports.jsx(FormErrorMessage$1,{"data-testid":"name-error",children:rt.name.message})]})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",marginBottom:"8px",isDisabled:!tt,size:"lg",type:"submit",children:"Save"})})]})})},RenameRemoveMenuSwitch=({account:_})=>{const{openWith:a,onClose:$}=reactExports.useContext(DynamicModalContext),j=useNavigate(),et=useImplicitAccounts().length===1,tt=useRemoveAccount();let rt;switch(_.type){case"secret_key":case"ledger":case"social":rt=()=>a(jsxRuntimeExports.jsx(ConfirmationModal,{buttonLabel:at,description:it,onSubmit:()=>{tt(_),$(),j("/")},title:nt}));break}const nt="Remove Account";let it="Are you sure you want to remove this account?",at="Remove Account";return et&&(it="Removing your last account will off-board you from Umami. This will remove or reset all customized settings to their defaults. Personal data (including saved contacts, password and accounts) won't be affected.",at="Remove & Off-board"),jsxRuntimeExports.jsx(RenameRemoveMenu,{onRemove:rt,onRename:()=>a(jsxRuntimeExports.jsx(RenameAccountModal,{account:_}))})},makeDelegation=_=>_.newDelegate?{sender:_.sender.address,timestamp:_.timestamp,id:_.id,amount:new BigNumber(_.amount),delegate:{address:_.newDelegate.address,alias:_.newDelegate.alias??void 0}}:null,TezRecapDisplay=_=>jsxRuntimeExports.jsxs(Box,{textAlign:_.center?"center":"initial",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:prettyTezAmount(_.balance)}),_.dollarBalance!==void 0&&jsxRuntimeExports.jsxs(Text,{marginTop:"6px",color:colors.gray[400],size:"sm",children:["$",_.dollarBalance.toFixed(2)]})]}),RoundButton=({icon:_,label:a,onClick:$=()=>{}})=>jsxRuntimeExports.jsxs(Box,{className:"account-drawer-cta-button",color:colors.gray[300],textAlign:"center",_hover:{color:colors.green},cursor:"pointer",marginX:"24px",onClick:$,children:[jsxRuntimeExports.jsx(IconButton,{className:"account-drawer-cta-button-icon",marginBottom:"8px","aria-label":"button",icon:_,size:"lg",variant:"circle_without_color"}),jsxRuntimeExports.jsx(Text,{cursor:"pointer",size:"sm",children:a})]}),AccountDrawerDisplay=({onSend:_,onReceive:a=()=>{},balance:$,dollarBalance:j,tokens:et,nfts:tt,account:rt})=>{const nt=rt.type==="multisig",{openWith:it}=reactExports.useContext(DynamicModalContext),at=useSelectedNetwork(),[st,ot]=reactExports.useState(null),{handleAsyncAction:ut}=useAsyncActionHandler();return reactExports.useEffect(()=>{ut(async()=>{const dt=await getLastDelegation(rt.address.pkh,at);dt&&ot(makeDelegation(dt))}).catch(lodashExports.noop)},[rt.address.pkh,ut,at]),jsxRuntimeExports.jsxs(Flex,{zIndex:2,alignItems:"center",flexDirection:"column",height:"100%",marginTop:"-86px",paddingTop:"86px",paddingRight:"30px",background:accountIconGradient({account:rt,radius:"350px",opacity:"35",mainBackgroundColor:"transparent",left:"300px",top:"-125px"}),"data-testid":`account-card-${rt.address.pkh}`,children:[jsxRuntimeExports.jsx(AccountTileIcon,{account:rt,size:"lg"}),jsxRuntimeExports.jsx(Heading,{marginTop:"24px",size:"md",children:rt.label}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"8px",marginBottom:"30px",children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"4px",address:rt.address,mode:{type:"no_icons"}}),jsxRuntimeExports.jsx(RenameRemoveMenuSwitch,{account:rt})]}),$&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:$,center:!0,dollarBalance:j}),jsxRuntimeExports.jsxs(Center,{marginTop:"34px",children:[jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(OutgoingArrow,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Send",onClick:_}),jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(IncomingArrow,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Receive",onClick:a}),!nt&&jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(PlusIcon,{stroke:"currentcolor"}),label:"Buy Tez",onClick:()=>it(jsxRuntimeExports.jsx(BuyTezForm,{recipient:rt.address.pkh}))}),jsxRuntimeExports.jsx(RoundButton,{icon:jsxRuntimeExports.jsx(BakerIcon,{width:"24px",height:"24px",stroke:"currentcolor"}),label:"Delegate",onClick:()=>it(jsxRuntimeExports.jsx(FormPage$3,{form:st?{baker:st.delegate.address,sender:rt.address.pkh}:void 0,sender:rt}))})]}),nt&&jsxRuntimeExports.jsx(MultisigApprovers,{signers:rt.signers}),jsxRuntimeExports.jsx(AssetsPanel,{account:rt,delegation:st,nfts:tt,tokens:et})]})};var dist={},lodash_isequal={exports:{}};lodash_isequal.exports;(function(_,a){var $=200,j="__lodash_hash_undefined__",et=1,tt=2,rt=9007199254740991,nt="[object Arguments]",it="[object Array]",at="[object AsyncFunction]",st="[object Boolean]",ot="[object Date]",ut="[object Error]",dt="[object Function]",mt="[object GeneratorFunction]",xt="[object Map]",Ct="[object Number]",Pt="[object Null]",Tt="[object Object]",kt="[object Promise]",Lt="[object Proxy]",Nt="[object RegExp]",zt="[object Set]",jt="[object String]",Mt="[object Symbol]",Dt="[object Undefined]",Ft="[object WeakMap]",Bt="[object ArrayBuffer]",yt="[object DataView]",bt="[object Float32Array]",ct="[object Float64Array]",ht="[object Int8Array]",vt="[object Int16Array]",St="[object Int32Array]",Rt="[object Uint8Array]",$t="[object Uint8ClampedArray]",Et="[object Uint16Array]",At="[object Uint32Array]",wt=/[\\^$.*+?()[\]{}|]/g,Ot=/^\[object .+?Constructor\]$/,tr=/^(?:0|[1-9]\d*)$/,nr={};nr[bt]=nr[ct]=nr[ht]=nr[vt]=nr[St]=nr[Rt]=nr[$t]=nr[Et]=nr[At]=!0,nr[nt]=nr[it]=nr[Bt]=nr[st]=nr[yt]=nr[ot]=nr[ut]=nr[dt]=nr[xt]=nr[Ct]=nr[Tt]=nr[Nt]=nr[zt]=nr[jt]=nr[Ft]=!1;var ir=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Wt=typeof self=="object"&&self&&self.Object===Object&&self,Kt=ir||Wt||Function("return this")(),Jt=a&&!a.nodeType&&a,Ht=Jt&&!0&&_&&!_.nodeType&&_,Vt=Ht&&Ht.exports===Jt,Qt=Vt&&ir.process,dr=function(){try{return Qt&&Qt.binding&&Qt.binding("util")}catch{}}(),xr=dr&&dr.isTypedArray;function pr(_r,Xt){for(var cr=-1,gr=_r==null?0:_r.length,Dr=0,rn=[];++cr-1}function ps(_r,Xt){var cr=this.__data__,gr=bo(cr,_r);return gr<0?(++this.size,cr.push([_r,Xt])):cr[gr][1]=Xt,this}yn.prototype.clear=En,yn.prototype.delete=ds,yn.prototype.get=fs,yn.prototype.has=hs,yn.prototype.set=ps;function qn(_r){var Xt=-1,cr=_r==null?0:_r.length;for(this.clear();++XtPn))return!1;var _n=rn.get(_r);if(_n&&rn.get(Xt))return _n==Xt;var Nn=-1,Fn=!0,ts=cr&tt?new es:void 0;for(rn.set(_r,Xt),rn.set(Xt,_r);++Nn-1&&_r%1==0&&_r-1&&_r%1==0&&_r<=rt}function Io(_r){var Xt=typeof _r;return _r!=null&&(Xt=="object"||Xt=="function")}function So(_r){return _r!=null&&typeof _r=="object"}var ko=xr?fr(xr):xl;function Xl(_r){return wo(_r)?yl(_r):El(_r)}function rs(){return[]}function Xn(){return!1}_.exports=Ts})(lodash_isequal,lodash_isequal.exports);var lodash_isequalExports=lodash_isequal.exports,qrcode={exports:{}};(function(_,a){var $=function(){var j=function(Nt,zt){var jt=236,Mt=17,Dt=Nt,Ft=tt[zt],Bt=null,yt=0,bt=null,ct=[],ht={},vt=function(Kt,Jt){yt=Dt*4+17,Bt=function(Ht){for(var Vt=new Array(Ht),Qt=0;Qt=7&&At(Kt),bt==null&&(bt=nr(Dt,Ft,ct)),Ot(bt,Jt)},St=function(Kt,Jt){for(var Ht=-1;Ht<=7;Ht+=1)if(!(Kt+Ht<=-1||yt<=Kt+Ht))for(var Vt=-1;Vt<=7;Vt+=1)Jt+Vt<=-1||yt<=Jt+Vt||(0<=Ht&&Ht<=6&&(Vt==0||Vt==6)||0<=Vt&&Vt<=6&&(Ht==0||Ht==6)||2<=Ht&&Ht<=4&&2<=Vt&&Vt<=4?Bt[Kt+Ht][Jt+Vt]=!0:Bt[Kt+Ht][Jt+Vt]=!1)},Rt=function(){for(var Kt=0,Jt=0,Ht=0;Ht<8;Ht+=1){vt(!0,Ht);var Vt=nt.getLostPoint(ht);(Ht==0||Kt>Vt)&&(Kt=Vt,Jt=Ht)}return Jt},$t=function(){for(var Kt=8;Kt>Ht&1)==1;Bt[Math.floor(Ht/3)][Ht%3+yt-8-3]=Vt}for(var Ht=0;Ht<18;Ht+=1){var Vt=!Kt&&(Jt>>Ht&1)==1;Bt[Ht%3+yt-8-3][Math.floor(Ht/3)]=Vt}},wt=function(Kt,Jt){for(var Ht=Ft<<3|Jt,Vt=nt.getBCHTypeInfo(Ht),Qt=0;Qt<15;Qt+=1){var dr=!Kt&&(Vt>>Qt&1)==1;Qt<6?Bt[Qt][8]=dr:Qt<8?Bt[Qt+1][8]=dr:Bt[yt-15+Qt][8]=dr}for(var Qt=0;Qt<15;Qt+=1){var dr=!Kt&&(Vt>>Qt&1)==1;Qt<8?Bt[8][yt-Qt-1]=dr:Qt<9?Bt[8][15-Qt-1+1]=dr:Bt[8][15-Qt-1]=dr}Bt[yt-8][8]=!Kt},Ot=function(Kt,Jt){for(var Ht=-1,Vt=yt-1,Qt=7,dr=0,xr=nt.getMaskFunction(Jt),pr=yt-1;pr>0;pr-=2)for(pr==6&&(pr-=1);;){for(var Ir=0;Ir<2;Ir+=1)if(Bt[Vt][pr-Ir]==null){var kr=!1;dr>>Qt&1)==1);var lr=xr(Vt,pr-Ir);lr&&(kr=!kr),Bt[Vt][pr-Ir]=kr,Qt-=1,Qt==-1&&(dr+=1,Qt=7)}if(Vt+=Ht,Vt<0||yt<=Vt){Vt-=Ht,Ht=-Ht;break}}},tr=function(Kt,Jt){for(var Ht=0,Vt=0,Qt=0,dr=new Array(Jt.length),xr=new Array(Jt.length),pr=0;pr=0?$r.getAt(Pr):0}}for(var Rr=0,lr=0;lrpr*8)throw"code length overflow. ("+Qt.getLengthInBits()+">"+pr*8+")";for(Qt.getLengthInBits()+4<=pr*8&&Qt.put(0,4);Qt.getLengthInBits()%8!=0;)Qt.putBit(!1);for(;!(Qt.getLengthInBits()>=pr*8||(Qt.put(jt,8),Qt.getLengthInBits()>=pr*8));)Qt.put(Mt,8);return tr(Qt,Vt)};ht.addData=function(Kt,Jt){Jt=Jt||"Byte";var Ht=null;switch(Jt){case"Numeric":Ht=ut(Kt);break;case"Alphanumeric":Ht=dt(Kt);break;case"Byte":Ht=mt(Kt);break;case"Kanji":Ht=xt(Kt);break;default:throw"mode:"+Jt}ct.push(Ht),bt=null},ht.isDark=function(Kt,Jt){if(Kt<0||yt<=Kt||Jt<0||yt<=Jt)throw Kt+","+Jt;return Bt[Kt][Jt]},ht.getModuleCount=function(){return yt},ht.make=function(){if(Dt<1){for(var Kt=1;Kt<40;Kt++){for(var Jt=st.getRSBlocks(Kt,Ft),Ht=ot(),Vt=0;Vt"u"?Kt*4:Jt;var Ht="";Ht+='";for(var Qt=0;Qt';Ht+=""}return Ht+="",Ht+="
",Ht},ht.createSvgTag=function(Kt,Jt,Ht,Vt){var Qt={};typeof arguments[0]=="object"&&(Qt=arguments[0],Kt=Qt.cellSize,Jt=Qt.margin,Ht=Qt.alt,Vt=Qt.title),Kt=Kt||2,Jt=typeof Jt>"u"?Kt*4:Jt,Ht=typeof Ht=="string"?{text:Ht}:Ht||{},Ht.text=Ht.text||null,Ht.id=Ht.text?Ht.id||"qrcode-description":null,Vt=typeof Vt=="string"?{text:Vt}:Vt||{},Vt.text=Vt.text||null,Vt.id=Vt.text?Vt.id||"qrcode-title":null;var dr=ht.getModuleCount()*Kt+Jt*2,xr,pr,Ir,kr,lr="",fr;for(fr="l"+Kt+",0 0,"+Kt+" -"+Kt+",0 0,-"+Kt+"z ",lr+=''+ir(Vt.text)+"":"",lr+=Ht.text?''+ir(Ht.text)+"":"",lr+='',lr+='"u"?Kt*4:Jt;var Ht=ht.getModuleCount()*Kt+Jt*2,Vt=Jt,Qt=Ht-Jt;return Lt(Ht,Ht,function(dr,xr){if(Vt<=dr&&dr"u"?Kt*4:Jt;var Vt=ht.getModuleCount()*Kt+Jt*2,Qt="";return Qt+="",Qt};var ir=function(Kt){for(var Jt="",Ht=0;Ht":Jt+=">";break;case"&":Jt+="&";break;case'"':Jt+=""";break;default:Jt+=Vt;break}}return Jt},Wt=function(Kt){var Jt=1;Kt=typeof Kt>"u"?Jt*2:Kt;var Ht=ht.getModuleCount()*Jt+Kt*2,Vt=Kt,Qt=Ht-Kt,dr,xr,pr,Ir,kr,lr={"██":"█","█ ":"▀"," █":"▄"," ":" "},fr={"██":"▀","█ ":"▀"," █":" "," ":" "},Er="";for(dr=0;dr=Qt?fr[kr]:lr[kr];Er+=` `}return Ht%2&&Kt>0?Er.substring(0,Er.length-Ht-1)+Array(Ht+1).join("▀"):Er.substring(0,Er.length-1)};return ht.createASCII=function(Kt,Jt){if(Kt=Kt||1,Kt<2)return Wt(Jt);Kt-=1,Jt=typeof Jt>"u"?Kt*2:Jt;var Ht=ht.getModuleCount()*Kt+Jt*2,Vt=Jt,Qt=Ht-Jt,dr,xr,pr,Ir,kr=Array(Kt+1).join("██"),lr=Array(Kt+1).join(" "),fr="",Er="";for(dr=0;dr>>8),Ft.push(bt&255)):Ft.push(Mt)}}return Ft}};var et={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},tt={L:1,M:0,Q:3,H:2},rt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},nt=function(){var Nt=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],zt=1335,jt=7973,Mt=21522,Dt={},Ft=function(Bt){for(var yt=0;Bt!=0;)yt+=1,Bt>>>=1;return yt};return Dt.getBCHTypeInfo=function(Bt){for(var yt=Bt<<10;Ft(yt)-Ft(zt)>=0;)yt^=zt<=0;)yt^=jt<5&&(bt+=3+vt-5)}for(var ct=0;ct=256;)Dt-=255;return Nt[Dt]},Mt}();function at(Nt,zt){if(typeof Nt.length>"u")throw Nt.length+"/"+zt;var jt=function(){for(var Dt=0;Dt"u")throw"bad rs block @ typeNumber:"+Dt+"/errorCorrectionLevel:"+Ft;for(var yt=Bt.length/3,bt=[],ct=0;ct>>7-Mt%8&1)==1},jt.put=function(Mt,Dt){for(var Ft=0;Ft>>Dt-Ft-1&1)==1)},jt.getLengthInBits=function(){return zt},jt.putBit=function(Mt){var Dt=Math.floor(zt/8);Nt.length<=Dt&&Nt.push(0),Mt&&(Nt[Dt]|=128>>>zt%8),zt+=1},jt},ut=function(Nt){var zt=et.MODE_NUMBER,jt=Nt,Mt={};Mt.getMode=function(){return zt},Mt.getLength=function(Bt){return jt.length},Mt.write=function(Bt){for(var yt=jt,bt=0;bt+2>>8&255)*192+(bt&255),Ft.put(bt,13),yt+=2}if(yt>>8)},zt.writeBytes=function(jt,Mt,Dt){Mt=Mt||0,Dt=Dt||jt.length;for(var Ft=0;Ft0&&(jt+=","),jt+=Nt[Mt];return jt+="]",jt},zt},Pt=function(){var Nt=0,zt=0,jt=0,Mt="",Dt={},Ft=function(yt){Mt+=String.fromCharCode(Bt(yt&63))},Bt=function(yt){if(!(yt<0)){if(yt<26)return 65+yt;if(yt<52)return 97+(yt-26);if(yt<62)return 48+(yt-52);if(yt==62)return 43;if(yt==63)return 47}throw"n:"+yt};return Dt.writeByte=function(yt){for(Nt=Nt<<8|yt&255,zt+=8,jt+=1;zt>=6;)Ft(Nt>>>zt-6),zt-=6},Dt.flush=function(){if(zt>0&&(Ft(Nt<<6-zt),Nt=0,zt=0),jt%3!=0)for(var yt=3-jt%3,bt=0;bt=zt.length){if(Dt==0)return-1;throw"unexpected end of file./"+Dt}var yt=zt.charAt(jt);if(jt+=1,yt=="=")return Dt=0,-1;if(yt.match(/^\s$/))continue;Mt=Mt<<6|Bt(yt.charCodeAt(0)),Dt+=6}var bt=Mt>>>Dt-8&255;return Dt-=8,bt};var Bt=function(yt){if(65<=yt&&yt<=90)return yt-65;if(97<=yt&&yt<=122)return yt-97+26;if(48<=yt&&yt<=57)return yt-48+52;if(yt==43)return 62;if(yt==47)return 63;throw"c:"+yt};return Ft},kt=function(Nt,zt){var jt=Nt,Mt=zt,Dt=new Array(Nt*zt),Ft={};Ft.setPixel=function(ct,ht,vt){Dt[ht*jt+ct]=vt},Ft.write=function(ct){ct.writeString("GIF87a"),ct.writeShort(jt),ct.writeShort(Mt),ct.writeByte(128),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(255),ct.writeByte(255),ct.writeByte(255),ct.writeString(","),ct.writeShort(0),ct.writeShort(0),ct.writeShort(jt),ct.writeShort(Mt),ct.writeByte(0);var ht=2,vt=yt(ht);ct.writeByte(ht);for(var St=0;vt.length-St>255;)ct.writeByte(255),ct.writeBytes(vt,St,255),St+=255;ct.writeByte(vt.length-St),ct.writeBytes(vt,St,vt.length-St),ct.writeByte(0),ct.writeString(";")};var Bt=function(ct){var ht=ct,vt=0,St=0,Rt={};return Rt.write=function($t,Et){if($t>>>Et)throw"length over";for(;vt+Et>=8;)ht.writeByte(255&($t<>>=8-vt,St=0,vt=0;St=$t<0&&ht.writeByte(St)},Rt},yt=function(ct){for(var ht=1<>6,128|it&63):it<55296||it>=57344?rt.push(224|it>>12,128|it>>6&63,128|it&63):(nt++,it=65536+((it&1023)<<10|tt.charCodeAt(nt)&1023),rt.push(240|it>>18,128|it>>12&63,128|it>>6&63,128|it&63))}return rt}return et(j)}})(),function(j){_.exports=j()}(function(){return $})})(qrcode);var qrcodeExports=qrcode.exports,__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var _=function(a,$){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,et){j.__proto__=et}||function(j,et){for(var tt in et)et.hasOwnProperty(tt)&&(j[tt]=et[tt])},_(a,$)};return function(a,$){_(a,$);function j(){this.constructor=a}a.prototype=$===null?Object.create($):(j.prototype=$.prototype,new j)}}();Object.defineProperty(dist,"__esModule",{value:!0});var QRCode_1=dist.QRCode=void 0,isEqual$1=lodash_isequalExports,qrGenerator=qrcodeExports,React=reactExports,ReactDOM=reactDomExports,QRCode=function(_){__extends(a,_);function a($){var j=_.call(this,$)||this;return j.canvas=React.createRef(),j}return a.utf16to8=function($){var j="",et,tt,rt=$.length;for(et=0;et=1&&tt<=127?j+=$.charAt(et):tt>2047?(j+=String.fromCharCode(224|tt>>12&15),j+=String.fromCharCode(128|tt>>6&63),j+=String.fromCharCode(128|tt>>0&63)):(j+=String.fromCharCode(192|tt>>6&31),j+=String.fromCharCode(128|tt>>0&63));return j},a.prototype.drawRoundedSquare=function($,j,et,tt,rt,nt,it,at){at.lineWidth=$,at.fillStyle=rt,at.strokeStyle=rt,et+=$/2,j+=$/2,tt-=$,Array.isArray(nt)||(nt=[nt,nt,nt,nt]),nt=nt.map(function(mt){return mt=Math.min(mt,tt/2),mt<0?0:mt});var st=nt[0]||0,ot=nt[1]||0,ut=nt[2]||0,dt=nt[3]||0;at.beginPath(),at.moveTo(j+st,et),at.lineTo(j+tt-ot,et),ot&&at.quadraticCurveTo(j+tt,et,j+tt,et+ot),at.lineTo(j+tt,et+tt-ut),ut&&at.quadraticCurveTo(j+tt,et+tt,j+tt-ut,et+tt),at.lineTo(j+dt,et+tt),dt&&at.quadraticCurveTo(j,et+tt,j,et+tt-dt),at.lineTo(j,et+st),st&&at.quadraticCurveTo(j,et,j+st,et),at.closePath(),at.stroke(),it&&at.fill()},a.prototype.drawPositioningPattern=function($,j,et,tt,rt,nt,it){it===void 0&&(it=[0,0,0,0]);var at=Math.ceil(j),st,ot;typeof it!="number"&&!Array.isArray(it)?(st=it.outer||0,ot=it.inner||0):(st=it,ot=st);var ut,dt;typeof nt!="string"?(ut=nt.outer,dt=nt.inner):(ut=nt,dt=nt);var mt=tt*j+et,xt=rt*j+et,Ct=j*7;this.drawRoundedSquare(at,xt,mt,Ct,ut,st,!1,$),Ct=j*3,mt+=j*2,xt+=j*2,this.drawRoundedSquare(at,xt,mt,Ct,dt,ot,!0,$)},a.prototype.isInPositioninZone=function($,j,et){return et.some(function(tt){return j>=tt.row&&j<=tt.row+7&&$>=tt.col&&$<=tt.col+7})},a.prototype.transformPixelLengthIntoNumberOfCells=function($,j){return $/j},a.prototype.isCoordinateInImage=function($,j,et,tt,rt,nt,it,at){if(at){var st=2,ot=this.transformPixelLengthIntoNumberOfCells(rt,it),ut=this.transformPixelLengthIntoNumberOfCells(nt,it),dt=this.transformPixelLengthIntoNumberOfCells(et,it)-1,mt=this.transformPixelLengthIntoNumberOfCells(tt,it)-1;return j>=ot-st&&j<=ot+dt+st&&$>=ut-st&&$<=ut+mt+st}else return!1},a.prototype.shouldComponentUpdate=function($){return!isEqual$1(this.props,$)},a.prototype.componentDidMount=function(){this.update()},a.prototype.componentDidUpdate=function(){this.update()},a.prototype.update=function(){var $=this.props,j=$.value,et=$.ecLevel,tt=$.enableCORS,rt=$.bgColor,nt=$.fgColor,it=$.logoImage,at=$.logoOpacity,st=$.logoOnLoad,ot=$.removeQrCodeBehindLogo,ut=$.qrStyle,dt=$.eyeRadius,mt=$.eyeColor,xt=$.logoPaddingStyle,Ct=+this.props.size,Pt=+this.props.quietZone,Tt=this.props.logoWidth?+this.props.logoWidth:0,kt=this.props.logoHeight?+this.props.logoHeight:0,Lt=this.props.logoPadding?+this.props.logoPadding:0,Nt=qrGenerator(0,et);Nt.addData(a.utf16to8(j)),Nt.make();var zt=ReactDOM.findDOMNode(this.canvas.current),jt=zt.getContext("2d"),Mt=Ct+2*Pt,Dt=Nt.getModuleCount(),Ft=Ct/Dt,Bt=window.devicePixelRatio||1;zt.height=zt.width=Mt*Bt,jt.scale(Bt,Bt),jt.fillStyle=rt,jt.fillRect(0,0,Mt,Mt);var yt=Pt,bt=[{row:0,col:0},{row:0,col:Dt-7},{row:Dt-7,col:0}];if(jt.strokeStyle=nt,ut==="dots"){jt.fillStyle=nt;for(var ct=Ft/2,ht=0;ht0&&!Nt.isDark(ht-1,vt)&&vt>0&&!Nt.isDark(ht,vt-1)&&(St[0]=!0),ht>0&&!Nt.isDark(ht-1,vt)&&vt0&&!Nt.isDark(ht,vt-1)&&(St[3]=!0);var Rt=Math.ceil((vt+1)*Ft)-Math.floor(vt*Ft),$t=Math.ceil((ht+1)*Ft)-Math.floor(ht*Ft);jt.fillStyle=nt,jt.beginPath(),jt.arc(Math.round(vt*Ft)+ct+yt,Math.round(ht*Ft)+ct+yt,ct,0,2*Math.PI,!1),jt.closePath(),jt.fill(),St[0]||jt.fillRect(Math.round(vt*Ft)+yt,Math.round(ht*Ft)+yt,Rt/2,$t/2),St[1]||jt.fillRect(Math.round(vt*Ft)+yt+Math.floor(Rt/2),Math.round(ht*Ft)+yt,Rt/2,$t/2),St[2]||jt.fillRect(Math.round(vt*Ft)+yt+Math.floor(Rt/2),Math.round(ht*Ft)+yt+Math.floor($t/2),Rt/2,$t/2),St[3]||jt.fillRect(Math.round(vt*Ft)+yt,Math.round(ht*Ft)+yt+Math.floor($t/2),Rt/2,$t/2)}}else for(var ht=0;ht{const $=useGetOwnedAccountSafe()(_);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"You can receive tez or other digital assets by scanning or sharing this QR code",title:"Receive"}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",flexDirection:"column",children:jsxRuntimeExports.jsx(Box,{padding:"8px",background:"white",borderRadius:"8px",children:jsxRuntimeExports.jsx(QRCode_1,{size:232,value:_})})})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsxs(Box,{width:"100%",children:[$&&jsxRuntimeExports.jsx(Heading,{textAlign:"center",marginY:2,children:$.label}),jsxRuntimeExports.jsx(Flex,{justifyContent:"center",width:"100%",children:jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_),mode:{type:"no_icons"}})})]})})]})},AccountCard=({accountPkh:_})=>{const a=useGetOwnedAccount(),$=useGetAccountBalance(),j=useGetDollarBalance(),et=useGetAccountAllTokens(),tt=useGetAccountNFTs(),{openWith:rt}=reactExports.useContext(DynamicModalContext),nt=a(_),it=$(_),at=j(_),st=et(_),ot=sortedByLastUpdate(tt(_));return jsxRuntimeExports.jsx(AccountDrawerDisplay,{account:nt,balance:it,dollarBalance:at,nfts:ot,onReceive:()=>rt(jsxRuntimeExports.jsx(ReceiveModal,{pkh:_})),onSend:()=>rt(jsxRuntimeExports.jsx(FormPage$4,{sender:nt})),tokens:st})},InfoModal=({account:_})=>{const a=[{title:"Template",content:_.derivationPathTemplate},{title:"Path",content:_.derivationPath},{title:"Type (Curve)",content:_.curve}];return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(CircleIcon,{icon:jsxRuntimeExports.jsx(SlashIcon,{}),size:"48px"}),jsxRuntimeExports.jsx(Center,{marginBottom:"8px",children:jsxRuntimeExports.jsx(Heading,{marginTop:"16px",children:"Derivation Info"})}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsx(ModalBody,{children:a.map(({title:$,content:j})=>j?jsxRuntimeExports.jsxs(Box,{marginTop:"24px",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:$}),jsxRuntimeExports.jsx(Center,{justifyContent:"flex-start",marginTop:"12px",padding:"15px",borderRadius:"4px",backgroundColor:colors.gray[800],children:jsxRuntimeExports.jsx(Text,{size:"sm",children:j})})]},j):null)})]})},DerivationInfoButton=({account:_,...a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);switch(_.type){case"multisig":case"secret_key":case"social":return null;case"ledger":case"mnemonic":return jsxRuntimeExports.jsx(Button,{"data-testid":"derivation-info-button",onClick:()=>$(jsxRuntimeExports.jsx(InfoModal,{account:_})),variant:"CTAWithIcon",...a,children:jsxRuntimeExports.jsx(FolderInfoIcon,{stroke:"currentcolor"})})}},CloseDrawerButton=({onClose:_})=>jsxRuntimeExports.jsx(Button,{minWidth:"24px",padding:"0",onClick:_,variant:"CTAWithIcon",children:jsxRuntimeExports.jsx(ExitArrowIcon,{stroke:"currentcolor"})}),scriptRel="modulepreload",assetsURL=function(_,a){return new URL(_,a).href},seen={},__vitePreload=function _(a,$,j){let et=Promise.resolve();if($&&$.length>0){const tt=document.getElementsByTagName("link"),rt=document.querySelector("meta[property=csp-nonce]"),nt=(rt==null?void 0:rt.nonce)||(rt==null?void 0:rt.getAttribute("nonce"));et=Promise.all($.map(it=>{if(it=assetsURL(it,j),it in seen)return;seen[it]=!0;const at=it.endsWith(".css"),st=at?'[rel="stylesheet"]':"";if(!!j)for(let dt=tt.length-1;dt>=0;dt--){const mt=tt[dt];if(mt.href===it&&(!at||mt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${it}"]${st}`))return;const ut=document.createElement("link");if(ut.rel=at?"stylesheet":scriptRel,at||(ut.as="script",ut.crossOrigin=""),ut.href=it,nt&&ut.setAttribute("nonce",nt),document.head.appendChild(ut),at)return new Promise((dt,mt)=>{ut.addEventListener("load",dt),ut.addEventListener("error",()=>mt(new Error(`Unable to preload CSS for ${it}`)))})}))}return et.then(()=>a()).catch(tt=>{const rt=new Event("vite:preloadError",{cancelable:!0});if(rt.payload=tt,window.dispatchEvent(rt),!rt.defaultPrevented)throw tt})};var loadScript=function _(a,$,j){var et=document.head||document.getElementsByTagName("head")[0],tt=document.createElement("script");typeof $=="function"&&(j=$,$={}),$=$||{},j=j||function(){},tt.type=$.type||"text/javascript",tt.charset=$.charset||"utf8",tt.async="async"in $?!!$.async:!0,tt.src=a,$.attrs&&setAttributes(tt,$.attrs),$.text&&(tt.text=""+$.text);var rt="onload"in tt?stdOnEnd:ieOnEnd;rt(tt,j),tt.onload||stdOnEnd(tt,j),et.appendChild(tt)};function setAttributes(_,a){for(var $ in a)_.setAttribute($,a[$])}function stdOnEnd(_,a){_.onload=function(){this.onerror=this.onload=null,a(null,_)},_.onerror=function(){this.onerror=this.onload=null,a(new Error("Failed to load "+this.src),_)}}function ieOnEnd(_,a){_.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,a(null,_))}}var isMergeableObject=function _(a){return isNonNullObject(a)&&!isSpecial(a)};function isNonNullObject(_){return!!_&&typeof _=="object"}function isSpecial(_){var a=Object.prototype.toString.call(_);return a==="[object RegExp]"||a==="[object Date]"||isReactElement(_)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(_){return _.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(_){return Array.isArray(_)?[]:{}}function cloneUnlessOtherwiseSpecified(_,a){return a.clone!==!1&&a.isMergeableObject(_)?deepmerge(emptyTarget(_),_,a):_}function defaultArrayMerge(_,a,$){return _.concat(a).map(function(j){return cloneUnlessOtherwiseSpecified(j,$)})}function getMergeFunction(_,a){if(!a.customMerge)return deepmerge;var $=a.customMerge(_);return typeof $=="function"?$:deepmerge}function getEnumerableOwnPropertySymbols(_){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(_).filter(function(a){return Object.propertyIsEnumerable.call(_,a)}):[]}function getKeys(_){return Object.keys(_).concat(getEnumerableOwnPropertySymbols(_))}function propertyIsOnObject(_,a){try{return a in _}catch{return!1}}function propertyIsUnsafe(_,a){return propertyIsOnObject(_,a)&&!(Object.hasOwnProperty.call(_,a)&&Object.propertyIsEnumerable.call(_,a))}function mergeObject(_,a,$){var j={};return $.isMergeableObject(_)&&getKeys(_).forEach(function(et){j[et]=cloneUnlessOtherwiseSpecified(_[et],$)}),getKeys(a).forEach(function(et){propertyIsUnsafe(_,et)||(propertyIsOnObject(_,et)&&$.isMergeableObject(a[et])?j[et]=getMergeFunction(et,$)(_[et],a[et],$):j[et]=cloneUnlessOtherwiseSpecified(a[et],$))}),j}function deepmerge(_,a,$){$=$||{},$.arrayMerge=$.arrayMerge||defaultArrayMerge,$.isMergeableObject=$.isMergeableObject||isMergeableObject,$.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var j=Array.isArray(a),et=Array.isArray(_),tt=j===et;return tt?j?$.arrayMerge(_,a,$):mergeObject(_,a,$):cloneUnlessOtherwiseSpecified(a,$)}deepmerge.all=function _(a,$){if(!Array.isArray(a))throw new Error("first argument should be an array");return a.reduce(function(j,et){return deepmerge(j,et,$)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1,__create$4=Object.create,__defProp$6=Object.defineProperty,__getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__getOwnPropNames$6=Object.getOwnPropertyNames,__getProtoOf$4=Object.getPrototypeOf,__hasOwnProp$6=Object.prototype.hasOwnProperty,__export$6=(_,a)=>{for(var $ in a)__defProp$6(_,$,{get:a[$],enumerable:!0})},__copyProps$6=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$6(a))!__hasOwnProp$6.call(_,et)&&et!==$&&__defProp$6(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$6(a,et))||j.enumerable});return _},__toESM$4=(_,a,$)=>($=_!=null?__create$4(__getProtoOf$4(_)):{},__copyProps$6(!_||!_.__esModule?__defProp$6($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$6=_=>__copyProps$6(__defProp$6({},"__esModule",{value:!0}),_),utils_exports={};__export$6(utils_exports,{callPlayer:()=>callPlayer,getConfig:()=>getConfig,getSDK:()=>getSDK,isBlobUrl:()=>isBlobUrl,isMediaStream:()=>isMediaStream,lazy:()=>lazy,omit:()=>omit,parseEndTime:()=>parseEndTime,parseStartTime:()=>parseStartTime,queryString:()=>queryString,randomString:()=>randomString,supportsWebKitPresentationMode:()=>supportsWebKitPresentationMode});var utils$1=__toCommonJS$6(utils_exports),import_react$2=__toESM$4(reactExports),import_load_script=__toESM$4(loadScript),import_deepmerge$1=__toESM$4(cjs);const lazy=_=>import_react$2.default.lazy(async()=>{const a=await _();return typeof a.default=="function"?a:a.default}),MATCH_START_QUERY=/[?&#](?:start|t)=([0-9hms]+)/,MATCH_END_QUERY=/[?&#]end=([0-9hms]+)/,MATCH_START_STAMP=/(\d+)(h|m|s)/g,MATCH_NUMERIC=/^\d+$/;function parseTimeParam(_,a){if(_ instanceof Array)return;const $=_.match(a);if($){const j=$[1];if(j.match(MATCH_START_STAMP))return parseTimeString(j);if(MATCH_NUMERIC.test(j))return parseInt(j)}}function parseTimeString(_){let a=0,$=MATCH_START_STAMP.exec(_);for(;$!==null;){const[,j,et]=$;et==="h"&&(a+=parseInt(j,10)*60*60),et==="m"&&(a+=parseInt(j,10)*60),et==="s"&&(a+=parseInt(j,10)),$=MATCH_START_STAMP.exec(_)}return a}function parseStartTime(_){return parseTimeParam(_,MATCH_START_QUERY)}function parseEndTime(_){return parseTimeParam(_,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(_){return Object.keys(_).map(a=>`${a}=${_[a]}`).join("&")}function getGlobal(_){return window[_]?window[_]:window.exports&&window.exports[_]?window.exports[_]:window.module&&window.module.exports&&window.module.exports[_]?window.module.exports[_]:null}const requests={},getSDK=function _(a,$,j=null,et=()=>!0,tt=import_load_script.default){const rt=getGlobal($);return rt&&et(rt)?Promise.resolve(rt):new Promise((nt,it)=>{if(requests[a]){requests[a].push({resolve:nt,reject:it});return}requests[a]=[{resolve:nt,reject:it}];const at=st=>{requests[a].forEach(ot=>ot.resolve(st))};if(j){const st=window[j];window[j]=function(){st&&st(),at(getGlobal($))}}tt(a,st=>{st?(requests[a].forEach(ot=>ot.reject(st)),requests[a]=null):j||at(getGlobal($))})})};function getConfig(_,a){return(0,import_deepmerge$1.default)(a.config,_.config)}function omit(_,...a){const $=[].concat(...a),j={},et=Object.keys(_);for(const tt of et)$.indexOf(tt)===-1&&(j[tt]=_[tt]);return j}function callPlayer(_,...a){if(!this.player||!this.player[_]){let $=`ReactPlayer: ${this.constructor.displayName} player could not call %c${_}%c – `;return this.player?this.player[_]||($+="The method was not available"):$+="The player was not available",console.warn($,"font-weight: bold",""),null}return this.player[_](...a)}function isMediaStream(_){return typeof window<"u"&&typeof window.MediaStream<"u"&&_ instanceof window.MediaStream}function isBlobUrl(_){return/^blob:/.test(_)}function supportsWebKitPresentationMode(_=document.createElement("video")){const a=/iPhone|iPod/.test(navigator.userAgent)===!1;return _.webkitSupportsPresentationMode&&typeof _.webkitSetPresentationMode=="function"&&a}function enableStubOn(_){return _}var __defProp$5=Object.defineProperty,__getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__getOwnPropNames$5=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__export$5=(_,a)=>{for(var $ in a)__defProp$5(_,$,{get:a[$],enumerable:!0})},__copyProps$5=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$5(a))!__hasOwnProp$5.call(_,et)&&et!==$&&__defProp$5(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$5(a,et))||j.enumerable});return _},__toCommonJS$5=_=>__copyProps$5(__defProp$5({},"__esModule",{value:!0}),_),patterns_exports={};__export$5(patterns_exports,{AUDIO_EXTENSIONS:()=>AUDIO_EXTENSIONS,DASH_EXTENSIONS:()=>DASH_EXTENSIONS,FLV_EXTENSIONS:()=>FLV_EXTENSIONS,HLS_EXTENSIONS:()=>HLS_EXTENSIONS,MATCH_URL_DAILYMOTION:()=>MATCH_URL_DAILYMOTION,MATCH_URL_FACEBOOK:()=>MATCH_URL_FACEBOOK,MATCH_URL_FACEBOOK_WATCH:()=>MATCH_URL_FACEBOOK_WATCH,MATCH_URL_KALTURA:()=>MATCH_URL_KALTURA,MATCH_URL_MIXCLOUD:()=>MATCH_URL_MIXCLOUD,MATCH_URL_MUX:()=>MATCH_URL_MUX,MATCH_URL_SOUNDCLOUD:()=>MATCH_URL_SOUNDCLOUD,MATCH_URL_STREAMABLE:()=>MATCH_URL_STREAMABLE,MATCH_URL_TWITCH_CHANNEL:()=>MATCH_URL_TWITCH_CHANNEL,MATCH_URL_TWITCH_VIDEO:()=>MATCH_URL_TWITCH_VIDEO,MATCH_URL_VIDYARD:()=>MATCH_URL_VIDYARD,MATCH_URL_VIMEO:()=>MATCH_URL_VIMEO,MATCH_URL_WISTIA:()=>MATCH_URL_WISTIA,MATCH_URL_YOUTUBE:()=>MATCH_URL_YOUTUBE,VIDEO_EXTENSIONS:()=>VIDEO_EXTENSIONS,canPlay:()=>canPlay});var patterns=__toCommonJS$5(patterns_exports),import_utils$3=utils$1;const MATCH_URL_YOUTUBE=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,MATCH_URL_SOUNDCLOUD=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,MATCH_URL_VIMEO=/vimeo\.com\/(?!progressive_redirect).+/,MATCH_URL_MUX=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,MATCH_URL_FACEBOOK=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,MATCH_URL_FACEBOOK_WATCH=/^https?:\/\/fb\.watch\/.+$/,MATCH_URL_STREAMABLE=/streamable\.com\/([a-z0-9]+)$/,MATCH_URL_WISTIA=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,MATCH_URL_TWITCH_VIDEO=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,MATCH_URL_TWITCH_CHANNEL=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,MATCH_URL_DAILYMOTION=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,MATCH_URL_MIXCLOUD=/mixcloud\.com\/([^/]+\/[^/]+)/,MATCH_URL_VIDYARD=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,MATCH_URL_KALTURA=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,AUDIO_EXTENSIONS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,VIDEO_EXTENSIONS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,HLS_EXTENSIONS=/\.(m3u8)($|\?)/i,DASH_EXTENSIONS=/\.(mpd)($|\?)/i,FLV_EXTENSIONS=/\.(flv)($|\?)/i,canPlayFile=_=>{if(_ instanceof Array){for(const a of _)if(typeof a=="string"&&canPlayFile(a)||canPlayFile(a.src))return!0;return!1}return(0,import_utils$3.isMediaStream)(_)||(0,import_utils$3.isBlobUrl)(_)?!0:AUDIO_EXTENSIONS.test(_)||VIDEO_EXTENSIONS.test(_)||HLS_EXTENSIONS.test(_)||DASH_EXTENSIONS.test(_)||FLV_EXTENSIONS.test(_)},canPlay={youtube:_=>_ instanceof Array?_.every(a=>MATCH_URL_YOUTUBE.test(a)):MATCH_URL_YOUTUBE.test(_),soundcloud:_=>MATCH_URL_SOUNDCLOUD.test(_)&&!AUDIO_EXTENSIONS.test(_),vimeo:_=>MATCH_URL_VIMEO.test(_)&&!VIDEO_EXTENSIONS.test(_)&&!HLS_EXTENSIONS.test(_),mux:_=>MATCH_URL_MUX.test(_),facebook:_=>MATCH_URL_FACEBOOK.test(_)||MATCH_URL_FACEBOOK_WATCH.test(_),streamable:_=>MATCH_URL_STREAMABLE.test(_),wistia:_=>MATCH_URL_WISTIA.test(_),twitch:_=>MATCH_URL_TWITCH_VIDEO.test(_)||MATCH_URL_TWITCH_CHANNEL.test(_),dailymotion:_=>MATCH_URL_DAILYMOTION.test(_),mixcloud:_=>MATCH_URL_MIXCLOUD.test(_),vidyard:_=>MATCH_URL_VIDYARD.test(_),kaltura:_=>MATCH_URL_KALTURA.test(_),file:canPlayFile};var __defProp$4=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__getOwnPropNames$4=Object.getOwnPropertyNames,__hasOwnProp$4=Object.prototype.hasOwnProperty,__export$4=(_,a)=>{for(var $ in a)__defProp$4(_,$,{get:a[$],enumerable:!0})},__copyProps$4=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$4(a))!__hasOwnProp$4.call(_,et)&&et!==$&&__defProp$4(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$4(a,et))||j.enumerable});return _},__toCommonJS$4=_=>__copyProps$4(__defProp$4({},"__esModule",{value:!0}),_),players_exports={};__export$4(players_exports,{default:()=>players_default});var players=__toCommonJS$4(players_exports),import_utils$2=utils$1,import_patterns=patterns,players_default=[{key:"youtube",name:"YouTube",canPlay:import_patterns.canPlay.youtube,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./YouTube-rN4jOR1J.js").then(_=>_.Y),[],import.meta.url))},{key:"soundcloud",name:"SoundCloud",canPlay:import_patterns.canPlay.soundcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./SoundCloud-DyFw8PPp.js").then(_=>_.S),[],import.meta.url))},{key:"vimeo",name:"Vimeo",canPlay:import_patterns.canPlay.vimeo,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vimeo-OM6omvoU.js").then(_=>_.V),[],import.meta.url))},{key:"mux",name:"Mux",canPlay:import_patterns.canPlay.mux,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mux-BMhgBc2q.js").then(_=>_.M),[],import.meta.url))},{key:"facebook",name:"Facebook",canPlay:import_patterns.canPlay.facebook,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Facebook-DXJhKi1H.js").then(_=>_.F),[],import.meta.url))},{key:"streamable",name:"Streamable",canPlay:import_patterns.canPlay.streamable,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Streamable-EfsHeeCs.js").then(_=>_.S),[],import.meta.url))},{key:"wistia",name:"Wistia",canPlay:import_patterns.canPlay.wistia,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Wistia-Bl5F6sjb.js").then(_=>_.W),[],import.meta.url))},{key:"twitch",name:"Twitch",canPlay:import_patterns.canPlay.twitch,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Twitch-T6QqMvoo.js").then(_=>_.T),[],import.meta.url))},{key:"dailymotion",name:"DailyMotion",canPlay:import_patterns.canPlay.dailymotion,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./DailyMotion-CteX4E3j.js").then(_=>_.D),[],import.meta.url))},{key:"mixcloud",name:"Mixcloud",canPlay:import_patterns.canPlay.mixcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mixcloud-BcC5g1Wh.js").then(_=>_.M),[],import.meta.url))},{key:"vidyard",name:"Vidyard",canPlay:import_patterns.canPlay.vidyard,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vidyard-CsuXaKoc.js").then(_=>_.V),[],import.meta.url))},{key:"kaltura",name:"Kaltura",canPlay:import_patterns.canPlay.kaltura,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Kaltura-Kwks3p2E.js").then(_=>_.K),[],import.meta.url))},{key:"file",name:"FilePlayer",canPlay:import_patterns.canPlay.file,canEnablePIP:_=>import_patterns.canPlay.file(_)&&(document.pictureInPictureEnabled||(0,import_utils$2.supportsWebKitPresentationMode)())&&!import_patterns.AUDIO_EXTENSIONS.test(_),lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./FilePlayer-l0jhCgoe.js").then(_=>_.F),[],import.meta.url))}],safeIsNaN=Number.isNaN||function _(a){return typeof a=="number"&&a!==a};function isEqual(_,a){return!!(_===a||safeIsNaN(_)&&safeIsNaN(a))}function areInputsEqual(_,a){if(_.length!==a.length)return!1;for(var $=0;$<_.length;$++)if(!isEqual(_[$],a[$]))return!1;return!0}function memoizeOne(_,a){a===void 0&&(a=areInputsEqual);var $,j=[],et,tt=!1;function rt(){for(var nt=[],it=0;it{for(var $ in a)__defProp$3(_,$,{get:a[$],enumerable:!0})},__copyProps$3=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$3(a))!__hasOwnProp$3.call(_,et)&&et!==$&&__defProp$3(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$3(a,et))||j.enumerable});return _},__toESM$3=(_,a,$)=>($=_!=null?__create$3(__getProtoOf$3(_)):{},__copyProps$3(!_||!_.__esModule?__defProp$3($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$3=_=>__copyProps$3(__defProp$3({},"__esModule",{value:!0}),_),props_exports={};__export$3(props_exports,{defaultProps:()=>defaultProps,propTypes:()=>propTypes});var props=__toCommonJS$3(props_exports),import_prop_types=__toESM$3(propTypesExports);const{string,bool,number,array,oneOfType,shape,object,func,node}=import_prop_types.default,propTypes={url:oneOfType([string,array,object]),playing:bool,loop:bool,controls:bool,volume:number,muted:bool,playbackRate:number,width:oneOfType([string,number]),height:oneOfType([string,number]),style:object,progressInterval:number,playsinline:bool,pip:bool,stopOnUnmount:bool,light:oneOfType([bool,string,object]),playIcon:node,previewTabIndex:number,previewAriaLabel:string,fallback:node,oEmbedUrl:string,wrapper:oneOfType([string,func,shape({render:func.isRequired})]),config:shape({soundcloud:shape({options:object}),youtube:shape({playerVars:object,embedOptions:object,onUnstarted:func}),facebook:shape({appId:string,version:string,playerId:string,attributes:object}),dailymotion:shape({params:object}),vimeo:shape({playerOptions:object,title:string}),mux:shape({attributes:object,version:string}),file:shape({attributes:object,tracks:array,forceVideo:bool,forceAudio:bool,forceHLS:bool,forceSafariHLS:bool,forceDisableHls:bool,forceDASH:bool,forceFLV:bool,hlsOptions:object,hlsVersion:string,dashVersion:string,flvVersion:string}),wistia:shape({options:object,playerId:string,customControls:array}),mixcloud:shape({options:object}),twitch:shape({options:object,playerId:string}),vidyard:shape({options:object})}),onReady:func,onStart:func,onPlay:func,onPause:func,onBuffer:func,onBufferEnd:func,onEnded:func,onError:func,onDuration:func,onSeek:func,onPlaybackRateChange:func,onPlaybackQualityChange:func,onProgress:func,onClickPreview:func,onEnablePIP:func,onDisablePIP:func},noop$1=()=>{},defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:noop$1},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},mux:{attributes:{},version:"2"},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:noop$1,onStart:noop$1,onPlay:noop$1,onPause:noop$1,onBuffer:noop$1,onBufferEnd:noop$1,onEnded:noop$1,onError:noop$1,onDuration:noop$1,onSeek:noop$1,onPlaybackRateChange:noop$1,onPlaybackQualityChange:noop$1,onProgress:noop$1,onClickPreview:noop$1,onEnablePIP:noop$1,onDisablePIP:noop$1};var __create$2=Object.create,__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__getOwnPropNames$2=Object.getOwnPropertyNames,__getProtoOf$2=Object.getPrototypeOf,__hasOwnProp$2=Object.prototype.hasOwnProperty,__defNormalProp$1=(_,a,$)=>a in _?__defProp$2(_,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):_[a]=$,__export$2=(_,a)=>{for(var $ in a)__defProp$2(_,$,{get:a[$],enumerable:!0})},__copyProps$2=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$2(a))!__hasOwnProp$2.call(_,et)&&et!==$&&__defProp$2(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$2(a,et))||j.enumerable});return _},__toESM$2=(_,a,$)=>($=_!=null?__create$2(__getProtoOf$2(_)):{},__copyProps$2(!_||!_.__esModule?__defProp$2($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$2=_=>__copyProps$2(__defProp$2({},"__esModule",{value:!0}),_),__publicField$1=(_,a,$)=>(__defNormalProp$1(_,typeof a!="symbol"?a+"":a,$),$),Player_exports={};__export$2(Player_exports,{default:()=>Player});var Player_1=__toCommonJS$2(Player_exports),import_react$1=__toESM$2(reactExports),import_react_fast_compare$1=__toESM$2(reactFastCompare),import_props$1=props,import_utils$1=utils$1;const SEEK_ON_PLAY_EXPIRY=5e3;class Player extends import_react$1.Component{constructor(){super(...arguments),__publicField$1(this,"mounted",!1),__publicField$1(this,"isReady",!1),__publicField$1(this,"isPlaying",!1),__publicField$1(this,"isLoading",!0),__publicField$1(this,"loadOnReady",null),__publicField$1(this,"startOnPlay",!0),__publicField$1(this,"seekOnPlay",null),__publicField$1(this,"onDurationCalled",!1),__publicField$1(this,"handlePlayerMount",a=>{if(this.player){this.progress();return}this.player=a,this.player.load(this.props.url),this.progress()}),__publicField$1(this,"getInternalPlayer",a=>this.player?this.player[a]:null),__publicField$1(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const a=this.getCurrentTime()||0,$=this.getSecondsLoaded(),j=this.getDuration();if(j){const et={playedSeconds:a,played:a/j};$!==null&&(et.loadedSeconds=$,et.loaded=$/j),(et.playedSeconds!==this.prevPlayed||et.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(et),this.prevPlayed=et.playedSeconds,this.prevLoaded=et.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),__publicField$1(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:a,playing:$,volume:j,muted:et}=this.props;a(),!et&&j!==null&&this.player.setVolume(j),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):$&&this.player.play(),this.handleDurationCheck()}),__publicField$1(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:a,onPlay:$,playbackRate:j}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&j!==1&&this.player.setPlaybackRate(j),a(),this.startOnPlay=!1),$(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),__publicField$1(this,"handlePause",a=>{this.isPlaying=!1,this.isLoading||this.props.onPause(a)}),__publicField$1(this,"handleEnded",()=>{const{activePlayer:a,loop:$,onEnded:j}=this.props;a.loopOnEnded&&$&&this.seekTo(0),$||(this.isPlaying=!1,j())}),__publicField$1(this,"handleError",(...a)=>{this.isLoading=!1,this.props.onError(...a)}),__publicField$1(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const a=this.getDuration();a?this.onDurationCalled||(this.props.onDuration(a),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),__publicField$1(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(a){if(!this.player)return;const{url:$,playing:j,volume:et,muted:tt,playbackRate:rt,pip:nt,loop:it,activePlayer:at,disableDeferredLoading:st}=this.props;if(!(0,import_react_fast_compare$1.default)(a.url,$)){if(this.isLoading&&!at.forceLoad&&!st&&!(0,import_utils$1.isMediaStream)($)){console.warn(`ReactPlayer: the attempt to load ${$} is being deferred until the player has loaded`),this.loadOnReady=$;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load($,this.isReady)}!a.playing&&j&&!this.isPlaying&&this.player.play(),a.playing&&!j&&this.isPlaying&&this.player.pause(),!a.pip&&nt&&this.player.enablePIP&&this.player.enablePIP(),a.pip&&!nt&&this.player.disablePIP&&this.player.disablePIP(),a.volume!==et&&et!==null&&this.player.setVolume(et),a.muted!==tt&&(tt?this.player.mute():(this.player.unmute(),et!==null&&setTimeout(()=>this.player.setVolume(et)))),a.playbackRate!==rt&&this.player.setPlaybackRate&&this.player.setPlaybackRate(rt),a.loop!==it&&this.player.setLoop&&this.player.setLoop(it)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(a,$,j){if(!this.isReady){a!==0&&(this.seekOnPlay=a,setTimeout(()=>{this.seekOnPlay=null},SEEK_ON_PLAY_EXPIRY));return}if($?$==="fraction":a>0&&a<1){const tt=this.player.getDuration();if(!tt){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(tt*a,j);return}this.player.seekTo(a,j)}render(){const a=this.props.activePlayer;return a?import_react$1.default.createElement(a,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}__publicField$1(Player,"displayName","Player");__publicField$1(Player,"propTypes",import_props$1.propTypes);__publicField$1(Player,"defaultProps",import_props$1.defaultProps);var __create$1=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__getProtoOf$1=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__defNormalProp=(_,a,$)=>a in _?__defProp$1(_,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):_[a]=$,__export$1=(_,a)=>{for(var $ in a)__defProp$1(_,$,{get:a[$],enumerable:!0})},__copyProps$1=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$1(a))!__hasOwnProp$1.call(_,et)&&et!==$&&__defProp$1(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$1(a,et))||j.enumerable});return _},__toESM$1=(_,a,$)=>($=_!=null?__create$1(__getProtoOf$1(_)):{},__copyProps$1(!_||!_.__esModule?__defProp$1($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$1=_=>__copyProps$1(__defProp$1({},"__esModule",{value:!0}),_),__publicField=(_,a,$)=>(__defNormalProp(_,typeof a!="symbol"?a+"":a,$),$),ReactPlayer_exports={};__export$1(ReactPlayer_exports,{createReactPlayer:()=>createReactPlayer});var ReactPlayer$1=__toCommonJS$1(ReactPlayer_exports),import_react=__toESM$1(reactExports),import_deepmerge=__toESM$1(cjs),import_memoize_one=__toESM$1(require$$2),import_react_fast_compare=__toESM$1(reactFastCompare),import_props=props,import_utils=utils$1,import_Player=__toESM$1(Player_1);const Preview=(0,import_utils.lazy)(()=>__vitePreload(()=>import("./Preview-jzdirRGw.js").then(_=>_.P),[],import.meta.url)),IS_BROWSER=typeof window<"u"&&window.document&&typeof document<"u",IS_GLOBAL=typeof commonjsGlobal<"u"&&commonjsGlobal.window&&commonjsGlobal.window.document,SUPPORTED_PROPS=Object.keys(import_props.propTypes),UniversalSuspense=IS_BROWSER||IS_GLOBAL?import_react.Suspense:()=>null,customPlayers=[],createReactPlayer=(_,a)=>{var $;return $=class extends import_react.Component{constructor(){super(...arguments),__publicField(this,"state",{showPreview:!!this.props.light}),__publicField(this,"references",{wrapper:j=>{this.wrapper=j},player:j=>{this.player=j}}),__publicField(this,"handleClickPreview",j=>{this.setState({showPreview:!1}),this.props.onClickPreview(j)}),__publicField(this,"showPreview",()=>{this.setState({showPreview:!0})}),__publicField(this,"getDuration",()=>this.player?this.player.getDuration():null),__publicField(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),__publicField(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),__publicField(this,"getInternalPlayer",(j="player")=>this.player?this.player.getInternalPlayer(j):null),__publicField(this,"seekTo",(j,et,tt)=>{if(!this.player)return null;this.player.seekTo(j,et,tt)}),__publicField(this,"handleReady",()=>{this.props.onReady(this)}),__publicField(this,"getActivePlayer",(0,import_memoize_one.default)(j=>{for(const et of[...customPlayers,..._])if(et.canPlay(j))return et;return a||null})),__publicField(this,"getConfig",(0,import_memoize_one.default)((j,et)=>{const{config:tt}=this.props;return import_deepmerge.default.all([import_props.defaultProps.config,import_props.defaultProps.config[et]||{},tt,tt[et]||{}])})),__publicField(this,"getAttributes",(0,import_memoize_one.default)(j=>(0,import_utils.omit)(this.props,SUPPORTED_PROPS))),__publicField(this,"renderActivePlayer",j=>{if(!j)return null;const et=this.getActivePlayer(j);if(!et)return null;const tt=this.getConfig(j,et.key);return import_react.default.createElement(import_Player.default,{...this.props,key:et.key,ref:this.references.player,config:tt,activePlayer:et.lazyPlayer||et,onReady:this.handleReady})})}shouldComponentUpdate(j,et){return!(0,import_react_fast_compare.default)(this.props,j)||!(0,import_react_fast_compare.default)(this.state,et)}componentDidUpdate(j){const{light:et}=this.props;!j.light&&et&&this.setState({showPreview:!0}),j.light&&!et&&this.setState({showPreview:!1})}renderPreview(j){if(!j)return null;const{light:et,playIcon:tt,previewTabIndex:rt,oEmbedUrl:nt,previewAriaLabel:it}=this.props;return import_react.default.createElement(Preview,{url:j,light:et,playIcon:tt,previewTabIndex:rt,previewAriaLabel:it,oEmbedUrl:nt,onClick:this.handleClickPreview})}render(){const{url:j,style:et,width:tt,height:rt,fallback:nt,wrapper:it}=this.props,{showPreview:at}=this.state,st=this.getAttributes(j),ot=typeof it=="string"?this.references.wrapper:void 0;return import_react.default.createElement(it,{ref:ot,style:{...et,width:tt,height:rt},...st},import_react.default.createElement(UniversalSuspense,{fallback:nt},at?this.renderPreview(j):this.renderActivePlayer(j)))}},__publicField($,"displayName","ReactPlayer"),__publicField($,"propTypes",import_props.propTypes),__publicField($,"defaultProps",import_props.defaultProps),__publicField($,"addCustomPlayer",j=>{customPlayers.push(j)}),__publicField($,"removeCustomPlayers",()=>{customPlayers.length=0}),__publicField($,"canPlay",j=>{for(const et of[...customPlayers,..._])if(et.canPlay(j))return!0;return!1}),__publicField($,"canEnablePIP",j=>{for(const et of[...customPlayers,..._])if(et.canEnablePIP&&et.canEnablePIP(j))return!0;return!1}),$};var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(_,a)=>{for(var $ in a)__defProp(_,$,{get:a[$],enumerable:!0})},__copyProps=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames(a))!__hasOwnProp.call(_,et)&&et!==$&&__defProp(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc(a,et))||j.enumerable});return _},__toESM=(_,a,$)=>($=_!=null?__create(__getProtoOf(_)):{},__copyProps(!_||!_.__esModule?__defProp($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS=_=>__copyProps(__defProp({},"__esModule",{value:!0}),_),src_exports={};__export(src_exports,{default:()=>src_default});var lib$1=__toCommonJS(src_exports),import_players=__toESM(players),import_ReactPlayer=ReactPlayer$1;const fallback=import_players.default[import_players.default.length-1];var src_default=(0,import_ReactPlayer.createReactPlayer)(import_players.default,fallback);const ReactPlayer=getDefaultExportFromCjs$1(lib$1),AttributesAccordionItem=({nft:_,style:a})=>{const $=_.metadata.attributes;return!$||$.length===0?null:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],"data-testid":"attributes-section",style:a,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"Attributes"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(Wrap,{marginLeft:"0",spacing:"10px",children:$.map(j=>jsxRuntimeExports.jsx(WrapItem,{flex:"1","data-testid":"nft-attribute",children:jsxRuntimeExports.jsx(Card,{width:"160px",height:"128px",marginBottom:"2px",background:colors.gray[700],children:jsxRuntimeExports.jsxs(CardBody,{padding:"16px",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:j.name}),jsxRuntimeExports.jsx(Heading,{size:"md",children:j.value})]})})},j.name))})})]})},TruncatedTextWithTooltip=({text:_,maxLength:a})=>_.length<=a?jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:_}):jsxRuntimeExports.jsx(Tooltip,{label:_,children:jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:truncate(_,a)})}),TzktLink=({url:_,...a})=>jsxRuntimeExports.jsx("a",{"data-testid":"tzkt-link",href:_,rel:"noopener noreferrer",target:"_blank",children:jsxRuntimeExports.jsx(WindowLinkIcon,{...a})}),CreatorElement=({nft:_})=>{if(!_.metadata.creators||_.metadata.creators.length===0)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"-"});const a=_.metadata.creators[0];return a.startsWith("tz")?jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(a)}):jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:a})},PropertiesAccordionItem=({nft:_,style:a})=>{const $=royalties(_),j=$.reduce((tt,rt)=>tt+rt.share,0).toFixed(2),et=useSelectedNetwork();return jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:a,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"Properties"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(TableContainer,{children:jsxRuntimeExports.jsx(Table,{variant:"stripped",children:jsxRuntimeExports.jsxs(Tbody,{fontSize:"14px",children:[jsxRuntimeExports.jsxs(Tr,{background:colors.gray[900],borderColor:colors.gray[700],borderBottomWidth:"1px",borderRadius:"8px",children:[jsxRuntimeExports.jsx(Td,{width:"20%",padding:"16px 0 16px 15px",paddingRight:"0",color:colors.gray[400],borderTopLeftRadius:"8px","data-testid":"nft-editions",children:"Editions:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-editions-value",children:_.totalSupply||"?"}),jsxRuntimeExports.jsx(Td,{width:"20%",padding:"16px 0 16px 15px",color:colors.gray[400],children:"Token ID:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",borderTopRightRadius:"8px",children:_.tokenId})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[800],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsxs(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-royalty",children:["Royalties",$.length>1?" ("+$.length+")":"",":"]}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-royalty-value",children:$.length>0?j+"%":"-"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-mime",children:"MIME type:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px","data-testid":"nft-mime-value",children:mimeType(_)||"-"})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[900],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"Contract:"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px",children:jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(_.contract)})}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"Metadata:"}),jsxRuntimeExports.jsxs(Td,{width:"30%",padding:"16px 0 16px 5px",children:["TzKT ",jsxRuntimeExports.jsx(TzktLink,{url:metadataUri(_,et)})]})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[800],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-creator",children:"Creator:"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-creator-value",children:jsxRuntimeExports.jsx(CreatorElement,{nft:_})}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"License:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",children:jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:_.metadata.rights||"-"})})]})]})})})})]})},TagsSection=({nft:_})=>{const a=_.metadata.tags;return!a||a.length===0?null:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"tags-section",children:a.map($=>jsxRuntimeExports.jsx(WrapItem,{padding:"3px 8px",background:colors.gray[600],borderRadius:"100px",children:jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-tag",children:$})},$))})},SendNFTRecapTile=({nft:_})=>{const a=getIPFSurl(thumbnailUri(_)),$=getIPFSurl(_.displayUri);return jsxRuntimeExports.jsx(Box,{width:"100%","aria-label":"nft",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"60px",padding:3,background:colors.gray[800],borderRadius:"4px","data-testid":"nft-name",children:[jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{fallbackSrc:$,src:a})}),_.metadata.name&&jsxRuntimeExports.jsx(Heading,{marginLeft:4,size:"sm",children:truncate(_.metadata.name,45)})]})})},SignPage$1=_=>{const{mode:a,operations:$,fee:j,data:{nft:et}}=_,{fee:tt,operations:rt,estimationFailed:nt,isLoading:it,form:at,signer:st,reEstimate:ot,onSign:ut}=useSignPageHelpers(j,$,a),{recipient:dt}=rt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...at,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:rt.type,signer:rt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:et})}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",marginY:"12px",paddingX:"4px",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Owned:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-owned",size:"sm",children:et.balance})]}),jsxRuntimeExports.jsx(SignPageFee,{fee:tt})]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"12px",marginBottom:"24px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"12px",size:"md",children:"Quantity:"}),jsxRuntimeExports.jsx(Center,{width:"100px",height:"48px",background:colors.gray[800],borderRadius:"4px",children:jsxRuntimeExports.jsxs(Text,{textAlign:"center",children:[rt.operations[0].amount," out of ",et.balance]})})]}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:rt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:dt}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:it,operationType:rt.type,reEstimate:ot,sender:rt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:nt,isLoading:it,onSubmit:ut,signer:st,text:headerText(rt.type,a)})})]})})})},FormPage$1=_=>{const{nft:a}=_,$=useOpenSignPageFormAction({SignPage:SignPage$1,signPageExtraData:{nft:a},FormPage:FormPage$1,defaultFormPageProps:_,toOperation:toOperation$1(a)}),j=useAddToBatchFormAction(toOperation$1(a)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:{quantity:1,...formDefaultValues(_)}}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=nt;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(FormPageHeader,{}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:_.nft})}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Owned:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-owned",size:"sm",children:a.balance})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.quantity,children:[jsxRuntimeExports.jsx(FormLabel,{children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"8px",size:"md",children:"Quantity:"}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(InputGroup,{width:"75px",children:jsxRuntimeExports.jsx(Input,{width:"60px",color:"white","data-testid":"quantity-input",step:1,type:"number",...st("quantity",{required:"Quantity is required",max:{value:a.balance,message:`Max quantity is ${a.balance}`},min:{value:1,message:"Min quantity is 1"}})})}),jsxRuntimeExports.jsxs(Text,{"data-testid":"out-of-nft",children:["out of ",a.balance]})]})]})}),at.quantity&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"quantity-error",children:at.quantity.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),at.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:at.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation$1=_=>a=>({type:"fa2",sender:parsePkh(a.sender),recipient:parsePkh(a.recipient),contract:parseContractPkh(_.contract),tokenId:_.tokenId,amount:a.quantity.toString()}),NFTDrawerCard=({nft:_})=>{var it;const a=getIPFSurl(artifactUri(_)),$=getIPFSurl(_.displayUri),j=useGetOwnedAccount(),{openWith:et}=reactExports.useContext(DynamicModalContext),tt=(it=mimeType(_))==null?void 0:it.startsWith("video/"),rt=tokenName(_),nt={border:"none",borderRadius:"8px",marginBottom:"20px"};return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Card,{width:"534px",height:"534px",background:colors.gray[800],children:jsxRuntimeExports.jsxs(CardBody,{padding:"24px",children:[jsxRuntimeExports.jsx(Box,{position:"relative",width:"486px",height:"486px",children:tt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{position:"absolute",zIndex:1,width:"486px",height:"486px",children:jsxRuntimeExports.jsx(ReactPlayer,{width:"100%",height:"100%",loop:!0,playing:!0,url:a})}),jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:0,top:"0",width:"486px",height:"486px",objectFit:"contain",alt:rt,filter:"blur(20px)",src:$})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:1,width:"486px",height:"486px",objectFit:"contain",alt:rt,fallbackSrc:$,src:a}),jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:0,top:"0",width:"486px",height:"486px",objectFit:"contain",alt:rt,"data-testid":"nft-image",fallbackSrc:$,filter:"blur(20px)",src:a})]})}),Number(_.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"24px",marginTop:"-38px",marginLeft:"16px",borderRadius:"100px",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",paddingX:"8px",children:"x"+_.balance})]})}),jsxRuntimeExports.jsx(TagsSection,{nft:_}),rt&&jsxRuntimeExports.jsx(Heading,{marginTop:"16px",marginBottom:"14px","data-testid":"nft-name",size:"lg",children:rt}),_.metadata.description&&jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-description",size:"sm",children:_.metadata.description}),jsxRuntimeExports.jsx(Button,{marginTop:"20px",onClick:()=>et(jsxRuntimeExports.jsx(FormPage$1,{nft:_,sender:j(_.owner)})),children:"Send"}),jsxRuntimeExports.jsxs(Accordion,{marginTop:"32px",allowMultiple:!0,children:[jsxRuntimeExports.jsx(AttributesAccordionItem,{nft:_,style:nt}),jsxRuntimeExports.jsx(PropertiesAccordionItem,{nft:_,style:nt}),jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:nt,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"JSON"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(JsValueWrap,{value:_})})]})]})]})},NFTDrawerBody=({nft:_,onCloseDrawer:a})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",paddingBottom:"22px",color:colors.gray[400],"data-testid":"nft-drawer-body",children:[jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.owner)}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:a})]}),jsxRuntimeExports.jsx(NFTDrawerCard,{nft:_})]}),AccountListWithDrawer=()=>{const[_,a]=reactExports.useState(null),{ownerPkh:$,nftId:j}=useParams(),et=useAllNfts(),tt=$&&lodashExports.get(et,[$],[]).find(dt=>fullId(dt)===j),rt=!!tt,{isOpen:nt,onOpen:it,onClose:at}=useDisclosure$1({defaultIsOpen:rt}),st=useNavigate(),ot=reactExports.useCallback(()=>{a(null),at(),st("/home")},[at,st]);reactExports.useEffect(()=>{const dt=mt=>{mt.key==="Escape"&&ot()};return document.addEventListener("keydown",dt),()=>document.removeEventListener("keydown",dt)},[ot]);const ut=reactExports.useMemo(()=>({selectedAccount:_,selectAccount:dt=>{a(dt),it()}}),[_,it]);return jsxRuntimeExports.jsxs(SelectedAccountContext.Provider,{value:ut,children:[jsxRuntimeExports.jsx(AccountsList,{}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:nt,onClose:ot,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(DrawerContent,{children:[rt&&jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(NFTDrawerBody,{nft:{...tt,owner:$},onCloseDrawer:ot})}),!rt&&_&&jsxRuntimeExports.jsxs(ModalBody,{overflow:"hidden",overflowY:"scroll",paddingRight:"0",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"flex-end",width:"100%",paddingRight:"24px",children:[jsxRuntimeExports.jsx(DerivationInfoButton,{marginRight:"5px",account:_}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:ot})]}),jsxRuntimeExports.jsx(AccountCard,{accountPkh:_.address.pkh})]})]})]})]})},HomeView=()=>jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Accounts"}),jsxRuntimeExports.jsx(Flex,{flex:1,minHeight:1,children:jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",flex:1,marginRight:"12px",paddingBottom:"12px",children:[jsxRuntimeExports.jsx(AccountListHeader,{}),jsxRuntimeExports.jsx(Box,{flex:1,overflow:"hidden",borderRadius:"8px",children:jsxRuntimeExports.jsx(AccountListWithDrawer,{})})]})})]}),SelectedNFTContext=reactExports.createContext({selectedNFT:void 0,setSelectedNFT:_=>{}}),NFTCard=({nft:_})=>{const{selectedNFT:a,setSelectedNFT:$}=reactExports.useContext(SelectedNFTContext),j=getIPFSurl(thumbnailUri(_)),et=getIPFSurl(_.displayUri),tt=_.metadata.name,rt={width:"100%",minWidth:"242px",minHeight:"242px",objectFit:"contain",aspectRatio:"1",fallbackSrc:et,src:j},nt=a&&fullId(a)===fullId(_)&&a.owner===_.owner;return jsxRuntimeExports.jsx(Card,{minWidth:"274px",borderRadius:"8px",cursor:"pointer","data-testid":`nft-card${nt?"-selected":""}`,onClick:()=>$(_),children:jsxRuntimeExports.jsxs(CardBody,{padding:"16px",background:colors.gray[900],border:"1px solid",borderColor:nt?colors.orangeL:"transparent",borderRadius:"8px",_hover:{background:colors.gray[700],borderColor:colors.gray[500]},children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsxs(Box,{position:"relative",width:"100%",children:[jsxRuntimeExports.jsx(Image$1,{...rt,zIndex:2,opacity:"0"}),jsxRuntimeExports.jsx(Image$1,{...rt,position:"absolute",zIndex:0,top:"0",filter:"blur(20px)"}),jsxRuntimeExports.jsx(Image$1,{...rt,position:"absolute",zIndex:1,top:"0","data-testid":"nft-image"})]})}),Number(_.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"24px",marginTop:"-36px",marginLeft:"10px",paddingTop:"1px",fontSize:"14px",borderRadius:"full",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",paddingX:"8px",children:"x"+_.balance}),jsxRuntimeExports.jsx(Box,{overflow:"hidden","data-testid":"nft-card-name",children:jsxRuntimeExports.jsx(Heading,{overflow:"hidden",marginTop:"15px",marginBottom:"8px",fontSize:"sm",whiteSpace:"nowrap",textOverflow:"ellipsis",children:tt})}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.owner)})]})})},NFTGallery=({nftsByOwner:_})=>{const a=Object.entries(_).flatMap(([j,et])=>(et||[]).map(tt=>({owner:j,...tt})));let $="repeat(auto-fit, minmax(min(100%/2, max(274px, 100%/7)), 1fr))";return a.length<3&&($=`repeat(auto-fit, min(100% / ${a.length} - 16px, 450px))`),jsxRuntimeExports.jsx(SimpleGrid,{gridTemplateColumns:$,marginBottom:"16px",minChildWidth:"340px",spacing:"16px",children:sortedByLastUpdate(a).map(j=>jsxRuntimeExports.jsx(NFTCard,{nft:j},`${j.owner}:${fullId(j)}`))})},AccountListDisplay=({accounts:_,onSelect:a})=>jsxRuntimeExports.jsx(MenuList,{zIndex:"docked",overflowY:"scroll",maxHeight:"300px",padding:0,background:colors.gray[900],children:_.map($=>jsxRuntimeExports.jsx(MenuItem$1,{width:"100%",minHeight:"48px",padding:"5px",background:colors.gray[700],"aria-label":$.label,onClick:()=>{a($)},value:$.address.pkh,children:jsxRuntimeExports.jsx(AddressTile,{width:"370px",height:"40px",padding:"5px",background:colors.gray[700],borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",address:$.address})},$.address.pkh))}),useAccountsFilter=()=>{const _=useAllAccounts(),[a]=reactExports.useState(_),[$,j]=useSearchParams(),et=$.getAll("accounts"),[tt,rt]=reactExports.useState(et.length===0),[nt,it]=reactExports.useState(_.filter(ot=>et.includes(ot.address.pkh))),at=lodashExports.differenceBy(_,nt,ot=>ot.address.pkh),st=nt.length===_.length;return reactExports.useEffect(()=>{j(ot=>({...ot,accounts:nt.map(ut=>ut.address.pkh)}))},[nt,j]),{selectedAccounts:tt?a:nt,accountsFilter:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(Box,{alignSelf:"flex-start",children:jsxRuntimeExports.jsxs(Menu,{children:[jsxRuntimeExports.jsx(MenuButton,{as:Button,maxHeight:"26px",paddingLeft:0,fontWeight:"normal",_hover:{bg:"none"},_active:{bg:"none"},"data-testid":"account-filter",isDisabled:st,marginY:"16px",rightIcon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),variant:"ghost",children:"Filter by Account"}),jsxRuntimeExports.jsx(AccountListDisplay,{accounts:at,onSelect:ot=>{rt(!1),it(ut=>[...ut,ot])}})]})}),jsxRuntimeExports.jsx(Wrap,{width:"100%",children:nt.map(ot=>jsxRuntimeExports.jsx(AddressPill,{address:ot.address,"data-testid":"account-pill",mode:{type:"removable",onRemove:()=>{rt(nt.length===1),it(ut=>ut.filter(dt=>dt.address.pkh!==ot.address.pkh))}}},ot.address.pkh))})]})}},NFTsView=()=>{const _=useAllNfts(),{accountsFilter:a,selectedAccounts:$}=useAccountsFilter(),[j,et]=reactExports.useState(void 0);reactExports.useEffect(()=>{const it=at=>{at.key==="Escape"&&et(void 0)};return document.addEventListener("keydown",it),()=>document.removeEventListener("keydown",it)},[]);const tt=lodashExports.pick(_,$.map(it=>it.address.pkh)),rt=lodashExports.sumBy(Object.values(tt).flat(),it=>Number((it==null?void 0:it.balance)||0)),nt=lodashExports.every(tt,it=>!it||it.length===0);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{subtitle:`(${rt})`,title:"NFTs"}),a,nt?jsxRuntimeExports.jsx(NoNFTs,{size:"lg"}):jsxRuntimeExports.jsxs(SelectedNFTContext.Provider,{value:{setSelectedNFT:et,selectedNFT:j},children:[jsxRuntimeExports.jsx(Box,{overflowY:"scroll",children:jsxRuntimeExports.jsx(NFTGallery,{nftsByOwner:tt})}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:!!j,onClose:()=>et(void 0),placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsx(ModalBody,{children:j&&jsxRuntimeExports.jsx(NFTDrawerBody,{nft:j,onCloseDrawer:()=>et(void 0)})})})]})]})]})},OperationsView=()=>{const{accountsFilter:_,selectedAccounts:a}=useAccountsFilter(),{operations:$,loadMore:j,hasMore:et,isLoading:tt,isFirstLoad:rt}=useGetOperations(a),nt=reactExports.useRef(!1),it=at=>{if(nt.current||!et||tt)return;const st=at.target;if(st.scrollHeight-st.scrollTop-st.clientHeight<100)return nt.current=!0,j().finally(()=>{nt.current=!1})};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Operations"}),_,jsxRuntimeExports.jsx(Center,{display:tt&&rt?"flex":"none",height:"100%",children:jsxRuntimeExports.jsx(Image$1,{width:"150px",height:"75px",marginBottom:"136px",src:"./static/media/loading-wheel.gif"})}),$.length===0&&!tt&&jsxRuntimeExports.jsx(NoOperations,{size:"lg"}),$.length>0&&jsxRuntimeExports.jsxs(Box,{overflowY:"scroll",marginBottom:"20px",background:colors.gray[900],borderRadius:"8px",onScroll:it,paddingX:"20px",children:[jsxRuntimeExports.jsx(OperationTileContext.Provider,{value:{mode:"page"},children:$.map((at,st)=>{const ot=st===$.length-1;return jsxRuntimeExports.jsxs(Box,{height:"90px",marginBottom:ot?"10px":0,paddingY:"20px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:at}),!ot&&jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Divider,{marginTop:"20px"})})]},at.id)})}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",display:tt&&!rt?"flex":"none",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Image$1,{width:"100px",height:"50px",src:"./static/media/loading-dots.gif"})]})]})]})},DrawerTopButtons=({onClose:_,...a})=>jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",paddingBottom:"30px",cursor:"pointer",...a,children:jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:_})}),BeaconPeers=()=>{const _=usePeers(),[a,$]=reactExports.useState([]);return reactExports.useEffect(()=>{const j=_.map(async et=>({...et,senderId:et.senderId||await getSenderId(et.publicKey)}));Promise.all(j).then($).catch(lodashExports.noop)},[_]),a.length===0?jsxRuntimeExports.jsxs(Box,{"data-testid":"beacon-peers-empty",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Text,{marginTop:"31px",color:colors.gray[400],size:"lg",children:"Your dApps will appear here"})]}):jsxRuntimeExports.jsx(PeersDisplay,{"data-testid":"beacon-peers",peerInfos:a})},PeersDisplay=({peerInfos:_})=>jsxRuntimeExports.jsx(Box,{children:_.map(a=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(PeerRow,{peerInfo:a})]},a.senderId))}),PeerRow=({peerInfo:_})=>{const a=useRemovePeer();return jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",height:"106px","data-testid":"peer-row",paddingY:"30px",children:[jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AspectRatio,{width:"48px",marginRight:"16px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{width:"100%",src:_.icon})}),jsxRuntimeExports.jsxs(Center,{alignItems:"flex-start",flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"6px",size:"md",children:_.name}),jsxRuntimeExports.jsx(StoredPeerInfo,{peerInfo:_})]})]}),jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(IconButton,{"aria-label":"Remove Peer",icon:jsxRuntimeExports.jsx(TrashIcon,{}),onClick:()=>a(_),size:"xs",variant:"circle"})})]})},StoredPeerInfo=({peerInfo:_})=>{const a=useGetConnectionInfo(_.senderId);return a?jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"10px",address:parsePkh(a.accountPkh)}),jsxRuntimeExports.jsx(Divider,{marginRight:"10px",orientation:"vertical"}),jsxRuntimeExports.jsx(Text,{marginTop:"2px",marginRight:"4px",color:colors.gray[450],fontWeight:650,size:"sm",children:"Network:"}),jsxRuntimeExports.jsx(Text,{marginTop:"2px",color:colors.white,"data-testid":"dapp-connection-network",size:"sm",children:lodashExports.capitalize(a.networkType)})]}):null},DAppsDrawerCard=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1(),j=useAddPeer();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"dApps",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"drawer-body",children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"96px",children:jsxRuntimeExports.jsx(Heading,{children:"dApps"})}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.readText().then(et=>j(et)),children:"Connect with Pairing Request"}),jsxRuntimeExports.jsx(Text,{marginTop:"16px",marginBottom:"32px",color:colors.gray[400],children:"or open a deeplink from inside the dApp..."}),jsxRuntimeExports.jsx(BeaconPeers,{})]})]})})]})]})},ErrorLogsDrawerCard=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Error Logs",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsx(ErrorLogsDrawerBody,{})]})})]})]})},ErrorLogsDrawerBody=()=>{const _=[...useAppSelector(j=>j.errors)].reverse(),a=useDispatch(),$=()=>{a(errorsSlice.actions.reset())};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",height:"50px",marginBottom:"20px",children:[jsxRuntimeExports.jsx(Heading,{size:"xl",children:"Error Logs"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx("a",{download:"UmamiErrorLogs.json",href:`data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(_))}`,children:jsxRuntimeExports.jsx(Button,{variant:"tertiary",children:"Download error logs"})}),jsxRuntimeExports.jsx(Button,{marginLeft:"8px",onClick:$,variant:"warning",children:"Clear All"})]})]}),_.map(j=>jsxRuntimeExports.jsx(ErrorLogRow,{errorLog:j},nanoid()))]})},ErrorLogRow=({errorLog:_})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{marginY:1}),jsxRuntimeExports.jsx(Flex,{justifyContent:"space-between",paddingY:"12px",children:jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(OutlineExclamationCircleIcon,{marginTop:"1px",marginRight:"8px"}),jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{wordBreak:"break-all",size:"sm",children:_.description}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:_.timestamp})]})]})})]}),removeTrailingSlashes=_=>_.replace(/\/+$/g,""),UpsertNetworkModal=({network:_})=>{const a=_?"edit":"create",{onClose:$}=reactExports.useContext(DynamicModalContext),j=useDispatch(),et=useAvailableNetworks(),{formState:{errors:tt,isValid:rt},register:nt,handleSubmit:it}=useForm({mode:"onBlur",defaultValues:_}),at=st=>{j(networksActions.upsertNetwork(st)),$()};return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:it(at),children:[jsxRuntimeExports.jsxs(ModalHeader,{textAlign:"center",children:[a==="edit"?"Edit":"Add"," Network",jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[a==="create"&&jsxRuntimeExports.jsxs(FormControl,{marginTop:"32px",marginBottom:"24px",isInvalid:!!tt.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Name"}),jsxRuntimeExports.jsx(Input,{placeholder:"mainnet",...nt("name",{required:"Name is required",validate:st=>{if(et.find(ot=>ot.name===st))return"Network with this name already exists"}})}),tt.name&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.name.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.rpcUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"RPC URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://prod.tcinfra.net/rpc/mainnet",...nt("rpcUrl",{required:"RPC URL is required",setValueAs:removeTrailingSlashes})}),tt.rpcUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.rpcUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.tzktApiUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Tzkt API URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://api.ghostnet.tzkt.io",...nt("tzktApiUrl",{required:"Tzkt API URL is required",setValueAs:removeTrailingSlashes})}),tt.tzktApiUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.tzktApiUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.tzktExplorerUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Tzkt Explorer URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://ghostnet.tzkt.io",...nt("tzktExplorerUrl",{required:"Tzkt Explorer URL is required",setValueAs:removeTrailingSlashes})}),tt.tzktExplorerUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.tzktExplorerUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Buy Tez URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://faucet.ghostnet.teztnets.com",...nt("buyTezUrl")})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!rt,onClick:()=>{},type:"submit",children:a==="edit"?"Save changes":"Add network"})})]})]})})},NetworkSettingsDrawerBody=()=>{const{openWith:_}=reactExports.useContext(DynamicModalContext),a=useSelectedNetwork(),$=useSelectNetwork(),j=useAvailableNetworks(),et=useAppDispatch(),tt=rt=>{et(networksActions.removeNetwork(rt))};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",children:[jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{children:"Network Settings"}),jsxRuntimeExports.jsxs(Button,{paddingRight:"0",onClick:()=>_(jsxRuntimeExports.jsx(UpsertNetworkModal,{})),variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{size:"sm",children:"Add Network"}),jsxRuntimeExports.jsx(PlusIcon,{width:"18px",height:"18px",marginLeft:"4px",stroke:"currentcolor"})]})]}),jsxRuntimeExports.jsx(RadioGroup,{marginTop:"60px",onChange:$,value:a.name,children:jsxRuntimeExports.jsx(Stack,{children:j.map(rt=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{borderColor:colors.gray[700]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between","data-testid":`network-${rt.name}`,children:[jsxRuntimeExports.jsx(Radio,{height:"100px",value:rt.name,variant:"primary",children:jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",marginLeft:"16px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"4px",size:"sm",children:rt.name}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],children:rt.rpcUrl})]})}),!isDefault(rt)&&jsxRuntimeExports.jsx(Center,{"data-testid":"popover-menu",children:jsxRuntimeExports.jsxs(PopoverMenu,{children:[jsxRuntimeExports.jsxs(Button,{onClick:()=>_(jsxRuntimeExports.jsx(UpsertNetworkModal,{network:rt})),variant:"popover",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Edit"}),jsxRuntimeExports.jsx(PenIcon,{stroke:"inherit"})]}),jsxRuntimeExports.jsx(Divider,{marginTop:"4px"}),jsxRuntimeExports.jsxs(Button,{onClick:()=>tt(rt),variant:"popover",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Remove"}),jsxRuntimeExports.jsx(TrashIcon,{stroke:"inherit"})]})]})})]})]},rt.name))})})]})},NetworkSettingsDrawerCard=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Network Settings",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsx(NetworkSettingsDrawerBody,{})]})})]})]})},ChangePasswordForm=()=>{const{onClose:_}=reactExports.useContext(DynamicModalContext),a=useForm({mode:"onBlur"}),$=useToast(),j=useAppDispatch(),{handleAsyncAction:et,isLoading:tt}=useAsyncActionHandler(),{handleSubmit:rt,formState:{isValid:nt,errors:it},getValues:at}=a,st=async({currentPassword:ot,newPassword:ut,newPasswordConfirmation:dt})=>{if(!(ot===ut||ut!==dt))return et(async()=>{await j(changeMnemonicPassword({currentPassword:ot,newPassword:ut})).unwrap(),$({description:"Password updated",status:"success"}),_()})};return jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[700],"data-testid":"change-password-modal",children:jsxRuntimeExports.jsxs("form",{onSubmit:rt(st),children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalHeader,{textAlign:"center",children:jsxRuntimeExports.jsx(Heading,{children:"Change Password"})}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{marginTop:"32px",isInvalid:!!it.currentPassword,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"current-password",inputName:"currentPassword",label:"Current Password",placeholder:"Enter your current password",required:"Current password is required"}),it.currentPassword&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"current-password-error",children:it.currentPassword.message})]}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!it.newPassword,marginY:6,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"new-password",inputName:"newPassword",label:"New Password",placeholder:"Enter new password",required:"New password is required",validate:ot=>at("currentPassword")!==ot||"Cannot be the same as old password"}),it.newPassword&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"new-password-error",children:it.newPassword.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:3,isInvalid:!!it.newPasswordConfirmation,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"new-password-confirmation",inputName:"newPasswordConfirmation",label:"Confirm New Password",placeholder:"Confirm new password",required:"Confirmation is required",validate:ot=>at("newPassword")===ot||"Your new passwords do no match"}),it.newPasswordConfirmation&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"new-password-confirmation-error",children:it.newPasswordConfirmation.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!nt,isLoading:tt,size:"lg",type:"submit",children:"Update Password"})})]})})})},SettingsView=()=>jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Settings"}),jsxRuntimeExports.jsxs(Box,{overflowY:"scroll",children:[jsxRuntimeExports.jsx(Box,{marginTop:"16px",children:jsxRuntimeExports.jsx(GeneralSection,{})}),jsxRuntimeExports.jsx(BackupSection,{}),jsxRuntimeExports.jsx(AdvancedSection,{})]})]}),GeneralSection=()=>jsxRuntimeExports.jsxs(SectionContainer,{title:"General",children:[jsxRuntimeExports.jsx(NetworkSettingsDrawerCard,{}),jsxRuntimeExports.jsx(ErrorLogsDrawerCard,{})]}),BackupSection=()=>jsxRuntimeExports.jsx(SectionContainer,{title:"Backup",children:jsxRuntimeExports.jsx(ClickableCard,{isSelected:!1,onClick:downloadBackupFile,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:"Download backup file"}),jsxRuntimeExports.jsx(Button,{onClick:downloadBackupFile,variant:"unstyled",children:jsxRuntimeExports.jsx(DownloadIcon,{cursor:"pointer"})})]})})}),AdvancedSection=()=>{const{modalElement:_,onOpen:a}=useOffboardingModal(),{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(SectionContainer,{title:"Advanced Settings",children:[jsxRuntimeExports.jsx(DAppsDrawerCard,{}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Off-board Wallet",isSelected:!1,onClick:a}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Change Password",isSelected:!1,onClick:()=>$(jsxRuntimeExports.jsx(ChangePasswordForm,{}))}),_]})},SectionContainer=({title:_,children:a})=>jsxRuntimeExports.jsx(Box,{marginTop:"8px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(Box,{width:"550px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"16px",size:"lg",children:_}),a]})})}),TokenTile=({token:_,amount:a,...$})=>{const{contract:j}=_,et=tokenPrettyAmount(a,_),tt=tokenSymbolSafe(_);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"start",width:"400px",padding:"15px",background:colors.gray[800],borderRadius:"4px","data-testid":"token-tile",...$,children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",marginRight:"12px",ratio:1,children:jsxRuntimeExports.jsx(TokenIcon,{padding:"6.25px",background:colors.gray[500],borderRadius:"4px",contract:j})})}),jsxRuntimeExports.jsx(PrettyNumber,{number:et}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:tt})]})},SignPage=_=>{const{mode:a,operations:$,fee:j,data:{token:et}}=_,{fee:tt,operations:rt,estimationFailed:nt,isLoading:it,form:at,signer:st,reEstimate:ot,onSign:ut}=useSignPageHelpers(j,$,a),{amount:dt,recipient:mt}=rt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...at,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:rt.type,signer:rt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(TokenTile,{amount:dt,token:et}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(SignPageFee,{fee:tt})})}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:rt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:mt}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:it,operationType:rt.type,reEstimate:ot,sender:rt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:nt,isLoading:it,onSubmit:ut,signer:st,text:headerText(rt.type,a)})})]})})})},FormPage=_=>{const{token:a}=_,$=useOpenSignPageFormAction({SignPage,signPageExtraData:{token:a},FormPage,defaultFormPageProps:_,toOperation:toOperation(a)}),j=useAddToBatchFormAction(toOperation(a)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(_)}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=nt,ut=tokenDecimals(a),dt=formatTokenAmount(a.balance,ut),mt=getSmallestUnit(Number(ut));return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(FormPageHeader,{}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!at.prettyAmount,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Amount"}),jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{isDisabled:rt,step:mt,type:"number",...st("prettyAmount",{required:"Amount is required",max:{value:dt.toString(),message:`Max amount is ${dt}`},validate:makeValidateDecimals(Number(ut))}),placeholder:mt}),jsxRuntimeExports.jsx(InputRightElement,{paddingRight:"12px","data-testid":"token-symbol",children:tokenSymbolSafe(a)})]}),at.prettyAmount&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"amount-error",children:at.prettyAmount.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),at.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:at.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation=_=>a=>{const $={type:"fa2",sender:parsePkh(a.sender),recipient:parsePkh(a.recipient),contract:parseContractPkh(_.contract),tokenId:_.tokenId,amount:getRealAmount(_,a.prettyAmount)};return _.type==="fa2"?$:{...$,type:"fa1.2",tokenId:"0"}},Header=({account:_})=>{const{address:a,label:$}=_;return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"78px",background:accountIconGradient({left:"-10px",top:"-10px",account:_,radius:"100px",mainBackgroundColor:colors.gray[800]}),borderTopRadius:"8px","data-testid":"header",paddingX:"30px",children:[jsxRuntimeExports.jsx(AccountTileIcon,{account:_,size:"lg"}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsxs(Box,{marginLeft:"16px","data-testid":"account-identifier",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"4px",size:"md",children:$}),jsxRuntimeExports.jsx(Text,{color:colors.gray[300],size:"sm",children:formatPkh(a.pkh)})]}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column-reverse",children:jsxRuntimeExports.jsx(AccountBalance,{verticalAlign:"bottom",address:_.address.pkh})})]})]})},AccountTokens=({account:_,tokens:a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(Card,{overflowX:"auto",marginBottom:"16px",borderBottomRadius:"8px",backgroundColor:colors.gray[900],children:[jsxRuntimeExports.jsx(Header,{account:_}),jsxRuntimeExports.jsx(TableContainer,{paddingX:"30px",children:jsxRuntimeExports.jsx(Table,{children:jsxRuntimeExports.jsx(Tbody,{children:a.map((j,et)=>{const tt=et===a.length-1?"transparent":colors.gray[700];return jsxRuntimeExports.jsxs(Tr,{"data-testid":"token-tile",children:[jsxRuntimeExports.jsx(Td,{width:"20%",minWidth:"240px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(TokenIcon,{display:"inline-block",width:"38px",contract:j.contract}),jsxRuntimeExports.jsx(Heading,{display:"inline-block",marginLeft:"16px",size:"sm",children:jsxRuntimeExports.jsx(TokenNameWithIcon,{token:j})})]})}),jsxRuntimeExports.jsx(Td,{width:"20%",minWidth:"200px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(AddressPill,{address:parseContractPkh(j.contract)})}),jsxRuntimeExports.jsx(Td,{width:"15%",minWidth:"160px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(Heading,{size:"sm",children:tokenPrettyAmount(j.balance,j,{showSymbol:!1})})}),jsxRuntimeExports.jsx(Td,{textAlign:"right",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(SendButton,{onClick:()=>$(jsxRuntimeExports.jsx(FormPage,{sender:_,token:j}))})})]},fullId(j))})})})})]})},TokensPage=()=>{const{accountsFilter:_,selectedAccounts:a}=useAccountsFilter(),$=useGetAccountAllTokens(),j=a.map(et=>[et,$(et.address.pkh)]).filter(([,et])=>et.length>0);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Tokens"}),_,j.length===0?jsxRuntimeExports.jsx(NoTokens,{size:"lg"}):jsxRuntimeExports.jsx(Box,{overflowY:"auto",children:j.map(([et,tt])=>jsxRuntimeExports.jsx(AccountTokens,{account:et,tokens:tt},et.address.pkh))})]})},AppVersion=({isCollapsed:_,...a})=>{const $=_?packageInfo.version:`Umami v${packageInfo.version}`;return jsxRuntimeExports.jsx(Text,{color:colors.gray[450],...a,children:$})},CollapseMenuButton=({toggle:_,...a})=>jsxRuntimeExports.jsx(Center,{width:"44px",height:"44px",marginRight:"-14px",borderRadius:"4px",_hover:{background:colors.gray[800]},cursor:"pointer","data-testid":"collapse-menu-button",onClick:_,...a,children:jsxRuntimeExports.jsx(BurgerMenuIcon,{})}),useCollapseMenu=()=>{const[_,a]=reactExports.useState(!1),$=reactExports.useCallback(()=>{a(j=>!j)},[]);return{isCollapsed:_,toggle:$}},ORANGE="#F74F18",MakiLogo=_=>{const a=useSelectedNetwork();return jsxRuntimeExports.jsx(MakiIcon,{background:"white",borderRadius:"8px","data-testid":"maki-logo",fishColor:a.name==="mainnet"?ORANGE:"black",..._})},NetworkSelector=()=>{const _=useSelectedNetwork(),a=useAvailableNetworks(),$=useSelectNetwork(),{onOpen:j,onClose:et,isOpen:tt}=useDisclosure$1();return jsxRuntimeExports.jsxs(Popover,{isOpen:tt,onClose:et,onOpen:j,placement:"bottom-end",children:[jsxRuntimeExports.jsx(PopoverTrigger,{children:jsxRuntimeExports.jsxs(Button,{marginTop:"4px",color:colors.green,"data-testid":"network-selector",variant:"unstyled",children:[lodashExports.capitalize(_.name),tt?jsxRuntimeExports.jsx(ChevronUpIcon,{marginTop:"-2px",stroke:"currentcolor"}):jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginTop:"-2px",stroke:"currentcolor"})]})}),jsxRuntimeExports.jsx(PopoverContent,{width:"100px",marginTop:"-10px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],children:jsxRuntimeExports.jsx(PopoverBody,{padding:"4px 12px",children:jsxRuntimeExports.jsx(Flex,{flexDirection:"column",children:a.map((rt,nt)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{height:"34px",color:rt.name===_.name?colors.green:colors.gray[300],fontSize:"14px",fontWeight:400,textAlign:"right",_hover:{color:colors.greenL},onClick:()=>{$(rt.name),et()},variant:"unstyled",children:lodashExports.capitalize(rt.name)}),nt{const[_,a]=reactExports.useState(!1),$=window;reactExports.useEffect(()=>{$&&$.electronAPI&&$.electronAPI.onAppUpdateDownloaded(et=>a(!0))},[$]);const j=()=>{$&&$.electronAPI&&$.electronAPI.installAppUpdateAndQuit()};return _?jsxRuntimeExports.jsx(Box,{marginTop:"24px",marginBottom:"6px",children:jsxRuntimeExports.jsxs(Button,{justifyContent:"flex-start",width:"100%",height:"32px",paddingTop:"7px",paddingRight:"8px",paddingBottom:"7px",paddingLeft:"8px",color:colors.black,background:colors.green,_hover:{color:colors.black,background:colors.greenL},onClick:j,children:[jsxRuntimeExports.jsx(FlipForwardEnergy,{}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:"Update Umami"})]})}):null},SideNavbar=()=>{const{isCollapsed:_,toggle:a}=useCollapseMenu(),$=jsxRuntimeExports.jsx(CollapseMenuButton,{marginTop:_?0:"2px",marginRight:_?0:"-14px",toggle:a});return jsxRuntimeExports.jsxs(Flex,{alignItems:_?"center":"normal",flexDirection:"column",width:_?"80px":"236px",padding:_?"30px 20px":"30px",background:colors.gray[900],"data-testid":`side-navbar${_?"-collapsed":""}`,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"30px",children:_?$:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(MakiLogo,{width:"38px",height:"38px"}),jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(NetworkSelector,{}),$]})]})}),jsxRuntimeExports.jsx(Divider,{marginTop:"28px"})]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",flexDirection:"column",flex:1,children:[jsxRuntimeExports.jsxs(Box,{alignItems:_?"center":"normal",justifyContent:_?"space-around":"normal",display:_?"flex":"block",height:"100%",children:[!_&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(UpdateAppButton,{}),jsxRuntimeExports.jsx(TotalBalance,{})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(AccountsIcon,{}),isCollapsed:_,label:"Accounts",to:"/home"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(DiamondIcon,{}),isCollapsed:_,label:"NFTs",to:"/nfts"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(RefreshClockIcon,{width:"24px",height:"24px"}),isCollapsed:_,label:"Operations",to:"/operations"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(CoinIcon,{}),isCollapsed:_,label:"Tokens",to:"/tokens"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(BatchIcon,{}),isCollapsed:_,label:"Batch",to:"/batch"})]})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(MenuItem,{marginTop:"22px",icon:jsxRuntimeExports.jsx(AddressBookIcon,{}),isCollapsed:_,label:"Address Book",to:"/address-book"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(GearIcon,{}),isCollapsed:_,label:"Settings",to:"/settings"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(HelpIcon,{}),isCollapsed:_,label:"Help",to:"/help"}),jsxRuntimeExports.jsx(AppVersion,{marginTop:"24px",fontSize:"14px",textAlign:_?"center":"left",isCollapsed:_})]})]})]})},MenuItem=({icon:_,label:a,to:$,isCollapsed:j,...et})=>{const rt=useLocation().pathname.startsWith($);return jsxRuntimeExports.jsx(Link,{to:$,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"flex-start",width:j?"44px":"176px",marginBottom:"8px",padding:"10px",background:rt?colors.gray[600]:"transparent",borderRadius:"4px",_hover:{background:rt?colors.gray[600]:colors.gray[800]},cursor:"pointer",...et,children:[_,!j&&jsxRuntimeExports.jsx(Text,{marginLeft:"10px",size:"sm",children:a})]})})},TotalBalance=()=>{const _=useTotalBalance(),[a]=useMediaQuery("(max-height: 900px)");return jsxRuntimeExports.jsxs(Box,{marginTop:"24px",marginBottom:a?"30px":"100px","data-testid":"total-balance",children:[jsxRuntimeExports.jsx(Text,{marginBottom:"4px",size:"sm",children:"Balance"}),_&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:_.mutez,dollarBalance:_.usd})]})},withSideMenu=_=>jsxRuntimeExports.jsxs(Flex,{height:"100vh",children:[jsxRuntimeExports.jsx(SideNavbar,{}),jsxRuntimeExports.jsx(Box,{flex:1,overflowX:"hidden",height:"100%",background:"linear-gradient(180deg, rgba(0, 231, 182, 0.35) -41.53%, rgba(0, 231, 182, 0.00) 34.71%)",paddingX:"24px",children:_})]}),AccountsImage=""+new URL("accounts-DTYOez9Q.png",import.meta.url).href,BatchImage=""+new URL("batch-CoYFN9ox.png",import.meta.url).href,MultisigImage=""+new URL("multisig-GRRIvmJS.png",import.meta.url).href;var js={},Carousel$1={},lib={},reactSwipe={},hasRequiredReactSwipe;function requireReactSwipe(){return hasRequiredReactSwipe||(hasRequiredReactSwipe=1,function(_){(function(a,$){$(_,reactExports,propTypesExports)})(commonjsGlobal,function(a,$,j){Object.defineProperty(a,"__esModule",{value:!0}),a.setHasSupportToCaptureOption=mt;var et=rt($),tt=rt(j);function rt(Tt){return Tt&&Tt.__esModule?Tt:{default:Tt}}var nt=Object.assign||function(Tt){for(var kt=1;kt=0||Object.prototype.hasOwnProperty.call(Tt,Nt)&&(Lt[Nt]=Tt[Nt]);return Lt}function at(Tt,kt){if(!(Tt instanceof kt))throw new TypeError("Cannot call a class as a function")}var st=function(){function Tt(kt,Lt){for(var Nt=0;Nt0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return dt?Tt:Tt.capture}function Ct(Tt){if("touches"in Tt){var kt=Tt.touches[0],Lt=kt.pageX,Nt=kt.pageY;return{x:Lt,y:Nt}}var zt=Tt.screenX,jt=Tt.screenY;return{x:zt,y:jt}}var Pt=function(Tt){ut(kt,Tt);function kt(){var Lt;at(this,kt);for(var Nt=arguments.length,zt=Array(Nt),jt=0;jtzt&&this.props.onSwipeRight(1,Nt),this.movePosition.deltaY<-zt?this.props.onSwipeUp(1,Nt):this.movePosition.deltaY>zt&&this.props.onSwipeDown(1,Nt)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(Nt){this.swiper=Nt,this.props.innerRef(Nt)}},{key:"render",value:function(){var Nt=this.props;Nt.tagName;var zt=Nt.className,jt=Nt.style,Mt=Nt.children;Nt.allowMouseEvents,Nt.onSwipeUp,Nt.onSwipeDown,Nt.onSwipeLeft,Nt.onSwipeRight,Nt.onSwipeStart,Nt.onSwipeMove,Nt.onSwipeEnd,Nt.innerRef,Nt.tolerance;var Dt=it(Nt,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return et.default.createElement(this.props.tagName,nt({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:zt,style:jt},Dt),Mt)}}]),kt}($.Component);Pt.displayName="ReactSwipe",Pt.propTypes={tagName:tt.default.string,className:tt.default.string,style:tt.default.object,children:tt.default.node,allowMouseEvents:tt.default.bool,onSwipeUp:tt.default.func,onSwipeDown:tt.default.func,onSwipeLeft:tt.default.func,onSwipeRight:tt.default.func,onSwipeStart:tt.default.func,onSwipeMove:tt.default.func,onSwipeEnd:tt.default.func,innerRef:tt.default.func,tolerance:tt.default.number.isRequired},Pt.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},a.default=Pt})}(reactSwipe)),reactSwipe}(function(_){(function(a,$){$(_,requireReactSwipe())})(commonjsGlobal,function(a,$){Object.defineProperty(a,"__esModule",{value:!0});var j=et($);function et(tt){return tt&&tt.__esModule?tt:{default:tt}}a.default=j.default})})(lib);var cssClasses={},classnames={exports:{}};/*! +`}return fr.substring(0,fr.length-1)},ht.renderTo2dContext=function(Kt,Jt){Jt=Jt||2;for(var Ht=ht.getModuleCount(),Vt=0;Vt>>8),Ft.push(bt&255)):Ft.push(Mt)}}return Ft}};var et={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},tt={L:1,M:0,Q:3,H:2},rt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},nt=function(){var Nt=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],zt=1335,jt=7973,Mt=21522,Dt={},Ft=function(Bt){for(var yt=0;Bt!=0;)yt+=1,Bt>>>=1;return yt};return Dt.getBCHTypeInfo=function(Bt){for(var yt=Bt<<10;Ft(yt)-Ft(zt)>=0;)yt^=zt<=0;)yt^=jt<5&&(bt+=3+vt-5)}for(var ct=0;ct=256;)Dt-=255;return Nt[Dt]},Mt}();function at(Nt,zt){if(typeof Nt.length>"u")throw Nt.length+"/"+zt;var jt=function(){for(var Dt=0;Dt"u")throw"bad rs block @ typeNumber:"+Dt+"/errorCorrectionLevel:"+Ft;for(var yt=Bt.length/3,bt=[],ct=0;ct>>7-Mt%8&1)==1},jt.put=function(Mt,Dt){for(var Ft=0;Ft>>Dt-Ft-1&1)==1)},jt.getLengthInBits=function(){return zt},jt.putBit=function(Mt){var Dt=Math.floor(zt/8);Nt.length<=Dt&&Nt.push(0),Mt&&(Nt[Dt]|=128>>>zt%8),zt+=1},jt},ut=function(Nt){var zt=et.MODE_NUMBER,jt=Nt,Mt={};Mt.getMode=function(){return zt},Mt.getLength=function(Bt){return jt.length},Mt.write=function(Bt){for(var yt=jt,bt=0;bt+2>>8&255)*192+(bt&255),Ft.put(bt,13),yt+=2}if(yt>>8)},zt.writeBytes=function(jt,Mt,Dt){Mt=Mt||0,Dt=Dt||jt.length;for(var Ft=0;Ft0&&(jt+=","),jt+=Nt[Mt];return jt+="]",jt},zt},Pt=function(){var Nt=0,zt=0,jt=0,Mt="",Dt={},Ft=function(yt){Mt+=String.fromCharCode(Bt(yt&63))},Bt=function(yt){if(!(yt<0)){if(yt<26)return 65+yt;if(yt<52)return 97+(yt-26);if(yt<62)return 48+(yt-52);if(yt==62)return 43;if(yt==63)return 47}throw"n:"+yt};return Dt.writeByte=function(yt){for(Nt=Nt<<8|yt&255,zt+=8,jt+=1;zt>=6;)Ft(Nt>>>zt-6),zt-=6},Dt.flush=function(){if(zt>0&&(Ft(Nt<<6-zt),Nt=0,zt=0),jt%3!=0)for(var yt=3-jt%3,bt=0;bt=zt.length){if(Dt==0)return-1;throw"unexpected end of file./"+Dt}var yt=zt.charAt(jt);if(jt+=1,yt=="=")return Dt=0,-1;if(yt.match(/^\s$/))continue;Mt=Mt<<6|Bt(yt.charCodeAt(0)),Dt+=6}var bt=Mt>>>Dt-8&255;return Dt-=8,bt};var Bt=function(yt){if(65<=yt&&yt<=90)return yt-65;if(97<=yt&&yt<=122)return yt-97+26;if(48<=yt&&yt<=57)return yt-48+52;if(yt==43)return 62;if(yt==47)return 63;throw"c:"+yt};return Ft},kt=function(Nt,zt){var jt=Nt,Mt=zt,Dt=new Array(Nt*zt),Ft={};Ft.setPixel=function(ct,ht,vt){Dt[ht*jt+ct]=vt},Ft.write=function(ct){ct.writeString("GIF87a"),ct.writeShort(jt),ct.writeShort(Mt),ct.writeByte(128),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(0),ct.writeByte(255),ct.writeByte(255),ct.writeByte(255),ct.writeString(","),ct.writeShort(0),ct.writeShort(0),ct.writeShort(jt),ct.writeShort(Mt),ct.writeByte(0);var ht=2,vt=yt(ht);ct.writeByte(ht);for(var St=0;vt.length-St>255;)ct.writeByte(255),ct.writeBytes(vt,St,255),St+=255;ct.writeByte(vt.length-St),ct.writeBytes(vt,St,vt.length-St),ct.writeByte(0),ct.writeString(";")};var Bt=function(ct){var ht=ct,vt=0,St=0,Rt={};return Rt.write=function($t,Et){if($t>>>Et)throw"length over";for(;vt+Et>=8;)ht.writeByte(255&($t<>>=8-vt,St=0,vt=0;St=$t<0&&ht.writeByte(St)},Rt},yt=function(ct){for(var ht=1<>6,128|it&63):it<55296||it>=57344?rt.push(224|it>>12,128|it>>6&63,128|it&63):(nt++,it=65536+((it&1023)<<10|tt.charCodeAt(nt)&1023),rt.push(240|it>>18,128|it>>12&63,128|it>>6&63,128|it&63))}return rt}return et(j)}})(),function(j){_.exports=j()}(function(){return $})})(qrcode);var qrcodeExports=qrcode.exports,__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var _=function(a,$){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,et){j.__proto__=et}||function(j,et){for(var tt in et)et.hasOwnProperty(tt)&&(j[tt]=et[tt])},_(a,$)};return function(a,$){_(a,$);function j(){this.constructor=a}a.prototype=$===null?Object.create($):(j.prototype=$.prototype,new j)}}();Object.defineProperty(dist,"__esModule",{value:!0});var QRCode_1=dist.QRCode=void 0,isEqual$1=lodash_isequalExports,qrGenerator=qrcodeExports,React=reactExports,ReactDOM=reactDomExports,QRCode=function(_){__extends(a,_);function a($){var j=_.call(this,$)||this;return j.canvas=React.createRef(),j}return a.utf16to8=function($){var j="",et,tt,rt=$.length;for(et=0;et=1&&tt<=127?j+=$.charAt(et):tt>2047?(j+=String.fromCharCode(224|tt>>12&15),j+=String.fromCharCode(128|tt>>6&63),j+=String.fromCharCode(128|tt>>0&63)):(j+=String.fromCharCode(192|tt>>6&31),j+=String.fromCharCode(128|tt>>0&63));return j},a.prototype.drawRoundedSquare=function($,j,et,tt,rt,nt,it,at){at.lineWidth=$,at.fillStyle=rt,at.strokeStyle=rt,et+=$/2,j+=$/2,tt-=$,Array.isArray(nt)||(nt=[nt,nt,nt,nt]),nt=nt.map(function(mt){return mt=Math.min(mt,tt/2),mt<0?0:mt});var st=nt[0]||0,ot=nt[1]||0,ut=nt[2]||0,dt=nt[3]||0;at.beginPath(),at.moveTo(j+st,et),at.lineTo(j+tt-ot,et),ot&&at.quadraticCurveTo(j+tt,et,j+tt,et+ot),at.lineTo(j+tt,et+tt-ut),ut&&at.quadraticCurveTo(j+tt,et+tt,j+tt-ut,et+tt),at.lineTo(j+dt,et+tt),dt&&at.quadraticCurveTo(j,et+tt,j,et+tt-dt),at.lineTo(j,et+st),st&&at.quadraticCurveTo(j,et,j+st,et),at.closePath(),at.stroke(),it&&at.fill()},a.prototype.drawPositioningPattern=function($,j,et,tt,rt,nt,it){it===void 0&&(it=[0,0,0,0]);var at=Math.ceil(j),st,ot;typeof it!="number"&&!Array.isArray(it)?(st=it.outer||0,ot=it.inner||0):(st=it,ot=st);var ut,dt;typeof nt!="string"?(ut=nt.outer,dt=nt.inner):(ut=nt,dt=nt);var mt=tt*j+et,xt=rt*j+et,Ct=j*7;this.drawRoundedSquare(at,xt,mt,Ct,ut,st,!1,$),Ct=j*3,mt+=j*2,xt+=j*2,this.drawRoundedSquare(at,xt,mt,Ct,dt,ot,!0,$)},a.prototype.isInPositioninZone=function($,j,et){return et.some(function(tt){return j>=tt.row&&j<=tt.row+7&&$>=tt.col&&$<=tt.col+7})},a.prototype.transformPixelLengthIntoNumberOfCells=function($,j){return $/j},a.prototype.isCoordinateInImage=function($,j,et,tt,rt,nt,it,at){if(at){var st=2,ot=this.transformPixelLengthIntoNumberOfCells(rt,it),ut=this.transformPixelLengthIntoNumberOfCells(nt,it),dt=this.transformPixelLengthIntoNumberOfCells(et,it)-1,mt=this.transformPixelLengthIntoNumberOfCells(tt,it)-1;return j>=ot-st&&j<=ot+dt+st&&$>=ut-st&&$<=ut+mt+st}else return!1},a.prototype.shouldComponentUpdate=function($){return!isEqual$1(this.props,$)},a.prototype.componentDidMount=function(){this.update()},a.prototype.componentDidUpdate=function(){this.update()},a.prototype.update=function(){var $=this.props,j=$.value,et=$.ecLevel,tt=$.enableCORS,rt=$.bgColor,nt=$.fgColor,it=$.logoImage,at=$.logoOpacity,st=$.logoOnLoad,ot=$.removeQrCodeBehindLogo,ut=$.qrStyle,dt=$.eyeRadius,mt=$.eyeColor,xt=$.logoPaddingStyle,Ct=+this.props.size,Pt=+this.props.quietZone,Tt=this.props.logoWidth?+this.props.logoWidth:0,kt=this.props.logoHeight?+this.props.logoHeight:0,Lt=this.props.logoPadding?+this.props.logoPadding:0,Nt=qrGenerator(0,et);Nt.addData(a.utf16to8(j)),Nt.make();var zt=ReactDOM.findDOMNode(this.canvas.current),jt=zt.getContext("2d"),Mt=Ct+2*Pt,Dt=Nt.getModuleCount(),Ft=Ct/Dt,Bt=window.devicePixelRatio||1;zt.height=zt.width=Mt*Bt,jt.scale(Bt,Bt),jt.fillStyle=rt,jt.fillRect(0,0,Mt,Mt);var yt=Pt,bt=[{row:0,col:0},{row:0,col:Dt-7},{row:Dt-7,col:0}];if(jt.strokeStyle=nt,ut==="dots"){jt.fillStyle=nt;for(var ct=Ft/2,ht=0;ht0&&!Nt.isDark(ht-1,vt)&&vt>0&&!Nt.isDark(ht,vt-1)&&(St[0]=!0),ht>0&&!Nt.isDark(ht-1,vt)&&vt0&&!Nt.isDark(ht,vt-1)&&(St[3]=!0);var Rt=Math.ceil((vt+1)*Ft)-Math.floor(vt*Ft),$t=Math.ceil((ht+1)*Ft)-Math.floor(ht*Ft);jt.fillStyle=nt,jt.beginPath(),jt.arc(Math.round(vt*Ft)+ct+yt,Math.round(ht*Ft)+ct+yt,ct,0,2*Math.PI,!1),jt.closePath(),jt.fill(),St[0]||jt.fillRect(Math.round(vt*Ft)+yt,Math.round(ht*Ft)+yt,Rt/2,$t/2),St[1]||jt.fillRect(Math.round(vt*Ft)+yt+Math.floor(Rt/2),Math.round(ht*Ft)+yt,Rt/2,$t/2),St[2]||jt.fillRect(Math.round(vt*Ft)+yt+Math.floor(Rt/2),Math.round(ht*Ft)+yt+Math.floor($t/2),Rt/2,$t/2),St[3]||jt.fillRect(Math.round(vt*Ft)+yt,Math.round(ht*Ft)+yt+Math.floor($t/2),Rt/2,$t/2)}}else for(var ht=0;ht{const $=useGetOwnedAccountSafe()(_);return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(FormPageHeader,{subTitle:"You can receive tez or other digital assets by scanning or sharing this QR code",title:"Receive"}),jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",flexDirection:"column",children:jsxRuntimeExports.jsx(Box,{padding:"8px",background:"white",borderRadius:"8px",children:jsxRuntimeExports.jsx(QRCode_1,{size:232,value:_})})})}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsxs(Box,{width:"100%",children:[$&&jsxRuntimeExports.jsx(Heading,{textAlign:"center",marginY:2,children:$.label}),jsxRuntimeExports.jsx(Flex,{justifyContent:"center",width:"100%",children:jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_),mode:{type:"no_icons"}})})]})})]})},AccountCard=({accountPkh:_})=>{const a=useGetOwnedAccount(),$=useGetAccountBalance(),j=useGetDollarBalance(),et=useGetAccountAllTokens(),tt=useGetAccountNFTs(),{openWith:rt}=reactExports.useContext(DynamicModalContext),nt=a(_),it=$(_),at=j(_),st=et(_),ot=sortedByLastUpdate(tt(_));return jsxRuntimeExports.jsx(AccountDrawerDisplay,{account:nt,balance:it,dollarBalance:at,nfts:ot,onReceive:()=>rt(jsxRuntimeExports.jsx(ReceiveModal,{pkh:_})),onSend:()=>rt(jsxRuntimeExports.jsx(FormPage$4,{sender:nt})),tokens:st})},InfoModal=({account:_})=>{const a=[{title:"Template",content:_.derivationPathTemplate},{title:"Path",content:_.derivationPath},{title:"Type (Curve)",content:_.curve}];return jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalHeader,{children:[jsxRuntimeExports.jsx(CircleIcon,{icon:jsxRuntimeExports.jsx(SlashIcon,{}),size:"48px"}),jsxRuntimeExports.jsx(Center,{marginBottom:"8px",children:jsxRuntimeExports.jsx(Heading,{marginTop:"16px",children:"Derivation Info"})}),jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsx(ModalBody,{children:a.map(({title:$,content:j})=>j?jsxRuntimeExports.jsxs(Box,{marginTop:"24px",children:[jsxRuntimeExports.jsx(Heading,{size:"md",children:$}),jsxRuntimeExports.jsx(Center,{justifyContent:"flex-start",marginTop:"12px",padding:"15px",borderRadius:"4px",backgroundColor:colors.gray[800],children:jsxRuntimeExports.jsx(Text,{size:"sm",children:j})})]},j):null)})]})},DerivationInfoButton=({account:_,...a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);switch(_.type){case"multisig":case"secret_key":case"social":return null;case"ledger":case"mnemonic":return jsxRuntimeExports.jsx(Button,{"data-testid":"derivation-info-button",onClick:()=>$(jsxRuntimeExports.jsx(InfoModal,{account:_})),variant:"CTAWithIcon",...a,children:jsxRuntimeExports.jsx(FolderInfoIcon,{stroke:"currentcolor"})})}},CloseDrawerButton=({onClose:_})=>jsxRuntimeExports.jsx(Button,{minWidth:"24px",padding:"0",onClick:_,variant:"CTAWithIcon",children:jsxRuntimeExports.jsx(ExitArrowIcon,{stroke:"currentcolor"})}),scriptRel="modulepreload",assetsURL=function(_,a){return new URL(_,a).href},seen={},__vitePreload=function _(a,$,j){let et=Promise.resolve();if($&&$.length>0){const tt=document.getElementsByTagName("link"),rt=document.querySelector("meta[property=csp-nonce]"),nt=(rt==null?void 0:rt.nonce)||(rt==null?void 0:rt.getAttribute("nonce"));et=Promise.all($.map(it=>{if(it=assetsURL(it,j),it in seen)return;seen[it]=!0;const at=it.endsWith(".css"),st=at?'[rel="stylesheet"]':"";if(!!j)for(let dt=tt.length-1;dt>=0;dt--){const mt=tt[dt];if(mt.href===it&&(!at||mt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${it}"]${st}`))return;const ut=document.createElement("link");if(ut.rel=at?"stylesheet":scriptRel,at||(ut.as="script",ut.crossOrigin=""),ut.href=it,nt&&ut.setAttribute("nonce",nt),document.head.appendChild(ut),at)return new Promise((dt,mt)=>{ut.addEventListener("load",dt),ut.addEventListener("error",()=>mt(new Error(`Unable to preload CSS for ${it}`)))})}))}return et.then(()=>a()).catch(tt=>{const rt=new Event("vite:preloadError",{cancelable:!0});if(rt.payload=tt,window.dispatchEvent(rt),!rt.defaultPrevented)throw tt})};var loadScript=function _(a,$,j){var et=document.head||document.getElementsByTagName("head")[0],tt=document.createElement("script");typeof $=="function"&&(j=$,$={}),$=$||{},j=j||function(){},tt.type=$.type||"text/javascript",tt.charset=$.charset||"utf8",tt.async="async"in $?!!$.async:!0,tt.src=a,$.attrs&&setAttributes(tt,$.attrs),$.text&&(tt.text=""+$.text);var rt="onload"in tt?stdOnEnd:ieOnEnd;rt(tt,j),tt.onload||stdOnEnd(tt,j),et.appendChild(tt)};function setAttributes(_,a){for(var $ in a)_.setAttribute($,a[$])}function stdOnEnd(_,a){_.onload=function(){this.onerror=this.onload=null,a(null,_)},_.onerror=function(){this.onerror=this.onload=null,a(new Error("Failed to load "+this.src),_)}}function ieOnEnd(_,a){_.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,a(null,_))}}var isMergeableObject=function _(a){return isNonNullObject(a)&&!isSpecial(a)};function isNonNullObject(_){return!!_&&typeof _=="object"}function isSpecial(_){var a=Object.prototype.toString.call(_);return a==="[object RegExp]"||a==="[object Date]"||isReactElement(_)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(_){return _.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(_){return Array.isArray(_)?[]:{}}function cloneUnlessOtherwiseSpecified(_,a){return a.clone!==!1&&a.isMergeableObject(_)?deepmerge(emptyTarget(_),_,a):_}function defaultArrayMerge(_,a,$){return _.concat(a).map(function(j){return cloneUnlessOtherwiseSpecified(j,$)})}function getMergeFunction(_,a){if(!a.customMerge)return deepmerge;var $=a.customMerge(_);return typeof $=="function"?$:deepmerge}function getEnumerableOwnPropertySymbols(_){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(_).filter(function(a){return Object.propertyIsEnumerable.call(_,a)}):[]}function getKeys(_){return Object.keys(_).concat(getEnumerableOwnPropertySymbols(_))}function propertyIsOnObject(_,a){try{return a in _}catch{return!1}}function propertyIsUnsafe(_,a){return propertyIsOnObject(_,a)&&!(Object.hasOwnProperty.call(_,a)&&Object.propertyIsEnumerable.call(_,a))}function mergeObject(_,a,$){var j={};return $.isMergeableObject(_)&&getKeys(_).forEach(function(et){j[et]=cloneUnlessOtherwiseSpecified(_[et],$)}),getKeys(a).forEach(function(et){propertyIsUnsafe(_,et)||(propertyIsOnObject(_,et)&&$.isMergeableObject(a[et])?j[et]=getMergeFunction(et,$)(_[et],a[et],$):j[et]=cloneUnlessOtherwiseSpecified(a[et],$))}),j}function deepmerge(_,a,$){$=$||{},$.arrayMerge=$.arrayMerge||defaultArrayMerge,$.isMergeableObject=$.isMergeableObject||isMergeableObject,$.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var j=Array.isArray(a),et=Array.isArray(_),tt=j===et;return tt?j?$.arrayMerge(_,a,$):mergeObject(_,a,$):cloneUnlessOtherwiseSpecified(a,$)}deepmerge.all=function _(a,$){if(!Array.isArray(a))throw new Error("first argument should be an array");return a.reduce(function(j,et){return deepmerge(j,et,$)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1,__create$4=Object.create,__defProp$6=Object.defineProperty,__getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__getOwnPropNames$6=Object.getOwnPropertyNames,__getProtoOf$4=Object.getPrototypeOf,__hasOwnProp$6=Object.prototype.hasOwnProperty,__export$6=(_,a)=>{for(var $ in a)__defProp$6(_,$,{get:a[$],enumerable:!0})},__copyProps$6=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$6(a))!__hasOwnProp$6.call(_,et)&&et!==$&&__defProp$6(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$6(a,et))||j.enumerable});return _},__toESM$4=(_,a,$)=>($=_!=null?__create$4(__getProtoOf$4(_)):{},__copyProps$6(!_||!_.__esModule?__defProp$6($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$6=_=>__copyProps$6(__defProp$6({},"__esModule",{value:!0}),_),utils_exports={};__export$6(utils_exports,{callPlayer:()=>callPlayer,getConfig:()=>getConfig,getSDK:()=>getSDK,isBlobUrl:()=>isBlobUrl,isMediaStream:()=>isMediaStream,lazy:()=>lazy,omit:()=>omit,parseEndTime:()=>parseEndTime,parseStartTime:()=>parseStartTime,queryString:()=>queryString,randomString:()=>randomString,supportsWebKitPresentationMode:()=>supportsWebKitPresentationMode});var utils$1=__toCommonJS$6(utils_exports),import_react$2=__toESM$4(reactExports),import_load_script=__toESM$4(loadScript),import_deepmerge$1=__toESM$4(cjs);const lazy=_=>import_react$2.default.lazy(async()=>{const a=await _();return typeof a.default=="function"?a:a.default}),MATCH_START_QUERY=/[?&#](?:start|t)=([0-9hms]+)/,MATCH_END_QUERY=/[?&#]end=([0-9hms]+)/,MATCH_START_STAMP=/(\d+)(h|m|s)/g,MATCH_NUMERIC=/^\d+$/;function parseTimeParam(_,a){if(_ instanceof Array)return;const $=_.match(a);if($){const j=$[1];if(j.match(MATCH_START_STAMP))return parseTimeString(j);if(MATCH_NUMERIC.test(j))return parseInt(j)}}function parseTimeString(_){let a=0,$=MATCH_START_STAMP.exec(_);for(;$!==null;){const[,j,et]=$;et==="h"&&(a+=parseInt(j,10)*60*60),et==="m"&&(a+=parseInt(j,10)*60),et==="s"&&(a+=parseInt(j,10)),$=MATCH_START_STAMP.exec(_)}return a}function parseStartTime(_){return parseTimeParam(_,MATCH_START_QUERY)}function parseEndTime(_){return parseTimeParam(_,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(_){return Object.keys(_).map(a=>`${a}=${_[a]}`).join("&")}function getGlobal(_){return window[_]?window[_]:window.exports&&window.exports[_]?window.exports[_]:window.module&&window.module.exports&&window.module.exports[_]?window.module.exports[_]:null}const requests={},getSDK=function _(a,$,j=null,et=()=>!0,tt=import_load_script.default){const rt=getGlobal($);return rt&&et(rt)?Promise.resolve(rt):new Promise((nt,it)=>{if(requests[a]){requests[a].push({resolve:nt,reject:it});return}requests[a]=[{resolve:nt,reject:it}];const at=st=>{requests[a].forEach(ot=>ot.resolve(st))};if(j){const st=window[j];window[j]=function(){st&&st(),at(getGlobal($))}}tt(a,st=>{st?(requests[a].forEach(ot=>ot.reject(st)),requests[a]=null):j||at(getGlobal($))})})};function getConfig(_,a){return(0,import_deepmerge$1.default)(a.config,_.config)}function omit(_,...a){const $=[].concat(...a),j={},et=Object.keys(_);for(const tt of et)$.indexOf(tt)===-1&&(j[tt]=_[tt]);return j}function callPlayer(_,...a){if(!this.player||!this.player[_]){let $=`ReactPlayer: ${this.constructor.displayName} player could not call %c${_}%c – `;return this.player?this.player[_]||($+="The method was not available"):$+="The player was not available",console.warn($,"font-weight: bold",""),null}return this.player[_](...a)}function isMediaStream(_){return typeof window<"u"&&typeof window.MediaStream<"u"&&_ instanceof window.MediaStream}function isBlobUrl(_){return/^blob:/.test(_)}function supportsWebKitPresentationMode(_=document.createElement("video")){const a=/iPhone|iPod/.test(navigator.userAgent)===!1;return _.webkitSupportsPresentationMode&&typeof _.webkitSetPresentationMode=="function"&&a}function enableStubOn(_){return _}var __defProp$5=Object.defineProperty,__getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__getOwnPropNames$5=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__export$5=(_,a)=>{for(var $ in a)__defProp$5(_,$,{get:a[$],enumerable:!0})},__copyProps$5=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$5(a))!__hasOwnProp$5.call(_,et)&&et!==$&&__defProp$5(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$5(a,et))||j.enumerable});return _},__toCommonJS$5=_=>__copyProps$5(__defProp$5({},"__esModule",{value:!0}),_),patterns_exports={};__export$5(patterns_exports,{AUDIO_EXTENSIONS:()=>AUDIO_EXTENSIONS,DASH_EXTENSIONS:()=>DASH_EXTENSIONS,FLV_EXTENSIONS:()=>FLV_EXTENSIONS,HLS_EXTENSIONS:()=>HLS_EXTENSIONS,MATCH_URL_DAILYMOTION:()=>MATCH_URL_DAILYMOTION,MATCH_URL_FACEBOOK:()=>MATCH_URL_FACEBOOK,MATCH_URL_FACEBOOK_WATCH:()=>MATCH_URL_FACEBOOK_WATCH,MATCH_URL_KALTURA:()=>MATCH_URL_KALTURA,MATCH_URL_MIXCLOUD:()=>MATCH_URL_MIXCLOUD,MATCH_URL_MUX:()=>MATCH_URL_MUX,MATCH_URL_SOUNDCLOUD:()=>MATCH_URL_SOUNDCLOUD,MATCH_URL_STREAMABLE:()=>MATCH_URL_STREAMABLE,MATCH_URL_TWITCH_CHANNEL:()=>MATCH_URL_TWITCH_CHANNEL,MATCH_URL_TWITCH_VIDEO:()=>MATCH_URL_TWITCH_VIDEO,MATCH_URL_VIDYARD:()=>MATCH_URL_VIDYARD,MATCH_URL_VIMEO:()=>MATCH_URL_VIMEO,MATCH_URL_WISTIA:()=>MATCH_URL_WISTIA,MATCH_URL_YOUTUBE:()=>MATCH_URL_YOUTUBE,VIDEO_EXTENSIONS:()=>VIDEO_EXTENSIONS,canPlay:()=>canPlay});var patterns=__toCommonJS$5(patterns_exports),import_utils$3=utils$1;const MATCH_URL_YOUTUBE=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,MATCH_URL_SOUNDCLOUD=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,MATCH_URL_VIMEO=/vimeo\.com\/(?!progressive_redirect).+/,MATCH_URL_MUX=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,MATCH_URL_FACEBOOK=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,MATCH_URL_FACEBOOK_WATCH=/^https?:\/\/fb\.watch\/.+$/,MATCH_URL_STREAMABLE=/streamable\.com\/([a-z0-9]+)$/,MATCH_URL_WISTIA=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,MATCH_URL_TWITCH_VIDEO=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,MATCH_URL_TWITCH_CHANNEL=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,MATCH_URL_DAILYMOTION=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,MATCH_URL_MIXCLOUD=/mixcloud\.com\/([^/]+\/[^/]+)/,MATCH_URL_VIDYARD=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,MATCH_URL_KALTURA=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,AUDIO_EXTENSIONS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,VIDEO_EXTENSIONS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,HLS_EXTENSIONS=/\.(m3u8)($|\?)/i,DASH_EXTENSIONS=/\.(mpd)($|\?)/i,FLV_EXTENSIONS=/\.(flv)($|\?)/i,canPlayFile=_=>{if(_ instanceof Array){for(const a of _)if(typeof a=="string"&&canPlayFile(a)||canPlayFile(a.src))return!0;return!1}return(0,import_utils$3.isMediaStream)(_)||(0,import_utils$3.isBlobUrl)(_)?!0:AUDIO_EXTENSIONS.test(_)||VIDEO_EXTENSIONS.test(_)||HLS_EXTENSIONS.test(_)||DASH_EXTENSIONS.test(_)||FLV_EXTENSIONS.test(_)},canPlay={youtube:_=>_ instanceof Array?_.every(a=>MATCH_URL_YOUTUBE.test(a)):MATCH_URL_YOUTUBE.test(_),soundcloud:_=>MATCH_URL_SOUNDCLOUD.test(_)&&!AUDIO_EXTENSIONS.test(_),vimeo:_=>MATCH_URL_VIMEO.test(_)&&!VIDEO_EXTENSIONS.test(_)&&!HLS_EXTENSIONS.test(_),mux:_=>MATCH_URL_MUX.test(_),facebook:_=>MATCH_URL_FACEBOOK.test(_)||MATCH_URL_FACEBOOK_WATCH.test(_),streamable:_=>MATCH_URL_STREAMABLE.test(_),wistia:_=>MATCH_URL_WISTIA.test(_),twitch:_=>MATCH_URL_TWITCH_VIDEO.test(_)||MATCH_URL_TWITCH_CHANNEL.test(_),dailymotion:_=>MATCH_URL_DAILYMOTION.test(_),mixcloud:_=>MATCH_URL_MIXCLOUD.test(_),vidyard:_=>MATCH_URL_VIDYARD.test(_),kaltura:_=>MATCH_URL_KALTURA.test(_),file:canPlayFile};var __defProp$4=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__getOwnPropNames$4=Object.getOwnPropertyNames,__hasOwnProp$4=Object.prototype.hasOwnProperty,__export$4=(_,a)=>{for(var $ in a)__defProp$4(_,$,{get:a[$],enumerable:!0})},__copyProps$4=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$4(a))!__hasOwnProp$4.call(_,et)&&et!==$&&__defProp$4(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$4(a,et))||j.enumerable});return _},__toCommonJS$4=_=>__copyProps$4(__defProp$4({},"__esModule",{value:!0}),_),players_exports={};__export$4(players_exports,{default:()=>players_default});var players=__toCommonJS$4(players_exports),import_utils$2=utils$1,import_patterns=patterns,players_default=[{key:"youtube",name:"YouTube",canPlay:import_patterns.canPlay.youtube,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./YouTube-BPBIdu0x.js").then(_=>_.Y),[],import.meta.url))},{key:"soundcloud",name:"SoundCloud",canPlay:import_patterns.canPlay.soundcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./SoundCloud-B6VMkdza.js").then(_=>_.S),[],import.meta.url))},{key:"vimeo",name:"Vimeo",canPlay:import_patterns.canPlay.vimeo,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vimeo-CeCS8etw.js").then(_=>_.V),[],import.meta.url))},{key:"mux",name:"Mux",canPlay:import_patterns.canPlay.mux,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mux-CzqAh8mF.js").then(_=>_.M),[],import.meta.url))},{key:"facebook",name:"Facebook",canPlay:import_patterns.canPlay.facebook,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Facebook-BCodjFGZ.js").then(_=>_.F),[],import.meta.url))},{key:"streamable",name:"Streamable",canPlay:import_patterns.canPlay.streamable,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Streamable-BilJxTCo.js").then(_=>_.S),[],import.meta.url))},{key:"wistia",name:"Wistia",canPlay:import_patterns.canPlay.wistia,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Wistia-B44VEAYA.js").then(_=>_.W),[],import.meta.url))},{key:"twitch",name:"Twitch",canPlay:import_patterns.canPlay.twitch,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Twitch-DaMRzaQ-.js").then(_=>_.T),[],import.meta.url))},{key:"dailymotion",name:"DailyMotion",canPlay:import_patterns.canPlay.dailymotion,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./DailyMotion-psE6EPNS.js").then(_=>_.D),[],import.meta.url))},{key:"mixcloud",name:"Mixcloud",canPlay:import_patterns.canPlay.mixcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mixcloud-Clr1DSie.js").then(_=>_.M),[],import.meta.url))},{key:"vidyard",name:"Vidyard",canPlay:import_patterns.canPlay.vidyard,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vidyard-Cd1bhxMy.js").then(_=>_.V),[],import.meta.url))},{key:"kaltura",name:"Kaltura",canPlay:import_patterns.canPlay.kaltura,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Kaltura-DnjjUfug.js").then(_=>_.K),[],import.meta.url))},{key:"file",name:"FilePlayer",canPlay:import_patterns.canPlay.file,canEnablePIP:_=>import_patterns.canPlay.file(_)&&(document.pictureInPictureEnabled||(0,import_utils$2.supportsWebKitPresentationMode)())&&!import_patterns.AUDIO_EXTENSIONS.test(_),lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./FilePlayer-zPq4b6iW.js").then(_=>_.F),[],import.meta.url))}],safeIsNaN=Number.isNaN||function _(a){return typeof a=="number"&&a!==a};function isEqual(_,a){return!!(_===a||safeIsNaN(_)&&safeIsNaN(a))}function areInputsEqual(_,a){if(_.length!==a.length)return!1;for(var $=0;$<_.length;$++)if(!isEqual(_[$],a[$]))return!1;return!0}function memoizeOne(_,a){a===void 0&&(a=areInputsEqual);var $,j=[],et,tt=!1;function rt(){for(var nt=[],it=0;it{for(var $ in a)__defProp$3(_,$,{get:a[$],enumerable:!0})},__copyProps$3=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$3(a))!__hasOwnProp$3.call(_,et)&&et!==$&&__defProp$3(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$3(a,et))||j.enumerable});return _},__toESM$3=(_,a,$)=>($=_!=null?__create$3(__getProtoOf$3(_)):{},__copyProps$3(!_||!_.__esModule?__defProp$3($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$3=_=>__copyProps$3(__defProp$3({},"__esModule",{value:!0}),_),props_exports={};__export$3(props_exports,{defaultProps:()=>defaultProps,propTypes:()=>propTypes});var props=__toCommonJS$3(props_exports),import_prop_types=__toESM$3(propTypesExports);const{string,bool,number,array,oneOfType,shape,object,func,node}=import_prop_types.default,propTypes={url:oneOfType([string,array,object]),playing:bool,loop:bool,controls:bool,volume:number,muted:bool,playbackRate:number,width:oneOfType([string,number]),height:oneOfType([string,number]),style:object,progressInterval:number,playsinline:bool,pip:bool,stopOnUnmount:bool,light:oneOfType([bool,string,object]),playIcon:node,previewTabIndex:number,previewAriaLabel:string,fallback:node,oEmbedUrl:string,wrapper:oneOfType([string,func,shape({render:func.isRequired})]),config:shape({soundcloud:shape({options:object}),youtube:shape({playerVars:object,embedOptions:object,onUnstarted:func}),facebook:shape({appId:string,version:string,playerId:string,attributes:object}),dailymotion:shape({params:object}),vimeo:shape({playerOptions:object,title:string}),mux:shape({attributes:object,version:string}),file:shape({attributes:object,tracks:array,forceVideo:bool,forceAudio:bool,forceHLS:bool,forceSafariHLS:bool,forceDisableHls:bool,forceDASH:bool,forceFLV:bool,hlsOptions:object,hlsVersion:string,dashVersion:string,flvVersion:string}),wistia:shape({options:object,playerId:string,customControls:array}),mixcloud:shape({options:object}),twitch:shape({options:object,playerId:string}),vidyard:shape({options:object})}),onReady:func,onStart:func,onPlay:func,onPause:func,onBuffer:func,onBufferEnd:func,onEnded:func,onError:func,onDuration:func,onSeek:func,onPlaybackRateChange:func,onPlaybackQualityChange:func,onProgress:func,onClickPreview:func,onEnablePIP:func,onDisablePIP:func},noop$1=()=>{},defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:noop$1},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},mux:{attributes:{},version:"2"},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:noop$1,onStart:noop$1,onPlay:noop$1,onPause:noop$1,onBuffer:noop$1,onBufferEnd:noop$1,onEnded:noop$1,onError:noop$1,onDuration:noop$1,onSeek:noop$1,onPlaybackRateChange:noop$1,onPlaybackQualityChange:noop$1,onProgress:noop$1,onClickPreview:noop$1,onEnablePIP:noop$1,onDisablePIP:noop$1};var __create$2=Object.create,__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__getOwnPropNames$2=Object.getOwnPropertyNames,__getProtoOf$2=Object.getPrototypeOf,__hasOwnProp$2=Object.prototype.hasOwnProperty,__defNormalProp$1=(_,a,$)=>a in _?__defProp$2(_,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):_[a]=$,__export$2=(_,a)=>{for(var $ in a)__defProp$2(_,$,{get:a[$],enumerable:!0})},__copyProps$2=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$2(a))!__hasOwnProp$2.call(_,et)&&et!==$&&__defProp$2(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$2(a,et))||j.enumerable});return _},__toESM$2=(_,a,$)=>($=_!=null?__create$2(__getProtoOf$2(_)):{},__copyProps$2(!_||!_.__esModule?__defProp$2($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$2=_=>__copyProps$2(__defProp$2({},"__esModule",{value:!0}),_),__publicField$1=(_,a,$)=>(__defNormalProp$1(_,typeof a!="symbol"?a+"":a,$),$),Player_exports={};__export$2(Player_exports,{default:()=>Player});var Player_1=__toCommonJS$2(Player_exports),import_react$1=__toESM$2(reactExports),import_react_fast_compare$1=__toESM$2(reactFastCompare),import_props$1=props,import_utils$1=utils$1;const SEEK_ON_PLAY_EXPIRY=5e3;class Player extends import_react$1.Component{constructor(){super(...arguments),__publicField$1(this,"mounted",!1),__publicField$1(this,"isReady",!1),__publicField$1(this,"isPlaying",!1),__publicField$1(this,"isLoading",!0),__publicField$1(this,"loadOnReady",null),__publicField$1(this,"startOnPlay",!0),__publicField$1(this,"seekOnPlay",null),__publicField$1(this,"onDurationCalled",!1),__publicField$1(this,"handlePlayerMount",a=>{if(this.player){this.progress();return}this.player=a,this.player.load(this.props.url),this.progress()}),__publicField$1(this,"getInternalPlayer",a=>this.player?this.player[a]:null),__publicField$1(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const a=this.getCurrentTime()||0,$=this.getSecondsLoaded(),j=this.getDuration();if(j){const et={playedSeconds:a,played:a/j};$!==null&&(et.loadedSeconds=$,et.loaded=$/j),(et.playedSeconds!==this.prevPlayed||et.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(et),this.prevPlayed=et.playedSeconds,this.prevLoaded=et.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),__publicField$1(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:a,playing:$,volume:j,muted:et}=this.props;a(),!et&&j!==null&&this.player.setVolume(j),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):$&&this.player.play(),this.handleDurationCheck()}),__publicField$1(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:a,onPlay:$,playbackRate:j}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&j!==1&&this.player.setPlaybackRate(j),a(),this.startOnPlay=!1),$(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),__publicField$1(this,"handlePause",a=>{this.isPlaying=!1,this.isLoading||this.props.onPause(a)}),__publicField$1(this,"handleEnded",()=>{const{activePlayer:a,loop:$,onEnded:j}=this.props;a.loopOnEnded&&$&&this.seekTo(0),$||(this.isPlaying=!1,j())}),__publicField$1(this,"handleError",(...a)=>{this.isLoading=!1,this.props.onError(...a)}),__publicField$1(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const a=this.getDuration();a?this.onDurationCalled||(this.props.onDuration(a),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),__publicField$1(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(a){if(!this.player)return;const{url:$,playing:j,volume:et,muted:tt,playbackRate:rt,pip:nt,loop:it,activePlayer:at,disableDeferredLoading:st}=this.props;if(!(0,import_react_fast_compare$1.default)(a.url,$)){if(this.isLoading&&!at.forceLoad&&!st&&!(0,import_utils$1.isMediaStream)($)){console.warn(`ReactPlayer: the attempt to load ${$} is being deferred until the player has loaded`),this.loadOnReady=$;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load($,this.isReady)}!a.playing&&j&&!this.isPlaying&&this.player.play(),a.playing&&!j&&this.isPlaying&&this.player.pause(),!a.pip&&nt&&this.player.enablePIP&&this.player.enablePIP(),a.pip&&!nt&&this.player.disablePIP&&this.player.disablePIP(),a.volume!==et&&et!==null&&this.player.setVolume(et),a.muted!==tt&&(tt?this.player.mute():(this.player.unmute(),et!==null&&setTimeout(()=>this.player.setVolume(et)))),a.playbackRate!==rt&&this.player.setPlaybackRate&&this.player.setPlaybackRate(rt),a.loop!==it&&this.player.setLoop&&this.player.setLoop(it)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(a,$,j){if(!this.isReady){a!==0&&(this.seekOnPlay=a,setTimeout(()=>{this.seekOnPlay=null},SEEK_ON_PLAY_EXPIRY));return}if($?$==="fraction":a>0&&a<1){const tt=this.player.getDuration();if(!tt){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(tt*a,j);return}this.player.seekTo(a,j)}render(){const a=this.props.activePlayer;return a?import_react$1.default.createElement(a,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}__publicField$1(Player,"displayName","Player");__publicField$1(Player,"propTypes",import_props$1.propTypes);__publicField$1(Player,"defaultProps",import_props$1.defaultProps);var __create$1=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__getProtoOf$1=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__defNormalProp=(_,a,$)=>a in _?__defProp$1(_,a,{enumerable:!0,configurable:!0,writable:!0,value:$}):_[a]=$,__export$1=(_,a)=>{for(var $ in a)__defProp$1(_,$,{get:a[$],enumerable:!0})},__copyProps$1=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames$1(a))!__hasOwnProp$1.call(_,et)&&et!==$&&__defProp$1(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc$1(a,et))||j.enumerable});return _},__toESM$1=(_,a,$)=>($=_!=null?__create$1(__getProtoOf$1(_)):{},__copyProps$1(!_||!_.__esModule?__defProp$1($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS$1=_=>__copyProps$1(__defProp$1({},"__esModule",{value:!0}),_),__publicField=(_,a,$)=>(__defNormalProp(_,typeof a!="symbol"?a+"":a,$),$),ReactPlayer_exports={};__export$1(ReactPlayer_exports,{createReactPlayer:()=>createReactPlayer});var ReactPlayer$1=__toCommonJS$1(ReactPlayer_exports),import_react=__toESM$1(reactExports),import_deepmerge=__toESM$1(cjs),import_memoize_one=__toESM$1(require$$2),import_react_fast_compare=__toESM$1(reactFastCompare),import_props=props,import_utils=utils$1,import_Player=__toESM$1(Player_1);const Preview=(0,import_utils.lazy)(()=>__vitePreload(()=>import("./Preview-BnlASUAm.js").then(_=>_.P),[],import.meta.url)),IS_BROWSER=typeof window<"u"&&window.document&&typeof document<"u",IS_GLOBAL=typeof commonjsGlobal<"u"&&commonjsGlobal.window&&commonjsGlobal.window.document,SUPPORTED_PROPS=Object.keys(import_props.propTypes),UniversalSuspense=IS_BROWSER||IS_GLOBAL?import_react.Suspense:()=>null,customPlayers=[],createReactPlayer=(_,a)=>{var $;return $=class extends import_react.Component{constructor(){super(...arguments),__publicField(this,"state",{showPreview:!!this.props.light}),__publicField(this,"references",{wrapper:j=>{this.wrapper=j},player:j=>{this.player=j}}),__publicField(this,"handleClickPreview",j=>{this.setState({showPreview:!1}),this.props.onClickPreview(j)}),__publicField(this,"showPreview",()=>{this.setState({showPreview:!0})}),__publicField(this,"getDuration",()=>this.player?this.player.getDuration():null),__publicField(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),__publicField(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),__publicField(this,"getInternalPlayer",(j="player")=>this.player?this.player.getInternalPlayer(j):null),__publicField(this,"seekTo",(j,et,tt)=>{if(!this.player)return null;this.player.seekTo(j,et,tt)}),__publicField(this,"handleReady",()=>{this.props.onReady(this)}),__publicField(this,"getActivePlayer",(0,import_memoize_one.default)(j=>{for(const et of[...customPlayers,..._])if(et.canPlay(j))return et;return a||null})),__publicField(this,"getConfig",(0,import_memoize_one.default)((j,et)=>{const{config:tt}=this.props;return import_deepmerge.default.all([import_props.defaultProps.config,import_props.defaultProps.config[et]||{},tt,tt[et]||{}])})),__publicField(this,"getAttributes",(0,import_memoize_one.default)(j=>(0,import_utils.omit)(this.props,SUPPORTED_PROPS))),__publicField(this,"renderActivePlayer",j=>{if(!j)return null;const et=this.getActivePlayer(j);if(!et)return null;const tt=this.getConfig(j,et.key);return import_react.default.createElement(import_Player.default,{...this.props,key:et.key,ref:this.references.player,config:tt,activePlayer:et.lazyPlayer||et,onReady:this.handleReady})})}shouldComponentUpdate(j,et){return!(0,import_react_fast_compare.default)(this.props,j)||!(0,import_react_fast_compare.default)(this.state,et)}componentDidUpdate(j){const{light:et}=this.props;!j.light&&et&&this.setState({showPreview:!0}),j.light&&!et&&this.setState({showPreview:!1})}renderPreview(j){if(!j)return null;const{light:et,playIcon:tt,previewTabIndex:rt,oEmbedUrl:nt,previewAriaLabel:it}=this.props;return import_react.default.createElement(Preview,{url:j,light:et,playIcon:tt,previewTabIndex:rt,previewAriaLabel:it,oEmbedUrl:nt,onClick:this.handleClickPreview})}render(){const{url:j,style:et,width:tt,height:rt,fallback:nt,wrapper:it}=this.props,{showPreview:at}=this.state,st=this.getAttributes(j),ot=typeof it=="string"?this.references.wrapper:void 0;return import_react.default.createElement(it,{ref:ot,style:{...et,width:tt,height:rt},...st},import_react.default.createElement(UniversalSuspense,{fallback:nt},at?this.renderPreview(j):this.renderActivePlayer(j)))}},__publicField($,"displayName","ReactPlayer"),__publicField($,"propTypes",import_props.propTypes),__publicField($,"defaultProps",import_props.defaultProps),__publicField($,"addCustomPlayer",j=>{customPlayers.push(j)}),__publicField($,"removeCustomPlayers",()=>{customPlayers.length=0}),__publicField($,"canPlay",j=>{for(const et of[...customPlayers,..._])if(et.canPlay(j))return!0;return!1}),__publicField($,"canEnablePIP",j=>{for(const et of[...customPlayers,..._])if(et.canEnablePIP&&et.canEnablePIP(j))return!0;return!1}),$};var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(_,a)=>{for(var $ in a)__defProp(_,$,{get:a[$],enumerable:!0})},__copyProps=(_,a,$,j)=>{if(a&&typeof a=="object"||typeof a=="function")for(let et of __getOwnPropNames(a))!__hasOwnProp.call(_,et)&&et!==$&&__defProp(_,et,{get:()=>a[et],enumerable:!(j=__getOwnPropDesc(a,et))||j.enumerable});return _},__toESM=(_,a,$)=>($=_!=null?__create(__getProtoOf(_)):{},__copyProps(!_||!_.__esModule?__defProp($,"default",{value:_,enumerable:!0}):$,_)),__toCommonJS=_=>__copyProps(__defProp({},"__esModule",{value:!0}),_),src_exports={};__export(src_exports,{default:()=>src_default});var lib$1=__toCommonJS(src_exports),import_players=__toESM(players),import_ReactPlayer=ReactPlayer$1;const fallback=import_players.default[import_players.default.length-1];var src_default=(0,import_ReactPlayer.createReactPlayer)(import_players.default,fallback);const ReactPlayer=getDefaultExportFromCjs$1(lib$1),AttributesAccordionItem=({nft:_,style:a})=>{const $=_.metadata.attributes;return!$||$.length===0?null:jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],"data-testid":"attributes-section",style:a,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"Attributes"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(Wrap,{marginLeft:"0",spacing:"10px",children:$.map(j=>jsxRuntimeExports.jsx(WrapItem,{flex:"1","data-testid":"nft-attribute",children:jsxRuntimeExports.jsx(Card,{width:"160px",height:"128px",marginBottom:"2px",background:colors.gray[700],children:jsxRuntimeExports.jsxs(CardBody,{padding:"16px",children:[jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:j.name}),jsxRuntimeExports.jsx(Heading,{size:"md",children:j.value})]})})},j.name))})})]})},TruncatedTextWithTooltip=({text:_,maxLength:a})=>_.length<=a?jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:_}):jsxRuntimeExports.jsx(Tooltip,{label:_,children:jsxRuntimeExports.jsx(Text,{"data-testid":"truncated-text",children:truncate(_,a)})}),TzktLink=({url:_,...a})=>jsxRuntimeExports.jsx("a",{"data-testid":"tzkt-link",href:_,rel:"noopener noreferrer",target:"_blank",children:jsxRuntimeExports.jsx(WindowLinkIcon,{...a})}),CreatorElement=({nft:_})=>{if(!_.metadata.creators||_.metadata.creators.length===0)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"-"});const a=_.metadata.creators[0];return a.startsWith("tz")?jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(a)}):jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:a})},PropertiesAccordionItem=({nft:_,style:a})=>{const $=royalties(_),j=$.reduce((tt,rt)=>tt+rt.share,0).toFixed(2),et=useSelectedNetwork();return jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:a,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"Properties"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(TableContainer,{children:jsxRuntimeExports.jsx(Table,{variant:"stripped",children:jsxRuntimeExports.jsxs(Tbody,{fontSize:"14px",children:[jsxRuntimeExports.jsxs(Tr,{background:colors.gray[900],borderColor:colors.gray[700],borderBottomWidth:"1px",borderRadius:"8px",children:[jsxRuntimeExports.jsx(Td,{width:"20%",padding:"16px 0 16px 15px",paddingRight:"0",color:colors.gray[400],borderTopLeftRadius:"8px","data-testid":"nft-editions",children:"Editions:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-editions-value",children:_.totalSupply||"?"}),jsxRuntimeExports.jsx(Td,{width:"20%",padding:"16px 0 16px 15px",color:colors.gray[400],children:"Token ID:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",borderTopRightRadius:"8px",children:_.tokenId})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[800],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsxs(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-royalty",children:["Royalties",$.length>1?" ("+$.length+")":"",":"]}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-royalty-value",children:$.length>0?j+"%":"-"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-mime",children:"MIME type:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px","data-testid":"nft-mime-value",children:mimeType(_)||"-"})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[900],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"Contract:"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px",children:jsxRuntimeExports.jsx(AddressPill,{marginRight:1,address:parsePkh(_.contract)})}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"Metadata:"}),jsxRuntimeExports.jsxs(Td,{width:"30%",padding:"16px 0 16px 5px",children:["TzKT ",jsxRuntimeExports.jsx(TzktLink,{url:metadataUri(_,et)})]})]}),jsxRuntimeExports.jsxs(Tr,{background:colors.gray[800],borderColor:colors.gray[700],borderBottomWidth:"1px",children:[jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],"data-testid":"nft-creator",children:"Creator:"}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 5px",borderColor:colors.gray[700],borderRightWidth:"1px","data-testid":"nft-creator-value",children:jsxRuntimeExports.jsx(CreatorElement,{nft:_})}),jsxRuntimeExports.jsx(Td,{padding:"16px 0 16px 15px",color:colors.gray[400],children:"License:"}),jsxRuntimeExports.jsx(Td,{width:"30%",padding:"16px 0 16px 5px",children:jsxRuntimeExports.jsx(TruncatedTextWithTooltip,{maxLength:15,text:_.metadata.rights||"-"})})]})]})})})})]})},TagsSection=({nft:_})=>{const a=_.metadata.tags;return!a||a.length===0?null:jsxRuntimeExports.jsx(Wrap,{marginTop:"20px","data-testid":"tags-section",children:a.map($=>jsxRuntimeExports.jsx(WrapItem,{padding:"3px 8px",background:colors.gray[600],borderRadius:"100px",children:jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-tag",children:$})},$))})},SendNFTRecapTile=({nft:_})=>{const a=getIPFSurl(thumbnailUri(_)),$=getIPFSurl(_.displayUri);return jsxRuntimeExports.jsx(Box,{width:"100%","aria-label":"nft",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"60px",padding:3,background:colors.gray[800],borderRadius:"4px","data-testid":"nft-name",children:[jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{fallbackSrc:$,src:a})}),_.metadata.name&&jsxRuntimeExports.jsx(Heading,{marginLeft:4,size:"sm",children:truncate(_.metadata.name,45)})]})})},SignPage$1=_=>{const{mode:a,operations:$,fee:j,data:{nft:et}}=_,{fee:tt,operations:rt,estimationFailed:nt,isLoading:it,form:at,signer:st,reEstimate:ot,onSign:ut}=useSignPageHelpers(j,$,a),{recipient:dt}=rt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...at,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:rt.type,signer:rt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:et})}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",marginY:"12px",paddingX:"4px",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Owned:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-owned",size:"sm",children:et.balance})]}),jsxRuntimeExports.jsx(SignPageFee,{fee:tt})]}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",marginTop:"12px",marginBottom:"24px",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"12px",size:"md",children:"Quantity:"}),jsxRuntimeExports.jsx(Center,{width:"100px",height:"48px",background:colors.gray[800],borderRadius:"4px",children:jsxRuntimeExports.jsxs(Text,{textAlign:"center",children:[rt.operations[0].amount," out of ",et.balance]})})]}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:rt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:dt}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:it,operationType:rt.type,reEstimate:ot,sender:rt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:nt,isLoading:it,onSubmit:ut,signer:st,text:headerText(rt.type,a)})})]})})})},FormPage$1=_=>{const{nft:a}=_,$=useOpenSignPageFormAction({SignPage:SignPage$1,signPageExtraData:{nft:a},FormPage:FormPage$1,defaultFormPageProps:_,toOperation:toOperation$1(a)}),j=useAddToBatchFormAction(toOperation$1(a)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:{quantity:1,...formDefaultValues(_)}}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=nt;return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(FormPageHeader,{}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(Flex,{marginBottom:"12px",children:jsxRuntimeExports.jsx(SendNFTRecapTile,{nft:_.nft})}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"4px",color:colors.gray[450],size:"sm",children:"Owned:"}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-owned",size:"sm",children:a.balance})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.quantity,children:[jsxRuntimeExports.jsx(FormLabel,{children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Heading,{marginRight:"8px",size:"md",children:"Quantity:"}),jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(InputGroup,{width:"75px",children:jsxRuntimeExports.jsx(Input,{width:"60px",color:"white","data-testid":"quantity-input",step:1,type:"number",...st("quantity",{required:"Quantity is required",max:{value:a.balance,message:`Max quantity is ${a.balance}`},min:{value:1,message:"Min quantity is 1"}})})}),jsxRuntimeExports.jsxs(Text,{"data-testid":"out-of-nft",children:["out of ",a.balance]})]})]})}),at.quantity&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"quantity-error",children:at.quantity.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),at.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:at.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation$1=_=>a=>({type:"fa2",sender:parsePkh(a.sender),recipient:parsePkh(a.recipient),contract:parseContractPkh(_.contract),tokenId:_.tokenId,amount:a.quantity.toString()}),NFTDrawerCard=({nft:_})=>{var it;const a=getIPFSurl(artifactUri(_)),$=getIPFSurl(_.displayUri),j=useGetOwnedAccount(),{openWith:et}=reactExports.useContext(DynamicModalContext),tt=(it=mimeType(_))==null?void 0:it.startsWith("video/"),rt=tokenName(_),nt={border:"none",borderRadius:"8px",marginBottom:"20px"};return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Card,{width:"534px",height:"534px",background:colors.gray[800],children:jsxRuntimeExports.jsxs(CardBody,{padding:"24px",children:[jsxRuntimeExports.jsx(Box,{position:"relative",width:"486px",height:"486px",children:tt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{position:"absolute",zIndex:1,width:"486px",height:"486px",children:jsxRuntimeExports.jsx(ReactPlayer,{width:"100%",height:"100%",loop:!0,playing:!0,url:a})}),jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:0,top:"0",width:"486px",height:"486px",objectFit:"contain",alt:rt,filter:"blur(20px)",src:$})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:1,width:"486px",height:"486px",objectFit:"contain",alt:rt,fallbackSrc:$,src:a}),jsxRuntimeExports.jsx(Image$1,{position:"absolute",zIndex:0,top:"0",width:"486px",height:"486px",objectFit:"contain",alt:rt,"data-testid":"nft-image",fallbackSrc:$,filter:"blur(20px)",src:a})]})}),Number(_.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"24px",marginTop:"-38px",marginLeft:"16px",borderRadius:"100px",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",paddingX:"8px",children:"x"+_.balance})]})}),jsxRuntimeExports.jsx(TagsSection,{nft:_}),rt&&jsxRuntimeExports.jsx(Heading,{marginTop:"16px",marginBottom:"14px","data-testid":"nft-name",size:"lg",children:rt}),_.metadata.description&&jsxRuntimeExports.jsx(Text,{color:colors.gray[400],"data-testid":"nft-description",size:"sm",children:_.metadata.description}),jsxRuntimeExports.jsx(Button,{marginTop:"20px",onClick:()=>et(jsxRuntimeExports.jsx(FormPage$1,{nft:_,sender:j(_.owner)})),children:"Send"}),jsxRuntimeExports.jsxs(Accordion,{marginTop:"32px",allowMultiple:!0,children:[jsxRuntimeExports.jsx(AttributesAccordionItem,{nft:_,style:nt}),jsxRuntimeExports.jsx(PropertiesAccordionItem,{nft:_,style:nt}),jsxRuntimeExports.jsxs(AccordionItem,{background:colors.gray[800],style:nt,children:[jsxRuntimeExports.jsxs(AccordionButton,{paddingY:"16px",children:[jsxRuntimeExports.jsx(Heading,{flex:"1",textAlign:"left",size:"md",children:"JSON"}),jsxRuntimeExports.jsx(AccordionIcon,{})]}),jsxRuntimeExports.jsx(AccordionPanel,{children:jsxRuntimeExports.jsx(JsValueWrap,{value:_})})]})]})]})},NFTDrawerBody=({nft:_,onCloseDrawer:a})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",paddingBottom:"22px",color:colors.gray[400],"data-testid":"nft-drawer-body",children:[jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.owner)}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:a})]}),jsxRuntimeExports.jsx(NFTDrawerCard,{nft:_})]}),AccountListWithDrawer=()=>{const[_,a]=reactExports.useState(null),{ownerPkh:$,nftId:j}=useParams(),et=useAllNfts(),tt=$&&lodashExports.get(et,[$],[]).find(dt=>fullId(dt)===j),rt=!!tt,{isOpen:nt,onOpen:it,onClose:at}=useDisclosure$1({defaultIsOpen:rt}),st=useNavigate(),ot=reactExports.useCallback(()=>{a(null),at(),st("/home")},[at,st]);reactExports.useEffect(()=>{const dt=mt=>{mt.key==="Escape"&&ot()};return document.addEventListener("keydown",dt),()=>document.removeEventListener("keydown",dt)},[ot]);const ut=reactExports.useMemo(()=>({selectedAccount:_,selectAccount:dt=>{a(dt),it()}}),[_,it]);return jsxRuntimeExports.jsxs(SelectedAccountContext.Provider,{value:ut,children:[jsxRuntimeExports.jsx(AccountsList,{}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:nt,onClose:ot,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsxs(DrawerContent,{children:[rt&&jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(NFTDrawerBody,{nft:{...tt,owner:$},onCloseDrawer:ot})}),!rt&&_&&jsxRuntimeExports.jsxs(ModalBody,{overflow:"hidden",overflowY:"scroll",paddingRight:"0",children:[jsxRuntimeExports.jsxs(Flex,{justifyContent:"flex-end",width:"100%",paddingRight:"24px",children:[jsxRuntimeExports.jsx(DerivationInfoButton,{marginRight:"5px",account:_}),jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:ot})]}),jsxRuntimeExports.jsx(AccountCard,{accountPkh:_.address.pkh})]})]})]})]})},HomeView=()=>jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Accounts"}),jsxRuntimeExports.jsx(Flex,{flex:1,minHeight:1,children:jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",flex:1,marginRight:"12px",paddingBottom:"12px",children:[jsxRuntimeExports.jsx(AccountListHeader,{}),jsxRuntimeExports.jsx(Box,{flex:1,overflow:"hidden",borderRadius:"8px",children:jsxRuntimeExports.jsx(AccountListWithDrawer,{})})]})})]}),SelectedNFTContext=reactExports.createContext({selectedNFT:void 0,setSelectedNFT:_=>{}}),NFTCard=({nft:_})=>{const{selectedNFT:a,setSelectedNFT:$}=reactExports.useContext(SelectedNFTContext),j=getIPFSurl(thumbnailUri(_)),et=getIPFSurl(_.displayUri),tt=_.metadata.name,rt={width:"100%",minWidth:"242px",minHeight:"242px",objectFit:"contain",aspectRatio:"1",fallbackSrc:et,src:j},nt=a&&fullId(a)===fullId(_)&&a.owner===_.owner;return jsxRuntimeExports.jsx(Card,{minWidth:"274px",borderRadius:"8px",cursor:"pointer","data-testid":`nft-card${nt?"-selected":""}`,onClick:()=>$(_),children:jsxRuntimeExports.jsxs(CardBody,{padding:"16px",background:colors.gray[900],border:"1px solid",borderColor:nt?colors.orangeL:"transparent",borderRadius:"8px",_hover:{background:colors.gray[700],borderColor:colors.gray[500]},children:[jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsxs(Box,{position:"relative",width:"100%",children:[jsxRuntimeExports.jsx(Image$1,{...rt,zIndex:2,opacity:"0"}),jsxRuntimeExports.jsx(Image$1,{...rt,position:"absolute",zIndex:0,top:"0",filter:"blur(20px)"}),jsxRuntimeExports.jsx(Image$1,{...rt,position:"absolute",zIndex:1,top:"0","data-testid":"nft-image"})]})}),Number(_.balance)>1&&jsxRuntimeExports.jsx(Text,{position:"absolute",zIndex:3,display:"inline",height:"24px",marginTop:"-36px",marginLeft:"10px",paddingTop:"1px",fontSize:"14px",borderRadius:"full",backgroundColor:"rgba(33, 33, 33, 0.75)","data-testid":"nft-owned-count",paddingX:"8px",children:"x"+_.balance}),jsxRuntimeExports.jsx(Box,{overflow:"hidden","data-testid":"nft-card-name",children:jsxRuntimeExports.jsx(Heading,{overflow:"hidden",marginTop:"15px",marginBottom:"8px",fontSize:"sm",whiteSpace:"nowrap",textOverflow:"ellipsis",children:tt})}),jsxRuntimeExports.jsx(AddressPill,{address:parsePkh(_.owner)})]})})},NFTGallery=({nftsByOwner:_})=>{const a=Object.entries(_).flatMap(([j,et])=>(et||[]).map(tt=>({owner:j,...tt})));let $="repeat(auto-fit, minmax(min(100%/2, max(274px, 100%/7)), 1fr))";return a.length<3&&($=`repeat(auto-fit, min(100% / ${a.length} - 16px, 450px))`),jsxRuntimeExports.jsx(SimpleGrid,{gridTemplateColumns:$,marginBottom:"16px",minChildWidth:"340px",spacing:"16px",children:sortedByLastUpdate(a).map(j=>jsxRuntimeExports.jsx(NFTCard,{nft:j},`${j.owner}:${fullId(j)}`))})},AccountListDisplay=({accounts:_,onSelect:a})=>jsxRuntimeExports.jsx(MenuList,{zIndex:"docked",overflowY:"scroll",maxHeight:"300px",padding:0,background:colors.gray[900],children:_.map($=>jsxRuntimeExports.jsx(MenuItem$1,{width:"100%",minHeight:"48px",padding:"5px",background:colors.gray[700],"aria-label":$.label,onClick:()=>{a($)},value:$.address.pkh,children:jsxRuntimeExports.jsx(AddressTile,{width:"370px",height:"40px",padding:"5px",background:colors.gray[700],borderRadius:"4px",_hover:{background:colors.gray[500]},cursor:"pointer",address:$.address})},$.address.pkh))}),useAccountsFilter=()=>{const _=useAllAccounts(),[a]=reactExports.useState(_),[$,j]=useSearchParams(),et=$.getAll("accounts"),[tt,rt]=reactExports.useState(et.length===0),[nt,it]=reactExports.useState(_.filter(ot=>et.includes(ot.address.pkh))),at=lodashExports.differenceBy(_,nt,ot=>ot.address.pkh),st=nt.length===_.length;return reactExports.useEffect(()=>{j(ot=>({...ot,accounts:nt.map(ut=>ut.address.pkh)}))},[nt,j]),{selectedAccounts:tt?a:nt,accountsFilter:jsxRuntimeExports.jsxs(Center,{children:[jsxRuntimeExports.jsx(Box,{alignSelf:"flex-start",children:jsxRuntimeExports.jsxs(Menu,{children:[jsxRuntimeExports.jsx(MenuButton,{as:Button,maxHeight:"26px",paddingLeft:0,fontWeight:"normal",_hover:{bg:"none"},_active:{bg:"none"},"data-testid":"account-filter",isDisabled:st,marginY:"16px",rightIcon:jsxRuntimeExports.jsx(ChevronDownIcon,{}),variant:"ghost",children:"Filter by Account"}),jsxRuntimeExports.jsx(AccountListDisplay,{accounts:at,onSelect:ot=>{rt(!1),it(ut=>[...ut,ot])}})]})}),jsxRuntimeExports.jsx(Wrap,{width:"100%",children:nt.map(ot=>jsxRuntimeExports.jsx(AddressPill,{address:ot.address,"data-testid":"account-pill",mode:{type:"removable",onRemove:()=>{rt(nt.length===1),it(ut=>ut.filter(dt=>dt.address.pkh!==ot.address.pkh))}}},ot.address.pkh))})]})}},NFTsView=()=>{const _=useAllNfts(),{accountsFilter:a,selectedAccounts:$}=useAccountsFilter(),[j,et]=reactExports.useState(void 0);reactExports.useEffect(()=>{const it=at=>{at.key==="Escape"&&et(void 0)};return document.addEventListener("keydown",it),()=>document.removeEventListener("keydown",it)},[]);const tt=lodashExports.pick(_,$.map(it=>it.address.pkh)),rt=lodashExports.sumBy(Object.values(tt).flat(),it=>Number((it==null?void 0:it.balance)||0)),nt=lodashExports.every(tt,it=>!it||it.length===0);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{subtitle:`(${rt})`,title:"NFTs"}),a,nt?jsxRuntimeExports.jsx(NoNFTs,{size:"lg"}):jsxRuntimeExports.jsxs(SelectedNFTContext.Provider,{value:{setSelectedNFT:et,selectedNFT:j},children:[jsxRuntimeExports.jsx(Box,{overflowY:"scroll",children:jsxRuntimeExports.jsx(NFTGallery,{nftsByOwner:tt})}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:!!j,onClose:()=>et(void 0),placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsx(ModalBody,{children:j&&jsxRuntimeExports.jsx(NFTDrawerBody,{nft:j,onCloseDrawer:()=>et(void 0)})})})]})]})]})},OperationsView=()=>{const{accountsFilter:_,selectedAccounts:a}=useAccountsFilter(),{operations:$,loadMore:j,hasMore:et,isLoading:tt,isFirstLoad:rt}=useGetOperations(a),nt=reactExports.useRef(!1),it=at=>{if(nt.current||!et||tt)return;const st=at.target;if(st.scrollHeight-st.scrollTop-st.clientHeight<100)return nt.current=!0,j().finally(()=>{nt.current=!1})};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Operations"}),_,jsxRuntimeExports.jsx(Center,{display:tt&&rt?"flex":"none",height:"100%",children:jsxRuntimeExports.jsx(Image$1,{width:"150px",height:"75px",marginBottom:"136px",src:"./static/media/loading-wheel.gif"})}),$.length===0&&!tt&&jsxRuntimeExports.jsx(NoOperations,{size:"lg"}),$.length>0&&jsxRuntimeExports.jsxs(Box,{overflowY:"scroll",marginBottom:"20px",background:colors.gray[900],borderRadius:"8px",onScroll:it,paddingX:"20px",children:[jsxRuntimeExports.jsx(OperationTileContext.Provider,{value:{mode:"page"},children:$.map((at,st)=>{const ot=st===$.length-1;return jsxRuntimeExports.jsxs(Box,{height:"90px",marginBottom:ot?"10px":0,paddingY:"20px",children:[jsxRuntimeExports.jsx(OperationTile,{operation:at}),!ot&&jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Divider,{marginTop:"20px"})})]},at.id)})}),jsxRuntimeExports.jsxs(Center,{flexDirection:"column",display:tt&&!rt?"flex":"none",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Image$1,{width:"100px",height:"50px",src:"./static/media/loading-dots.gif"})]})]})]})},DrawerTopButtons=({onClose:_,...a})=>jsxRuntimeExports.jsx(Flex,{justifyContent:"flex-end",paddingBottom:"30px",cursor:"pointer",...a,children:jsxRuntimeExports.jsx(CloseDrawerButton,{onClose:_})}),BeaconPeers=()=>{const _=usePeers(),[a,$]=reactExports.useState([]);return reactExports.useEffect(()=>{const j=_.map(async et=>({...et,senderId:et.senderId||await getSenderId(et.publicKey)}));Promise.all(j).then($).catch(lodashExports.noop)},[_]),a.length===0?jsxRuntimeExports.jsxs(Box,{"data-testid":"beacon-peers-empty",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Text,{marginTop:"31px",color:colors.gray[400],size:"lg",children:"Your dApps will appear here"})]}):jsxRuntimeExports.jsx(PeersDisplay,{"data-testid":"beacon-peers",peerInfos:a})},PeersDisplay=({peerInfos:_})=>jsxRuntimeExports.jsx(Box,{children:_.map(a=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(PeerRow,{peerInfo:a})]},a.senderId))}),PeerRow=({peerInfo:_})=>{const a=useRemovePeer();return jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",height:"106px","data-testid":"peer-row",paddingY:"30px",children:[jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AspectRatio,{width:"48px",marginRight:"16px",ratio:1,children:jsxRuntimeExports.jsx(Image$1,{width:"100%",src:_.icon})}),jsxRuntimeExports.jsxs(Center,{alignItems:"flex-start",flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"6px",size:"md",children:_.name}),jsxRuntimeExports.jsx(StoredPeerInfo,{peerInfo:_})]})]}),jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(IconButton,{"aria-label":"Remove Peer",icon:jsxRuntimeExports.jsx(TrashIcon,{}),onClick:()=>a(_),size:"xs",variant:"circle"})})]})},StoredPeerInfo=({peerInfo:_})=>{const a=useGetConnectionInfo(_.senderId);return a?jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(AddressPill,{marginRight:"10px",address:parsePkh(a.accountPkh)}),jsxRuntimeExports.jsx(Divider,{marginRight:"10px",orientation:"vertical"}),jsxRuntimeExports.jsx(Text,{marginTop:"2px",marginRight:"4px",color:colors.gray[450],fontWeight:650,size:"sm",children:"Network:"}),jsxRuntimeExports.jsx(Text,{marginTop:"2px",color:colors.white,"data-testid":"dapp-connection-network",size:"sm",children:lodashExports.capitalize(a.networkType)})]}):null},DAppsDrawerCard=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1(),j=useAddPeer();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"dApps",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{autoFocus:!1,blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{"data-testid":"drawer-body",children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"96px",children:jsxRuntimeExports.jsx(Heading,{children:"dApps"})}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.readText().then(et=>j(et)),children:"Connect with Pairing Request"}),jsxRuntimeExports.jsx(Text,{marginTop:"16px",marginBottom:"32px",color:colors.gray[400],children:"or open a deeplink from inside the dApp..."}),jsxRuntimeExports.jsx(BeaconPeers,{})]})]})})]})]})},ErrorLogsDrawerCard=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Error Logs",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsx(ErrorLogsDrawerBody,{})]})})]})]})},ErrorLogsDrawerBody=()=>{const _=[...useAppSelector(j=>j.errors)].reverse(),a=useDispatch(),$=()=>{a(errorsSlice.actions.reset())};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",height:"50px",marginBottom:"20px",children:[jsxRuntimeExports.jsx(Heading,{size:"xl",children:"Error Logs"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx("a",{download:"UmamiErrorLogs.json",href:`data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(_))}`,children:jsxRuntimeExports.jsx(Button,{variant:"tertiary",children:"Download error logs"})}),jsxRuntimeExports.jsx(Button,{marginLeft:"8px",onClick:$,variant:"warning",children:"Clear All"})]})]}),_.map(j=>jsxRuntimeExports.jsx(ErrorLogRow,{errorLog:j},nanoid()))]})},ErrorLogRow=({errorLog:_})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{marginY:1}),jsxRuntimeExports.jsx(Flex,{justifyContent:"space-between",paddingY:"12px",children:jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(OutlineExclamationCircleIcon,{marginTop:"1px",marginRight:"8px"}),jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",children:[jsxRuntimeExports.jsx(Heading,{wordBreak:"break-all",size:"sm",children:_.description}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],size:"sm",children:_.timestamp})]})]})})]}),removeTrailingSlashes=_=>_.replace(/\/+$/g,""),UpsertNetworkModal=({network:_})=>{const a=_?"edit":"create",{onClose:$}=reactExports.useContext(DynamicModalContext),j=useDispatch(),et=useAvailableNetworks(),{formState:{errors:tt,isValid:rt},register:nt,handleSubmit:it}=useForm({mode:"onBlur",defaultValues:_}),at=st=>{j(networksActions.upsertNetwork(st)),$()};return jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:it(at),children:[jsxRuntimeExports.jsxs(ModalHeader,{textAlign:"center",children:[a==="edit"?"Edit":"Add"," Network",jsxRuntimeExports.jsx(ModalCloseButton,{})]}),jsxRuntimeExports.jsxs(ModalBody,{children:[a==="create"&&jsxRuntimeExports.jsxs(FormControl,{marginTop:"32px",marginBottom:"24px",isInvalid:!!tt.name,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Name"}),jsxRuntimeExports.jsx(Input,{placeholder:"mainnet",...nt("name",{required:"Name is required",validate:st=>{if(et.find(ot=>ot.name===st))return"Network with this name already exists"}})}),tt.name&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.name.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.rpcUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"RPC URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://prod.tcinfra.net/rpc/mainnet",...nt("rpcUrl",{required:"RPC URL is required",setValueAs:removeTrailingSlashes})}),tt.rpcUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.rpcUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.tzktApiUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Tzkt API URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://api.ghostnet.tzkt.io",...nt("tzktApiUrl",{required:"Tzkt API URL is required",setValueAs:removeTrailingSlashes})}),tt.tzktApiUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.tzktApiUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginBottom:"24px",isInvalid:!!tt.tzktExplorerUrl,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Tzkt Explorer URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://ghostnet.tzkt.io",...nt("tzktExplorerUrl",{required:"Tzkt Explorer URL is required",setValueAs:removeTrailingSlashes})}),tt.tzktExplorerUrl&&jsxRuntimeExports.jsx(FormErrorMessage,{children:tt.tzktExplorerUrl.message})]}),jsxRuntimeExports.jsxs(FormControl,{children:[jsxRuntimeExports.jsx(FormLabel,{children:"Buy Tez URL"}),jsxRuntimeExports.jsx(Input,{placeholder:"https://faucet.ghostnet.teztnets.com",...nt("buyTezUrl")})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!rt,onClick:()=>{},type:"submit",children:a==="edit"?"Save changes":"Add network"})})]})]})})},NetworkSettingsDrawerBody=()=>{const{openWith:_}=reactExports.useContext(DynamicModalContext),a=useSelectedNetwork(),$=useSelectNetwork(),j=useAvailableNetworks(),et=useAppDispatch(),tt=rt=>{et(networksActions.removeNetwork(rt))};return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",children:[jsxRuntimeExports.jsxs(Center,{justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{children:"Network Settings"}),jsxRuntimeExports.jsxs(Button,{paddingRight:"0",onClick:()=>_(jsxRuntimeExports.jsx(UpsertNetworkModal,{})),variant:"CTAWithIcon",children:[jsxRuntimeExports.jsx(Text,{size:"sm",children:"Add Network"}),jsxRuntimeExports.jsx(PlusIcon,{width:"18px",height:"18px",marginLeft:"4px",stroke:"currentcolor"})]})]}),jsxRuntimeExports.jsx(RadioGroup,{marginTop:"60px",onChange:$,value:a.name,children:jsxRuntimeExports.jsx(Stack,{children:j.map(rt=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{borderColor:colors.gray[700]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between","data-testid":`network-${rt.name}`,children:[jsxRuntimeExports.jsx(Radio,{height:"100px",value:rt.name,variant:"primary",children:jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",marginLeft:"16px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"4px",size:"sm",children:rt.name}),jsxRuntimeExports.jsx(Text,{color:colors.gray[400],children:rt.rpcUrl})]})}),!isDefault(rt)&&jsxRuntimeExports.jsx(Center,{"data-testid":"popover-menu",children:jsxRuntimeExports.jsxs(PopoverMenu,{children:[jsxRuntimeExports.jsxs(Button,{onClick:()=>_(jsxRuntimeExports.jsx(UpsertNetworkModal,{network:rt})),variant:"popover",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Edit"}),jsxRuntimeExports.jsx(PenIcon,{stroke:"inherit"})]}),jsxRuntimeExports.jsx(Divider,{marginTop:"4px"}),jsxRuntimeExports.jsxs(Button,{onClick:()=>tt(rt),variant:"popover",children:[jsxRuntimeExports.jsx(Text,{marginRight:"4px",children:"Remove"}),jsxRuntimeExports.jsx(TrashIcon,{stroke:"inherit"})]})]})})]})]},rt.name))})})]})},NetworkSettingsDrawerCard=()=>{const{isOpen:_,onClose:a,onOpen:$}=useDisclosure$1();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Network Settings",isSelected:_,onClick:$}),jsxRuntimeExports.jsxs(Drawer,{blockScrollOnMount:!1,isOpen:_,onClose:a,placement:"right",children:[jsxRuntimeExports.jsx(ModalOverlay,{}),jsxRuntimeExports.jsx(DrawerContent,{children:jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(DrawerTopButtons,{onClose:a}),jsxRuntimeExports.jsx(NetworkSettingsDrawerBody,{})]})})]})]})},ChangePasswordForm=()=>{const{onClose:_}=reactExports.useContext(DynamicModalContext),a=useForm({mode:"onBlur"}),$=useToast(),j=useAppDispatch(),{handleAsyncAction:et,isLoading:tt}=useAsyncActionHandler(),{handleSubmit:rt,formState:{isValid:nt,errors:it},getValues:at}=a,st=async({currentPassword:ot,newPassword:ut,newPasswordConfirmation:dt})=>{if(!(ot===ut||ut!==dt))return et(async()=>{await j(changeMnemonicPassword({currentPassword:ot,newPassword:ut})).unwrap(),$({description:"Password updated",status:"success"}),_()})};return jsxRuntimeExports.jsx(FormProvider,{...a,children:jsxRuntimeExports.jsx(ModalContent,{background:colors.gray[700],"data-testid":"change-password-modal",children:jsxRuntimeExports.jsxs("form",{onSubmit:rt(st),children:[jsxRuntimeExports.jsx(ModalCloseButton,{}),jsxRuntimeExports.jsx(ModalHeader,{textAlign:"center",children:jsxRuntimeExports.jsx(Heading,{children:"Change Password"})}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{marginTop:"32px",isInvalid:!!it.currentPassword,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"current-password",inputName:"currentPassword",label:"Current Password",placeholder:"Enter your current password",required:"Current password is required"}),it.currentPassword&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"current-password-error",children:it.currentPassword.message})]}),jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!it.newPassword,marginY:6,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"new-password",inputName:"newPassword",label:"New Password",placeholder:"Enter new password",required:"New password is required",validate:ot=>at("currentPassword")!==ot||"Cannot be the same as old password"}),it.newPassword&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"new-password-error",children:it.newPassword.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:3,isInvalid:!!it.newPasswordConfirmation,children:[jsxRuntimeExports.jsx(PasswordInput,{"data-testid":"new-password-confirmation",inputName:"newPasswordConfirmation",label:"Confirm New Password",placeholder:"Confirm new password",required:"Confirmation is required",validate:ot=>at("newPassword")===ot||"Your new passwords do no match"}),it.newPasswordConfirmation&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"new-password-confirmation-error",children:it.newPasswordConfirmation.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(Button,{width:"100%",isDisabled:!nt,isLoading:tt,size:"lg",type:"submit",children:"Update Password"})})]})})})},SettingsView=()=>jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Settings"}),jsxRuntimeExports.jsxs(Box,{overflowY:"scroll",children:[jsxRuntimeExports.jsx(Box,{marginTop:"16px",children:jsxRuntimeExports.jsx(GeneralSection,{})}),jsxRuntimeExports.jsx(BackupSection,{}),jsxRuntimeExports.jsx(AdvancedSection,{})]})]}),GeneralSection=()=>jsxRuntimeExports.jsxs(SectionContainer,{title:"General",children:[jsxRuntimeExports.jsx(NetworkSettingsDrawerCard,{}),jsxRuntimeExports.jsx(ErrorLogsDrawerCard,{})]}),BackupSection=()=>jsxRuntimeExports.jsx(SectionContainer,{title:"Backup",children:jsxRuntimeExports.jsx(ClickableCard,{isSelected:!1,onClick:downloadBackupFile,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Heading,{size:"sm",children:"Download backup file"}),jsxRuntimeExports.jsx(Button,{onClick:downloadBackupFile,variant:"unstyled",children:jsxRuntimeExports.jsx(DownloadIcon,{cursor:"pointer"})})]})})}),AdvancedSection=()=>{const{modalElement:_,onOpen:a}=useOffboardingModal(),{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(SectionContainer,{title:"Advanced Settings",children:[jsxRuntimeExports.jsx(DAppsDrawerCard,{}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Off-board Wallet",isSelected:!1,onClick:a}),jsxRuntimeExports.jsx(SettingsCardWithDrawerIcon,{left:"Change Password",isSelected:!1,onClick:()=>$(jsxRuntimeExports.jsx(ChangePasswordForm,{}))}),_]})},SectionContainer=({title:_,children:a})=>jsxRuntimeExports.jsx(Box,{marginTop:"8px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(Box,{width:"550px",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"16px",size:"lg",children:_}),a]})})}),TokenTile=({token:_,amount:a,...$})=>{const{contract:j}=_,et=tokenPrettyAmount(a,_),tt=tokenSymbolSafe(_);return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"start",width:"400px",padding:"15px",background:colors.gray[800],borderRadius:"4px","data-testid":"token-tile",...$,children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(AspectRatio,{width:"30px",height:"30px",marginRight:"12px",ratio:1,children:jsxRuntimeExports.jsx(TokenIcon,{padding:"6.25px",background:colors.gray[500],borderRadius:"4px",contract:j})})}),jsxRuntimeExports.jsx(PrettyNumber,{number:et}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:tt})]})},SignPage=_=>{const{mode:a,operations:$,fee:j,data:{token:et}}=_,{fee:tt,operations:rt,estimationFailed:nt,isLoading:it,form:at,signer:st,reEstimate:ot,onSign:ut}=useSignPageHelpers(j,$,a),{amount:dt,recipient:mt}=rt.operations[0];return jsxRuntimeExports.jsx(FormProvider,{...at,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(SignPageHeader,{..._,operationsType:rt.type,signer:rt.signer}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsx(TokenTile,{amount:dt,token:et}),jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"end",marginTop:"12px",marginBottom:"24px",paddingX:"4px",children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(SignPageFee,{fee:tt})})}),jsxRuntimeExports.jsx(FormLabel,{children:"From"}),jsxRuntimeExports.jsx(AddressTile,{marginBottom:"24px",address:rt.sender.address}),jsxRuntimeExports.jsx(FormLabel,{children:"To"}),jsxRuntimeExports.jsx(AddressTile,{address:mt}),jsxRuntimeExports.jsx(OperationSignerSelector,{isLoading:it,operationType:rt.type,reEstimate:ot,sender:rt.sender})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(SignButton,{isDisabled:nt,isLoading:it,onSubmit:ut,signer:st,text:headerText(rt.type,a)})})]})})})},FormPage=_=>{const{token:a}=_,$=useOpenSignPageFormAction({SignPage,signPageExtraData:{token:a},FormPage,defaultFormPageProps:_,toOperation:toOperation(a)}),j=useAddToBatchFormAction(toOperation(a)),{onFormSubmitActionHandlers:[et,tt],isLoading:rt}=useHandleOnSubmitFormActions([$,j]),nt=useForm({mode:"onBlur",defaultValues:formDefaultValues(_)}),{formState:{isValid:it,errors:at},register:st,handleSubmit:ot}=nt,ut=tokenDecimals(a),dt=formatTokenAmount(a.balance,ut),mt=getSmallestUnit(Number(ut));return jsxRuntimeExports.jsx(FormProvider,{...nt,children:jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(FormPageHeader,{}),jsxRuntimeExports.jsxs(ModalBody,{children:[jsxRuntimeExports.jsxs(FormControl,{isInvalid:!!at.prettyAmount,children:[jsxRuntimeExports.jsx(FormLabel,{children:"Amount"}),jsxRuntimeExports.jsxs(InputGroup,{children:[jsxRuntimeExports.jsx(Input,{isDisabled:rt,step:mt,type:"number",...st("prettyAmount",{required:"Amount is required",max:{value:dt.toString(),message:`Max amount is ${dt}`},validate:makeValidateDecimals(Number(ut))}),placeholder:mt}),jsxRuntimeExports.jsx(InputRightElement,{paddingRight:"12px","data-testid":"token-symbol",children:tokenSymbolSafe(a)})]}),at.prettyAmount&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"amount-error",children:at.prettyAmount.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.sender,children:[jsxRuntimeExports.jsx(OwnedAccountsAutocomplete,{allowUnknown:!1,inputName:"sender",isDisabled:!0,label:"From"}),at.sender&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"from-error",children:at.sender.message})]}),jsxRuntimeExports.jsxs(FormControl,{marginTop:"24px",isInvalid:!!at.recipient,children:[jsxRuntimeExports.jsx(KnownAccountsAutocomplete,{allowUnknown:!0,inputName:"recipient",label:"To"}),at.recipient&&jsxRuntimeExports.jsx(FormErrorMessage,{"data-testid":"recipient-error",children:at.recipient.message})]})]}),jsxRuntimeExports.jsx(ModalFooter,{children:jsxRuntimeExports.jsx(FormSubmitButtons,{isLoading:rt,isValid:it,onAddToBatch:ot(tt),onSingleSubmit:ot(et)})})]})})})},toOperation=_=>a=>{const $={type:"fa2",sender:parsePkh(a.sender),recipient:parsePkh(a.recipient),contract:parseContractPkh(_.contract),tokenId:_.tokenId,amount:getRealAmount(_,a.prettyAmount)};return _.type==="fa2"?$:{...$,type:"fa1.2",tokenId:"0"}},Header=({account:_})=>{const{address:a,label:$}=_;return jsxRuntimeExports.jsxs(Flex,{alignItems:"center",height:"78px",background:accountIconGradient({left:"-10px",top:"-10px",account:_,radius:"100px",mainBackgroundColor:colors.gray[800]}),borderTopRadius:"8px","data-testid":"header",paddingX:"30px",children:[jsxRuntimeExports.jsx(AccountTileIcon,{account:_,size:"lg"}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",flex:1,children:[jsxRuntimeExports.jsxs(Box,{marginLeft:"16px","data-testid":"account-identifier",children:[jsxRuntimeExports.jsx(Heading,{marginBottom:"4px",size:"md",children:$}),jsxRuntimeExports.jsx(Text,{color:colors.gray[300],size:"sm",children:formatPkh(a.pkh)})]}),jsxRuntimeExports.jsx(Flex,{flexDirection:"column-reverse",children:jsxRuntimeExports.jsx(AccountBalance,{verticalAlign:"bottom",address:_.address.pkh})})]})]})},AccountTokens=({account:_,tokens:a})=>{const{openWith:$}=reactExports.useContext(DynamicModalContext);return jsxRuntimeExports.jsxs(Card,{overflowX:"auto",marginBottom:"16px",borderBottomRadius:"8px",backgroundColor:colors.gray[900],children:[jsxRuntimeExports.jsx(Header,{account:_}),jsxRuntimeExports.jsx(TableContainer,{paddingX:"30px",children:jsxRuntimeExports.jsx(Table,{children:jsxRuntimeExports.jsx(Tbody,{children:a.map((j,et)=>{const tt=et===a.length-1?"transparent":colors.gray[700];return jsxRuntimeExports.jsxs(Tr,{"data-testid":"token-tile",children:[jsxRuntimeExports.jsx(Td,{width:"20%",minWidth:"240px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(TokenIcon,{display:"inline-block",width:"38px",contract:j.contract}),jsxRuntimeExports.jsx(Heading,{display:"inline-block",marginLeft:"16px",size:"sm",children:jsxRuntimeExports.jsx(TokenNameWithIcon,{token:j})})]})}),jsxRuntimeExports.jsx(Td,{width:"20%",minWidth:"200px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(AddressPill,{address:parseContractPkh(j.contract)})}),jsxRuntimeExports.jsx(Td,{width:"15%",minWidth:"160px",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(Heading,{size:"sm",children:tokenPrettyAmount(j.balance,j,{showSymbol:!1})})}),jsxRuntimeExports.jsx(Td,{textAlign:"right",borderColor:tt,paddingX:"0",children:jsxRuntimeExports.jsx(SendButton,{onClick:()=>$(jsxRuntimeExports.jsx(FormPage,{sender:_,token:j}))})})]},fullId(j))})})})})]})},TokensPage=()=>{const{accountsFilter:_,selectedAccounts:a}=useAccountsFilter(),$=useGetAccountAllTokens(),j=a.map(et=>[et,$(et.address.pkh)]).filter(([,et])=>et.length>0);return jsxRuntimeExports.jsxs(Flex,{flexDirection:"column",height:"100%",children:[jsxRuntimeExports.jsx(TopBar,{title:"Tokens"}),_,j.length===0?jsxRuntimeExports.jsx(NoTokens,{size:"lg"}):jsxRuntimeExports.jsx(Box,{overflowY:"auto",children:j.map(([et,tt])=>jsxRuntimeExports.jsx(AccountTokens,{account:et,tokens:tt},et.address.pkh))})]})},AppVersion=({isCollapsed:_,...a})=>{const $=_?packageInfo.version:`Umami v${packageInfo.version}`;return jsxRuntimeExports.jsx(Text,{color:colors.gray[450],...a,children:$})},CollapseMenuButton=({toggle:_,...a})=>jsxRuntimeExports.jsx(Center,{width:"44px",height:"44px",marginRight:"-14px",borderRadius:"4px",_hover:{background:colors.gray[800]},cursor:"pointer","data-testid":"collapse-menu-button",onClick:_,...a,children:jsxRuntimeExports.jsx(BurgerMenuIcon,{})}),useCollapseMenu=()=>{const[_,a]=reactExports.useState(!1),$=reactExports.useCallback(()=>{a(j=>!j)},[]);return{isCollapsed:_,toggle:$}},ORANGE="#F74F18",MakiLogo=_=>{const a=useSelectedNetwork();return jsxRuntimeExports.jsx(MakiIcon,{background:"white",borderRadius:"8px","data-testid":"maki-logo",fishColor:a.name==="mainnet"?ORANGE:"black",..._})},NetworkSelector=()=>{const _=useSelectedNetwork(),a=useAvailableNetworks(),$=useSelectNetwork(),{onOpen:j,onClose:et,isOpen:tt}=useDisclosure$1();return jsxRuntimeExports.jsxs(Popover,{isOpen:tt,onClose:et,onOpen:j,placement:"bottom-end",children:[jsxRuntimeExports.jsx(PopoverTrigger,{children:jsxRuntimeExports.jsxs(Button,{marginTop:"4px",color:colors.green,"data-testid":"network-selector",variant:"unstyled",children:[lodashExports.capitalize(_.name),tt?jsxRuntimeExports.jsx(ChevronUpIcon,{marginTop:"-2px",stroke:"currentcolor"}):jsxRuntimeExports.jsx(ChevronDownIcon$1,{marginTop:"-2px",stroke:"currentcolor"})]})}),jsxRuntimeExports.jsx(PopoverContent,{width:"100px",marginTop:"-10px",background:colors.gray[700],border:"1px solid",borderColor:colors.gray[500],children:jsxRuntimeExports.jsx(PopoverBody,{padding:"4px 12px",children:jsxRuntimeExports.jsx(Flex,{flexDirection:"column",children:a.map((rt,nt)=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{height:"34px",color:rt.name===_.name?colors.green:colors.gray[300],fontSize:"14px",fontWeight:400,textAlign:"right",_hover:{color:colors.greenL},onClick:()=>{$(rt.name),et()},variant:"unstyled",children:lodashExports.capitalize(rt.name)}),nt{const[_,a]=reactExports.useState(!1),$=window;reactExports.useEffect(()=>{$&&$.electronAPI&&$.electronAPI.onAppUpdateDownloaded(et=>a(!0))},[$]);const j=()=>{$&&$.electronAPI&&$.electronAPI.installAppUpdateAndQuit()};return _?jsxRuntimeExports.jsx(Box,{marginTop:"24px",marginBottom:"6px",children:jsxRuntimeExports.jsxs(Button,{justifyContent:"flex-start",width:"100%",height:"32px",paddingTop:"7px",paddingRight:"8px",paddingBottom:"7px",paddingLeft:"8px",color:colors.black,background:colors.green,_hover:{color:colors.black,background:colors.greenL},onClick:j,children:[jsxRuntimeExports.jsx(FlipForwardEnergy,{}),jsxRuntimeExports.jsx(Text,{marginLeft:"4px",size:"sm",children:"Update Umami"})]})}):null},SideNavbar=()=>{const{isCollapsed:_,toggle:a}=useCollapseMenu(),$=jsxRuntimeExports.jsx(CollapseMenuButton,{marginTop:_?0:"2px",marginRight:_?0:"-14px",toggle:a});return jsxRuntimeExports.jsxs(Flex,{alignItems:_?"center":"normal",flexDirection:"column",width:_?"80px":"236px",padding:_?"30px 20px":"30px",background:colors.gray[900],"data-testid":`side-navbar${_?"-collapsed":""}`,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Flex,{alignItems:"center",justifyContent:"space-between",height:"30px",children:_?$:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(MakiLogo,{width:"38px",height:"38px"}),jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(NetworkSelector,{}),$]})]})}),jsxRuntimeExports.jsx(Divider,{marginTop:"28px"})]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"space-between",flexDirection:"column",flex:1,children:[jsxRuntimeExports.jsxs(Box,{alignItems:_?"center":"normal",justifyContent:_?"space-around":"normal",display:_?"flex":"block",height:"100%",children:[!_&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(UpdateAppButton,{}),jsxRuntimeExports.jsx(TotalBalance,{})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(AccountsIcon,{}),isCollapsed:_,label:"Accounts",to:"/home"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(DiamondIcon,{}),isCollapsed:_,label:"NFTs",to:"/nfts"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(RefreshClockIcon,{width:"24px",height:"24px"}),isCollapsed:_,label:"Operations",to:"/operations"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(CoinIcon,{}),isCollapsed:_,label:"Tokens",to:"/tokens"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(BatchIcon,{}),isCollapsed:_,label:"Batch",to:"/batch"})]})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(MenuItem,{marginTop:"22px",icon:jsxRuntimeExports.jsx(AddressBookIcon,{}),isCollapsed:_,label:"Address Book",to:"/address-book"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(GearIcon,{}),isCollapsed:_,label:"Settings",to:"/settings"}),jsxRuntimeExports.jsx(MenuItem,{icon:jsxRuntimeExports.jsx(HelpIcon,{}),isCollapsed:_,label:"Help",to:"/help"}),jsxRuntimeExports.jsx(AppVersion,{marginTop:"24px",fontSize:"14px",textAlign:_?"center":"left",isCollapsed:_})]})]})]})},MenuItem=({icon:_,label:a,to:$,isCollapsed:j,...et})=>{const rt=useLocation().pathname.startsWith($);return jsxRuntimeExports.jsx(Link,{to:$,children:jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"flex-start",width:j?"44px":"176px",marginBottom:"8px",padding:"10px",background:rt?colors.gray[600]:"transparent",borderRadius:"4px",_hover:{background:rt?colors.gray[600]:colors.gray[800]},cursor:"pointer",...et,children:[_,!j&&jsxRuntimeExports.jsx(Text,{marginLeft:"10px",size:"sm",children:a})]})})},TotalBalance=()=>{const _=useTotalBalance(),[a]=useMediaQuery("(max-height: 900px)");return jsxRuntimeExports.jsxs(Box,{marginTop:"24px",marginBottom:a?"30px":"100px","data-testid":"total-balance",children:[jsxRuntimeExports.jsx(Text,{marginBottom:"4px",size:"sm",children:"Balance"}),_&&jsxRuntimeExports.jsx(TezRecapDisplay,{balance:_.mutez,dollarBalance:_.usd})]})},withSideMenu=_=>jsxRuntimeExports.jsxs(Flex,{height:"100vh",children:[jsxRuntimeExports.jsx(SideNavbar,{}),jsxRuntimeExports.jsx(Box,{flex:1,overflowX:"hidden",height:"100%",background:"linear-gradient(180deg, rgba(0, 231, 182, 0.35) -41.53%, rgba(0, 231, 182, 0.00) 34.71%)",paddingX:"24px",children:_})]}),AccountsImage=""+new URL("accounts-DTYOez9Q.png",import.meta.url).href,BatchImage=""+new URL("batch-CoYFN9ox.png",import.meta.url).href,MultisigImage=""+new URL("multisig-GRRIvmJS.png",import.meta.url).href;var js={},Carousel$1={},lib={},reactSwipe={},hasRequiredReactSwipe;function requireReactSwipe(){return hasRequiredReactSwipe||(hasRequiredReactSwipe=1,function(_){(function(a,$){$(_,reactExports,propTypesExports)})(commonjsGlobal,function(a,$,j){Object.defineProperty(a,"__esModule",{value:!0}),a.setHasSupportToCaptureOption=mt;var et=rt($),tt=rt(j);function rt(Tt){return Tt&&Tt.__esModule?Tt:{default:Tt}}var nt=Object.assign||function(Tt){for(var kt=1;kt=0||Object.prototype.hasOwnProperty.call(Tt,Nt)&&(Lt[Nt]=Tt[Nt]);return Lt}function at(Tt,kt){if(!(Tt instanceof kt))throw new TypeError("Cannot call a class as a function")}var st=function(){function Tt(kt,Lt){for(var Nt=0;Nt0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return dt?Tt:Tt.capture}function Ct(Tt){if("touches"in Tt){var kt=Tt.touches[0],Lt=kt.pageX,Nt=kt.pageY;return{x:Lt,y:Nt}}var zt=Tt.screenX,jt=Tt.screenY;return{x:zt,y:jt}}var Pt=function(Tt){ut(kt,Tt);function kt(){var Lt;at(this,kt);for(var Nt=arguments.length,zt=Array(Nt),jt=0;jtzt&&this.props.onSwipeRight(1,Nt),this.movePosition.deltaY<-zt?this.props.onSwipeUp(1,Nt):this.movePosition.deltaY>zt&&this.props.onSwipeDown(1,Nt)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(Nt){this.swiper=Nt,this.props.innerRef(Nt)}},{key:"render",value:function(){var Nt=this.props;Nt.tagName;var zt=Nt.className,jt=Nt.style,Mt=Nt.children;Nt.allowMouseEvents,Nt.onSwipeUp,Nt.onSwipeDown,Nt.onSwipeLeft,Nt.onSwipeRight,Nt.onSwipeStart,Nt.onSwipeMove,Nt.onSwipeEnd,Nt.innerRef,Nt.tolerance;var Dt=it(Nt,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return et.default.createElement(this.props.tagName,nt({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:zt,style:jt},Dt),Mt)}}]),kt}($.Component);Pt.displayName="ReactSwipe",Pt.propTypes={tagName:tt.default.string,className:tt.default.string,style:tt.default.object,children:tt.default.node,allowMouseEvents:tt.default.bool,onSwipeUp:tt.default.func,onSwipeDown:tt.default.func,onSwipeLeft:tt.default.func,onSwipeRight:tt.default.func,onSwipeStart:tt.default.func,onSwipeMove:tt.default.func,onSwipeEnd:tt.default.func,innerRef:tt.default.func,tolerance:tt.default.number.isRequired},Pt.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},a.default=Pt})}(reactSwipe)),reactSwipe}(function(_){(function(a,$){$(_,requireReactSwipe())})(commonjsGlobal,function(a,$){Object.defineProperty(a,"__esModule",{value:!0});var j=et($);function et(tt){return tt&&tt.__esModule?tt:{default:tt}}a.default=j.default})})(lib);var cssClasses={},classnames={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames diff --git a/index.html b/index.html index 5f6d82c988..28a317565a 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ --> Umami - +