{"version":3,"file":"js/639.3eb494f0.js","sources":["webpack://frontend/./src/icons/BackIcon.vue","webpack://frontend/./src/icons/BackIcon.vue?88ba","webpack://frontend/./src/views/SearchView.vue?faf7","webpack://frontend/./src/views/SearchView.vue","webpack://frontend/./src/views/SearchView.vue?f97a"],"sourceRoot":"","sourcesContent":["\n","import { render } from \"./BackIcon.vue?vue&type=template&id=45539604\"\nconst script = {}\n\nimport exportComponent from \"../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, vShow as _vShow, withDirectives as _withDirectives, createVNode as _createVNode, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, withCtx as _withCtx, Fragment as _Fragment } from \"vue\"\n\nconst _hoisted_1 = { class: \"fixed inset-0 z-30 bg-black flex items-center justify-center h-full overflow-hidden\" }\nconst _hoisted_2 = { class: \"absolute flex bottom-0 min-w-full bg-black bg-opacity-50 py-4 items-center justify-center space-x-12\" }\nconst _hoisted_3 = {\n for: \"search-input-search\",\n class: \"text-white inline-block cursor-pointer hover:text-gray-500\",\n title: \"upload image\"\n}\n\nimport { onBeforeUnmount, onMounted, ref } from 'vue';\n\nimport SpinnerComponent from '@/components/common/SpinnerComponent.vue';\n\nimport BackIcon from '@/icons/BackIcon.vue';\nimport UploadIcon from '@/icons/UploadIcon.vue';\nimport { useLoadingStore } from '@/stores/loading';\n\nimport camera from '@/composables/camera';\nimport { useSearch } from '@/composables/search';\n\n\n\nexport default /*@__PURE__*/_defineComponent({\n __name: 'SearchView',\n setup(__props) {\n\nconst video = ref(null);\nconst canvas = ref(null);\nconst hasCamera = ref(true);\nconst loadingStore = useLoadingStore();\nconst { predictFromVideo, predictFromUpload } = useSearch();\n\nconst handleKeys = async (e: KeyboardEvent): Promise => {\n if (e.code === 'Space') {\n await predictFromVideo(video.value, canvas.value);\n }\n};\n\nonMounted(() => {\n if (video.value) {\n camera.startCamera(video.value, hasCamera);\n }\n window.addEventListener('keyup', handleKeys);\n});\n\nonBeforeUnmount(() => {\n if (video.value) {\n camera.stopCamera(video.value);\n }\n window.removeEventListener('keyup', handleKeys);\n});\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_link = _resolveComponent(\"router-link\")!\n\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n (_unref(loadingStore).isLoading)\n ? (_openBlock(), _createBlock(SpinnerComponent, { key: 0 }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"video\", {\n ref_key: \"video\",\n ref: video,\n autoplay: \"\",\n playsinline: \"\",\n muted: \"\",\n class: \"absolute w-auto min-w-full min-h-full max-w-none\"\n }, null, 512),\n _withDirectives(_createElementVNode(\"canvas\", {\n ref_key: \"canvas\",\n ref: canvas,\n class: \"absolute w-auto min-w-full min-h-full max-w-none\"\n }, null, 512), [\n [_vShow, _unref(loadingStore).isLoading]\n ]),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"label\", _hoisted_3, [\n _createVNode(UploadIcon, { class: \"w-8 h-8\" })\n ]),\n _createElementVNode(\"input\", {\n type: \"file\",\n accept: \"image/*\",\n onChange: _cache[0] || (_cache[0] = (event) => _unref(predictFromUpload)(event.target as HTMLInputElement, canvas.value)),\n id: \"search-input-search\",\n class: \"hidden\"\n }, null, 32),\n (hasCamera.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n onClick: _cache[1] || (_cache[1] = () => _unref(predictFromVideo)(video.value, canvas.value)),\n class: \"text-white inline-block cursor-pointer w-16 h-16 border-white border-2 rounded-full flex items-center justify-center\",\n title: \"take a photo\"\n }, _cache[2] || (_cache[2] = [\n _createElementVNode(\"div\", { class: \"inline-block bg-white w-14 h-14 rounded-full hover:bg-opacity-75\" }, null, -1)\n ])))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_router_link, {\n class: \"text-white inline-block cursor-pointer hover:text-gray-500\",\n to: \"/\",\n title: \"go back\"\n }, {\n default: _withCtx(() => [\n _createVNode(BackIcon, { class: \"w-8 h-8\" })\n ]),\n _: 1\n })\n ])\n ])\n ], 64))\n}\n}\n\n})","\n\n\n","import script from \"./SearchView.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./SearchView.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__"],"names":["xmlns","fill","viewBox","stroke","_createElementBlock","_hoisted_1","_cache","_createElementVNode","d","script","__exports__","render","class","_hoisted_2","_hoisted_3","for","title","_defineComponent","__name","setup","__props","video","ref","canvas","hasCamera","loadingStore","useLoadingStore","predictFromVideo","predictFromUpload","useSearch","handleKeys","async","e","code","value","onMounted","camera","startCamera","window","addEventListener","onBeforeUnmount","stopCamera","removeEventListener","_ctx","_component_router_link","_resolveComponent","_openBlock","_Fragment","_unref","isLoading","_createBlock","SpinnerComponent","key","_createCommentVNode","ref_key","autoplay","playsinline","muted","_withDirectives","_vShow","_createVNode","UploadIcon","type","accept","onChange","event","target","id","onClick","to","default","_withCtx","BackIcon","_"],"mappings":";;mMACSA,MAAM,6BAA6BC,KAAK,OAAOC,QAAQ,YAAY,eAAa,MAAMC,OAAO,gB,kCAAlGC,EAAAA,EAAAA,IAEM,MAFNC,EAEMC,EAAA,KAAAA,EAAA,KADFC,EAAAA,EAAAA,IAAoG,QAA9F,iBAAe,QAAQ,kBAAgB,QAAQC,EAAE,4C,0BCD/D,MAAMC,EAAS,CAAC,EAGVC,GAA2B,OAAgBD,EAAQ,CAAC,CAAC,SAASE,KAEpE,Q,wCCHA,MAAMN,EAAa,CAAEO,MAAO,uFACtBC,EAAa,CAAED,MAAO,wGACtBE,EAAa,CACjBC,IAAK,sBACLH,MAAO,6DACPI,MAAO,gBAgBT,OAA4BC,EAAAA,EAAAA,IAAiB,CAC3CC,OAAQ,aACRC,KAAAA,CA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