speice.io/assets/js/1359.3fc5336a.js

123 lines
228 KiB
JavaScript
Raw Permalink Normal View History

(self.webpackChunkspeice_io=self.webpackChunkspeice_io||[]).push([["1359"],{92509:function(e,t,n){var r;r=0,function(e,t,n,r){"use strict";class s{constructor({file:e,sourceRoot:n}={}){this._names=new t.SetArray,this._sources=new t.SetArray,this._sourcesContent=[],this._mappings=[],this.file=e,this.sourceRoot=n,this._ignoreList=new t.SetArray}}function o(e){return e}function i(e){let{_mappings:t,_sources:n,_sourcesContent:r,_names:s,_ignoreList:o}=e;return function(e){let{length:t}=e,n=t;for(let t=n-1;t>=0&&!(e[t].length>0);n=t,t--);n<t&&(e.length=n)}(t),{version:3,file:e.file||void 0,names:s.array,sourceRoot:e.sourceRoot||void 0,sources:n.array,sourcesContent:r,mappings:t,ignoreList:o.array}}function a(e,n,r,s,o,i,a,l,u){let{_mappings:h,_sources:p,_sourcesContent:f,_names:d}=n,m=function(e,t){for(let n=e.length;n<=t;n++)e[n]=[];return e[t]}(h,r),k=function(e,t){let n=e.length;for(let r=n-1;r>=0&&!(t>=e[r][0]);n=r--);return n}(m,s);if(!o){if(e&&function(e,t){return 0===t||1===e[t-1].length}(m,k))return;return c(m,k,[s])}let g=t.put(p,o),_=l?t.put(d,l):-1;if(g===f.length&&(f[g]=null!=u?u:null),!(e&&function(e,t,n,r,s,o){if(0===t)return!1;let i=e[t-1];return 1!==i.length&&n===i[1]&&r===i[2]&&s===i[3]&&o===(5===i.length?i[4]:-1)}(m,k,g,i,a,_)))return c(m,k,l?[s,g,i,a,_]:[s,g,i,a])}function c(e,t,n){for(let n=e.length;n>t;n--)e[n]=e[n-1];e[t]=n}function l(e,n){for(let r=0;r<n.length;r++)t.put(e,n[r])}function u(e,t,n){let{generated:r,source:s,original:o,name:i,content:c}=n;return s?a(e,t,r.line-1,r.column,s,o.line-1,o.column,i,c):a(e,t,r.line-1,r.column,null,null,null,null,null)}e.GenMapping=s,e.addMapping=function(e,t){return u(!1,e,t)},e.addSegment=function(e,t,n,r,s,o,i,c){return a(!1,e,t,n,r,s,o,i,c)},e.allMappings=function(e){let t=[],{_mappings:n,_sources:r,_names:s}=e;for(let e=0;e<n.length;e++){let o=n[e];for(let n=0;n<o.length;n++){let i,a,c,l=o[n],u={line:e+1,column:l[0]};1!==l.length&&(i=r.array[l[1]],a={line:l[2]+1,column:l[3]},5===l.length&&(c=s.array[l[4]])),t.push({generated:u,source:i,original:a,name:c})}}return t},e.fromMap=function(e){let t=new r.TraceMap(e),n=new s({file:t.file,sourceRoot:t.sourceRoot});if(l(n._names,t.names),l(n._sources,t.sources),n._sourcesContent=t.sourcesContent||t.sources.map(()=>null),n._mappings=r.decodedMappings(t),t.ignoreList)l(n._ignoreList,t.ignoreList);return n},e.maybeAddMapping=(e,t)=>u(!0,e,t),e.maybeAddSegment=(e,t,n,r,s,o,i,c)=>a(!0,e,t,n,r,s,o,i,c),e.setIgnore=function(e,n,r=!0){let{_sources:s,_sourcesContent:o,_ignoreList:i}=e,a=t.put(s,n);a===o.length&&(o[a]=null),r?t.put(i,a):t.remove(i,a)},e.setSourceContent=function(e,n,r){let{_sources:s,_sourcesContent:o}=e;o[t.put(s,n)]=r},e.toDecodedMap=i,e.toEncodedMap=function(e){let t=i(e);return Object.assign(Object.assign({},t),{mappings:n.encode(t.mappings)})},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(22208),n(92297),n(83446))},48435:function(e){var t,n;t=0,n=function(){"use strict";let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(e){return e.startsWith("/")}function s(e){return/^[.?#]/.test(e)}function o(e){let n=t.exec(e);return i(n[1],n[2]||"",n[3],n[4]||"",n[5]||"/",n[6]||"",n[7]||"")}function i(e,t,n,r,s,o,i){return{scheme:e,user:t,host:n,port:r,path:s,query:o,hash:i,type:7}}function a(t){var s;if(t.startsWith("//")){let e=o("http:"+t);return e.scheme="",e.type=6,e}if(r(t)){let e=o("http://foo.com"+t);return e.scheme="",e.host="",e.type=5,e}if(t.startsWith("file:"))return function(e){let t=n.exec(e),s=t[2];return i("file:","",t[1]||"","",r(s)?s:"/"+s,t[3]||"",t[4]||"")}(t);if(s=t,e.test(s))return o(t);let a=o("http://foo.com/"+t);return a.scheme="",a.host="",a.type=t?t.startsWith("?")?3:t.startsWith("#")?2:4:1,a}function c(e,t){let n=t<=4,r=e.path.split("/"),s=1,o=0,i=!1;for(let e=1;e<r.length;e++){let t=r[e];if(!t){i=!0;continue}if(i=!1,"."!==t){if(".."===t){o?(i=!0,o--,s--):n&&(r[s++]=t);continue}r[s++]=t,o++}}let a="";for(let e=1;e<s;e++)a+="/"+r[e];(!a||i&&!a.endsWith("/.."
import {createRequire as CREATE_REQUIRE_NAME} from "module";
const require = CREATE_REQUIRE_NAME(import.meta.url);
`,interopRequireWildcard:`
function interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
newObj[key] = obj[key];
}
}
}
newObj.default = obj;
return newObj;
}
}
`,interopRequireDefault:`
function interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
`,createNamedExportFrom:`
function createNamedExportFrom(obj, localName, importedName) {
Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]});
}
`,createStarExport:`
function createStarExport(obj) {
Object.keys(obj)
.filter((key) => key !== "default" && key !== "__esModule")
.forEach((key) => {
if (exports.hasOwnProperty(key)) {
return;
}
Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]});
});
}
`,nullishCoalesce:`
function nullishCoalesce(lhs, rhsFn) {
if (lhs != null) {
return lhs;
} else {
return rhsFn();
}
}
`,asyncNullishCoalesce:`
async function asyncNullishCoalesce(lhs, rhsFn) {
if (lhs != null) {
return lhs;
} else {
return await rhsFn();
}
}
`,optionalChain:`
function optionalChain(ops) {
let lastAccessLHS = undefined;
let value = ops[0];
let i = 1;
while (i < ops.length) {
const op = ops[i];
const fn = ops[i + 1];
i += 2;
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
return undefined;
}
if (op === 'access' || op === 'optionalAccess') {
lastAccessLHS = value;
value = fn(value);
} else if (op === 'call' || op === 'optionalCall') {
value = fn((...args) => value.call(lastAccessLHS, ...args));
lastAccessLHS = undefined;
}
}
return value;
}
`,asyncOptionalChain:`
async function asyncOptionalChain(ops) {
let lastAccessLHS = undefined;
let value = ops[0];
let i = 1;
while (i < ops.length) {
const op = ops[i];
const fn = ops[i + 1];
i += 2;
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
return undefined;
}
if (op === 'access' || op === 'optionalAccess') {
lastAccessLHS = value;
value = await fn(value);
} else if (op === 'call' || op === 'optionalCall') {
value = await fn((...args) => value.call(lastAccessLHS, ...args));
lastAccessLHS = undefined;
}
}
return value;
}
`,optionalChainDelete:`
function optionalChainDelete(ops) {
const result = OPTIONAL_CHAIN_NAME(ops);
return result == null ? true : result;
}
`,asyncOptionalChainDelete:`
async function asyncOptionalChainDelete(ops) {
const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);
return result == null ? true : result;
}
`};class eO{__init(){this.helperNames={}}__init2(){this.createRequireName=null}constructor(e){this.nameManager=e,eO.prototype.__init.call(this),eO.prototype.__init2.call(this)}getHelperName(e){let t=this.helperNames[e];return t?t:(t=this.nameManager.claimFreeName(`_${e}`),this.helperNames[e]=t,t)}emitHelpers(){let e="";for(let[t,n]of(this.helperNames.optionalChainDelete&&this.getHelperName("optionalChain"),this.helperNames.asyncOptionalChainDelete&&this.getHelperName("asyncOptionalChain"),Object.entries(ej))){let r=this.helperNames[t],s=n;"optionalChainDelete"===t?s=s.replace("OPTIONAL_CHAIN_NAME",this.helperNames.optionalChain):"asyncOptionalChainDelete"===t?s=s.replace("ASYNC_OPTIONAL_CHAIN_NAME",this.helperNames.asyncOptionalChain):"require"===t&&(null===this.createRequireName&&(this.createRequireName=this.nameManager.claimFreeName("_createRequire")),s=s.replace(/CREATE_REQUIRE_NAME/g,this.createRequireName)),r&&(e+=" ",e+=s.replace(t,r).replace(/\s+/g," ").trim())}return e}}function eD(e,t,n){if(!!function(e,t){for(let n of e.tokens)if(n.type===p.name&&!n.isType&&function(e){let t=e.identifierRole;return t===d.FunctionScopedDeclaration||t===d.BlockScopedDeclaration||t===d.ObjectShorthandFunctionScopedDeclaration||t===d.ObjectShorthandBlockScopedDeclaration}(n)&&t.has(e.identifierNameForToken(n)))return!0;return!1}(e,n))(function(e,t,n){let r=[],s=t.length-1;for(let o=e.tokens.length-1;;o--){for(;r.length>0&&r[r.length-1].startTokenIndex===o+1;)r.pop();for(;s>=0&&t[s].endTokenIndex===o+1;)r.push(t[s]),s--;if(o<0)break;let i=e.tokens[o],a=e.identifierNameForToken(i);if(r.length>1&&!i.isType&&i.type===p.name&&n.has(a)){if(function(e){let t=e.identifierRole;return t===d.TopLevelDeclaration||t===d.BlockScopedDeclaration||t===d.ObjectShorthandTopLevelDeclaration||t===d.ObjectShorthandBlockScopedDeclaration}(i))eP(r[r.length-1],e,a);else if(function(e){let t=e.identifierRole;return t===d.FunctionScopedDeclaration||t===d.ObjectShorthandFunctionScopedDeclaration}(i)){let t=r.length-1;for(;t>0&&!r[t].isFunctionScope;)t--;if(t<0)throw Error("Did not find parent function scope.");eP(r[t],e,a)}}}if(r.length>0)throw Error("Expected empty scope stack after processing file.")})(e,t,n)}function eP(e,t,n){for(let r=e.startTokenIndex;r<e.endTokenIndex;r++){let e=t.tokens[r];(e.type===p.name||e.type===p.jsxName)&&t.identifierNameForToken(e)===n&&(e.shadowsGlobal=!0)}}class eq{__init(){this.usedNames=new Set}constructor(e,t){eq.prototype.__init.call(this),this.usedNames=new Set(function(e,t){let n=[];for(let r of t)r.type===p.name&&n.push(e.slice(r.start,r.end));return n}(e,t))}claimFreeName(e){let t=this.findFreeName(e);return this.usedNames.add(t),t}findFreeName(e){if(!this.usedNames.has(e))return e;let t=2;for(;this.usedNames.has(e+String(t));)t++;return e+String(t)}}var eF=n("41074");let e$=eF.union(eF.lit("jsx"),eF.lit("typescript"),eF.lit("flow"),eF.lit("imports"),eF.lit("react-hot-loader"),eF.lit("jest")),eB=eF.iface([],{compiledFilename:"string"}),eM=eF.iface([],{transforms:eF.array("Transform"),disableESTransforms:eF.opt("boolean"),jsxRuntime:eF.opt(eF.union(eF.lit("classic"),eF.lit("automatic"),eF.lit("preserve"))),production:eF.opt("boolean"),jsxImportSource:eF.opt("string"),jsxPragma:eF.opt("string"),jsxFragmentPragma:eF.opt("string"),keepUnusedImports:eF.opt("boolean"),preserveDynamicImport:eF.opt("boolean"),injectCreateRequireForImportRequire:eF.opt("boolean"),enableLegacyTypeScriptModuleInterop:eF.opt("boolean"),enableLegacyBabel5ModuleInterop:eF.opt("boolean"),sourceMapOptions:eF.opt("SourceMapOptions"),filePath:eF.opt("string")}),{Options:eK}=(0,eF.createCheckers)({Transform:e$,SourceMapOptions:eB,Options:eM});function eV(){Z(),tN(!1)}function eU(e){Z(),eG(e)}function eW(e){t2(),eX(e)}function eH(){t2(),i.tokens[i.tokens.length-1].identifierRole=d.ImportDeclaration}function eX(e){let t;t=0===i.scopeDepth?d.TopLevelDeclaration:e?d.BlockScopedDeclaration:d.FunctionScopedDeclaration,i.tokens[i.tokens.length-1].identifierRole=t}function eG(e){switch(i.type){case p._this:{let e=Y(0);Z(),ee(e);return}case p._yield:case p.na
(function () {
var enterModule = require('react-hot-loader').enterModule;
enterModule && enterModule(module);
})();`.replace(/\s+/g," ").trim()}getSuffixCode(){let e=new Set;for(let t of this.tokens.tokens)!t.isType&&J(t)&&t.identifierRole!==d.ImportDeclaration&&e.add(this.tokens.identifierNameForToken(t));let t=Array.from(e).map(e=>({variableName:e,uniqueLocalName:e}));return this.extractedDefaultExportName&&t.push({variableName:this.extractedDefaultExportName,uniqueLocalName:"default"}),`
;(function () {
var reactHotLoader = require('react-hot-loader').default;
var leaveModule = require('react-hot-loader').leaveModule;
if (!reactHotLoader) {
return;
}
${t.map(({variableName:e,uniqueLocalName:t})=>` reactHotLoader.register(${e}, "${t}", ${JSON.stringify(this.filePath||"")});`).join("\n")}
leaveModule(module);
})();`}process(){return!1}}let ro=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","implements","interface","let","package","private","protected","public","static","await","false","null","true"]);function ri(e){if(0===e.length||!H[e.charCodeAt(0)])return!1;for(let t=1;t<e.length;t++)if(!W[e.charCodeAt(t)])return!1;return!ro.has(e)}class ra extends eC{constructor(e,t,n){super(),this.rootTransformer=e,this.tokens=t,this.isImportsTransformEnabled=n}process(){return!!(this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange())||(this.tokens.matches1(p._public)||this.tokens.matches1(p._protected)||this.tokens.matches1(p._private)||this.tokens.matches1(p._abstract)||this.tokens.matches1(p._readonly)||this.tokens.matches1(p._override)||this.tokens.matches1(p.nonNullAssertion)?(this.tokens.removeInitialToken(),!0):this.tokens.matches1(p._enum)||this.tokens.matches2(p._const,p._enum)?(this.processEnum(),!0):!!(this.tokens.matches2(p._export,p._enum)||this.tokens.matches3(p._export,p._const,p._enum))&&(this.processEnum(!0),!0))}processEnum(e=!1){for(this.tokens.removeInitialToken();this.tokens.matches1(p._const)||this.tokens.matches1(p._enum);)this.tokens.removeToken();let t=this.tokens.identifierName();this.tokens.removeToken(),e&&!this.isImportsTransformEnabled&&this.tokens.appendCode("export "),this.tokens.appendCode(`var ${t}; (function (${t})`),this.tokens.copyExpectedToken(p.braceL),this.processEnumBody(t),this.tokens.copyExpectedToken(p.braceR),e&&this.isImportsTransformEnabled?this.tokens.appendCode(`)(${t} || (exports.${t} = ${t} = {}));`):this.tokens.appendCode(`)(${t} || (${t} = {}));`)}processEnumBody(e){let t=null;for(;!this.tokens.matches1(p.braceR);){;let{nameStringCode:n,variableName:r}=this.extractEnumKeyInfo(this.tokens.currentToken());this.tokens.removeInitialToken(),this.tokens.matches3(p.eq,p.string,p.comma)||this.tokens.matches3(p.eq,p.string,p.braceR)?this.processStringLiteralEnumMember(e,n,r):this.tokens.matches1(p.eq)?this.processExplicitValueEnumMember(e,n,r):this.processImplicitValueEnumMember(e,n,r,t),this.tokens.matches1(p.comma)&&this.tokens.removeToken(),t=null!=r?r:`${e}[${n}]`}}extractEnumKeyInfo(e){if(e.type===p.name){let t=this.tokens.identifierNameForToken(e);return{nameStringCode:`"${t}"`,variableName:ri(t)?t:null}}if(e.type===p.string){let t=this.tokens.stringValueForToken(e);return{nameStringCode:this.tokens.code.slice(e.start,e.end),variableName:ri(t)?t:null}}throw Error("Expected name or string at beginning of enum element.")}processStringLiteralEnumMember(e,t,n){null!=n?(this.tokens.appendCode(`const ${n}`),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.appendCode(`; ${e}[${t}] = ${n};`)):(this.tokens.appendCode(`${e}[${t}]`),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.appendCode(";"))}processExplicitValueEnumMember(e,t,n){let r=this.tokens.currentToken().rhsEndIndex;if(null==r)throw Error("Expected rhsEndIndex on enum assign.");if(null!=n){for(this.tokens.appendCode(`const ${n}`),this.tokens.copyToken();this.tokens.currentIndex()<r;)this.rootTransformer.processToken();this.tokens.appendCode(`; ${e}[${e}[${t}] = ${n}] = ${t};`)}else{for(this.tokens.appendCode(`${e}[${e}[${t}]`),this.tokens.copyToken();this.tokens.currentIndex()<r;)this.rootTransformer.processToken();this.tokens.appendCode(`] = ${t};`)}}processImplicitValueEnumMember(e,t,n,r){let s=null!=r?`${r} + 1`:"0";null!=n&&(this.tokens.appendCode(`const ${n} = ${s}; `),s=n),this.tokens.appendCode(`${e}[${e}[${t}] = ${s}] = ${t};`)}}class rc{__init(){this.transformers=[]}__init2(){this.generatedVariables=[]}constructor(e,t,n,r){rc.prototype.__init.call(this),rc.prototype.__init2.call(this),this.nameManager=e.nameManager,this.helperManager=e.helperManager;let{tokenProcess