@galaxyproject/galaxy-client
Version:
Galaxy client application build system
1 lines • 6.32 kB
JavaScript
(()=>{"use strict";var e,t,r={5616:(e,t,r)=>{var o=r(2543);const n=function(e,t,r=!1){if(0===e.length)return t.length;if(0===t.length)return e.length;var o,n,s=[];for(o=0;o<=t.length;o++)s[o]=[o];for(n=0;n<=e.length;n++)s[0][n]=n;for(o=1;o<=t.length;o++)for(n=1;n<=e.length;n++)t.charAt(o-1)===e.charAt(n-1)?s[o][n]=s[o-1][n-1]:(s[o][n]=Math.min(s[o-1][n-1]+1,Math.min(s[o][n-1]+1,s[o-1][n]+1)),1==r&&o>1&&n>1&&t.charAt(o-1)===e.charAt(n-2)&&t.charAt(o-2)===e.charAt(n-1)&&(s[o][n]=Math.min(s[o][n],s[o-2][n-2]+1)));return s[t.length][e.length]},s={id:["id","tool_id"],panel_section_name:["section","panel_section_name"],labels:["label","labels","tag"]},l=[" ","-","\\(","\\)","'",":",'"'],i={model_class:"ToolSection",id:"unsectioned",name:"Unsectioned Tools",description:"Tools that don't appear under any section in the unsearched panel"};function a(e,t,r,n="default",p,g=!1){const m=[];let y=null;const{filteredQuery:b,filteredKeys:v}=function(e,t){for(const r in t){const o=h(e,t[r]||[]);if(o)return{filteredQuery:o,filteredKeys:{[r]:1}}}return{filteredQuery:null,filteredKeys:{}}}(r,s);b&&(r=b,t=v);const w=r.trim().toLowerCase().split(" "),x=f(r.trim().toLowerCase(),l);for(const r of e)for(const e of Object.keys(t))if(r[e]||"combined"===e){let o="";if("combined"===e)o=`${r.name.trim()} ${r.description.trim()}`.toLowerCase();else{const t=r[e];"string"==typeof t?o=t.trim().toLowerCase():Array.isArray(t)?o=t.join(" ").trim().toLowerCase():"number"==typeof t&&(o=t.toString().trim().toLowerCase())}const n=o.split(" ");o=f(o,l);let s=void 0!==t.exact&&o===x?t.exact:t[e];s=void 0!==t.startsWith&&s!==t.exact&&"name"===e&&o.startsWith(x)?t.startsWith:s;const i=Array.from(new Set(n.filter((e=>w.includes(e)))));if(g){if(g){let t=null;if(("name"==e||"description"==e)&&x.length>=5&&(t=c(x,o)),t){const e=d(n,t);e&&(!y||y&&e.length<y.length)&&(y=e),m.push({id:r.id,order:s});break}}}else{if(o.match(x)){m.push({id:r.id,order:s});break}if("combined"===e&&void 0!==t.wordMatch&&i.length>=2){m.push({id:r.id,order:t.wordMatch});break}}}if(!b&&!g&&0==m.length)return a(e,t,r,n,p,!0);const{idResults:S,resultPanel:T}=function(e,t){const r=[],n=(0,o.orderBy)(e,["order"],["desc"]).reduce(((e,o)=>{const n=Object.keys(t);for(const s of n){let n=!1;const l=s?t[s]:void 0;if(l&&s){if(l.tools&&l.tools?.includes(o.id)){let t=e[s];t||(t={...l},t.tools=[]),t.tools?.push(o.id),e[s]=t,n=!0}else if(u(l)&&l.id===o.id){const t=i.id;let r=e[t];r||(r={...i},r.tools=[]),r.tools?.push(o.id),e[t]=r,n=!0}n&&!r.includes(o.id)&&r.push(o.id)}}return e}),{});return{idResults:r,resultPanel:n}}(m,p);return{results:S,resultPanel:T,closestTerm:y}}function c(e,t){const r=Math.floor(e.length/5),o=Array.from({length:t.length-e.length+r},((r,o)=>t.substr(o,e.length)));e.length>1&&o.push(...Array.from({length:t.length-e.length+r+1},((o,n)=>t.substr(n,e.length-r)))),t.length>e.length&&o.push(...Array.from({length:t.length-e.length},((o,n)=>t.substr(n,e.length+r))));for(const t of o)if(n(e,t,!0)<=r)return t;return null}function u(e){return!e.text&&"ToolSectionLabel"!==e.model_class&&"ToolSection"!==e.model_class&&void 0===e.tools}function d(e,t){const r=f(t);for(const t in e){const o=e[t];if(o?.match(r))return o}return null}function f(e,t=[],r=""){let o=e;return t.forEach((e=>{o=o.replace(new RegExp(e,"g"),r)})),o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function h(e,t){for(const r of t)if(e.trim().startsWith(`${r}:`))return e.split(`${r}:`)[1]?.trim();return null}self.addEventListener("message",(e=>{const{type:t,payload:r}=e.data;if("searchToolsByKeys"===t){const{tools:e,keys:t,query:o,panelView:n,currentPanel:s}=r,{results:l,resultPanel:i,closestTerm:c}=a(e,t,o,n,s);self.postMessage({type:"searchToolsByKeysResult",payload:l,sectioned:i,query:o,closestTerm:c})}else"clearFilter"===t?self.postMessage({type:"clearFilterResult"}):"favoriteTools"===t&&self.postMessage({type:"favoriteToolsResult"})}))}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var s=o[e]={id:e,loaded:!1,exports:{}};return r[e].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.m=r,n.x=()=>{var e=n.O(void 0,[215],(()=>n(5616)));return e=n.O(e)},n.amdD=function(){throw new Error("define cannot be used indirect")},e=[],n.O=(t,r,o,s)=>{if(!r){var l=1/0;for(u=0;u<e.length;u++){r=e[u][0],o=e[u][1],s=e[u][2];for(var i=!0,a=0;a<r.length;a++)(!1&s||l>=s)&&Object.keys(n.O).every((e=>n.O[e](r[a])))?r.splice(a--,1):(i=!1,s<l&&(l=s));if(i){e.splice(u--,1);var c=o();void 0!==c&&(t=c)}}return t}s=s||0;for(var u=e.length;u>0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[r,o,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"libs.bundled.js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.j=616,(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={616:1};n.f.i=(t,r)=>{e[t]||importScripts(n.p+n.u(t))};var t=self.webpackChunk_galaxyproject_galaxy_client=self.webpackChunk_galaxyproject_galaxy_client||[],r=t.push.bind(t);t.push=t=>{var o=t[0],s=t[1],l=t[2];for(var i in s)n.o(s,i)&&(n.m[i]=s[i]);for(l&&l(n);o.length;)e[o.pop()]=1;r(t)}})(),t=n.x,n.x=()=>n.e(215).then(t);n.x()})();