Dot_Files/.config/raycast/extensions/9dae4bd8-1609-4deb-a818-f2f01838bb9e/index.js

9 lines
40 KiB
JavaScript
Raw Normal View History

var Vr=Object.create;var ue=Object.defineProperty;var Wr=Object.getOwnPropertyDescriptor;var Gr=Object.getOwnPropertyNames;var Xr=Object.getPrototypeOf,Yr=Object.prototype.hasOwnProperty;var ut=t=>ue(t,"__esModule",{value:!0});var p=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Kr=(t,e)=>{for(var r in e)ue(t,r,{get:e[r],enumerable:!0})},ct=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Gr(e))!Yr.call(t,s)&&(r||s!=="default")&&ue(t,s,{get:()=>e[s],enumerable:!(n=Wr(e,s))||n.enumerable});return t},ft=(t,e)=>ct(ut(ue(t!=null?Vr(Xr(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Qr=(t=>(e,r)=>t&&t.get(e)||(r=ct(ut({}),e,1),t&&t.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Se=p((Is,lt)=>{"use strict";lt.exports=function(e,r){return function(){for(var s=new Array(arguments.length),o=0;o<s.length;o++)s[o]=arguments[o];return e.apply(r,s)}}});var q=p((Ms,pt)=>{"use strict";var Zr=Se(),I=Object.prototype.toString;function Fe(t){return I.call(t)==="[object Array]"}function Ae(t){return typeof t=="undefined"}function en(t){return t!==null&&!Ae(t)&&t.constructor!==null&&!Ae(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function tn(t){return I.call(t)==="[object ArrayBuffer]"}function rn(t){return typeof FormData!="undefined"&&t instanceof FormData}function nn(t){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function sn(t){return typeof t=="string"}function on(t){return typeof t=="number"}function ht(t){return t!==null&&typeof t=="object"}function ce(t){if(I.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function an(t){return I.call(t)==="[object Date]"}function un(t){return I.call(t)==="[object File]"}function cn(t){return I.call(t)==="[object Blob]"}function dt(t){return I.call(t)==="[object Function]"}function fn(t){return ht(t)&&dt(t.pipe)}function ln(t){return typeof URLSearchParams!="undefined"&&t instanceof URLSearchParams}function hn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function dn(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function Ne(t,e){if(!(t===null||typeof t=="undefined"))if(typeof t!="object"&&(t=[t]),Fe(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}function Le(){var t={};function e(s,o){ce(t[o])&&ce(s)?t[o]=Le(t[o],s):ce(s)?t[o]=Le({},s):Fe(s)?t[o]=s.slice():t[o]=s}for(var r=0,n=arguments.length;r<n;r++)Ne(arguments[r],e);return t}function pn(t,e,r){return Ne(e,function(s,o){r&&typeof s=="function"?t[o]=Zr(s,r):t[o]=s}),t}function mn(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}pt.exports={isArray:Fe,isArrayBuffer:tn,isBuffer:en,isFormData:rn,isArrayBufferView:nn,isString:sn,isNumber:on,isObject:ht,isPlainObject:ce,isUndefined:Ae,isDate:an,isFile:un,isBlob:cn,isFunction:dt,isStream:fn,isURLSearchParams:ln,isStandardBrowserEnv:dn,forEach:Ne,merge:Le,extend:pn,trim:hn,stripBOM:mn}});var fe=p((js,vt)=>{"use strict";var k=q();function mt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}vt.exports=function(e,r,n){if(!r)return e;var s;if(n)s=n(r);else if(k.isURLSearchParams(r))s=r.toString();else{var o=[];k.forEach(r,function(f,h){f===null||typeof f=="undefined"||(k.isArray(f)?h=h+"[]":f=[f],k.forEach(f,function(c){k.isDate(c)?c=c.toISOString():k.isObject(c)&&(c=JSON.stringify(c)),o.push(mt(h)+"="+mt(c))}))}),s=o.join("&")}if(s){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}});var yt=p((ks,Ct)=>{"use strict";var vn=q();function le(){this.handlers=[]}le.prototype.use=function(e,r,n){return this.handlers.push({fulfilled:e,
`),function(u){if(o=u.indexOf(":"),n=De.trim(u.substr(0,o)).toLowerCase(),s=De.trim(u.substr(o+1)),n){if(r[n]&&gn.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([s]):r[n]=r[n]?r[n]+", "+s:s}}),r}});var Pt=p((Ks,Bt)=>{"use strict";var Lt=q();Bt.exports=Lt.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function s(o){var a=o;return e&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(a){var u=Lt.isString(a)?s(a):a;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}()});var H=p((Qs,Dt)=>{"use strict";function Ue(t){this.message=t}Ue.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Ue.prototype.__CANCEL__=!0;Dt.exports=Ue});var It=p((Zs,Ut)=>{"use strict";var me=q(),En=Be(),qn=_t(),_n=fe(),xn=Pe(),On=Nt(),Tn=Pt(),Ie=de(),Sn=z(),Fn=H();Ut.exports=function(e){return new Promise(function(n,s){var o=e.data,a=e.headers,u=e.responseType,f;function h(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}me.isFormData(o)&&delete a["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var c=e.auth.username||"",l=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(c+":"+l)}var _=xn(e.baseURL,e.url);i.open(e.method.toUpperCase(),_n(_,e.params,e.paramsSerializer),!0),i.timeout=e.timeout;function D(){if(!!i){var d="getAllResponseHeaders"in i?On(i.getAllResponseHeaders()):null,C=!u||u==="text"||u==="json"?i.responseText:i.response,g={data:C,status:i.status,statusText:i.statusText,headers:d,config:e,request:i};En(function(L){n(L),h()},function(L){s(L),h()},g),i=null}}if("onloadend"in i?i.onloadend=D:i.onreadystatechange=function(){!i||i.readyState!==4||i.status===0&&!(i.responseURL&&i.responseURL.indexOf("file:")===0)||setTimeout(D)},i.onabort=function(){!i||(s(Ie("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){s(Ie("Network Error",e,null,i)),i=null},i.ontimeout=function(){var C=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",g=e.transitional||Sn.transitional;e.timeoutErrorMessage&&(C=e.timeoutErrorMessage),s(Ie(C,e,g.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",i)),i=null},me.isStandardBrowserEnv()){var R=(e.withCredentials||Tn(_))&&e.xsrfCookieName?qn.read(e.xsrfCookieName):void 0;R&&(a[e.xsrfHeaderName]=R)}"setRequestHeader"in i&&me.forEach(a,function(C,g){typeof o=="undefined"&&g.toLowerCase()==="content-type"?delete a[g]:i.setRequestHeader(g,C)}),me.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),u&&u!=="json"&&(i.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&i.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(d){!i||(s(!d||d&&d.type?new Fn("canceled"):d),i.abort(),i=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),o||(o=null),i.send(o)})}});var jt=p((ei,Mt)=>{var $=1e3,J=$*60,V=J*60,M=V*24,An=M*7,Nn=M*365.25;Mt.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Ln(t);if(r==="number"&&isFinite(t))return e.long?Pn(t):Bn(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Ln(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!!e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Nn;case"weeks":case"week":case"w":retu
`).join(`
`+o),t.push(s+"m+"+be.exports.humanize(this.diff)+"")}else t[0]=Xn()+e+" "+t[0]}function Xn(){return y.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Yn(...t){return process.stderr.write(ye.format(...t)+`
`)}function Kn(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Qn(){return process.env.DEBUG}function Zn(t){t.inspectOpts={};let e=Object.keys(y.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=y.inspectOpts[e[r]]}be.exports=Me()(y);var{formatters:Wt}=be.exports;Wt.o=function(t){return this.inspectOpts.colors=this.useColors,ye.inspect(t,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};Wt.O=function(t){return this.inspectOpts.colors=this.useColors,ye.inspect(t,this.inspectOpts)}});var Xt=p((si,ke)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?ke.exports=Ht():ke.exports=Gt()});var Kt=p((ii,Yt)=>{var te;Yt.exports=function(){if(!te){try{te=Xt()("follow-redirects")}catch{}typeof te!="function"&&(te=function(){})}te.apply(null,arguments)}});var Ve=p((oi,Je)=>{var G=require("url"),He=G.URL,es=require("http"),ts=require("https"),Qt=require("stream").Writable,rs=require("assert"),Zt=Kt(),j=["abort","aborted","connect","error","socket","timeout"],ze=Object.create(null);j.forEach(function(t){ze[t]=function(e,r,n){this._redirectable.emit(t,e,r,n)}});var ns=we("ERR_FR_REDIRECTION_FAILURE",""),ss=we("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),is=we("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),os=we("ERR_STREAM_WRITE_AFTER_END","write after end");function T(t,e){Qt.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var r=this;this._onNativeResponse=function(n){r._processResponse(n)},this._performRequest()}T.prototype=Object.create(Qt.prototype);T.prototype.abort=function(){rr(this._currentRequest),this.emit("abort")};T.prototype.write=function(t,e,r){if(this._ending)throw new os;if(!(typeof t=="string"||typeof t=="object"&&"length"in t))throw new TypeError("data should be a string, Buffer or Uint8Array");if(typeof e=="function"&&(r=e,e=null),t.length===0){r&&r();return}this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,r)):(this.emit("error",new is),this.abort())};T.prototype.end=function(t,e,r){if(typeof t=="function"?(r=t,t=e=null):typeof e=="function"&&(r=e,e=null),!t)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,s=this._currentRequest;this.write(t,e,function(){n._ended=!0,s.end(null,null,r)}),this._ending=!0}};T.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)};T.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)};T.prototype.setTimeout=function(t,e){var r=this;function n(a){a.setTimeout(t),a.removeListener("timeout",a.destroy),a.addListener("timeout",a.destroy)}function s(a){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),o()},t),n(a)}function o(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),e&&r.removeListener("timeout",e),r.socket||r._currentRequest.removeListener("socket",s)}return e&&this.on("timeout",e),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",n),this.once("response",o),this.once("error",o),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(t){T.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}});["aborted","connection","socket"].forEach(function(t){Object.defineProperty(T.prototype,t,{get:function(){return this._currentRequest[t]}})});T.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}};T.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(!e){this.emit("error",new TypeError("Unsupported protocol "+t));return}if(this._options.agents){var r=t.substr(0,t.length-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=G.format(this._options),n._redirectable=this;for(var s=0;s<j.length;s++)n.on(j[s],ze[j[s]]);if(this._isRedirect){var o=0,a=this,u=this._requestBodyBuffers;(function f(h){i
## Summary
${r}`,actions:_jsx(v.ActionPanel,null,_jsx(v.OpenInBrowserAction,{url:n}),_jsx(v.CopyToClipboardAction,{title:"Copy URL",content:n}))})}async function Ps(t){try{return(await Hr.default.get("https://developer.mozilla.org/api/v1/search/en-US",{params:{q:t,sort:"best"}})).data.documents.map(r=>({title:r.title,summary:r.summary,url:(0,zr.default)("https://developer.mozilla.org",r.mdn_url)}))}catch(e){return console.error(e),(0,v.showToast)(v.ToastStyle.Failure,`Could not load MDN results. ${e}`),Promise.resolve([])}}module.exports=Qr(Ds);0&&(module.exports={});