1import{M as n}from"./MapSound-D7nbLdWW.js";import{aK as l,an as u,bn as d}from"./App-BlOGmO9g.js";import{g as m,S as a,e as g,I as f}from"./FixSpinePlugin-DiEGCSkI.js";import{G as c}from"./GetAssetPath-D1U8ycN4.js";import{C as h}from"./Consts-7dmw_rEH.js";import"./howler-SVOLQxu6.js";import"./index-Dcy1tFaY.js";import"./Button-CUxiOft3.js";import"./polished.esm-9CA2z3Zz.js";import"./inheritsLoose-CFKjdpr9.js";import"./mobxreact.esm-B4bS6DcA.js";import"./index-vm9hVe9r.js";import"./QuizTypes-SHiKhVER.js";import"./MapModeType-BXMqp17U.js";import"./TutorialConsts-CWe09mqN.js";import"./ActionButton-CMcYQfmQ.js";import"./index-B4Md0EsT.js";import"./playSound-CR8YlazW.js";import"./index-DxEBONtJ.js";import"./context-DlowcCd4.js";import"./FontAwesomeIcon-D2UqZQEy.js";import"./Centered-C5sj4Dfb.js";import"./CapitalizeFirstLetter-BbjzObVf.js";import"./index-BxlhiTeK.js";import"./motion-CqMsCn7w.js";import"./index-By4gUW5W.js";import"./index-DaNATshx.js";import"./EditOutlined-BAL8LbHN.js";import"./styleChecker-D5L2TqP-.js";import"./index-BOjfgH98.js";import"./CheckOutlined-Uq9jJiGY.js";import"./CopyOutlined-B0aqKX4d.js";import"./SixteenByNineScaler-6sRX0mT7.js";import"./index-6SiUO94k.js";import"./index-C6mZxfbt.js";import"./index-BDkuXMYU.js";import"./progress-CrDH-viY.js";import"./ElementIds-BgXDJmRJ.js";import"./SeasonTicketName-BN_q1-rH.js";import"./useQuery-DpFLT4Gy.js";import"./___vite-browser-external_commonjs-proxy-BLwQMALO.js";import"./util-B6_QydWp.js";import"./util-Bx3BnOd_.js";import"./Shortcut-CupZFxTN.js";import"./Names-DfDh6qGd.js";import"./useWillUnmount-BGM4Ny_k.js";import"./CircularProgress-Bun-fazV.js";import"./clsx.m-epcrg5mr.js";import"./index-C1hqt1Ug.js";import"./AccessibleAnchor-D0-8Y4NG.js";import"./index-toH0QDea.js";import"./use-force-update-DkckTXVJ.js";import"./GimkitLiveQuestion-CFSF97dm.js";import"./Text-FYaGmkKL.js";import"./getCloudinaryUrl-Drn97BLG.js";import"./LazyLatexRenderer-qdZBVXqD.js";import"./Tooltip-D122G6nv.js";import"./use-motion-value-p0Lc2eXE.js";import"./index-CRIlUwkL.js";import"./index-BJ0CjMgE.js";import"./useIntervalWhen-DCi6d6Q1.js";import"./index-DidzyGiJ.js";import"./move-Cv8ZdGnp.js";import"./react-flip-move.es-DM3ckaJz.js";import"./sounds--5UYNuke.js";import"./App-CTzrpJQ4.js";import"./AnimatedBackground-Cgo12375.js";import"./useDebouncedValue-BaFicexy.js";import"./MapStyle-TMfqPjvX.js";import"./FillRemainingSpace-BnY_DKqx.js";import"./index-Dd84QHlP.js";const y={imageId:"music_device",imageUrl:c("devices/music/music-device.png")};var i=(o=>(o.stopped="stopped",o.playing="playing",o.fadingOut="fadingOut",o))(i||{});const t=new Map,p=new Map;class Dt extends l{constructor(e){if(super(e),this.onMasterVolumeChange=()=>{this.howl&&this.howl.volume(m({volume:this.options.volume/100,type:a.music}))},this.onStateChange=s=>{s==="currentState"&&(this.state.currentState===i.playing?this.play():this.state.currentState===i.stopped?this.stop():this.state.currentState===i.fadingOut&&this.fadeOut())},this.onDestroy=s=>{var r;s.isBeingReplaced||((r=t.get(this.id))==null||r.unload(),t.delete(this.id),p.delete(this.id))},g()&&u()){if(!t.get(this.id)){const r=new n({src:[d(this.options.audioUrl)],volume:this.options.volume/100,preload:!0,loop:!0});t.set(this.id,r)}this.state.currentState===i.playing&&this.play(),this.state.currentState===i.stopped&&this.isPlaying&&this.stop()}f()&&(this.parts.add.sprite(y),t.delete(this.id))}get howl(){return t.get(this.id)}get isPlaying(){return p.get(this.id)||!1}set isPlaying(e){p.set(this.id,e)}play(){!this.howl||this.isPlaying||(this.howl.volume(0),this.howl.play(),this.isPlaying=!0,this.howl.fade(0,m({volume:this.options.volume/100,type:a.music}),h.fadeInTime))}stop(){!this.howl||!this.isPlaying||(this.howl.stop(),this.isPlaying=!1)}fadeOut(){!this.howl||!this.isPlaying||(this.howl.fade(this.howl.volume(),0,h.fadeOutTime),this.isPlaying=!1)}}export{Dt as MusicDevice,Dt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.