status/client/shimport@2.0.5.js

2 lines
7.1 KiB
JavaScript
Raw Normal View History

2023-10-28 01:46:50 -04:00
var __shimport__=function(n){"use strict";function t(){for(var n=0,t=0,r=arguments.length;t<r;t++)n+=arguments[t].length;var e=Array(n),u=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,i=o.length;a<i;a++,u++)e[u]=o[a];return e}function r(n,t){for(var r=n.length;r--;)if(n[r].name===t)return n[r].as}var e=/\b(case|default|delete|do|else|in|instanceof|new|return|throw|typeof|void)\s*$/,u=/(^|\{|\(|\[\.|;|,|<|>|<=|>=|==|!=|===|!==|\+|-|\*\%|<<|>>|>>>|&|\||\^|!|~|&&|\|\||\?|:|=|\+=|-=|\*=|%=|<<=|>>=|>>>=|&=|\|=|\^=|\/=|\/)\s*$/,o=/(\}|\)|\+\+|--)\s*$/,a=/[{}()[.;,<>=+\-*%&|\^!~?:/]/,i=/[a-zA-Z_$0-9]/,f={" ":1,"\t":1,"\n":1,"\r":1,"\f":1,"\v":1," ":1,"\u2028":1,"\u2029":1};function s(n){return n in f}function c(n){return"'"===n||'"'===n}var l=/^\*\s+as\s+(\w+)$/,d=/(\w+)\s*,\s*\*\s*as\s*(\w+)$/,p=/(\w+)\s*,\s*{(.+)}$/;function v(n){return n?n.split(",").map((function(n){var t=n.trim().split(/[^\S]+/),r=t[0];return{name:r,as:t[2]||r}})):[]}function m(n,t){for(var e=t,u=t+=6;n[t]&&s(n[t]);)t+=1;for(;n[t]&&!c(n[t]);)t+=1;for(var o=t,a=t+=1;n[t]&&!c(n[t]);)t+=1;var i=t++;return function(n,t,e,u,o){var a=r(u,"*")||r(u,"default");return{start:t,end:e,source:o,name:a,specifiers:u,toString:function(){return"/*"+n.slice(t,e)+"*/"}}}(n,e,t,function(n){var t=l.exec(n);return t?[{name:"*",as:t[1]}]:(t=d.exec(n))?[{name:"default",as:t[1]},{name:"*",as:t[2]}]:(t=p.exec(n))?[{name:"default",as:t[1]}].concat(v(t[2].trim())):"{"===n[0]?v(n.slice(1,-1).trim()):n?[{name:"default",as:n}]:[]}(n.slice(u,o).replace(/from\s*$/,"").trim()),n.slice(a,i))}var h=/^import\s*\.\s*meta\s*\.\s*url/;function _(n,t){var r=t;for(t+=6;n[t]&&s(n[t]);)t+=1;var e=t;if("{"===n[t]){for(;"}"!==n[t];)t+=1;for(var u=t+=1,o=null;s(n[t]);)t+=1;if(/^from[\s\n'"]/.test(n.slice(t,t+5))){for(t+=4;s(n[t]);)t+=1;for(;n[t]&&!c(n[t]);)t+=1;for(var i=t+=1;n[t]&&!c(n[t]);)t+=1;o=n.slice(i,t),t+=1}return function(n,t,r,e,u,o){var a=v(n.slice(r+1,e-1).trim());return{start:t,end:u,source:o,toString:function(r){var e=o&&r.get(o);return a.map((function(n){return"__exports."+n.as+" = "+(e?e+"."+n.name:n.name)+"; "})).join("")+"/*"+n.slice(t,u)+"*/"}}}(n,r,e,u,t,o)}if("*"===n[t]){for(t+=1;s(n[t]);)t+=1;for(t+=4;n[t]&&!c(n[t]);)t+=1;for(i=t+=1;n[t]&&!c(n[t]);)t+=1;var f=t++;return function(n,t,r,e){return{start:t,end:r,source:e,toString:function(u){return"Object.assign(__exports, "+u.get(e)+"); /*"+n.slice(t,r)+"*/"}}}(n,r,t,n.slice(i,f))}return/^default\b/.test(n.slice(t,t+8))?function(n,t,r){var e=/^\s*(?:(class)(\s+extends|\s*{)|(function)\s*\()/.exec(n.slice(r));if(e){r+=e[0].length;var u="__default_export";return{start:t,end:r,name:u,as:"default",toString:function(){return e[1]?"class "+u+e[2]:"function "+u+"("}}}return{start:t,end:r,toString:function(){return"__exports.default ="}}}(n,r,e+7):function(n,t,r){for(var e=r;n[r]&&/\S/.test(n[r]);)r+=1;for(;n[r]&&!/\S/.test(n[r]);)r+=1;for(var u=r;n[r]&&!a.test(n[r])&&!s(n[r]);)r+=1;var o=r;return{start:t,end:e,name:n.slice(u,o),toString:function(){return""}}}(n,r,e)}function g(n,t){var r,f=!0,c=!1,l=[],d=-1,p={},v={},g=0,x=[],w=[],S=[],$=[];function y(){if(")"===n[d]){for(var t=p[d];s(n[t-1]);)t-=1;return!/(if|while)$/.test(n.slice(t-5,t))}return!0}for(var b={pattern:/(?:(\()|(\))|({)|(})|(")|(')|(\/\/)|(\/\*)|(\/)|(`)|(import)|(export)|(\+\+|--))/g,handlers:[function(n){d=n,v[g++]=n},function(n){d=n,p[n]=v[--g]},function(n){d=n,l.push(b)},function(n){return d=n,l.pop()},function(n){return l.push(b),j},function(n){return l.push(b),A},function(n){return O},function(n){return k},function(t){for(var r=t;r>0&&s(n[r-1]);)r-=1;if(r>0){var c=r;if(a.test(n[c-1]))for(;c>0&&a.test(n[c-1]);)c-=1;else for(;c>0&&i.test(n[c-1]);)c-=1;var l=n.slice(c,r);f=!!l&&(e.test(l)||u.test(l)||o.test(l)&&!y())}else f=!0;return E},function(n){return z},function(r){if(0===r||s(n[r-1])||a.test(n[r-1])){var e=r+6,u=void 0;do{u=n[e++]}while(s(u));var o=e>r+7;if(/^['"{*]$/.test(u)||o&&/^[a-zA-Z_$]$/.test(u)){var i=m(n,r);x.push(i),N=i.end}else if("("===u){var f=function(n){return{start:n,end:n+6,toString:function(){return"__import"}}}(r);w.push(f),N=f.end}else if("."===