;(function(){System.register(['./index-legacy.104980d7.js','./index-legacy.09964bee.js','./index-legacy.a46536b0.js','./header-legacy.78b148f6.js','./vendor-legacy.031e1374.js','./music-legacy.9bfa98dd.js','./index-legacy.f25f109a5.js','./index-legacy.f25f109a6.js','./index-legacy.edec5e29.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a3.js','./index-legacy.1cd7b6bb.js','./item-legacy.20e87ec2.js','./index-legacy.f25f109a4.js','./footer-legacy.015c48d6.js','./favorite-legacy.403f54ea.js','./select-tag-legacy.8087e2bf.js','./index-legacy.f25f109a10.js','./index-legacy.f25f109a13.js','./index-legacy.f25f109a14.js','./index-legacy.6e10cd37.js','./item-legacy.a4c36c80.js','./init-user-icon-legacy.6fbc494f.js','./index.module-legacy.c95c0685.js','./orderStatus-legacy.071c8548.js','./index-legacy.c75fe8a2.js','./index-legacy.637f35562.js','./index-legacy.637f35563.js'],function(exports){'use strict';var useLocalStorage,AlbumList,MusicList,mitter,styles,defineComponent,ref,useRoute,useRouter,onMounted,onUnmounted,createVNode,getRandomKey,musicBuy;return{setters:[function(module){useLocalStorage=module.c;},function(module){AlbumList=module["default"];},function(module){MusicList=module["default"];},function(module){mitter=module.m;styles=module.s;},function(module){defineComponent=module.d;ref=module.V;useRoute=module._;useRouter=module.a2;onMounted=module.a4;onUnmounted=module.a5;createVNode=module.a;},function(module){getRandomKey=module.g;musicBuy=module.m;},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var index=exports('default',defineComponent({name:'MusicSearch',emits:['confirm'],setup:function setup(){ref();localStorage.setItem('behaviorId',getRandomKey());var route=useRoute();var router=useRouter();ref(false);var keyword=ref(route.query.keyword||'');var tagids=ref(route.query.tagids||'');ref([]);ref([]);var tagVisibility=ref(false);var words=useLocalStorage('music-search',[]);var activeTab=ref('songe');var onSearch=function onSearch(val){var _activeRef$value$onSe,_activeRef$value;keyword.value=val;var indexOf=words.value.indexOf(val);if(indexOf>-1){words.value.splice(indexOf,1);}if(val){words.value.unshift(val);words.value.length=Math.min(words.value.length,5);}var activeRef=activeTab.value==='album'?albumList:musicList;console.log(val);(_activeRef$value$onSe=(_activeRef$value=activeRef.value).onSearch)===null||_activeRef$value$onSe===void 0?void 0:_activeRef$value$onSe.call(_activeRef$value,val);// FetchList()
};var onComfirm=function onComfirm(tags){var _activeRef$value$onCo,_activeRef$value2;var data=Object.values(tags).flat().filter(Boolean).join(',');tagids.value=data;// FetchList()
var activeRef=activeTab.value==='album'?albumList:musicList;(_activeRef$value$onCo=(_activeRef$value2=activeRef.value).onComfirm)===null||_activeRef$value$onCo===void 0?void 0:_activeRef$value$onCo.call(_activeRef$value2,tags);tagVisibility.value=false;};var albumList=ref(null);var musicList=ref(null);var changeTab=function changeTab(val){activeTab.value=val;};onMounted(function(){mitter.on('changeTab',changeTab);mitter.on('search',onSearch);mitter.on('confirm',onComfirm);// ;(activeRef.value as any).onSearch?.('')
// console.log(searchInputRef.value)
});onUnmounted(function(){mitter.off('changeTab',changeTab);mitter.off('search',onSearch);mitter.off('confirm',onComfirm);});return function(){return createVNode("div",{"class":styles.search},[activeTab.value==='album'?createVNode(AlbumList,{"hideSearch":true,"ref":albumList,"defauleParams":{search:keyword.value,tagids:tagids.value}},null):createVNode(MusicList,{"hideSearch":true,"ref":musicList,"onItemClick":function onItemClick(item){musicBuy(item,function(path){router.push({path:path,query:{orderType:'MUSIC'}});});},"defauleParams":{search:keyword.value,tagids:tagids.value}},null)]);};}}));}};});})();
