jinabox
Version:
A lightweight, customizable omnibox. Useful for searching text, images, videos, audios or all other kinds data with a Jina backend.
1 lines • 63.5 kB
JavaScript
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;e.length>n;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function i(t){for(var e=1;arguments.length>e;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?a(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t,e,n){return(l=s()?Reflect.construct:function(t,e,n){var a=[null];a.push.apply(a,e);var i=new(Function.bind.apply(t,a));return n&&c(i,n.prototype),i}).apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return(d=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,r(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)})(t)}function u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function g(t){var e=s();return function(){var n,a=r(t);if(e){var i=r(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return u(this,n)}}function M(t){return function(t){if(Array.isArray(t))return j(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return j(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=Array(e);e>n;n++)a[n]=t[n];return a}var v=["type or drag anything to search","powered by Jina","unleash your curiosity and happy searching"],h={resultsLocation:"dropdown",typewriterEffect:!1,typewriterDelayCharacter:50,typewriterDelayItem:1e3,userMediaHeight:500,userMediaWidth:300,theme:"default",searchIcon:"color",floaterIcon:"color",showDropzone:!0,acceptAudio:!0,acceptVideo:!0,acceptText:!0,acceptImage:!0};function I(t){return new Promise((function(e,n){setTimeout((function(){return e()}),1e3*t)}))}function w(t){return"true"===(t+"").toLowerCase()}var y={color:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIi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jEzNC0wLjE5NiwxMS4zMTJzOC4xMzQsMy4yNjYsMTEuMzEyLDAuMTk2YzAuMDY3LTAuMDY0LDAuMTMyLTAuMTMsMC4xOTYtMC4xOTZMMjQ4LjA5OCwyNTkuMzEgICAgbDIzNC4zNDQsMjM0LjM0NGMzLjE3OCwzLjA3LDguMjQyLDIuOTgyLDExLjMxMi0wLjE5NmMyLjk5NS0zLjEsMi45OTUtOC4wMTYsMC0xMS4xMTZMMjU5LjQxLDI0Ny45OTh6IiBmaWxsPSIjMDAwMDAwIi8+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==",gridView:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-grid'%3E%3Crect x='3' y='3' width='7' height='7'%3E%3C/rect%3E%3Crect x='14' y='3' width='7' height='7'%3E%3C/rect%3E%3Crect x='14' y='14' width='7' height='7'%3E%3C/rect%3E%3Crect x='3' y='14' width='7' height='7'%3E%3C/rect%3E%3C/svg%3E",listView:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-list'%3E%3Cline x1='8' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='8' y1='18' x2='21' y2='18'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'%3E%3C/line%3E%3C/svg%3E",arrow_right:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-arrow-right'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3Cpolyline points='12 5 19 12 12 19'%3E%3C/polyline%3E%3C/svg%3E",camera:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-camera'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'%3E%3C/path%3E%3Ccircle cx='12' cy='13' r='4'%3E%3C/circle%3E%3C/svg%3E",camera_off:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-camera-off'%3E%3Cline x1='1' y1='1' x2='23' y2='23'%3E%3C/line%3E%3Cpath d='M21 21H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3m3-3h6l2 3h4a2 2 0 0 1 2 2v9.34m-7.72-2.06a4 4 0 1 1-5.56-5.56'%3E%3C/path%3E%3C/svg%3E",mic:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-mic'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'%3E%3C/path%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'%3E%3C/path%3E%3Cline x1='12' y1='19' x2='12' y2='23'%3E%3C/line%3E%3Cline x1='8' y1='23' x2='16' y2='23'%3E%3C/line%3E%3C/svg%3E",pause:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-pause'%3E%3Crect x='6' y='4' width='4' height='16'%3E%3C/rect%3E%3Crect x='14' y='4' width='4' height='16'%3E%3C/rect%3E%3C/svg%3E",play:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-play'%3E%3Cpolygon points='5 3 19 12 5 21 5 3'%3E%3C/polygon%3E%3C/svg%3E",stop:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-square'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3C/svg%3E",video:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-video'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'%3E%3C/polygon%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'%3E%3C/rect%3E%3C/svg%3E",close:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-x'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E",filePlus:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-file-plus'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3Cline x1='12' y1='18' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='9' y1='15' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E",monitor:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-monitor'%3E%3Crect x='2' y='3' width='20' height='14' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='8' y1='21' x2='16' y2='21'%3E%3C/line%3E%3Cline x1='12' y1='17' x2='12' y2='21'%3E%3C/line%3E%3C/svg%3E",radio:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-radio'%3E%3Ccircle cx='12' cy='12' r='2'%3E%3C/circle%3E%3Cpath d='M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14'%3E%3C/path%3E%3C/svg%3E"},p=function(e){o(a,e);var n=g(a);function a(){var e;t(this,a),(e=n.call(this)).typeWriter=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e3;n||(e.searchInput.placeholder="");var r=t[a];r.length>n?(e.searchInput.placeholder+=r.charAt(n),n++,setTimeout(e.typeWriter,i,t,n,a,i,o)):void 0===t[++a]?setTimeout(e.typeWriter,o,t,0,0,i,o):setTimeout(e.typeWriter,o,t,n=0,a,i,o)},e.search=async function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[e.searchInput.value],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;console.log("query: ",n),a&&1>=n.length||(e.searchIcon.src=e.defaultSearchIcon,e.searchIcon.classList.remove("jina-border-right"));for(var o=0;n.length>o;++o){console.log("acceptVideo",e.settings.acceptVideo),console.log("acceptImage",e.settings.acceptImage),console.log("acceptAudio",e.settings.acceptAudio),console.log("acceptText",e.settings.acceptText);var r=n[o];if(r.startsWith("data:image")&&!w(e.settings.acceptImage))return e.showError("Images are not accepted");if(r.startsWith("data:video")&&!w(e.settings.acceptVideo))return e.showError("Video queries are not accepted");if(r.startsWith("data:audio")&&!w(e.settings.acceptAudio))return e.showError("Audio queries are not accepted");if(!r.startsWith("data")&&!w(e.settings.acceptText))return e.showError("Text queries are not accepted")}"live"!==e.searchType&&e.showLoading(),console.log("searching");var c=new Date;try{t=await window.JinaBox.search(n,16,a)}catch(t){return console.log("error"),e.showError(t)}var s=new Date,l=Math.round((s-c)/10)/100;console.log("response:",t);var d=[],u=[],g=0,M=!1,j=!1,v=!0,h=t.data.docs,I=t.status||{},y=I.code,p=I.description;if("ERROR"==y)return e.showError(p);for(var D=0;h.length>D;++D){var N=h[D];console.log("docResults",N);var m=N.matches,z=N.uri,C=N.mime_type,L=C;u.push({uri:z,mimeType:L}),L.includes("image")&&(M=!0);for(var T=m,f=0;T.length>f;++f){var E=T[f];d[D]||(d[D]=[]);var x=void 0,O=void 0,b=void 0,A=void 0;A=E.score.value,E.matchDoc?(b=E.matchDoc.mime_type,x=E.matchDoc.uri,O=E.matchDoc.text):(b=E.mime_type,x=E.uri,O=E.text),b.includes("text")&&(v=!1,j=!0),b.includes("image")||(v=!1);var k={mimeType:b,data:x,text:O,score:A};console.log("result",k),d[D].push(k),g++}}e.queries=u,e.results=d,e.resultsMeta={totalTime:l,totalResults:g,resultsContainText:j,queriesContainMedia:M,onlyImages:v},console.log("resultsMeta:",e.resultsMeta),e.resultsIndex=0,e.showResults(0,i)},e.listenForEnter=function(t){13==t.keyCode&&e.search()},e.preventDefaults=function(t){t.preventDefault(),t.stopPropagation()},e.handleDrop=async function(t){e.dropped=!0;var n,a=t.dataTransfer,i=a.getData("Text"),o=a.getData("URL");if(console.log("text: ",i),console.log("imgsrc: ",o),o)if(o.startsWith("data:"))e.search([o],!0),e.searchIcon.src=o,e.searchIcon.classList.add("jina-border-right");else{var r;try{r=await(n=o,new Promise((function(t,e){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.open("GET","".concat(n)),a.onload=function(){var e,n,i,o;i=new Uint8Array(a.response),n=[].map.call(i,(function(t){return String.fromCharCode(t)})).join(""),e="data:"+((o=a.getResponseHeader("content-type"))?o+";":"")+"base64,"+btoa(n),t(e)},a.onerror=function(t){console.log("xhr error:",t),e(t)},a.send()})))}catch(t){r=o}console.log("dataUri:",r),e.searchIcon.src=r,e.searchIcon.classList.add("jina-border-right"),e.search([o],!0)}else i?(e.searchInput.value=i,e.search()):function(){var t=a.files,n=[];console.log("files: ",t);for(var i=function(a){var i=t[a],o=new FileReader;o.addEventListener("load",(function(){var a=o.result;n.push(a),n.length===t.length&&(e.search(n,!0),2>n.length&&(e.searchIcon.src=n[0],e.searchIcon.classList.add("jina-border-right"))),console.log("processed: ",a)}),!1),o.readAsDataURL(i)},o=0;t.length>o;++o)i(o)}()},e.handleUpload=function(t){var n=t.target.files,a=[];console.log("files: ",n);for(var i=function(t){var i=n[t],o=new FileReader;o.addEventListener("load",(function(){var t=o.result;a.push(t),a.length===n.length&&(e.search(a,!0),2>a.length&&(e.searchIcon.src=a[0],e.searchIcon.classList.add("jina-border-right"))),console.log("processed: ",t)}),!1),o.readAsDataURL(i)},o=0;n.length>o;++o)i(o)},e.showContentContainer=function(){e.overlay&&(e.overlay.style.display="block",e.overlay.style.opacity="1"),e.contentContainer.style.height="auto",e.contentContainer.style.opacity=1},e.clearContentContainer=function(){e.dropped=!1,e.searchType="",e.overlay&&(e.overlay.style.display="none",e.overlay.style.opacity="0"),e.contentContainer.innerHTML=e.defaultContent||""},e.handleDrag=function(){e.dragCounter++,e.highlighted||(w(e.settings.showDropzone)&&e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t\t<div class="jina-dropdown-message jina-ready unselectable">\n \t\t\t<div class="jina-face"><div class="eye"></div><div class="eye right"></div><div class="mouth happy"></div></div>\n \t\t\t<div class="jina-shadow jina-scale"></div>\n\t\t\t\t\t<h4 class="alert">Drop here</h4>\n\t\t\t\t\t<p>Drop any content here from webpage/local to search</p>\n\t\t\t\t</div>\n\t\t\t\t',e.highlighted=!0)},e.handleDragLeave=function(){e.dragCounter--,1>e.dragCounter&&(e.searchInput.classList.remove("jina-highlighted"),e.dropped||e.clearExpander(),e.dragCounter=0)},e.showInputOptions=async function(){e.clearMedia(),e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t<div class="jina-input-options">\n\t\t\t\t<input type="file" class="jina-expander-file-input" multiple>\n\t\t\t\t<button class="jina-expander-file-input-trigger"><img src="'.concat(y.filePlus,'"> Upload Files</button>\n\t\t\t\t<button class="jina-expander-capture-media-button"><img src="').concat(y.camera,'"> Camera</button>\n\t\t\t\t').concat(window.MediaRecorder?'<button class="jina-expander-capture-audio-button"><img src="'.concat(y.mic,'"> Audio</button>'):"","\n\t\t\t\t").concat(navigator.mediaDevices&&(navigator.mediaDevices.getDisplayMedia||navigator.getDisplayMedia)?'<button class="jina-expander-capture-screen-button"><img src="'.concat(y.monitor,'"> Screen Capture</button>'):"","\n\t\t\t\t\n\t\t\t</div>\n\t\t"),e.getElement("jina-expander-file-input-trigger").onclick=function(){return e.getElement("jina-expander-file-input").click()},e.getElement("jina-expander-file-input").addEventListener("change",e.handleUpload);var t=e.getElement("jina-expander-capture-media-button");t&&t.addEventListener("click",e.showCaptureMedia);var n=e.getElement("jina-expander-capture-audio-button");n&&n.addEventListener("click",e.showCaptureAudio);var a=e.getElement("jina-expander-capture-screen-button");a&&a.addEventListener("click",e.showCaptureScreen)},e.showCaptureMedia=async function(t){e.searchType="capture",e.useVideo=!0,e.useAudio=!0;try{e.showLoading("Accessing Device Media"),e.mediaStream=await e.getUserMediaStream()}catch(t){return console.log("error"),console.log(t),e.showError("Could not access media. Please ensure permission is granted.")}e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t<div class="jina-media-container">\n\t\t\t\t<canvas class="jina-media-capture-canvas">\n\t\t\t\t</canvas>\n\t\t\t\t<div class="jina-input-controls">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<input type="file" name="video" accept="video/*" capture style="display: none;" class="jina-video-input-button">\n\t\t\t\t\t\t<img src="'.concat(y.camera,'"/>\n\t\t\t\t\t\t<select class="jina-select jina-small jina-video-select">\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<img src="').concat(y.mic,'"/>\n\t\t\t\t\t\t<select class="jina-select jina-small jina-audio-select">\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="jina-media-preview-container">\n\t\t\t\t\t<button class="jina-media-live-button">\n\t\t\t\t\t<div class="jina-live-icon"></div> Live Search\n\t\t\t\t\t</button>\n\t\t\t\t\t<video class="jina-capture-preview" width="100%" style="display: block;" autoplay muted playsinline></video>\n\t\t\t\t\t<button class="jina-media-screen-button" style="display:none;"></button>\n\t\t\t\t</div>\n\t\t\t\t<div class="jina-media-controls-container jina-media-controls">\n\t\t\t\t<button class="jina-media-button jina-take-photo-button"><img src="').concat(y.camera,'"></button>\n\t\t\t\t<button class="jina-media-button jina-record-video-button"><img src="').concat(y.video,'"></button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t'),e.capturePreview=e.getElement("jina-capture-preview"),e.videoInputButton=e.getElement("jina-video-input-button"),e.videoSelect=e.getElement("jina-video-select"),e.audioSelect=e.getElement("jina-audio-select"),e.captureCanvas=e.getElement("jina-media-capture-canvas"),e.captureCanvas.width=0,e.captureCanvas.height=0,e.captureCanvas.style.display="none",e.audioSelect.onchange=function(){return e.updateStreamSource(e.showCaptureMedia)},e.videoSelect.onchange=function(){return e.updateStreamSource(e.showCaptureMedia)},e.capturePreview.srcObject=e.mediaStream,await e.getMediaDevices(),e.audioSource&&(e.audioSelect.selectedIndex=M(e.audioSelect.options).findIndex((function(t){return t.value===e.audioSource}))),e.videoSource&&(e.videoSelect.selectedIndex=M(e.videoSelect.options).findIndex((function(t){return t.value===e.videoSource}))),e.videoInputButton.addEventListener("change",e.handleUpload),e.getElement("jina-take-photo-button").onclick=e.capturePhoto,e.getElement("jina-record-video-button").onclick=window.MediaRecorder?e.startMediaRecord:function(){return e.videoInputButton.click()},e.getElement("jina-media-live-button").onclick=e.showLiveSearch,e.previousCapture=e.showCaptureMedia},e.showCaptureScreen=async function(){e.searchType="capture",e.useVideo=!0,e.useAudio=!0;try{e.showLoading("Accessing Screen Capture"),e.mediaStream=await e.getScreenMediaStream()}catch(t){return console.log("error"),console.log(t),e.showError("Could not access screen capture. Please ensure permission is granted.")}e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t<div class="jina-media-container">\n\t\t\t\t<canvas class="jina-media-capture-canvas">\n\t\t\t\t</canvas>\n\t\t\t\t<div class="jina-media-preview-container">\n\t\t\t\t\t<button class="jina-media-live-button">\n\t\t\t\t\t<div class="jina-live-icon"></div> Live Search\n\t\t\t\t\t</button>\n\t\t\t\t\t<video class="jina-capture-preview" width="100%" style="display: block;" autoplay muted playsinline></video>\n\t\t\t\t\t<button class="jina-media-screen-button" style="display:none;"></button>\n\t\t\t\t</div>\n\t\t\t\t<div class="jina-media-controls-container jina-media-controls">\n\t\t\t\t<button class="jina-media-button jina-take-photo-button"><img src="'.concat(y.camera,'"></button>\n\t\t\t\t<button class="jina-media-button jina-record-video-button"><img src="').concat(y.video,'"></button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t'),e.capturePreview=e.getElement("jina-capture-preview"),e.captureCanvas=e.getElement("jina-media-capture-canvas"),e.captureCanvas.width=0,e.captureCanvas.height=0,e.captureCanvas.style.display="none",e.capturePreview.srcObject=e.mediaStream,e.getElement("jina-take-photo-button").onclick=e.capturePhoto,e.getElement("jina-record-video-button").onclick=window.MediaRecorder?e.startMediaRecord:function(){return e.videoInputButton.click()},e.getElement("jina-media-live-button").onclick=e.showLiveSearch,e.previousCapture=e.showCaptureScreen},e.showCaptureAudio=async function(){e.searchType="capture",e.useVideo=!1,e.useAudio=!0;try{e.showLoading("Accessing Audio"),e.mediaStream=await e.getUserMediaStream()}catch(t){return console.log(t),e.showError("Could not access audio. Please ensure permission is granted.")}e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t<div class="jina-media-container">\n\t\t\t\t<div class="jina-input-controls">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<img src="'.concat(y.mic,'"/>\n\t\t\t\t\t\t<select class="jina-select jina-small jina-audio-select">\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="jina-media-controls" style="margin-top:2em; margin-bottom:2em;">\n\t\t\t\t<button class="jina-media-button jina-record-audio-button"><img src="').concat(y.mic,'"></button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t'),e.audioSelect=e.getElement("jina-audio-select"),e.audioSelect.onchange=function(){return e.updateStreamSource(e.showCaptureAudio)},await e.getMediaDevices(),e.audioSource&&(e.audioSelect.selectedIndex=M(e.audioSelect.options).findIndex((function(t){return t.value===e.audioSource}))),e.getElement("jina-record-audio-button").onclick=function(){return e.startMediaRecord()},e.previousCapture=e.showCaptureAudio},e.showLiveSearch=async function(){e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t<div class="jina-live-container">\n\t\t\t\t<canvas class="jina-media-capture-canvas">\n\t\t\t\t</canvas>\n\t\t\t\t<div class="jina-live-header">\n\t\t\t\t\t<div class="jina-live-header-item" style="text-align: left;">\n\t\t\t\t\t\t<button class="jina-live-button jina-live-cancel-button">\n\t\t\t\t\t\t\t<img src="'.concat(y.close,'">\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="jina-live-header-item" style="margin-top: .5em;text-align:center;">\n\t\t\t\t\t<div class="jina-live-icon jina-pulse" ></div> Live Search\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="jina-live-header-item" style="text-align: right;">\n\t\t\t\t\t\t<button class="jina-live-button jina-live-toggle-button">\n\t\t\t\t\t\t\t<img src="').concat(y.pause,'">\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="jina-live-results-area">\n\t\t\t\t\t<div class="jina-sea">\n\t\t\t\t\t\t<span class="jina-wave"></span>\n\t\t\t\t\t\t<span class="jina-wave"></span>\n\t\t\t\t\t\t<span class="jina-wave"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<video class="jina-live-preview jina-capture-preview" autoplay muted width="33%"></video>\n\t\t\t</div>\n\t\t\t');var t=e.getElement("jina-live-preview");e.captureCanvas=e.getElement("jina-media-capture-canvas"),e.captureCanvas.width=0,e.captureCanvas.height=0,e.captureCanvas.style.display="none",e.liveIcon=e.getElement("jina-live-icon"),e.getElement("jina-live-cancel-button").onclick=function(){e.liveSearchActive=!1,e.liveInterval&&(clearInterval(e.liveInterval),e.liveInterval=!1),e.showCaptureMedia()},t.srcObject=e.mediaStream,e.searchType="live",t.oncanplaythrough=function(){return setTimeout(e.startLiveSearch,50)},e.getElement("jina-live-toggle-button").onclick=e.toggleLiveSearch},e.getUserMediaStream=function(){e.clearMedia();var t={};return e.useVideo&&(t.video={deviceId:e.videoSource?{exact:e.videoSource}:void 0,width:{ideal:e.settings.userMediaWidth},height:{ideal:e.settings.userMediaHeight},facingMode:"environment"}),e.useAudio&&(t.audio={deviceId:e.audioSource?{exact:e.audioSource}:void 0}),console.log("userMedia constraints: ",t),navigator.mediaDevices.getUserMedia(t)},e.getScreenMediaStream=async function(){e.clearMedia();var t=e.useAudio;return navigator.mediaDevices.getDisplayMedia?navigator.mediaDevices.getDisplayMedia({video:!0,audio:t}):navigator.getDisplayMedia?navigator.getDisplayMedia({video:!0,audio:t}):await navigator.mediaDevices.getUserMedia({video:{mediaSource:"screen"},audio:t})},e.updateStreamSource=async function(t){if(e.clearMedia(),e.useAudio&&(e.audioSource=e.audioSelect.value),e.useVideo&&(e.videoSource=e.videoSelect.value),t==e.showCaptureMedia)return t();try{e.showLoading("Accessing Device Media"),e.mediaStream=await e.getUserMediaStream()}catch(t){return console.log(t),e.showError("Could not access media. Please ensure permission is granted.")}return t()},e.clearMedia=function(){e.liveSearchActive=!1,e.liveInterval&&clearInterval(e.liveInterval),e.mediaStream&&e.mediaStream.getTracks().forEach((function(t){t.stop()}))},e.showReviewMedia=async function(){e.clearMedia();var t=e.recordedMedia,n=t.type,a=t.dataURI;console.log("recorded media:",e.recordedMedia),e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t<div class="jina-media-container">\n\t\t\t\t<button class="jina-media-cancel-button">\n\t\t\t\t<img src="'.concat(y.close,'">\n\t\t\t\t</button>\n\t\t\t\t').concat("video"===n?'<video src="'.concat(a,'" width="100%" autoplay muted playsinline loop style="display: block;"></video>'):"audio"===n?'<audio src="'.concat(a,'" controls autoplay loop style="margin-top: 5em; margin-bottom:5em; display:block"></audio>'):'<img src="'.concat(a,'" width="100%">'),'\n\t\t\t\t<div class="jina-media-search-button-container">\n\t\t\t\t<button class="jina-media-search-button">\n\t\t\t\tsearch <img src="').concat(y.arrow_right,'">\n\t\t\t\t</button\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t'),e.getElement("jina-media-search-button").onclick=function(){return e.search([e.recordedMedia.dataURI])},e.getElement("jina-media-cancel-button").onclick=e.previousCapture},e.getMediaDevices=async function(){var t=await navigator.mediaDevices.enumerateDevices();console.log("deviceInfos: ",t);for(var n=0;n!==t.length;++n){var a=t[n],i=document.createElement("option");i.value=a.deviceId,"audioinput"===a.kind?(i.text=a.label||"Microphone "+(e.audioSelect.length+1),e.audioSelect&&e.audioSelect.appendChild(i)):"videoinput"===a.kind&&(i.text=a.label||"Camera "+(e.videoSelect.length+1),e.videoSelect&&e.videoSelect.appendChild(i))}},e.capturePhoto=async function(){var t=e.capturePreview.videoWidth,n=e.capturePreview.videoHeight;e.captureCanvas.width=t,e.captureCanvas.height=n,e.captureCanvas.style.display="block",e.captureCanvas.getContext("2d").drawImage(e.getElement("jina-capture-preview"),0,0,t,n);var a=e.captureCanvas.toDataURL("image/jpeg");e.captureCanvas.width=0,e.captureCanvas.height=0,e.captureCanvas.style.display="none",console.log("data:",a),e.recordedMedia={src:a,dataURI:a,type:"image"},"live"===e.searchType?e.search([a],!1,"live"):e.showReviewMedia()},e.startMediaRecord=async function(){e.recordedBlobs=[];try{e.mediaRecorder=new MediaRecorder(e.mediaStream)}catch(t){return console.error("Exception while creating MediaRecorder:",t),void(errorMsgElement.innerHTML="Exception while creating MediaRecorder: ".concat(JSON.stringify(t)))}e.mediaRecorder.addEventListener("dataavailable",(function(t){t.data&&t.data.size>0&&e.recordedBlobs.push(t.data)})),e.mediaRecorder.addEventListener("stop",e.handleStopMediaRecording),e.mediaRecorder.start(),console.log("MediaRecorder started",e.mediaRecorder),e.getElement("jina-media-controls").innerHTML='\n\t\t\t<button class="jina-media-button jina-stop-record-button"><img src="'.concat(y.stop,'"></button>\n\t\t\t'),e.getElement("jina-stop-record-button").onclick=e.stopMediaRecord;var t=e.getElement("jina-media-live-button");t&&(t.style.display="none")},e.startLiveSearch=async function(){e.liveSearchActive=!0,e.capturePhoto(),e.liveInterval=setInterval((function(){return e.capturePhoto()}),3e3)},e.toggleLiveSearch=function(){e.liveInterval?(e.liveSearchActive=!1,clearInterval(e.liveInterval),e.liveIcon.classList.add("jina-live-icon-paused"),e.liveIcon.classList.remove("jina-pulse"),e.getElement("jina-live-toggle-button img").setAttribute("src",y.play),e.liveInterval=!1):(e.liveSearchActive=!0,e.liveIcon.classList.remove("jina-live-icon-paused"),e.liveIcon.classList.add("jina-pulse"),e.getElement("jina-live-toggle-button img").setAttribute("src",y.pause),e.startLiveSearch())},e.stopMediaRecord=function(){console.log("stopping media recording"),e.mediaRecorder.stop()},e.handleStopMediaRecording=function(){var t;console.log("handleStop"),t=e.useVideo?new Blob(e.recordedBlobs,{type:"video/mp4"}):new Blob(e.recordedBlobs,{type:"audio/wav"});var n=new FileReader;n.addEventListener("load",(function(){var a=n.result;console.log("processed: ",a),e.recordedMedia={src:window.URL.createObjectURL(t),type:e.useVideo?"video":"audio",dataURI:a},e.showReviewMedia()}),!1),n.readAsDataURL(t)},e.showLoading=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Searching";e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t<div class="jina-sea">\n\t\t\t\t<p class="jina-title">'.concat(t,'</p>\n\t\t\t\t<span class="jina-wave"></span>\n\t\t\t\t<span class="jina-wave"></span>\n\t\t\t\t<span class="jina-wave"></span>\n\t\t\t</div>\n\t\t')},e.showError=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"could not reach server";e.showContentContainer(),e.contentContainer.innerHTML='\n\t\t\t<div class="jina-dropdown-message jina-error unselectable">\n \t\t<div class="jina-face jina-roll"><div class="eye"></div><div class="eye right"></div><div class="mouth sad"></div>\n \t</div>\n \t\t\t<div class="jina-shadow jina-move"></div>\n\t\t\t\t<h4 class="alert">Error!</h4>\n\t\t\t\t<p>'.concat(t,'</p>\n\t\t\t\t<button class="jina-searchbar-error-ok">Ok</button>\n\t\t\t</div>\n\t\t'),e.errorButton=e.getElement("jina-searchbar-error-ok"),e.errorButton.onclick=e.clearExpander},e.showResults=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.resultsIndex,n=arguments.length>1?arguments[1]:void 0;if("live"!==n||e.liveSearchActive){e.resultsIndex=t;var a,i="",o=e.results,r=e.queries,c=e.resultsMeta,s=c.totalResults,l=c.totalTime,d=c.onlyImages,u=c.queriesContainMedia;if(r.length>1||d){if(a='\n\t\t\t\t<div class="jina-results-toolbar">\n\t\t\t\t\t<div class="jina-results-tabs">',u)for(var g=0;r.length>g;++g)a+=e.renderPreviewTab(r[g],g,t===g);d&&(a+='\n\t\t\t\t\t</div>\n\t\t\t\t\t<img class="jina-results-action-button'.concat("list"===e.resultsView?" jina-active":"",' jina-toolbar-button-list" src="').concat(y.listView,'" draggable="false">\n\t\t\t\t\t<img class="jina-results-action-button').concat("grid"===e.resultsView?" jina-active":"",' jina-toolbar-button-grid" src="').concat(y.gridView,'" draggable="false">')),a+="</div></div>"}i+='<p class="jina-results-label">'.concat(s," results in ").concat(l," seconds</p>");for(var M=0;o[t].length>M;++M){var j=o[t][M];j.index=M,i+=e.renderResult(j)}if("live"===e.searchType?e.getElement("jina-live-results-area").innerHTML="\n\t\t\t\t".concat(a||"",'\n\t\t\t\t<div class="jina-expander-results-area">\n\t\t\t\t\t').concat(i,"\n\t\t\t\t</div>\n\t\t\t\t"):"dropdown"===e.settings.resultsLocation?(e.showContentContainer(),e.contentContainer.innerHTML="\n\t\t\t\t".concat(a||"",'\n\t\t\t\t<div class="jina-expander-results-area">\n\t\t\t\t\t').concat(i,"\n\t\t\t\t</div>\n\t\t\t\t")):(e.resultsArea=document.getElementById(e.settings.resultsAreaId||"jina-results-area"),e.resultsArea.innerHTML="\n\t\t\t\t".concat(a||"",'\n\t\t\t\t<div class="jina-expander-results-area">\n\t\t\t\t\t').concat(i,"\n\t\t\t\t</div>\n\t\t\t\t"),e.clearExpander()),a){if(u)for(var v=function(t){e.getElement("jina-results-tab-".concat(t)).addEventListener("click",(function(){return e.showResults(t)}))},h=0;r.length>h;++h)v(h);d&&(e.getElement("jina-toolbar-button-list").addEventListener("click",(function(){return e.setResultsView("list")})),e.getElement("jina-toolbar-button-grid").addEventListener("click",(function(){return e.setResultsView("grid")})))}o[t].forEach((function(t,n){console.log("nextResult",t),e.getElement("jina-result-".concat(n)).addEventListener("click",(function(){t.mimeType.includes("text")?(e.searchInput.value=t.text,e.search()):(e.search([t.data],!0),e.searchIcon.src=t.data,e.searchIcon.classList.add("jina-border-right"))}))}))}},e.renderResult=function(t){return t.mimeType.includes("text")?'<div class="jina-result jina-text-result jina-result-'.concat(t.index,'">').concat(t.text,"</div>"):t.mimeType.includes("image")?"grid"===e.resultsView?'<div class="jina-grid-container"><div class="jina-result jina-result-'.concat(t.index,'"><img src="').concat(t.data,'" class="jina-result-image"/></div></div>'):'<div class="jina-result jina-result-'.concat(t.index,'"><img src="').concat(t.data,'" class="jina-result-image"/></div>'):t.mimeType.includes("audio")?'<div class="jina-result jina-result-'.concat(t.index,'"><audio src="').concat(t.data,'" class="jina-result-audio" controls></audio></div>'):t.mimeType.includes("video")?'<div class="jina-result jina-result-'.concat(t.index,'"><video src="').concat(t.data,'" class="jina-result-video" controls autoplay muted loop></video></div>'):void 0},e.renderPreviewTab=function(t,e,n){var a=t.uri,i=t.mimeType;return'\n\t\t\t<div class="jina-results-tab'.concat(n?" jina-active":""," jina-results-tab-").concat(e,'">\n\t\t\t').concat(i.includes("image")?'<div class="jina-results-tab-img" style="background:url('.concat(a,');background-size: cover;"></div>'):i.includes("video")?'<video class="jina-results-tab-video" src="'.concat(a,'" autoplay muted loop></video>'):i.includes("audio")?'<audio controls class="jina-results-tab-audio" src="'.concat(a,'"></audio>'):"","\n\t\t\t</div>")},e.setResultsView=function(t){localStorage.setItem("jina-results-view",t),e.resultsView=t,e.showResults()},e.clearExpander=async function(){e.clearMedia(),e.searchIcon.src=e.defaultSearchIcon,e.searchIcon.classList.remove("jina-border-right"),e.searchInput.value="",e.dragCounter=0,e.searchInput.classList.remove("jina-highlighted"),e.clearContentContainer(),await I(.2),e.contentContainer.innerHTML=e.defaultContent||"",e.highlighted=!1},e.init=function(){if(console.log(e.getAttribute("name")||"JinaSearchComponent","settings:",e.settings),e.dragCounter=0,["drag","dragenter","dragover","dragleave","dragexit","drop"].forEach((function(t){document.addEventListener(t,e.preventDefaults)})),["dragenter"].forEach((function(t){document.addEventListener(t,e.handleDrag)})),["drop","dragleave"].forEach((function(t){document.addEventListener(t,e.handleDragLeave)})),e.overlay&&e.overlay.addEventListener("click",e.clearExpander),e.searchInput&&(e.searchInput.addEventListener("drop",e.handleDrop),e.searchInput.addEventListener("keydown",e.listenForEnter)),e.contentContainer&&e.contentContainer.addEventListener("drop",e.handleDrop),e.searchIcon&&e.searchIcon.addEventListener("click",e.showInputOptions),e.resultsView=localStorage.getItem("jina-results-view")||"list",e.settings.typewriterEffect){var t=JSON.parse(e.getAttribute("placeholders"));e.typeWriter(t||v,0,0,e.settings.typewriterDelayCharacter,e.settings.typewriterDelayItem)}},e.getElement=function(t){return document.querySelector("#".concat(e.elementId," .").concat(t))},e.settings={};for(var i=Object.keys(h),o=0;i.length>o;++o){var r=i[o];e.settings[r]=e.getAttribute(r)||h[r]}return e.elementId=e.getAttribute("id")||"jina-component-".concat(Math.floor(1e10*Math.random())),e.defaultSearchIcon=y[e.settings.searchIcon]||e.settings.searchIcon,console.log("elementId",e.elementId),e.innerHTML='\n\t\t<div id="'.concat(e.elementId,'">\n\t\t\t<div class="jina-expander-overlay"></div>\n\t\t\t<div class="jina-searchbar-container jina-theme-').conca