vite-plugin-taro 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@ ${t.map((e,t)=>`${t+1}) ${e.toString()}`).join(`
|
|
|
5
5
|
injectIntoGlobalHook(globalThis);
|
|
6
6
|
globalThis.$RefreshReg$ = () => {};
|
|
7
7
|
globalThis.$RefreshSig$ = () => (type) => type;`,map:null}}function Qr(e){if(!/\bhook\.inject\(internals\)/.test(e))throw Error(`React Reconciler must inject its renderer into the DevTools hook`);return{code:`import '${Jr}'\n${e}`,map:null}}function $r(e){return e.name===`client`}function ei(e,t){let r=qr(e.options.hmr,e.runtime.modules),i=null;return[{name:`vpt:mini-dev`,apply:`serve`,applyToEnvironment:$r,config(){return{define:{"performance.now":`Date.now`},build:{emptyOutDir:!1,sourcemap:!1},experimental:{bundledDev:!0},server:{ws:{path:yr}}}},configureServer:{order:`post`,async handler(a){bt(n.resolve(a.config.root,a.config.build.outDir)),i=await Or({server:a,contract:e,styles:t,hmrMode:r})}},generateBundle:{order:`post`,handler(t,n){ti(n,e.styles.appFileName)}},closeBundle(){return i?.close()}},{name:`vpt:mini-runtime-lowering`,apply:`serve`,transform:{order:`post`,filter:{id:Te(Ct)},handler(e){return ni(e)}}},...r.plugins,...Xr()]}function ti(e,t){delete e[t]}const ni=xt(e=>c(e,Ct,{lang:`js`,target:Me,sourcemap:!1,assumptions:{setPublicClassFields:!0}})),ri=P(`global/vpt-global`),ii=`common/vpt/global.js`;function ai(e){function t(t){let r=n.posix.relative(n.posix.dirname(e.getPhysicalChunkId(t)),ii),i=r.startsWith(`.`)?r:`./${r}`;return`require(${JSON.stringify(i)}).vptGlobal`}return[{name:`vpt:mini-global`,resolveId:{filter:{id:Te(wt)},handler(){return wt}},load:{filter:{id:Te(wt)},handler(){return`export const vptGlobal = __VPT_GLOBAL__;`}},config(){return{build:{rolldownOptions:{transform:{inject:{globalThis:[wt,`vptGlobal`]}}}}}},renderChunk:{order:`pre`,filter:{code:/__VPT_GLOBAL__/},handler(e,n,r){if(n.moduleIds.includes(`\0vpt:global-binding`)||n.moduleIds.includes(`\0rolldown/runtime.js`))return c(e,n.fileName,{define:{__VPT_GLOBAL__:t(n)},sourcemap:!!r.sourcemap})}},generateBundle:{order:`post`,async handler(e){let t=await oi({dir:e.dir,minify:e.minify!==!1,sourcemap:e.sourcemap});for(let e of t.output)e.type===`asset`?this.emitFile({type:`asset`,fileName:e.fileName,source:e.source}):this.emitFile({type:`prebuilt-chunk`,fileName:e.fileName,code:e.code,exports:e.exports,facadeModuleId:ri,isEntry:!0})}}},{name:`vpt:mini-global-dev`,apply:`serve`,renderChunk:{order:`pre`,filter:{code:/__rolldown_runtime__/},handler(e,n){return{code:(n.moduleIds.includes(`\0rolldown/runtime.js`)?`let __rolldown_runtime__;
|
|
8
|
-
`:`const __rolldown_runtime__ = ${t(n)}.__rolldown_runtime__;\n`)+e,map:null}}}}]}const oi=xt(e=>f({input:ri,transform:{target:Me},output:{...e,format:`cjs`,strict:!
|
|
8
|
+
`:`const __rolldown_runtime__ = ${t(n)}.__rolldown_runtime__;\n`)+e,map:null}}}}]}const oi=xt(e=>f({input:ri,transform:{target:Me},output:{...e,format:`cjs`,strict:!1,generatedCode:{symbols:!1},entryFileNames:ii},write:!1}),{getCacheKey:e=>JSON.stringify(e)});function si(e){return e?.[`vpt:native-components`]?.assetBytes??0}function ci(e){return e?.[`vpt:native-components`]?.sources??[]}async function li(e,t){await ui(e.folder),await di(e);let n=[];return await fi(e.folder,[],n,o(t)),{...e,assets:n}}async function ui(e){try{if((await T(e)).isDirectory())return}catch(t){throw Error.isError(t)&&`code`in t&&t.code===`ENOENT`?Error(`Native component folder does not exist: ${e}`,{cause:t}):t}throw Error(`Native component source is not a directory: ${e}`)}async function di(e){let t=n.join(e.folder,`${e.entry}.js`);try{if((await T(t)).isFile())return}catch(e){throw Error.isError(e)&&`code`in e&&e.code===`ENOENT`?Error(`Native component entry file does not exist: ${t}`,{cause:e}):e}throw Error(`Native component entry is not a file: ${t}`)}async function fi(e,t,r,i){let a=n.join(e,...t),s=await ee(a,{withFileTypes:!0});s.sort((e,t)=>e.name.localeCompare(t.name));for(let a of s){let s=[...t,a.name];if(a.isDirectory()){await fi(e,s,r,i);continue}if(!a.isFile())continue;let c=n.join(e,...s);o(c)!==i&&r.push({relativePath:s.join(`/`),byteLength:(await T(c)).size})}}function pi(e,t,r){let i=Ee(t),a=te(e,{astType:`ts`,lang:`tsx`,preserveParens:!1,sourceType:`module`},i),o=yi(a),s=hi(a),c=gi(a,new Set(s.flatMap(e=>e.names))).map(t=>({call:t,definition:vi(t,i,o,n=>Ti(n,i,e,t.start))})),l=new d(e,{filename:i});return c.forEach(({call:e,definition:t})=>{l.overwrite(e.start,e.end,JSON.stringify(n.posix.basename(t.folder)))}),s.forEach(({declaration:e})=>{l.remove(e.start,e.end)}),{code:l.toString(),map:r?mi(l,i):null,definitions:c.map(({definition:e})=>e)}}function mi(e,t){let n=e.generateMap({hires:`boundary`,includeContent:!0,source:t});return{file:n.file,mappings:n.mappings,names:n.names,sources:n.sources,sourcesContent:n.sourcesContent,version:n.version}}function hi(e){return e.body.flatMap(e=>{if(e.type!==`ImportDeclaration`||e.source.value!==`virtual:taro/native`)return[];let t=e.specifiers.flatMap(e=>e.type!==`ImportSpecifier`||Si(e.imported)!==`defineNativeComponent`?[]:[e.local.name]);return t.length===0?[]:[{declaration:e,names:t}]})}function gi(e,t){return e.body.flatMap(e=>{if(e.type===`ExpressionStatement`)return _i(e.expression,t)?[e.expression]:[];if(e.type===`ExportDefaultDeclaration`)return _i(e.declaration,t)?[e.declaration]:[];let n=e.type===`ExportNamedDeclaration`?e.declaration:e;return n?.type===`VariableDeclaration`?n.declarations.flatMap(({init:e})=>_i(e,t)?[e]:[]):[]})}function _i(e,t){return e?.type===`CallExpression`&&e.callee.type===`Identifier`&&t.has(e.callee.name)}function vi(e,t,r,i){if(e.arguments.length!==1)throw i(`defineNativeComponent() requires exactly one entry loader`);let a=Ci(e.arguments[0]);if(!a)throw i(`Native component entry must use () => import(...) with a static relative .js path`);let s=o(n.resolve(n.dirname(t),a));return{folder:n.posix.dirname(s),entry:n.posix.basename(s,`.js`),fields:xi(e.typeArguments,r,i)}}function yi(e){let t=/* @__PURE__ */ new Map;for(let n of e.body){let e=n.type===`ExportNamedDeclaration`?n.declaration:n;if(e?.type===`TSTypeAliasDeclaration`&&!e.typeParameters&&e.typeAnnotation.type===`TSTypeLiteral`){t.set(e.id.name,e.typeAnnotation.members);continue}e?.type===`TSInterfaceDeclaration`&&!e.typeParameters&&e.extends.length===0&&t.set(e.id.name,e.body.body)}return t}function bi(e,t){if(e.type===`TSTypeLiteral`)return e.members;if(e.type===`TSTypeReference`&&e.typeName.type===`Identifier`&&!e.typeArguments)return t.get(e.typeName.name)}function xi(e,t,n){if(!e)return[];if(e.params.length!==1)throw n(`Native component interface must be one TypeScript object type`);let r=e.params[0],i=bi(r,t);if(!i)throw n(`Native component interface must be inline or declared in the same module`);let a=/* @__PURE__ */ new Set;for(let e of i){if(e.type!==`TSPropertySignature`&&e.type!==`TSMethodSignature`)throw n(`Native component interface must contain only static fields`);if(e.computed)throw n(`Native component interface contains a computed field`);let t=Si(e.key);if(!t)throw n(`Native component interface contains a computed field`);if(a.has(t))throw n(`Duplicate native component interface field: ${t}`);a.add(t)}return[...a].filter(e=>e!==`children`)}function Si(e){if(e.type===`Identifier`)return e.name;if(e.type===`Literal`&&typeof e.value==`string`)return e.value}function Ci(e){if(e?.type!==`ArrowFunctionExpression`||e.params.length!==0||e.body.type!==`ImportExpression`)return;let t=e.body;if(t.source.type===`Literal`&&typeof t.source.value==`string`&&t.options===null&&wi(t.source.value))return t.source.value}function wi(e){return(e.startsWith(`./`)||e.startsWith(`../`))&&n.posix.extname(e)===`.js`}function Ti(e,t,n,r){let i=n.slice(0,r),a=i.split(`
|
|
9
9
|
`).length,o=r-i.lastIndexOf(`
|
|
10
|
-
`);return/* @__PURE__ */ Error(`${e}\n${t}:${a}:${o}`)}async function Ei({code:e,id:t,sourcemap:r,addWatchFile:i}){let a=pi(e,t,r),s=Ee(t),c=await Promise.all(a.definitions.map(e=>li(e,s)));c.forEach(e=>{i(e.folder),e.assets.forEach(t=>{i(o(n.join(e.folder,t.relativePath)))})});let l=c.reduce((e,t)=>e+t.assets.reduce((e,t)=>e+t.byteLength,0),0);return{code:a.code,map:a.map,meta:{"vpt:native-components":{sources:c,assetBytes:l}}}}function Di(){return{name:`vpt:mini-native-component`,transform:{order:`pre`,filter:{code:be},handler(e,t){return Ei({code:e,id:t,sourcemap:!!this.environment.config.build.sourcemap,addWatchFile:e=>this.addWatchFile(e)})}}}}function Oi(e){return n.posix.normalize(e)}function ki(e,t){if(!t.startsWith(`./`)&&!t.startsWith(`../`))throw Error(`Expected a relative chunk reference in ${e}: ${t}`);return n.posix.join(n.posix.dirname(e),t)}function Ai(e,t){return Oi(ki(e,t))}function ji({bundle:e,classifyModule:t,getPackageLocation:r}){let i=[],a=n.posix.dirname(Et);for(let o of Object.keys(e).sort()){let s=e[o];if(s.type!==`chunk`)continue;let c=t(s);if(c===`native`)continue;let l=r(s),u=l.kind===`subpackage`;if(c===`amphibious`&&u)throw Error(`Amphibious module must be in the main package: ${s.fileName}`);let d=Oi(u?s.fileName.slice(l.root.length+1):s.fileName),f=n.posix.relative(a,s.fileName),p=JSON.stringify(f.startsWith(`.`)?f:`./${f}`),m=`${u?`require.async`:`require`}(${p})`,h=c===`amphibious`?`[[],function(e){return{execute:function(){e(${m})}}}]`:m;i.push(`case ${JSON.stringify(d)}:return ${h};`)}return{type:`asset`,fileName:Et,source:`"use strict";exports.transport=function(m){switch(m){${i.join(``)}default:throw new Error('Unknown module: '+m)}};`}}async function Mi({bundle:e,getModuleInfo:t,getPackageLocation:r}){let i=[],a=[];for(let o of Object.values(e)){if(o.type!==`chunk`)continue;let e=r(o),s=e.kind===`subpackage`?e.root:void 0;for(let e of o.moduleIds){let r=ci(t(e)?.meta);for(let e of r){let t=n.posix.basename(e.folder),r=n.posix.join(`components`,t),o=s?n.posix.join(s,r):r;a.push({name:t,componentPath:`/${n.posix.join(o,e.entry)}`,fields:e.fields});for(let t of e.assets)i.push({type:`asset`,fileName:n.posix.join(o,t.relativePath),source:await w(n.join(e.folder,t.relativePath))})}}}return{files:i,registrations:a}}async function Ni({bundle:e,contract:t,subpackages:n,isProduction:r,getModuleInfo:i,getPackageLocation:a}){let o=await Mi({bundle:e,getModuleInfo:i,getPackageLocation:a});return[{type:`asset`,fileName:t.styles.appFileName,source:`@import "./${t.styles.globalFileName}";\n`},...t.output.generateProjectSkeleton({bundle:e,subpackages:n,nativeComponents:o.registrations,isProduction:r}),...o.files]}const Pi=`sub/p_`,Fi={kind:`main`};function Ii({chunks:e,planningBudgetBytes:t,getAdditionalModuleBytes:n}){let r=new Map(Object.entries(e).sort(([e],[t])=>e.localeCompare(t))),i=new Map([...r.values()].flatMap(e=>e.facadeModuleId===null?[]:[[e.facadeModuleId,e]])),a=Li(r),o=Ri({chunks:r,mainChunkIds:a}),s=Bi({chunks:[...r].filter(([e])=>!a.has(e)).map(([e,t])=>({chunkId:e,estimatedBytes:Ki(t)+t.moduleIds.reduce((e,t)=>e+n(t),0),transitions:o.get(e)??/* @__PURE__ */ new Set})),planningBudgetBytes:t}).map(qi),c=/* @__PURE__ */ new Map;for(let e of a)c.set(e,Fi);for(let e of s)for(let t of e.chunkIds)c.set(t,e);function l(e){let t=c.get(e);if(!t)throw Error(`Mini Program placement is missing final chunk: ${e}`);return t}function u(e){return l(`preliminaryFileName`in e?e.preliminaryFileName:e.fileName)}return{getPackageLocation:u,getPhysicalChunkId(e){let t=typeof e==`string`?i.get(e):e;if(!t)throw Error(`Mini Program placement is missing entry module: ${e}`);let n=u(t);return n.kind===`main`?t.fileName:`${n.root}/${t.fileName}`},finalize(e){let t=Object.values(e).filter(e=>e.type===`chunk`),n=/* @__PURE__ */ new Set;for(let e of t){let t=l(e.preliminaryFileName);t.kind===`subpackage`&&(e.fileName=`${t.root}/${e.fileName}`,n.add(t.root))}return[...n].sort().map(e=>({root:e}))}}}function Li(e){let t=/* @__PURE__ */ new Set,n=[...e].filter(([,e])=>e.isEntry).map(([e])=>e);for(;n.length>0;){let r=n.pop();if(!r||t.has(r))continue;let i=e.get(r);i&&(t.add(r),n.push(...i.imports))}return t}function Ri({chunks:e,mainChunkIds:t}){let n=/* @__PURE__ */ new Map,r=0;for(let i of e.values())for(let a of[...i.dynamicImports].sort())if(e.has(a)&&!t.has(a)){for(let i of zi({rootId:a,chunks:e,mainChunkIds:t})){let e=n.get(i)??/* @__PURE__ */ new Set;e.add(r),n.set(i,e)}r++}return n}function zi({rootId:e,chunks:t,mainChunkIds:n}){let r=/* @__PURE__ */ new Set,i=[e];for(;i.length>0;){let e=i.pop();if(!e||r.has(e)||n.has(e))continue;let a=t.get(e);a&&(r.add(e),i.push(...a.imports))}return[...r].sort()}function Bi({chunks:e,planningBudgetBytes:t}){let n=[],r=[...e].sort(Vi);for(let e of r)Gi(e.estimatedBytes<=t?Hi({bins:n,chunk:e,planningBudgetBytes:t})??Wi(n):Wi(n),e);return n}function Vi(e,t){return t.transitions.size-e.transitions.size||t.estimatedBytes-e.estimatedBytes||e.chunkId.localeCompare(t.chunkId)}function Hi({bins:e,chunk:t,planningBudgetBytes:n}){let r;for(let i of e){if(i.estimatedBytes+t.estimatedBytes>n)continue;let e={bin:i,overlap:Ui(i.transitions,t.transitions),remainingBytes:n-i.estimatedBytes-t.estimatedBytes};(!r||e.overlap>r.overlap||e.overlap===r.overlap&&e.remainingBytes<r.remainingBytes)&&(r=e)}return r?.bin}function Ui(e,t){let[n,r]=e.size<=t.size?[e,t]:[t,e],i=0;for(let e of n)r.has(e)&&i++;return i}function Wi(e){let t={chunkIds:[],estimatedBytes:0,transitions:/* @__PURE__ */ new Set};return e.push(t),t}function Gi(e,t){e.chunkIds.push(t.chunkId),e.estimatedBytes+=t.estimatedBytes;for(let n of t.transitions)e.transitions.add(n)}function Ki(e){let t=Object.values(e.modules).reduce((e,t)=>e+(t.code?Buffer.byteLength(t.code,`utf8`):0),0),n=e.moduleIds.length*64,r=(e.imports.length+e.dynamicImports.length)*32;return t+n+r+64}function qi(e){let t=[...e.chunkIds].sort(),n=x(`sha256`).update(t.join(`\0`)).digest(`hex`).slice(0,8);return{kind:`subpackage`,root:`${Pi}${n}`,chunkIds:t}}function Ji(e){return e.startsWith(Pi)}function Yi(e){return{output:{codeSplitting:{groups:[{name:`polyfills`,test:At,priority:200,includeDependenciesRecursively:!1},{name:`vendor`,test:jt,priority:100,includeDependenciesRecursively:!0}]},entryFileNames(t){switch(e(t)){case`native`:return`[name]`;case`entry-capsule`:return`[name].js`;default:return`common/[name].js`}},chunkFileNames:`common/[name].js`},preserveEntrySignatures:`allow-extension`}}function Xi(e){let t=Mt(e),n={phase:`idle`};function r(){if(n.phase===`idle`||n.phase===`awaiting-chunks`)throw Error(`Mini Program placement is unavailable before Rolldown exposes the final chunk graph`);return n.placement}return{name:`vpt:mini-placer`,config(){return{build:{rolldownOptions:Yi(t)}}},renderStart(){n={phase:`awaiting-chunks`}},renderChunk:{order:`pre`,handler(e,t,r,i){if(n.phase!==`planned`){if(n.phase!==`awaiting-chunks`)throw Error(`Mini Program placement received final chunks during the ${n.phase} phase`);n={phase:`planned`,placement:Ii({chunks:i.chunks,planningBudgetBytes:19e5,getAdditionalModuleBytes:e=>si(this.getModuleInfo(e)?.meta)})}}}},generateBundle:{order:`pre`,handler(e,t){let i=r();n={phase:`finalized`,placement:i,subpackages:i.finalize(t)}}},classifyChunk(e){return t(e)},getPackageLocation(e){return r().getPackageLocation(e)},getPhysicalChunkId(e){return r().getPhysicalChunkId(e)},getSubpackages(){if(n.phase!==`finalized`)throw Error(`Mini Program subpackages are unavailable before output finalization`);return n.subpackages}}}const Zi={document:[St,`document`],navigator:[St,`navigator`],requestAnimationFrame:[St,`requestAnimationFrame`],cancelAnimationFrame:[St,`cancelAnimationFrame`],Element:[St,`TaroElement`],SVGElement:[St,`SVGElement`],MutationObserver:[St,`MutationObserver`],history:[St,`history`],location:[St,`location`]},Qi=Object.fromEntries(Object.keys(Zi).map(e=>[e,`globalThis.${e}`]));function $i(e){let t=[...new Set(e.options.polyfills??[])];return{name:`vpt:mini-polyfills`,config(){return{build:{rolldownOptions:{
|
|
10
|
+
`);return/* @__PURE__ */ Error(`${e}\n${t}:${a}:${o}`)}async function Ei({code:e,id:t,sourcemap:r,addWatchFile:i}){let a=pi(e,t,r),s=Ee(t),c=await Promise.all(a.definitions.map(e=>li(e,s)));c.forEach(e=>{i(e.folder),e.assets.forEach(t=>{i(o(n.join(e.folder,t.relativePath)))})});let l=c.reduce((e,t)=>e+t.assets.reduce((e,t)=>e+t.byteLength,0),0);return{code:a.code,map:a.map,meta:{"vpt:native-components":{sources:c,assetBytes:l}}}}function Di(){return{name:`vpt:mini-native-component`,transform:{order:`pre`,filter:{code:be},handler(e,t){return Ei({code:e,id:t,sourcemap:!!this.environment.config.build.sourcemap,addWatchFile:e=>this.addWatchFile(e)})}}}}function Oi(e){return n.posix.normalize(e)}function ki(e,t){if(!t.startsWith(`./`)&&!t.startsWith(`../`))throw Error(`Expected a relative chunk reference in ${e}: ${t}`);return n.posix.join(n.posix.dirname(e),t)}function Ai(e,t){return Oi(ki(e,t))}function ji({bundle:e,classifyModule:t,getPackageLocation:r}){let i=[],a=n.posix.dirname(Et);for(let o of Object.keys(e).sort()){let s=e[o];if(s.type!==`chunk`)continue;let c=t(s);if(c===`native`)continue;let l=r(s),u=l.kind===`subpackage`;if(c===`amphibious`&&u)throw Error(`Amphibious module must be in the main package: ${s.fileName}`);let d=Oi(u?s.fileName.slice(l.root.length+1):s.fileName),f=n.posix.relative(a,s.fileName),p=JSON.stringify(f.startsWith(`.`)?f:`./${f}`),m=`${u?`require.async`:`require`}(${p})`,h=c===`amphibious`?`[[],function(e){return{execute:function(){e(${m})}}}]`:m;i.push(`case ${JSON.stringify(d)}:return ${h};`)}return{type:`asset`,fileName:Et,source:`"use strict";exports.transport=function(m){switch(m){${i.join(``)}default:throw new Error('Unknown module: '+m)}};`}}async function Mi({bundle:e,getModuleInfo:t,getPackageLocation:r}){let i=[],a=[];for(let o of Object.values(e)){if(o.type!==`chunk`)continue;let e=r(o),s=e.kind===`subpackage`?e.root:void 0;for(let e of o.moduleIds){let r=ci(t(e)?.meta);for(let e of r){let t=n.posix.basename(e.folder),r=n.posix.join(`components`,t),o=s?n.posix.join(s,r):r;a.push({name:t,componentPath:`/${n.posix.join(o,e.entry)}`,fields:e.fields});for(let t of e.assets)i.push({type:`asset`,fileName:n.posix.join(o,t.relativePath),source:await w(n.join(e.folder,t.relativePath))})}}}return{files:i,registrations:a}}async function Ni({bundle:e,contract:t,subpackages:n,isProduction:r,getModuleInfo:i,getPackageLocation:a}){let o=await Mi({bundle:e,getModuleInfo:i,getPackageLocation:a});return[{type:`asset`,fileName:t.styles.appFileName,source:`@import "./${t.styles.globalFileName}";\n`},...t.output.generateProjectSkeleton({bundle:e,subpackages:n,nativeComponents:o.registrations,isProduction:r}),...o.files]}const Pi=`sub/p_`,Fi={kind:`main`};function Ii({chunks:e,planningBudgetBytes:t,getAdditionalModuleBytes:n}){let r=new Map(Object.entries(e).sort(([e],[t])=>e.localeCompare(t))),i=new Map([...r.values()].flatMap(e=>e.facadeModuleId===null?[]:[[e.facadeModuleId,e]])),a=Li(r),o=Ri({chunks:r,mainChunkIds:a}),s=Bi({chunks:[...r].filter(([e])=>!a.has(e)).map(([e,t])=>({chunkId:e,estimatedBytes:Ki(t)+t.moduleIds.reduce((e,t)=>e+n(t),0),transitions:o.get(e)??/* @__PURE__ */ new Set})),planningBudgetBytes:t}).map(qi),c=/* @__PURE__ */ new Map;for(let e of a)c.set(e,Fi);for(let e of s)for(let t of e.chunkIds)c.set(t,e);function l(e){let t=c.get(e);if(!t)throw Error(`Mini Program placement is missing final chunk: ${e}`);return t}function u(e){return l(`preliminaryFileName`in e?e.preliminaryFileName:e.fileName)}return{getPackageLocation:u,getPhysicalChunkId(e){let t=typeof e==`string`?i.get(e):e;if(!t)throw Error(`Mini Program placement is missing entry module: ${e}`);let n=u(t);return n.kind===`main`?t.fileName:`${n.root}/${t.fileName}`},finalize(e){let t=Object.values(e).filter(e=>e.type===`chunk`),n=/* @__PURE__ */ new Set;for(let e of t){let t=l(e.preliminaryFileName);t.kind===`subpackage`&&(e.fileName=`${t.root}/${e.fileName}`,n.add(t.root))}return[...n].sort().map(e=>({root:e}))}}}function Li(e){let t=/* @__PURE__ */ new Set,n=[...e].filter(([,e])=>e.isEntry).map(([e])=>e);for(;n.length>0;){let r=n.pop();if(!r||t.has(r))continue;let i=e.get(r);i&&(t.add(r),n.push(...i.imports))}return t}function Ri({chunks:e,mainChunkIds:t}){let n=/* @__PURE__ */ new Map,r=0;for(let i of e.values())for(let a of[...i.dynamicImports].sort())if(e.has(a)&&!t.has(a)){for(let i of zi({rootId:a,chunks:e,mainChunkIds:t})){let e=n.get(i)??/* @__PURE__ */ new Set;e.add(r),n.set(i,e)}r++}return n}function zi({rootId:e,chunks:t,mainChunkIds:n}){let r=/* @__PURE__ */ new Set,i=[e];for(;i.length>0;){let e=i.pop();if(!e||r.has(e)||n.has(e))continue;let a=t.get(e);a&&(r.add(e),i.push(...a.imports))}return[...r].sort()}function Bi({chunks:e,planningBudgetBytes:t}){let n=[],r=[...e].sort(Vi);for(let e of r)Gi(e.estimatedBytes<=t?Hi({bins:n,chunk:e,planningBudgetBytes:t})??Wi(n):Wi(n),e);return n}function Vi(e,t){return t.transitions.size-e.transitions.size||t.estimatedBytes-e.estimatedBytes||e.chunkId.localeCompare(t.chunkId)}function Hi({bins:e,chunk:t,planningBudgetBytes:n}){let r;for(let i of e){if(i.estimatedBytes+t.estimatedBytes>n)continue;let e={bin:i,overlap:Ui(i.transitions,t.transitions),remainingBytes:n-i.estimatedBytes-t.estimatedBytes};(!r||e.overlap>r.overlap||e.overlap===r.overlap&&e.remainingBytes<r.remainingBytes)&&(r=e)}return r?.bin}function Ui(e,t){let[n,r]=e.size<=t.size?[e,t]:[t,e],i=0;for(let e of n)r.has(e)&&i++;return i}function Wi(e){let t={chunkIds:[],estimatedBytes:0,transitions:/* @__PURE__ */ new Set};return e.push(t),t}function Gi(e,t){e.chunkIds.push(t.chunkId),e.estimatedBytes+=t.estimatedBytes;for(let n of t.transitions)e.transitions.add(n)}function Ki(e){let t=Object.values(e.modules).reduce((e,t)=>e+(t.code?Buffer.byteLength(t.code,`utf8`):0),0),n=e.moduleIds.length*64,r=(e.imports.length+e.dynamicImports.length)*32;return t+n+r+64}function qi(e){let t=[...e.chunkIds].sort(),n=x(`sha256`).update(t.join(`\0`)).digest(`hex`).slice(0,8);return{kind:`subpackage`,root:`${Pi}${n}`,chunkIds:t}}function Ji(e){return e.startsWith(Pi)}function Yi(e){return{output:{codeSplitting:{groups:[{name:`polyfills`,test:At,priority:200,includeDependenciesRecursively:!1},{name:`vendor`,test:jt,priority:100,includeDependenciesRecursively:!0}]},entryFileNames(t){switch(e(t)){case`native`:return`[name]`;case`entry-capsule`:return`[name].js`;default:return`common/[name].js`}},chunkFileNames:`common/[name].js`},preserveEntrySignatures:`allow-extension`}}function Xi(e){let t=Mt(e),n={phase:`idle`};function r(){if(n.phase===`idle`||n.phase===`awaiting-chunks`)throw Error(`Mini Program placement is unavailable before Rolldown exposes the final chunk graph`);return n.placement}return{name:`vpt:mini-placer`,config(){return{build:{rolldownOptions:Yi(t)}}},renderStart(){n={phase:`awaiting-chunks`}},renderChunk:{order:`pre`,handler(e,t,r,i){if(n.phase!==`planned`){if(n.phase!==`awaiting-chunks`)throw Error(`Mini Program placement received final chunks during the ${n.phase} phase`);n={phase:`planned`,placement:Ii({chunks:i.chunks,planningBudgetBytes:19e5,getAdditionalModuleBytes:e=>si(this.getModuleInfo(e)?.meta)})}}}},generateBundle:{order:`pre`,handler(e,t){let i=r();n={phase:`finalized`,placement:i,subpackages:i.finalize(t)}}},classifyChunk(e){return t(e)},getPackageLocation(e){return r().getPackageLocation(e)},getPhysicalChunkId(e){return r().getPhysicalChunkId(e)},getSubpackages(){if(n.phase!==`finalized`)throw Error(`Mini Program subpackages are unavailable before output finalization`);return n.subpackages}}}const Zi={document:[St,`document`],navigator:[St,`navigator`],requestAnimationFrame:[St,`requestAnimationFrame`],cancelAnimationFrame:[St,`cancelAnimationFrame`],Element:[St,`TaroElement`],SVGElement:[St,`SVGElement`],MutationObserver:[St,`MutationObserver`],history:[St,`history`],location:[St,`location`]},Qi=Object.fromEntries(Object.keys(Zi).map(e=>[e,`globalThis.${e}`]));function $i(e){let t=[...new Set(e.options.polyfills??[])];return{name:`vpt:mini-polyfills`,config(){return{build:{rolldownOptions:{transform:{inject:Zi}}}}},transform:{filter:{id:kt,code:RegExp(`\\\\|\\b(?:${Object.keys(Zi).join(`|`)})\\b`)},handler(e,t){return c(e,t,{define:Qi,sourcemap:!!this.environment.config.build.sourcemap})}},resolveId:{filter:{id:Te(Tt)},handler(){return Tt}},load:{filter:{id:Te(Tt)},handler(){return t.map(e=>`import ${JSON.stringify(ea(e))};`).join(`
|
|
11
11
|
`)}}}}function ea(e){if(!/^[a-z][a-z\d]*(?:[.-][a-z\d]+)*$/.test(e))throw Error(`Invalid core-js polyfill module: ${JSON.stringify(e)}. Use a module name such as "web.url".`);try{return M.resolve(`core-js/modules/${e}.js`)}catch(t){throw Error(`Unknown core-js polyfill module: ${JSON.stringify(e)}.`,{cause:t})}}var ta=class{original;#e=/* @__PURE__ */ new Map;#t=[];constructor(e){this.original=e}overwrite(e,t,n){this.#t.push({content:n,end:t,start:e})}prependLeft(e,t){this.#n(e).prepend.push(t)}appendLeft(e,t){this.#n(e).append.push(t)}appendRight(e,t){this.#n(e).append.push(t)}compile(){let e={original:this.original,replacements:this.#t.toSorted((e,t)=>e.start-t.start||t.end-e.end),insertions:[...this.#e].sort(([e],[t])=>e-t).map(([e,t])=>({start:e,content:t.prepend.toReversed().join(``)+t.append.join(``)}))};return{render:(t,n)=>ra(e,t,n,!0,!0),renderOutside:t=>na(e,t)}}#n(e){let t=this.#e.get(e);if(t)return t;let n={append:[],prepend:[]};return this.#e.set(e,n),n}};function na(e,t){let n=[],r=0,i=!0;for(let a of t)n.push(ra(e,r,a.start,i,!1)),r=a.end,i=!1;return n.push(ra(e,r,e.original.length,i,!0)),n.join(``)}function ra(e,t,n,r,i){let a=t,o=ia(e.insertions,t),s=[],c=(n,i)=>{for(;o<e.insertions.length;){let c=e.insertions[o];if(c.start>n||c.start===n&&!i)break;o++,!(c.start<a||c.start===t&&!r)&&(s.push(e.original.slice(a,c.start),c.content),a=c.start)}s.push(e.original.slice(a,n)),a=n};for(let r=ia(e.replacements,t);r<e.replacements.length;r++){let t=e.replacements[r];if(t.start>=n)break;if(!(t.end>n||t.end<=a)){if(t.start<a)throw Error(`Partially overlapping source edits at ${t.start}:${t.end}`);c(t.start,!1),s.push(t.content),a=t.end}}return c(n,i),s.join(``)}function ia(e,t){let n=0,r=e.length;for(;n<r;){let i=Math.floor((n+r)/2);e[i].start<t?n=i+1:r=i}return n}function aa(e){let t=p(e.filename,e.code);if(t.errors.length>0){let n=t.errors.map(e=>e.message).join(`; `);throw Error(`Failed to parse ${e.filename} with Oxc: ${n}`)}let n=oa(t.program,e.filename);if(!e.sourcemap){let t=new ta(e.code);return ua(t,n),ha(t,n,e),{code:ya(t,n,e),map:null}}let r=new d(e.code,{filename:e.filename});return ua(r,n),ha(r,n,e),ba(r,n,e),{code:r.toString(),map:Ka(r,e.filename)}}function oa(e,t){let n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=[],o=[],s=[],c=/* @__PURE__ */ new Set,l=/* @__PURE__ */ new Set,u=new Be({preserveExitedScopes:!0}),d=0,f=!1,p=!1;Re(e,{scopeTracker:u,enter(e,t){if(e.type===`Identifier`&&n.add(e.name),e.type===`CallExpression`&&e.callee.type===`Identifier`&&e.callee.name===`eval`&&(f=!0),Ba(e)&&(d+=1),e.type===`AwaitExpression`&&d===0&&(p=!0),e.type===`VariableDeclaration`&&d===0&&(e.kind===`var`||t?.type===`Program`)&&(o.push(e),e.kind===`var`)){if(t?.type!==`Program`){let n=(t?.type===`ForInStatement`||t?.type===`ForOfStatement`)&&t.left===e;s.push({declaration:e,isForIterationBinding:n})}Fa(e).forEach(e=>{l.add(e)})}},leave(e){Ba(e)&&--d}});for(let n of e.body)switch(n.type){case`ImportDeclaration`:sa(n,i,c,l,t);break;case`ExportNamedDeclaration`:ca(n,r,t);break;case`ExportDefaultDeclaration`:case`ExportAllDeclaration`:throw Ga(t,`source-level ${n.type}`);case`VariableDeclaration`:Ua(n,t),n.declarations.flatMap(e=>Ia(e.id)).forEach(e=>{l.add(e)});break;case`FunctionDeclaration`:{let e=n.id;a.push(n),l.add(e.name);break}case`ClassDeclaration`:{let e=n.id;l.add(e.name);break}}u.freeze(),Ha(f,t);let m=Ma(n,i.size);return la(r,l,t),{dependencies:[...i.values()],exportNamesByLocal:r,functions:a,generatedNames:m,hasTopLevelAwait:p,importBindings:c,moduleVariables:o,nestedHoistedVariables:s,outerBindings:l,program:e,scopes:u}}function sa(e,t,n,r,i){if(e.phase||e.attributes.length>0||e.importKind===`type`)throw Ga(i,`import phases, attributes, or type-only imports`);let a=e.source.value,o=t.get(a)??{source:a,imports:[]};t.has(a)||t.set(a,o);for(let t of e.specifiers)switch(n.add(t.local.name),r.add(t.local.name),t.type){case`ImportDefaultSpecifier`:o.imports.push({imported:`default`,local:t.local.name});break;case`ImportNamespaceSpecifier`:o.imports.push({imported:null,local:t.local.name});break;case`ImportSpecifier`:o.imports.push({imported:Na(t.imported),local:t.local.name})}}function ca(e,t,n){if(e.declaration||e.source||e.attributes.length>0||e.exportKind===`type`)throw Ga(n,`declaration exports, re-exports, export attributes, or type-only exports`);for(let n of e.specifiers){let e=Na(n.local),r=Na(n.exported),i=t.get(e)??[];i.push(r),t.has(e)||t.set(e,i)}}function la(e,t,n){for(let r of e.keys())if(!t.has(r))throw Ga(n,`export of non-module binding ${JSON.stringify(r)}`)}function ua(e,t){for(let n of t.program.body)switch(n.type){case`ImportDeclaration`:e.overwrite(n.start,n.end,``);break;case`ExportNamedDeclaration`:e.overwrite(n.start,n.end,Ca(n.specifiers,t));break;case`VariableDeclaration`:da(e,n,t.generatedNames.exportBinding,t.exportNamesByLocal);break;case`ClassDeclaration`:ma(e,n,t.generatedNames.exportBinding,t.exportNamesByLocal)}for(let{declaration:n,isForIterationBinding:r}of t.nestedHoistedVariables)fa(e,n,r,t.generatedNames.exportBinding,t.exportNamesByLocal)}function da(e,t,n,r){let i=t.declarations[0];e.overwrite(t.start,i.start,`(`),e.appendLeft(Wa(e.original,t.end),`)`),pa(e,t,n,r)}function fa(e,t,n,r,i){let a=t.declarations[0];e.overwrite(t.start,a.start,n?``:`(`),n||e.appendLeft(Wa(e.original,t.end),`)`),pa(e,t,r,i)}function pa(e,t,n,r){for(let i of t.declarations){if(!i.init)continue;let t=Ia(i.id).flatMap(e=>(r.get(e)??[]).map(t=>({exported:t,local:e})));if(t.length!==0){if(i.id.type===`Identifier`){let t=r.get(i.id.name);e.prependLeft(i.start,Ea(n,t,``)),e.appendRight(i.end,Da(t));continue}e.prependLeft(i.start,`(`),e.appendRight(i.end,`,${t.map(({exported:e,local:t})=>Aa(n,e,t)).join(`,`)})`)}}}function ma(e,t,n,r){let i=t.id,a=r.get(i.name)??[];e.prependLeft(t.start,Ea(n,a,`${i.name}=`)),e.appendRight(t.end,Da(a))}function ha(e,t,n){let r=t.scopes,i=0;Re(t.program,{scopeTracker:r,enter(a){switch(Va(a)&&(i+=1),a.type){case`ImportExpression`:if(a.options||a.phase)throw Ga(n.filename,`dynamic import options or phases`);e.overwrite(a.start,a.source.start,`${t.generatedNames.context}.import(`),a.source.type===`Literal`&&typeof a.source.value==`string`&&e.overwrite(a.source.start,a.source.end,JSON.stringify(n.resolveReference(a.source.value,`dynamic`)));break;case`MetaProperty`:a.meta.name===`import`&&a.property.name===`meta`&&e.overwrite(a.start,a.end,`${t.generatedNames.context}.meta`);break;case`ThisExpression`:i===0&&e.overwrite(a.start,a.end,`void 0`);break;case`AssignmentExpression`:ga(e,a.left,a.start,a.end,r,t,n.filename);break;case`UpdateExpression`:_a(e,a,r,t);break;case`ForInStatement`:case`ForOfStatement`:a.left.type!==`VariableDeclaration`&&va(a.left,r,t.exportNamesByLocal,n.filename)}},leave(e){Va(e)&&--i}})}function ga(e,t,n,r,i,a,o){if(t.type===`Identifier`){let o=Ta(t.name,i,a.exportNamesByLocal);if(o.length===0)return;e.prependLeft(n,Ea(a.generatedNames.exportBinding,o,``)),e.appendRight(r,Da(o));return}va(t,i,a.exportNamesByLocal,o)}function _a(e,t,n,r){if(t.argument.type!==`Identifier`)return;let i=Ta(t.argument.name,n,r.exportNamesByLocal);if(i.length===0)return;if(t.prefix){e.prependLeft(t.start,Ea(r.generatedNames.exportBinding,i,``)),e.appendRight(t.end,Da(i));return}let a=`+${t.argument.name}${t.operator[0]}1`;e.prependLeft(t.start,`(${Oa(r.generatedNames.exportBinding,i,a)},`),e.appendRight(t.end,`)`)}function va(e,t,n,r){let i=La(e).filter(e=>Ta(e,t,n).length>0);if(i.length>0)throw Ga(r,`destructuring write to exported binding ${JSON.stringify(i[0])}`)}function ya(e,t,n){let r=xa(t,n),i=e.compile(),a=t.functions.map(e=>i.render(e.start,e.end)).join(``);return`${r.prefix}${i.renderOutside(t.functions)}}};${a}${r.suffix}`}function ba(e,t,n){let r=xa(t,n);for(let n of t.functions)e.move(n.start,n.end,e.original.length);e.prepend(r.prefix),e.prependLeft(e.original.length,`}};`),e.append(r.suffix)}function xa(e,t){let n=e.dependencies.map(e=>t.resolveReference(e.source,`static`)),r=e.dependencies.map((t,n)=>wa(t,n,e.generatedNames)),i=Sa(e),a=e.outerBindings.size>0?`var ${[...e.outerBindings].join(`,`)};`:``,o=e.hasTopLevelAwait?`async function`:`function`,s=`function(${e.generatedNames.exportBinding},${e.generatedNames.context}){"use strict";${a}${i}return {setters:[${r.join(`,`)}],execute:${o}(){`;return t.format===`system-register`?{prefix:`System.register(${JSON.stringify(n)},${s}`,suffix:`})`}:{prefix:`module.exports=[${JSON.stringify(n)},${s}`,suffix:`}]`}}function Sa(e){let t=new Set(e.functions.map(e=>e.id.name)),n=[];for(let[r,i]of e.exportNamesByLocal)if(t.has(r))for(let e of i)n.push({exported:e,value:r});for(let t of e.moduleVariables)for(let r of t.declarations)if(!r.init)for(let t of Ia(r.id))for(let r of e.exportNamesByLocal.get(t)??[])n.push({exported:r,value:`void 0`});if(n.length===0)return``;if(n.length===1){let[t]=n;return ja(e.generatedNames.exportBinding,t.exported,t.value)}let r=n.map(({exported:e,value:t})=>`[${JSON.stringify(e)}]:${t}`).join(`,`);return`${e.generatedNames.exportBinding}({${r}});`}function Ca(e,t){return e.filter(e=>t.importBindings.has(Na(e.local))).map(e=>{let n=Na(e.local);return ja(t.generatedNames.exportBinding,Na(e.exported),n)}).join(``)}function wa(e,t,n){let r=`${n.dependencyPrefix}${t}`;return`function(${r}){${e.imports.flatMap(e=>{let t=e.imported===null?r:Pa(r,e.imported);return[`${e.local}=${t};`]}).join(``)}}`}function Ta(e,t,n){let r=n.get(e)??[];return r.length===0||t.getDeclaration(e)?.scope===``?r:[]}function Ea(e,t,n){return t.length===0?n:t.reduce((t,n)=>`${ka(e,n)}${t}`,n)}function Da(e){return`)`.repeat(e.length)}function Oa(e,t,n){return t.reduce((t,n)=>`${ka(e,n)}${t})`,n)}function ka(e,t){return`${e}(${JSON.stringify(t)},`}function Aa(e,t,n){return`${e}(${JSON.stringify(t)},${n})`}function ja(e,t,n){return`${e}(${JSON.stringify(t)},${n});`}function Ma(e,t){let n=t=>{let n=0,r=t;for(;e.has(r);)n+=1,r=`${t}${n}`;return r};return{context:n(`__systemContext`),exportBinding:n(`__systemExport`),dependencyPrefix:(n=>{let r=0,i=n;for(;;){let a=0;for(;a<t&&!e.has(`${i}${a}`);)a+=1;if(a===t)return i;r+=1,i=`${n}${r}`}})(`__systemDependency`)}}function Na(e){return e.type===`Literal`?String(e.value):e.name}function Pa(e,t){return/^[$A-Z_a-z][$\w]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function Fa(e){return e.declarations.flatMap(e=>Ia(e.id))}function Ia(e){return Ra(e)}function La(e){return Ra(e)}function Ra(e){switch(e.type){case`Identifier`:return[e.name];case`AssignmentPattern`:return Ra(e.left);case`ArrayPattern`:return e.elements.flatMap(e=>e?Ra(e):[]);case`ObjectPattern`:return e.properties.flatMap(e=>e.type===`Property`?Ra(e.value):Ra(e.argument));case`RestElement`:return Ra(e.argument);default:return[]}}function za(e){return e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ArrowFunctionExpression`||e.type===`TSEmptyBodyFunctionExpression`}function Ba(e){return za(e)||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function Va(e){return za(e)&&e.type!==`ArrowFunctionExpression`||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function Ha(e,t){if(e)throw Ga(t,`direct eval`)}function Ua(e,t){if(e.kind===`using`||e.kind===`await using`||e.declare)throw Ga(t,`using or ambient variable declaration`)}function Wa(e,t){return e[t-1]===`;`?t-1:t}function Ga(e,t){return/* @__PURE__ */ Error(`Unsupported final Rolldown chunk ${e}: ${t}`)}function Ka(e,t){let n=e.generateMap({file:t,hires:`boundary`,includeContent:!0,source:t});return{version:n.version,file:n.file,sources:n.sources,sourcesContent:n.sourcesContent,names:n.names,mappings:n.mappings}}function qa(e,t,n){return aa({code:e,filename:t.fileName,format:`commonjs-registration`,sourcemap:n,resolveReference(e,n){return Ja(t.fileName,e,n)}})}function Ja(e,t,n){return n===`dynamic`&&!t.startsWith(`./`)&&!t.startsWith(`../`)?t:Ai(e,t)}function Ya({code:e,chunk:t,chunks:n,bootstrapModuleId:r,getPhysicalChunkId:i,classifyModule:a,sourcemap:o}){let s=p(t.fileName,e);if(s.errors.length>0){let e=s.errors.map(e=>e.message).join(`; `);throw Error(`Failed to parse ${t.fileName} with Oxc: ${e}`)}let c=Xa(s.program,t,n,r,i,a),l=new d(e,{filename:t.fileName});Qa(l,c,t.fileName);let u=$a(l,c,t.fileName);Za(l,c);let f=c.exportNamesByLocal.size>0,m=vo(c),h=u?`var ${c.postfixTemp};`:``,g=go(c);return f?l.prepend(`"use strict";Object.defineProperty(exports,"__esModule",{value:true});${m}${h}${g}`):l.prepend(`"use strict";${m}${h}${g}`),{code:l.toString(),map:o?Eo(l,t.fileName):null}}function Xa(e,t,r,i,a,o){let s=/* @__PURE__ */ new Set,c=/* @__PURE__ */ new Map,l=[],u=/* @__PURE__ */ new Map,d=new Be({preserveExitedScopes:!0}),f=[],m=!1;if(Re(e,{scopeTracker:d,enter(e){e.type===`Identifier`&&s.add(e.name),e.type===`CallExpression`&&e.callee.type===`Identifier`&&e.callee.name===`eval`&&(m=!0),e.type===`ImportExpression`&&f.push(e)}}),d.freeze(),m)throw To(t.fileName,`direct eval`);let h=0;function g(e,t){let n=t;if(n===void 0){for(n=h===0?`__nativeImport`:`__nativeImport${h}`;s.has(n);)h+=1,n=`__nativeImport${h}`;s.add(n),h+=1}let r=n;return{bindings:e.specifiers.map(e=>{let t={imported:e.type===`ImportNamespaceSpecifier`?null:e.type===`ImportDefaultSpecifier`?`default`:xo(e.imported),local:e.local.name,namespace:r};return u.set(t.local,t),t}),capsuleBinding:null,interop:_o(e),namespace:r,reference:e.source.value}}for(let n of e.body)switch(n.type){case`ImportDeclaration`:{yo(n,t.fileName);let e=ho(t.fileName,n.source.value,r,o);if(e){let[r]=n.specifiers;if(n.specifiers.length!==1||!r||r.type===`ImportNamespaceSpecifier`)throw Error(`Expected one capsule value import from ${e.fileName} in ${t.fileName}`);l.push({bindings:[],capsuleBinding:{imported:r.type===`ImportDefaultSpecifier`?`default`:xo(r.imported),local:r.local.name,logicalId:Ai(t.fileName,n.source.value)},interop:`none`,namespace:``,reference:n.source.value});continue}l.push(g(n,void 0));break}case`ExportNamedDeclaration`:io(n,c,t.fileName);break;case`ExportDefaultDeclaration`:case`ExportAllDeclaration`:throw To(t.fileName,`source-level ${n.type}`)}if(f.length>0||l.some(e=>e.capsuleBinding)){let e=n.posix.relative(n.posix.dirname(a(t)),a(i)),r=e.startsWith(`../`)?e:`./${e}`,o=bo(`__nativeSystem`,s),c=p(t.fileName,`import { System as ${o} } from ${JSON.stringify(r)}`).program.body[0],u=l.findIndex(e=>e.reference===r),d=u<0?void 0:l.splice(u,1)[0],f=g(c,d?.namespace);l.unshift(d?{...d,bindings:[...f.bindings,...d.bindings]}:f)}return{defaultInterop:bo(`__nativeDefault`,s),dynamicImports:f,exportNamesByLocal:c,imports:l,importBindingsByLocal:u,namespaceInterop:bo(`__nativeNamespace`,s),postfixTemp:bo(`__nativePostfix`,s),program:e,scopes:d}}function Za(e,t){for(let n of t.program.body)switch(n.type){case`ImportDeclaration`:e.remove(n.start,n.end);break;case`ExportNamedDeclaration`:n.declaration?(e.remove(n.start,n.declaration.start),ao(e,n.declaration,t.exportNamesByLocal)):e.overwrite(n.start,n.end,oo(n.specifiers,t));break;case`VariableDeclaration`:so(e,n,t.exportNamesByLocal);break;case`FunctionDeclaration`:n.id&&co(e,n.end,n.id.name,t.exportNamesByLocal);break;case`ClassDeclaration`:n.id&&co(e,n.end,n.id.name,t.exportNamesByLocal)}}function Qa(e,t,n){for(let r of t.dynamicImports){if(r.options||r.phase)throw To(n,`dynamic import options or phases`);let i=po(t.imports[0].bindings[0]);e.overwrite(r.start,r.source.start,`${i}.import(`),r.source.type===`Literal`&&typeof r.source.value==`string`&&(r.source.value.startsWith(`./`)||r.source.value.startsWith(`../`))&&e.overwrite(r.source.start,r.source.end,JSON.stringify(Ai(n,r.source.value)))}}function $a(e,t,n){let r=[],i=0,a=!1;return Re(t.program,{scopeTracker:t.scopes,enter(o,s){if(wo(o)&&(i+=1),o.type===`ThisExpression`&&i===0&&e.overwrite(o.start,o.end,`void 0`),o.type===`Identifier`&&s?.type!==`ImportDeclaration`&&We(o,s)){let n=t.importBindingsByLocal.get(o.name),i=n?t.scopes.getDeclaration(o.name):null;if(n&&i?.type===`Import`){let t=fo(o,s,r),i=po(n),a=t===`unbound`?`(0,${i})`:i;e.overwrite(o.start,o.end,s?.type===`Property`&&s.shorthand&&s.value===o?`${o.name}:${a}`:a)}}switch(o.type){case`AssignmentExpression`:eo(e,o.left,o.start,t,n);break;case`UpdateExpression`:to(e,o,t)&&(a=!0);break;case`ForInStatement`:case`ForOfStatement`:o.left.type!==`VariableDeclaration`&&no(o.left,t,n)}r.push(o)},leave(e){r.pop(),wo(e)&&--i}}),a}function eo(e,t,n,r,i){if(t.type===`Identifier`){let i=ro(t.name,r);i.length>0&&e.prependLeft(n,lo(i));return}no(t,r,i)}function to(e,t,n){if(t.argument.type!==`Identifier`)return!1;let r=ro(t.argument.name,n);return r.length===0?!1:t.prefix?(e.prependLeft(t.start,lo(r)),!1):(e.prependLeft(t.start,`(${n.postfixTemp}=`),e.appendRight(t.end,`,${uo(r,t.argument.name)},${n.postfixTemp})`),!0)}function no(e,t,n){let r=Co(e).filter(e=>ro(e,t).length>0);if(r.length>0)throw To(n,`destructuring write to exported binding ${JSON.stringify(r[0])}`)}function ro(e,t){let n=t.exportNamesByLocal.get(e)??[];return n.length===0||t.scopes.getDeclaration(e)?.scope===``?n:[]}function io(e,t,n){if(e.source||e.attributes.length>0||e.exportKind===`type`)throw To(n,`re-exports, export attributes, or type-only exports`);if(e.declaration){for(let r of So(e.declaration,n)){let e=t.get(r)??[];e.push(r),t.has(r)||t.set(r,e)}return}for(let n of e.specifiers){let e=xo(n.local),r=t.get(e)??[];r.push(xo(n.exported)),t.has(e)||t.set(e,r)}}function ao(e,t,n){switch(t.type){case`VariableDeclaration`:so(e,t,n);break;case`FunctionDeclaration`:case`ClassDeclaration`:t.id&&co(e,t.end,t.id.name,n)}}function oo(e,t){return e.map(e=>{let n=xo(e.local),r=xo(e.exported),i=t.importBindingsByLocal.get(n);return i?`Object.defineProperty(exports,${JSON.stringify(r)},{enumerable:true,get:function(){return ${po(i)}}});`:``}).join(``)}function so(e,t,n){for(let r of t.declarations){if(r.id.type!==`Identifier`){if(Co(r.id).filter(e=>n.has(e)).length>0)throw To(`native chunk`,`exported destructuring declaration`);continue}let t=n.get(r.id.name)??[];t.length!==0&&(r.init?e.prependLeft(r.init.start,lo(t)):e.appendRight(r.end,`=${uo(t,`void 0`)}`))}}function co(e,t,n,r){let i=r.get(n)??[];i.length>0&&e.appendRight(t,`;${uo(i,n)};`)}function lo(e){return e.reduce((e,t)=>`exports[${JSON.stringify(t)}]=${e}`,``)}function uo(e,t){return`${lo(e)}${t}`}function fo(e,t,n){let r=e,i=t,a=n.length-1;for(;i?.type===`ParenthesizedExpression`&&i.expression===r;)r=i,--a,i=n[a];return i?.type===`CallExpression`&&i.callee===r?`unbound`:i?.type===`NewExpression`&&i.callee===r?`plain`:i?.type===`TaggedTemplateExpression`&&i.tag===r?`unbound`:`plain`}function po(e){return e.imported===null?e.namespace:mo(e.namespace,e.imported)}function mo(e,t){return/^[$A-Z_a-z][$\w]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function ho(e,t,n,r){if(!t.startsWith(`./`)&&!t.startsWith(`../`))return;let i=n[ki(e,t)];return i&&r(i)===`entry-capsule`?i:void 0}function go(e){return e.imports.map(t=>{if(t.capsuleBinding){let{imported:n,local:r,logicalId:i}=t.capsuleBinding;return`var ${r}=${mo(`${po(e.imports[0].bindings[0])}.importSync(${JSON.stringify(i)})`,n)};`}let n=`require(${JSON.stringify(t.reference)})`;if(t.bindings.length===0)return`${n};`;let r=t.interop==="default"?`${e.defaultInterop}(${n})`:t.interop===`namespace`?`${e.namespaceInterop}(${n})`:n;return`var ${t.namespace}=${r};`}).join(``)}function _o(e){return e.specifiers.some(e=>e.type===`ImportNamespaceSpecifier`)?`namespace`:e.specifiers.some(e=>e.type===`ImportDefaultSpecifier`)?`default`:`none`}function vo(e){let t=new Set(e.imports.map(({interop:e})=>e));return`${t.has(`default`)?`function ${e.defaultInterop}(value){return value&&value.__esModule?value:{default:value};}`:``}${t.has(`namespace`)?`function ${e.namespaceInterop}(value){if(value&&value.__esModule)return value;var namespace={default:value};if(value!==null&&(typeof value==="object"||typeof value==="function")){for(var key in value)if(key!=="default"&&Object.prototype.hasOwnProperty.call(value,key))Object.defineProperty(namespace,key,{enumerable:true,get:function(key){return function(){return value[key]}}(key)});}return namespace;}`:``}`}function yo(e,t){if(e.phase||e.attributes.length>0||e.importKind===`type`)throw To(t,`import phases, attributes, or type-only imports`)}function bo(e,t){let n=0,r=e;for(;t.has(r);)n+=1,r=`${e}${n}`;return t.add(r),r}function xo(e){return e.type===`Literal`?String(e.value):e.name}function So(e,t){return e.type===`VariableDeclaration`?e.declarations.flatMap(({id:e})=>Co(e)):[e.id.name]}function Co(e){switch(e.type){case`Identifier`:return[e.name];case`AssignmentPattern`:return Co(e.left);case`ArrayPattern`:return e.elements.flatMap(e=>e?Co(e):[]);case`ObjectPattern`:return e.properties.flatMap(e=>e.type===`Property`?Co(e.value):Co(e.argument));case`RestElement`:return Co(e.argument);default:return[]}}function wo(e){return e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function To(e,t){return/* @__PURE__ */ Error(`Unsupported final Rolldown native chunk ${e}: ${t}`)}function Eo(e,t){let n=e.generateMap({file:t,hires:`boundary`,includeContent:!0,source:t});return{version:n.version,file:n.file,sources:n.sources,sourcesContent:n.sourcesContent,names:n.names,mappings:n.mappings}}function Do({code:e,id:t,appConfig:n,sourcemap:r}){return lt(e,t,{__VPT_APP_CONFIG__:JSON.stringify(n)},r??!1)}function Oo({code:e,id:t,page:n,sourcemap:r}){return lt(e,t,{__VPT_PAGE_PATH__:JSON.stringify(n.path),__VPT_PAGE_CONFIG__:JSON.stringify(ot(n))},r??!1)}function ko(e){let t=o(e.runtime.modules.appCapsule),r=o(e.runtime.modules.pageCapsule),i=Ao(e.options.pages,e.runtime.modules),a=new Map(e.options.pages.map(e=>[e.path,e])),s=/* @__PURE__ */ new Map([[`\0vite/preload-helper.js`,()=>e.runtime.modules.bootstrap],[`\0vpt:taro-target-runtime`,()=>e.taro.targetRuntimePath],[`\0vpt:app-component`,(t,n)=>Se({appPath:e.options.app,projectRoot:n})],[`\0vpt:page-component`,(e,t)=>Ce({pagePath:Mo({moduleId:e,pageByPath:a}).path,projectRoot:t})],[`\0vpt:page-capsule`,t=>{let n=Mo({moduleId:t,pageByPath:a});return jo({moduleId:e.runtime.modules.pageCapsule,pagePath:n.path})}]]);return{...i,resolveId(e,t,r){return e===`\0vpt:mini-transport`?{id:`./${n.posix.relative(`common`,Et)}`,external:!0}:s.get(e)?.(t,r)},specialize(n,i,o){let s=Ee(i);if(s===t)return Do({code:n,id:i,appConfig:st(e.options),sourcemap:o});if(s===r)return Oo({code:n,id:i,page:Mo({moduleId:i,pageByPath:a}),sourcemap:o})}}}function Ao(e,t){let n=e.map(e=>({capsuleId:jo({moduleId:t.pageCapsule,pagePath:e.path}),capsuleName:`${e.path}-capsule`,shellId:jo({moduleId:t.pageShell,pagePath:e.path}),shellName:`${e.path}.js`}));return{applicationEntryIds:[t.appCapsule,...n.map(e=>e.capsuleId)],input:Object.fromEntries([[`bootstrap`,t.bootstrap],[`app.js`,t.appShell],[`app-capsule`,t.appCapsule],[`comp.js`,t.componentShell],[`component-capsule`,t.componentCapsule],[`custom-wrapper.js`,t.customWrapperShell],...n.flatMap(e=>[[e.shellName,e.shellId],[e.capsuleName,e.capsuleId]])])}}function jo({moduleId:e,pagePath:t}){return`${e}?route=${encodeURIComponent(t)}`}function Mo({moduleId:e,pageByPath:t}){let n=e?.indexOf(`?`)??-1,r=n===-1?void 0:new URLSearchParams(e?.slice(n+1)).get(`route`),i=r?t.get(r):void 0;if(!i)throw Error(r?`Unknown Page capsule: ${r}`:`Page capsule import must originate from a route module`);return i}var No;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(No||={});var Po;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Po||={});var Fo;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(Fo||={});var Io;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Io||={});var Lo;(function(e){e[e.Tab=9]=`Tab`,e[e.NewLine=10]=`NewLine`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.Number=35]=`Number`,e[e.Amp=38]=`Amp`,e[e.SingleQuote=39]=`SingleQuote`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Dash=45]=`Dash`,e[e.Slash=47]=`Slash`,e[e.Zero=48]=`Zero`,e[e.Nine=57]=`Nine`,e[e.Semi=59]=`Semi`,e[e.Lt=60]=`Lt`,e[e.Eq=61]=`Eq`,e[e.Gt=62]=`Gt`,e[e.Questionmark=63]=`Questionmark`,e[e.UpperA=65]=`UpperA`,e[e.LowerA=97]=`LowerA`,e[e.UpperF=70]=`UpperF`,e[e.LowerF=102]=`LowerF`,e[e.UpperZ=90]=`UpperZ`,e[e.LowerZ=122]=`LowerZ`,e[e.LowerX=120]=`LowerX`,e[e.OpeningSquareBracket=91]=`OpeningSquareBracket`})(Lo||={});var Ro;(function(e){e[e.Text=1]=`Text`,e[e.BeforeTagName=2]=`BeforeTagName`,e[e.InTagName=3]=`InTagName`,e[e.InSelfClosingTag=4]=`InSelfClosingTag`,e[e.BeforeClosingTagName=5]=`BeforeClosingTagName`,e[e.InClosingTagName=6]=`InClosingTagName`,e[e.AfterClosingTagName=7]=`AfterClosingTagName`,e[e.BeforeAttributeName=8]=`BeforeAttributeName`,e[e.InAttributeName=9]=`InAttributeName`,e[e.AfterAttributeName=10]=`AfterAttributeName`,e[e.BeforeAttributeValue=11]=`BeforeAttributeValue`,e[e.InAttributeValueDq=12]=`InAttributeValueDq`,e[e.InAttributeValueSq=13]=`InAttributeValueSq`,e[e.InAttributeValueNq=14]=`InAttributeValueNq`,e[e.BeforeDeclaration=15]=`BeforeDeclaration`,e[e.InDeclaration=16]=`InDeclaration`,e[e.InProcessingInstruction=17]=`InProcessingInstruction`,e[e.BeforeComment=18]=`BeforeComment`,e[e.CDATASequence=19]=`CDATASequence`,e[e.DeclarationSequence=20]=`DeclarationSequence`,e[e.InSpecialComment=21]=`InSpecialComment`,e[e.InCommentLike=22]=`InCommentLike`,e[e.SpecialStartSequence=23]=`SpecialStartSequence`,e[e.InSpecialTag=24]=`InSpecialTag`,e[e.InPlainText=25]=`InPlainText`,e[e.InEntity=26]=`InEntity`})(Ro||={});var zo;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(zo||={});const Bo={Empty:/* @__PURE__ */ new Uint8Array,Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,33,62]),Doctype:new Uint8Array([100,111,99,116,121,112,101]),IframeEnd:new Uint8Array([60,47,105,102,114,97,109,101]),NoembedEnd:new Uint8Array([60,47,110,111,101,109,98,101,100]),NoframesEnd:new Uint8Array([60,47,110,111,102,114,97,109,101,115]),Plaintext:new Uint8Array([60,47,112,108,97,105,110,116,101,120,116]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};Bo.IframeEnd[2],Bo.IframeEnd,Bo.NoembedEnd[2],Bo.NoembedEnd,Bo.Plaintext[2],Bo.Plaintext,Bo.ScriptEnd[2],Bo.ScriptEnd,Bo.TitleEnd[2],Bo.TitleEnd,Bo.XmpEnd[2],Bo.XmpEnd;const{fromCodePoint:Vo}=String;var Ho;(function(e){e[e.None=0]=`None`,e[e.Svg=1]=`Svg`,e[e.MathML=2]=`MathML`})(Ho||={});let Uo=()=>{var e=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},a=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of n(a))!r.call(i,c)&&c!==o&&e(i,c,{get:()=>a[c],enumerable:!(s=t(a,c))||s.enumerable});return i},o=t=>a(e({},`__esModule`,{value:!0}),t),s={};i(s,{default:()=>Ie});var c=e=>Array.isArray(e),l=e=>typeof e==`function`,u=e=>e.length===0,d=e=>typeof e==`number`,f=e=>typeof e==`object`&&!!e,p=e=>e instanceof RegExp,m=e=>typeof e==`string`,h=e=>e===void 0,g=e=>{let t=/* @__PURE__ */ new Map;return n=>{let r=t.get(n);if(r)return r;let i=e(n);return t.set(n,i),i}},_=(e,t,n={})=>{let r={cache:{},input:e,index:0,indexMax:0,options:n,output:[]};if(re(t)(r)&&r.index===e.length)return r.output;throw Error(`Failed to parse at index ${r.indexMax}`)},v=(e,t)=>c(e)?y(e,t):m(e)?x(e,t):b(e,t),y=(e,t)=>{let n={};for(let t of e){if(t.length!==1)throw Error(`Invalid character: "${t}"`);let e=t.charCodeAt(0);n[e]=!0}return e=>{let r=e.index,i=e.input;for(;e.index<i.length&&i.charCodeAt(e.index)in n;)e.index+=1;let a=e.index;if(a>r){if(!h(t)&&!e.options.silent){let n=e.input.slice(r,a),o=l(t)?t(n,i,String(r)):t;h(o)||e.output.push(o)}e.indexMax=Math.max(e.indexMax,e.index)}return!0}},b=(e,t)=>{let n=e.source,r=e.flags.replace(/y|$/,`y`),i=new RegExp(n,r);return ne(e=>{i.lastIndex=e.index;let n=i.exec(e.input);if(n){if(!h(t)&&!e.options.silent){let r=l(t)?t(...n,e.input,String(e.index)):t;h(r)||e.output.push(r)}return e.index+=n[0].length,e.indexMax=Math.max(e.indexMax,e.index),!0}return!1})},x=(e,t)=>n=>{if(n.input.startsWith(e,n.index)){if(!h(t)&&!n.options.silent){let r=l(t)?t(e,n.input,String(n.index)):t;h(r)||n.output.push(r)}return n.index+=e.length,n.indexMax=Math.max(n.indexMax,n.index),!0}return!1},S=(e,t,n,r)=>{let i=re(e);return ne(E(te(e=>{let r=0;for(;r<n;){let t=e.index;if(!i(e)||(r+=1,e.index===t))break}return r>=t})))},C=(e,t)=>S(e,0,1),w=(e,t)=>S(e,0,1/0),ee=(e,t)=>{let n=e.map(re);return ne(E(te(e=>{for(let t=0,r=n.length;t<r;t++)if(!n[t](e))return!1;return!0})))},T=(e,t)=>{let n=e.map(re);return ne(E(e=>{for(let t=0,r=n.length;t<r;t++)if(n[t](e))return!0;return!1}))},te=(e,t=!1)=>{let n=re(e);return e=>{let r=e.index,i=e.output.length,a=n(e);return(!a||t)&&(e.index=r,e.output.length!==i&&(e.output.length=i)),a}},E=(e,t)=>re(e),ne=(()=>{let e=0;return t=>{let n=re(t),r=e+=1;return e=>{var t;if(e.options.memoization===!1)return n(e);let i=e.index,a=(t=e.cache)[r]||(t[r]=/* @__PURE__ */ new Map),o=a.get(i);if(o===!1)return!1;if(d(o))return e.index=o,!0;if(o)return e.index=o.index,o.output?.length&&e.output.push(...o.output),!0;{let t=e.output.length;if(n(e)){let n=e.index,r=e.output.length;if(r>t){let o=e.output.slice(t,r);a.set(i,{index:n,output:o})}else a.set(i,n);return!0}return a.set(i,!1),!1}}}})(),D=e=>{let t;return n=>(t||=re(e()),t(n))},re=g(e=>{if(l(e))return u(e)?D(e):e;if(m(e)||p(e))return v(e);if(c(e))return ee(e);if(f(e))return T(Object.values(e));throw Error(`Invalid rule`)}),ie=`abcdefghijklmnopqrstuvwxyz`,ae=e=>{let t=``;for(;e>0;)t=ie[(e-1)%26]+t,e=Math.floor((e-1)/26);return t},oe=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t=t*26+ie.indexOf(e[n])+1;return t},se=(e,t)=>{if(t<e)return se(t,e);let n=[];for(;e<=t;)n.push(e++);return n},ce=(e,t,n)=>se(e,t).map(e=>String(e).padStart(n,`0`)),le=(e,t)=>se(oe(e),oe(t)).map(ae),O=e=>e,ue=e=>de(t=>_(t,e,{memoization:!1}).join(``)),de=e=>{let t={};return n=>t[n]??(t[n]=e(n))},fe=v(/^\*\*\/\*$/,`.*`),k=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(e,t,n)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}`),A=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(e,t,n,r)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}(?:${r.replaceAll(`,`,`|`).replaceAll(`.`,`\\.`)})`),pe=v(/\\./,O),me=v(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),j=v(/./,O),he=T([v(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${je(t)}$).*?`),v(/^(!!)+/,``)]),ge=T([v(/\/(\*\*\/)+/,`(?:/.+/|/)`),v(/^(\*\*\/)+/,`(?:^|.*/)`),v(/\/(\*\*)$/,`(?:/.*|$)`),v(/\*\*/,`.*`)]),_e=T([v(/\*\/(?!\*\*\/)/,`[^/]*/`),v(/\*/,`[^/]*`)]),M=v(`?`,`[^/]`),ve=v(`[`,O),ye=v(`]`,O),N=v(/[!^]/,`^/`),P=v(/[a-z]-[a-z]|[0-9]-[0-9]/i,O),be=T([pe,v(/[$.*+?^(){}[\|]/,e=>`\\${e}`),P,v(/[^\]]/,O)]),xe=ee([ve,C(N),w(be),ye]),Se=v(`{`,`(?:`),Ce=v(`}`,`)`),we=ee([Se,T([v(/(\d+)\.\.(\d+)/,(e,t,n)=>ce(+t,+n,Math.min(t.length,n.length)).join(`|`)),v(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>le(t,n).join(`|`)),v(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>le(t.toLowerCase(),n.toLowerCase()).join(`|`).toUpperCase())]),Ce]),Te=v(`{`,`(?:`),Ee=v(`}`,`)`),De=v(`,`,`|`),Oe=v(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),ke=v(/[^}]/,O),Ae=ee([Te,w(T([ge,_e,M,xe,we,D(()=>Ae),pe,Oe,De,ke])),Ee]),je=ue(w(T([fe,k,A,he,ge,_e,M,xe,we,Ae,pe,me,j]))),Me=v(/\\./,O),Ne=v(/./,O),Pe=ue(w(T([Me,v(/\*\*\*+/,`*`),v(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),v(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),Ne]))),Fe=(e,t)=>{let n=Array.isArray(e)?e:[e];if(!n.length)return!1;let r=n.map(Fe.compile),i=n.every(e=>/(\/(?:\*\*)?|\[\/\])$/.test(e)),a=t.replace(/[\\\/]+/g,`/`).replace(/\/$/,i?`/`:``);return r.some(e=>e.test(a))};Fe.compile=e=>RegExp(`^${je(Pe(e))}$`,`s`);var Ie=Fe;return o(s)})();return e.default||e},Wo;const Go=(e,t)=>(Wo||(Wo=Uo(),Uo=null),Wo(e,t)),Ko=/^[A-Za-z]:\//;function qo(e=``){return e&&e.replace(/\\/g,`/`).replace(Ko,e=>e.toUpperCase())}const Jo=/^[/\\]{2}/,Yo=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Xo=/^[A-Za-z]:$/,Zo=/^\/([A-Za-z]:)?$/,Qo=/.(\.[^./]+|\.)$/,$o=/^[/\\]|^[a-zA-Z]:[/\\]/,es=function(e){if(e.length===0)return`.`;e=qo(e);let t=e.match(Jo),n=as(e),r=e[e.length-1]===`/`;return e=is(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),Xo.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!as(e)?`/${e}`:e)},ts=function(...e){let t=``;for(let n of e)if(n){if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n}return es(t)};function ns(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const rs=function(...e){e=e.map(e=>qo(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:ns();i&&i.length!==0&&(t=`${i}/${t}`,n=as(i))}return t=is(t,!n),n&&!as(t)?`/${t}`:t.length>0?t:`.`};function is(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const as=function(e){return Yo.test(e)},os=function(e){return qo(e)},ss=function(e){if(e===`..`)return``;let t=Qo.exec(qo(e));return t&&t[1]||``},cs=function(e,t){let n=rs(e).replace(Zo,`$1`).split(`/`),r=rs(t).replace(Zo,`$1`).split(`/`);if(r[0][1]===`:`&&n[0][1]===`:`&&n[0]!==r[0])return r.join(`/`);let i=[...n];for(let e of i){if(r[0]!==e)break;n.shift(),r.shift()}return[...n.map(()=>`..`),...r].join(`/`)},ls=function(e){let t=qo(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&Xo.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(as(e)?`/`:`.`)},us=function(e){let t=e.ext?e.ext.startsWith(`.`)?e.ext:`.${e.ext}`:``,n=[e.root,e.dir,e.base??(e.name??``)+t].filter(Boolean);return qo(e.root?rs(...n):n.join(`/`))},ds=function(e,t){let n=qo(e).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return t&&r.endsWith(t)?r.slice(0,-t.length):r},fs={__proto__:null,basename:ds,dirname:ls,extname:ss,format:us,isAbsolute:as,join:ts,matchesGlob:(e,t)=>Go(t,es(e)),normalize:es,normalizeString:is,parse:function(e){let t=$o.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=ds(e),r=ss(n);return{root:t,dir:ls(e),base:n,ext:r,name:n.slice(0,n.length-r.length)}},relative:cs,resolve:rs,sep:`/`,toNamespacedPath:os},ps=globalThis.process?.platform===`win32`?`;`:`:`,ms={posix:void 0,win32:void 0},hs=(e=ps)=>new Proxy(fs,{get(t,n){return n===`delimiter`?e:n===`posix`?gs:n===`win32`?_s:ms[n]||fs[n]}}),gs=/* @__PURE__ */ hs(`:`),_s=/* @__PURE__ */ hs(`;`);var vs=/* @__PURE__ */ j(((e,t)=>{let n=/[\t\n\f\r "#'()/;[\\\]{}]/g,r=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,i=/.[\r\n"'(/\\]/,a=/[\da-f]/i;t.exports=function(e,t={}){let o=e.css.valueOf(),s=t.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[],S=-1;function C(){return y}function w(t){throw e.error(`Unclosed `+t,y)}function ee(){return x.length===0&&y>=v}function T(e){if(x.length)return x.pop();if(y>=v)return;let t=e?e.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:d=y;do d+=1,c=o.charCodeAt(d);while(c===32||c===10||c===9||c===13||c===12);p=[`space`,o.slice(y,d)],y=d-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);p=[e,e,y];break}case 40:if(_=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),_===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){d=y;do{if(m=!1,d=o.indexOf(`)`,d+1),d===-1){if(s||t){d=y;break}w(`bracket`)}for(h=d;o.charCodeAt(h-1)===92;)--h,m=!m}while(m);p=[`brackets`,o.slice(y,d+1),y,d],y=d}else y<=S?p=[`(`,`(`,y]:(d=o.indexOf(`)`,y+1),l=o.slice(y,d+1),d===-1||i.test(l)?(S=d===-1?v:d,p=[`(`,`(`,y]):(p=[`brackets`,l,y,d],y=d));break;case 39:case 34:f=c===39?`'`:`"`,d=y;do{if(m=!1,d=o.indexOf(f,d+1),d===-1){if(s||t){d=y+1;break}w(`string`)}for(h=d;o.charCodeAt(h-1)===92;)--h,m=!m}while(m);p=[`string`,o.slice(y,d+1),y,d],y=d;break;case 64:n.lastIndex=y+1,n.test(o),d=n.lastIndex===0?o.length-1:n.lastIndex-2,p=[`at-word`,o.slice(y,d+1),y,d],y=d;break;case 92:for(d=y,u=!0;o.charCodeAt(d+1)===92;)d+=1,u=!u;if(c=o.charCodeAt(d+1),u&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(d+=1,a.test(o.charAt(d)))){for(;a.test(o.charAt(d+1));)d+=1;o.charCodeAt(d+1)===32&&(d+=1)}p=[`word`,o.slice(y,d+1),y,d],y=d;break;default:c===47&&o.charCodeAt(y+1)===42?(d=o.indexOf(`*/`,y+2)+1,d===0&&(s||t?d=o.length:w(`comment`)),p=[`comment`,o.slice(y,d+1),y,d],y=d):(r.lastIndex=y+1,r.test(o),d=r.lastIndex===0?o.length-1:r.lastIndex-2,p=[`word`,o.slice(y,d+1),y,d],b.push(p),y=d)}return y++,p}function te(e){x.push(e)}return{back:te,endOfFile:ee,nextToken:T,position:C}}})),ys=/* @__PURE__ */ j(((e,t)=>{let n=Nt(),r=vs(),i;function a(e){i=e}let o={";":n.yellow,":":n.yellow,"(":n.cyan,")":n.cyan,"[":n.yellow,"]":n.yellow,"{":n.yellow,"}":n.yellow,"at-word":n.cyan,brackets:n.cyan,call:n.cyan,class:n.yellow,comment:n.gray,hash:n.magenta,string:n.green};function s([e,t],n){if(e===`word`){if(t[0]===`.`)return`class`;if(t[0]===`#`)return`hash`}if(!n.endOfFile()){let e=n.nextToken();if(n.back(e),e[0]===`brackets`||e[0]===`(`)return`call`}return e}function c(e){let t=r(new i(e),{ignoreErrors:!0}),n=``;for(;!t.endOfFile();){let e=t.nextToken(),r=o[s(e,t)];n+=r?e[1].split(/\r?\n/).map(e=>r(e)).join(`
|
|
12
12
|
`):e[1]}return n}c.registerInput=a,t.exports=c})),bs=/* @__PURE__ */ j(((e,t)=>{let n=Nt(),r=ys();var i=class e extends Error{constructor(t,n,r,i,a,o){super(t),this.name=`CssSyntaxError`,this.reason=t,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),n!==void 0&&r!==void 0&&(typeof n==`number`?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(e){if(!this.source)return``;let t=this.source;e??=n.isColorSupported;let i=e=>e,a=e=>e,o=e=>e;if(e){let{bold:e,gray:t,red:s}=n.createColors(!0);a=t=>e(s(t)),i=e=>t(e),r&&(o=e=>r(e))}let s=t.split(/\r?\n/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;return s.slice(c,l).map((e,t)=>{let n=c+1+t,r=` `+(` `+n).slice(-u)+` | `;if(n===this.line){if(e.length>160){let t=Math.max(0,this.column-20),n=Math.max(this.column+20,this.endColumn+20),s=e.slice(t,n),c=i(r.replace(/\d/g,` `))+e.slice(0,Math.min(this.column-1,19)).replace(/[^\t]/g,` `);return a(`>`)+i(r)+o(s)+`
|
|
13
13
|
`+c+a(`^`)}let t=i(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return a(`>`)+i(r)+o(e)+`
|
|
@@ -5,7 +5,7 @@ export declare const miniRuntimeId: string;
|
|
|
5
5
|
export declare const rolldownRuntimeId = "\0rolldown/runtime.js";
|
|
6
6
|
/** Identifies the virtual binding shared by native files, SystemJS capsules and HMR factories. */
|
|
7
7
|
export declare const vptGlobalBindingId = "\0vpt:global-binding";
|
|
8
|
-
/** Generates the selected core-js imports
|
|
8
|
+
/** Generates the selected core-js imports loaded by bootstrap from the native polyfill chunk. */
|
|
9
9
|
export declare const miniPolyfillsId = "\0vpt:mini-polyfills";
|
|
10
10
|
/** External bootstrap dependency emitted only after the bundled graph is finalized. */
|
|
11
11
|
export declare const miniTransportId = "\0vpt:mini-transport";
|
package/dist/options.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export interface VptOptions {
|
|
|
102
102
|
*
|
|
103
103
|
* Use core-js module names without the `core-js/modules/` prefix or `.js` suffix; no separate core-js installation is needed.
|
|
104
104
|
* For example, `web.url` provides `URL` and `URLSearchParams`, while `es.array.at` provides `Array.prototype.at`.
|
|
105
|
-
*
|
|
105
|
+
* Installed APIs support both `globalThis` access and unshadowed bare identifiers on every mini target.
|
|
106
106
|
*
|
|
107
107
|
* Selected polyfills run before your app in development and production, updating global APIs and prototypes when needed.
|
|
108
108
|
* Omit this option or use `[]` to add no optional polyfills. H5 ignores this option.
|
|
@@ -27,6 +27,10 @@ function getGlobalThis() {
|
|
|
27
27
|
configurable: true
|
|
28
28
|
});
|
|
29
29
|
resolved = __vpt_global__;
|
|
30
|
+
if (!resolved) {
|
|
31
|
+
console.error('Unable to resolve globalThis, might in strict mode');
|
|
32
|
+
resolved = getOrCreateFakeGlobal();
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
catch (cause) {
|
|
32
36
|
console.error('Unable to resolve globalThis', cause);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-taro",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"author": "sep2",
|
|
5
5
|
"description": "Vite 8 plugin for building one React/Taro codebase for WeChat, Alipay, TikTok, and H5 targets.",
|
|
6
6
|
"type": "module",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"rolldown": "1.2.9",
|
|
68
68
|
"sval": "0.6.12",
|
|
69
69
|
"tailwindcss": "^4.3.3",
|
|
70
|
-
"vite-plugin-taro-runtime": "0.7.
|
|
70
|
+
"vite-plugin-taro-runtime": "0.7.7"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": "^19.3.0",
|