@tempo-ai/visual-review 0.0.145-staging.2 → 0.0.145
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/bin.js +1 -1
- package/dist/{cli-YQHPCD63.js → cli-EPW52GGH.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/sdk-runtime/node/astro.cjs +27 -27
- package/dist/sdk-runtime/node/core.cjs +22 -22
- package/dist/sdk-runtime/node/nuxt.cjs +21 -21
- package/dist/sdk-runtime/node/svelte.cjs +13 -13
- package/dist/sdk-runtime/node/vue.cjs +13 -13
- package/dist/sdk-runtime/runtime.json +11 -11
- package/package.json +1 -1
- /package/dist/{chunk-RSVBXXIJ.js → chunk-F7OCI5MM.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
exports.tempoRuntimeContract=1;exports.createRuntime=function(__tempoRuntime){const require=__tempoRuntime.require;const module={exports:{}};const exports=module.exports;
|
|
2
|
-
var
|
|
2
|
+
var Ko=Object.create;var he=Object.defineProperty;var Wo=Object.getOwnPropertyDescriptor;var Xo=Object.getOwnPropertyNames;var Go=Object.getPrototypeOf,zo=Object.prototype.hasOwnProperty;var a=(t,e)=>he(t,"name",{value:e,configurable:!0});var w=(t,e)=>()=>(t&&(e=t(t=0)),e);var Qt=(t,e)=>{for(var n in e)he(t,n,{get:e[n],enumerable:!0})},en=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Xo(e))!zo.call(t,o)&&o!==n&&he(t,o,{get:()=>e[o],enumerable:!(r=Wo(e,o))||r.enumerable});return t};var tn=(t,e,n)=>(n=t!=null?Ko(Go(t)):{},en(e||!t||!t.__esModule?he(n,"default",{value:t,enumerable:!0}):n,t)),nn=t=>en(he({},"__esModule",{value:!0}),t);async function on(t=process.env.TEMPO_SDK_RUNTIME_PATH){if(!t||!(0,J.isAbsolute)(t))throw new Error("Tempo browser runtime is not provisioned. Set TEMPO_SDK_RUNTIME_PATH to the host's private runtime directory.");let e=JSON.parse(await(0,te.readFile)((0,J.resolve)(t,"runtime.json"),"utf8")),n=e.browser;if(e.tempoRuntimeContract!==1||typeof n?.file!="string"||typeof n?.sha256!="string")throw new Error("Incompatible Tempo browser runtime. Update the host application.");let r=await(0,te.realpath)(t),o=await(0,te.realpath)((0,J.resolve)(r,n.file)),i=(0,J.relative)(r,o);if((0,J.isAbsolute)(i)||i===".."||i.startsWith("../")||i.startsWith("..\\"))throw new Error("Tempo browser runtime path escapes its directory.");let s=await(0,te.readFile)(o,"utf8");if((0,rn.createHash)("sha256").update(s).digest("hex")!==n.sha256)throw new Error("Tempo browser runtime artifact failed its integrity check.");return s}var rn,te,J,sn=w(()=>{rn=require("node:crypto"),te=require("node:fs/promises"),J=require("node:path");a(on,"readBrowserRuntimeScript")});function ct(t){return`${t.replace(/\/$/,"")}${qo}`}function an(t){let e=ct(t),n;return async(r,o,i)=>{if(r.url?.split(/[?#]/)[0]!==e)return i();if(o.setHeader("Cache-Control","no-store"),o.setHeader("X-Content-Type-Options","nosniff"),r.method!=="GET"&&r.method!=="HEAD"){o.statusCode=405,o.setHeader("Allow","GET, HEAD"),o.end();return}try{n||(n=await Yo()),o.setHeader("Content-Type","application/javascript; charset=utf-8"),o.end(r.method==="HEAD"?void 0:n)}catch(u){o.statusCode=503,o.setHeader("Content-Type","text/plain; charset=utf-8"),o.end(r.method==="HEAD"?void 0:`Tempo browser runtime unavailable: ${u instanceof Error?u.message:String(u)}`)}}}async function Yo(){return Zo(await on())}function Zo(t){return`(() => { const provider = globalThis.__tempoSdkRuntime; if (provider) { if (provider.contract !== 1 || typeof provider.createBrowserRuntime !== "function" || typeof provider.createDocumentRuntime !== "function") throw new Error("Incompatible Tempo browser runtime. Update the host application."); return; }
|
|
3
3
|
${t}
|
|
4
|
-
})();`}var
|
|
4
|
+
})();`}var qo,ln=w(()=>{sn();qo="/@tempo/browser-runtime.js";a(ct,"browserRuntimeUrl");a(an,"createBrowserRuntimeMiddleware");a(Yo,"readBrowserRuntimeInstallScript");a(Zo,"browserRuntimeInstallScript")});var ye,un=w(()=>{ye=__tempoRuntime.sdkModuleUrl});function Le(t,e){let n=(0,_.resolve)(t),r=(0,_.relative)(e.sourceRoot,n);if(!r||/^\.\.(?:[\\/]|$)/.test(r)||(0,_.isAbsolute)(r)||r.split(/[\\/]/).includes("node_modules"))return null;let i=(0,_.relative)(e.root,n).replace(/\\/g,"/");return!i||(0,_.isAbsolute)(i)?null:{absoluteFilename:n,filepath:i}}function cn(t){return Math.trunc((0,ne.statSync)(t).mtimeMs)}function pn(t){let e=(0,_.resolve)(t);for(;;){if(Qo(e))return e;let n=(0,_.dirname)(e);if(n===e)return(0,_.resolve)(t);e=n}}function Qo(t){if((0,ne.existsSync)((0,_.join)(t,"pnpm-workspace.yaml")))return!0;try{return JSON.parse((0,ne.readFileSync)((0,_.join)(t,"package.json"),"utf8"))?.workspaces!=null}catch{return!1}}var ne,_,pt=w(()=>{ne=require("node:fs"),_=require("node:path");a(Le,"resolveAnnotationIdentity");a(cn,"readModifiedTs");a(pn,"defaultSourceRoot");a(Qo,"isWorkspaceRoot")});function Se(t){let e=t;for(;["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression"].includes(e.type);){let n=e.expression;if(!n)break;e=n}return e}function D(t){let e=Se(t);if(["Literal","StringLiteral","NumericLiteral","BooleanLiteral"].includes(e.type)&&(typeof e.value=="string"||typeof e.value=="boolean"||typeof e.value=="number"&&Number.isFinite(e.value)))return e.value;if(e.type==="TemplateLiteral"){let n=e.expressions,r=e.quasis;if(n.length===0&&r.length===1&&typeof r[0]?.value.cooked=="string")return r[0].value.cooked}if(e.type==="UnaryExpression"&&(e.operator==="-"||e.operator==="+")){let n=D(e.argument);if(typeof n=="number")return e.operator==="-"?-n:n}if(e.type==="BinaryExpression"&&["+","-","*","/"].includes(e.operator)){let n=D(e.left),r=D(e.right);if(typeof n!="number"||typeof r!="number")return null;let o=e.operator==="+"?n+r:e.operator==="-"?n-r:e.operator==="*"?n*r:n/r;return Number.isFinite(o)?o:null}return null}function dt(t){if(t.type!=="JSXExpressionContainer")return null;let e=Se(t.expression);return e.type==="JSXElement"?e:null}function ft(t,e=!1){if(!e&&t.type==="Identifier")return typeof t.name=="string"?t.name:null;let n=D(t);return typeof n=="string"||typeof n=="number"?String(n):null}var Fe=w(()=>{"use strict";a(Se,"unwrapLiteralExpression");a(D,"readLiteralExpression");a(dt,"literalJsxChild");a(ft,"literalPropertyName")});function fn(t,e,n=!1){let o=t.openingElement.attributes,i=[];!n&&e!=="JSXElement"&&e!=="JSXFragment"&&i.push(mt);let s=new Map;o.forEach((l,c)=>{let p=es(l);p!==null&&s.set(p,c)});let u=-1;o.forEach((l,c)=>{l.type==="JSXSpreadAttribute"&&(u=c)});for(let[l,c]of s){if(ts(l))continue;let p=c<u,f=o[c].value;if(f!==null){if(l==="style"&&!p){i.push(...ns(f));continue}if(p)i.push(l);else{if(l==="className"&&ss(f))continue;rs(f)||i.push(l)}}}return i.length>0?i.join(" "):u>=0?"":void 0}function es(t){if(t.type!=="JSXAttribute")return null;let e=t.name;return e.type==="JSXIdentifier"?e.name:e.type==="JSXNamespacedName"?`${e.namespace.name}:${e.name.name}`:null}function ts(t){return t==="key"||t.startsWith("data-tempo-")}function ns(t){let e=t.type==="JSXExpressionContainer"?is(t.expression):t;if(e.type!=="ObjectExpression")return["style"];let n=e.properties,r=new Map;n.forEach((i,s)=>{let u=dn(i);u!==null&&r.set(u,s)});let o=[];for(let[i,s]of r){let u=n[s],l=n.slice(s+1).some(p=>p.type==="SpreadElement"||p.computed&&dn(p)===null),c=u.type!=="ObjectMethod"&&!u.shorthand&&mn(u.value);(l||!c)&&o.push(`style.${i}`)}return o}function dn(t){return t.type==="Property"||t.type==="ObjectProperty"||t.type==="ObjectMethod"?ft(t.key,!!t.computed):null}function rs(t){return t.type==="Literal"||t.type==="StringLiteral"?!0:t.type!=="JSXExpressionContainer"?!1:mn(t.expression)}function ss(t){if(t.type!=="JSXExpressionContainer")return!1;let e=t.expression;if(e.type!=="CallExpression")return!1;let n=e.callee;return n.type!=="Identifier"||!os.has(n.name)?!1:e.arguments.every(r=>(r.type==="Literal"||r.type==="StringLiteral")&&typeof r.value=="string"||r.type==="TemplateLiteral"&&r.expressions.length===0)}function mn(t){return D(t)!==null}function is(t){return Se(t)}var z,mt,os,De=w(()=>{"use strict";Fe();Fe();z="data-tempo-expr",mt="#slot";a(fn,"expressionFacts");a(es,"attributeName");a(ts,"unstamped");a(ns,"styleFacts");a(dn,"styleKey");a(rs,"isLiteralValue");os=new Set(["cn","clsx","twMerge","cx","classNames"]);a(ss,"isClassHelperCall");a(mn,"isLiteral");a(is,"unwrap")});function K(t){let e=5381,n=0;for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);e=(e<<5)+e^o,n=o+(n<<6)+(n<<16)-n|0}return gn(e)+gn(n)}function gn(t){return(t>>>0).toString(16).padStart(8,"0")}var re=w(()=>{"use strict";a(K,"sourceVersionHash");a(gn,"toHex8")});function W(t){return t.replace(/[?#].*$/,"")}function ls(t){return t.length>0&&t[0]===t[0].toLowerCase()}function gt(t,e){for(let n of t.element.openingElement.attributes)if(n.name?.name===e)return!0;return!1}function us(t,e,n,r){return{"data-tempo-filepath":e,"data-tempo-position":t.element.openingElement.start,"data-tempo-source-tag":t.tagName,"data-tempo-modifiedts":n,"data-tempo-source-version":r}}function je(t,e,n,r){let o=JSON.stringify({file:e,modifiedTs:n,sourceVersion:r});return`${t}
|
|
5
5
|
;typeof window !== "undefined" && (globalThis.__TEMPO_MODULE_VERSIONS__ || (globalThis.__TEMPO_MODULE_VERSIONS__ = [])).push(${o});
|
|
6
|
-
`}function pn(t){let{info:e,filepath:n,modifiedtsMs:r,sourceVersion:o,computeAnnotatedProps:i,elementSupportOverrides:s}=t,u={...i?i(e,n,r,o):Go(e,n,r,o),...e.parentType!==void 0&&!ft(e,X)?{[X]:ln(e.element,e.parentType,e.isStaticJsxChild)}:{}};if(zo(e.tagName))return{...u,"data-tempo-supports-children":ft(e,"data-tempo-supports-children")?void 0:!Xo.has(e.tagName)};let l=s?.get(e.tagName);return l?{...u,"data-tempo-supports-children":ft(e,"data-tempo-supports-children")?void 0:l.supportsChildren}:u}var Xo,ne=E(()=>{Oe();te();Xo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);a(H,"cleanModuleId");a(zo,"isIntrinsicElement");a(ft,"hasJsxAttribute");a(Go,"defaultComputeAnnotatedProps");a(Me,"appendModuleVersionRecord");a(pn,"computeTempoAnnotatedProps")});function Ve(t){return t.trim().replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/^\/+/,"")}var mt,gt,dn=E(()=>{"use strict";mt="/__tempo/canvas-host-registration",gt="x-tempo-canvas-host-registration";a(Ve,"normalizeCanvasRegistrationPath")});async function mn(t,e){let n=performance.now(),r=!1,o=setTimeout(()=>{r=!0,e("pending",Math.round(performance.now()-n))},5e3),i=a(s=>{let u=Math.round(performance.now()-n);(r||u>=5e3)&&e(s,u)},"settled");try{let s=await t();return i("ready"),s}catch(s){throw i("error"),s}finally{clearTimeout(o)}}function gn(){let t=new Map;return a(async function(n,r){let o=(0,fn.readFileSync)(n,"utf8"),i=t.get(n);if(i?.source===o&&(i.pending||i.current()))return i.result;let s={source:o,pending:!0,current:a(()=>!1,"current"),result:Promise.resolve()};return t.set(n,s),s.result=Promise.resolve().then(async()=>{s.current=await r(),s.pending=!1}).catch(u=>{throw t.get(n)===s&&t.delete(n),u}),s.result},"confirm")}async function hn(t,e,n,r=1e3){if(!n)return await t,null;let o;try{return await Promise.race([t.then(()=>null),new Promise(i=>{o=setTimeout(()=>i(e()),r)})])}finally{clearTimeout(o)}}var fn,yn=E(()=>{fn=require("node:fs");a(mn,"traceSlowRegistration");a(gn,"createRegistrationTransforms");a(hn,"registrationReply")});function Sn(t){let e=t.now??Date.now,n=t.watcherGraceMs??1e3,r=t.maxEmitsPerRevision??3,o=new Map,i=new Map;return{async sweep(){let s=[];for(let[u,l]of t.listServedFiles()){let c=await t.statMtimeMs(u);if(c===null){i.delete(u);continue}let p=o.get(u);if(p===void 0){let h=t.lastHotUpdateMtimeMs?.(u);if(h===void 0||h>=c){o.set(u,c);continue}p=h,o.set(u,h)}if(c>p){if(e()-c<n)continue;o.set(u,c)}else c<p&&o.set(u,c);let d=i.get(u);if(c<=p&&d===void 0)continue;let m=t.lastHotUpdateMtimeMs?.(u),g;if(m!==void 0)g=m>=c;else{g=!1;for(let h of l)if((h.lastInvalidationTimestamp??0)>=c){g=!0;break}}if(g){i.delete(u);continue}let f=d!==void 0&&d.mtimeMs===c?d:{mtimeMs:c,emits:0};i.set(u,f),!(f.emits>=r)&&(f.emits+=1,t.emitChange(u),s.push(u))}return s}}}var vn=E(()=>{a(Sn,"createMissedChangeSweep")});function bn(t){let e=t?.quietMs??100,n=t?.schedule??setTimeout,r=t?.cancel??clearTimeout,o=new Map,i=a((s,u)=>{s.eventCount<2||(u?.gate&&u.release?(s.gate=u.gate,s.release=u.release,u.release=void 0,u.expiry&&r(u.expiry)):s.gate=new Promise(l=>{s.release=l}),s.expiry=n(()=>s.release?.(),e*2))},"armGate");return{observe(s,u){let l=o.get(s);l?.timer&&r(l.timer);let c={eventCount:(l?.eventCount??0)+1,replay:u};i(c,l),c.timer=n(()=>{if(o.get(s)!==c||(o.delete(s),c.expiry&&r(c.expiry),c.release?.(),c.eventCount<2))return;let p={eventCount:-1,replay:c.replay};p.timer=n(()=>{o.get(s)===p&&o.delete(s)},e),o.set(s,p),c.replay()},e),o.set(s,c)},settled(s){return o.get(s)?.gate??Promise.resolve()},clear(){for(let s of o.values())s.timer&&r(s.timer),s.expiry&&r(s.expiry),s.release?.();o.clear()}}}var En=E(()=>{a(bn,"createRapidHotUpdateReplay")});function V(t){return H(t).replace(/^\/@fs\//,"/")}function ge(t){return V(t).replace(/\\/g,"/")}function Yo(){let t=bn(),e=new Map,n=a(r=>{let o=V(r),i=ge(r);try{e.set(i,(0,ht.statSync)(o).mtimeMs)}catch{e.delete(i)}},"recordCoverage");return{recordCoverage:n,lastHotUpdateMtimeMs(r){return e.get(ge(r))},observeUpdate(r,o){t.observe(ge(o),()=>{r.config.logger.info(`[tempo] replaying settled rapid watcher change: ${o}`,{timestamp:!0}),r.watcher.emit("change",o)})},settled(r){return t.settled(ge(r))},installCoverage(r){for(let o of["change","add","unlink"])r.watcher?.prependListener?.(o,n)},installSweep(r,o={}){let i=r.config.cacheDir?.replace(/\\/g,"/").replace(/\/+$/,""),s=Sn({listServedFiles:a(()=>{let c=new Map(r.moduleGraph?.fileToModulesMap??new Map);for(let p of o.listExtraFiles?.()??[]){let d=V(p),m=(0,J.isAbsolute)(d)?d:(0,J.resolve)(r.config.root,d);c.has(m)||c.set(m,[])}if(i)for(let p of c.keys())p.replace(/\\/g,"/").startsWith(`${i}/`)&&c.delete(p);return Zo(r,c),c.entries()},"listServedFiles"),statMtimeMs:a(async c=>{try{return(0,ht.statSync)(c).mtimeMs}catch{return null}},"statMtimeMs"),emitChange:a(c=>{r.config?.logger?.info?.(`[tempo] re-emitting lost watcher change: ${c}`,{timestamp:!0}),r.watcher?.emit?.("change",c)},"emitChange"),lastHotUpdateMtimeMs:a(c=>e.get(ge(c)),"lastHotUpdateMtimeMs")}),u=!1,l=setInterval(()=>{u||(u=!0,s.sweep().then(()=>o.afterSweep?.()).catch(()=>{}).finally(()=>{u=!1}))},o.sweepIntervalMs??yt);l.unref?.(),r.httpServer?.once("close",()=>clearInterval(l))},clear(){t.clear(),e.clear()}}}function Zo(t,e){let r=t.watcher?.getWatched?.();if(r)for(let o of[...e.keys()]){let i=r[(0,J.dirname)(o)];i&&!i.includes((0,J.basename)(o))&&e.delete(o)}}function St(t={}){let e=Yo();return{name:qo,configureServer(n){e.installCoverage(n),e.installSweep(n,{sweepIntervalMs:t.sweepIntervalMs}),n.httpServer?.once("close",()=>e.clear())},load:{async handler(n){return n.startsWith("\0")||await e.settled(n),null}},hotUpdate:{order:"post",handler(n){n.type==="update"&&n.modules.length>0&&e.observeUpdate(n.server,n.file)}},handleHotUpdate:{order:"post",handler(n){n.modules.length>0&&e.observeUpdate(n.server,n.file)}}}}var ht,J,qo,yt,he=E(()=>{ht=require("node:fs"),J=require("node:path");ne();vn();En();qo="tempo-hot-update-net",yt=3e3;a(V,"fsPathFromModuleId");a(ge,"fileKey");a(Yo,"createHotUpdateNet");a(Zo,"dropUnwatched");a(St,"tempoHotUpdateNetPlugin")});function Cn(t){let e=new Set,n=/\bcanvasPath:\s*("(?:\\.|[^"\\])*")/g;for(let r of t.matchAll(n))try{let o=JSON.parse(r[1]??"");if(typeof o!="string")continue;let i=Ve(o);i&&e.add(i)}catch{}return[...e]}async function es(t,e){let n=(0,ye.resolve)(t.config.root,".tempo","tempo-host.tsx"),r;try{r=(0,z.readFileSync)(n,"utf8")}catch(c){throw new Error(`Canvas host wrapper is unavailable at ${n}: ${c instanceof Error?c.message:String(c)}`)}if(!Cn(r).includes(e))throw Object.assign(new Error(`Generated canvas host wrapper does not contain ${JSON.stringify(e)}`),{statusCode:409});let i=(0,z.realpathSync)(n),s=/\bcanvasPath:\s*("(?:\\.|[^"\\])*")\s*,\s*load:\s*\(\)\s*=>\s*import\(\s*("(?:\\.|[^"\\])*")\s*\)/g,u,l=t.environments?.client??t;for(let c of r.matchAll(s)){if(Ve(JSON.parse(c[1]))!==e)continue;let p=await l.pluginContainer.resolveId(JSON.parse(c[2]),n);if(!p)throw new Error(`Cannot resolve canvas ${e}`);let d=V(p.id),m=`/@fs/${d.replace(/^\/+/,"")}`;u=`${ts(t)}${m.slice(1)}`,await wn(t,l,(0,z.realpathSync)(d),d,m);break}return await wn(t,l,i,n),r.includes("tempo-incremental-canvas-registration")?u:void 0}function ts(t){let e=t.config.base||"/",n=e.startsWith("/")?e:new URL(e,"http://tempo.invalid").pathname;return n.endsWith("/")?n:`${n}/`}function kn(t){let e=t.environments?.client?.depsOptimizer;return{status:"compiling",phase:e?.scanProcessing?"scanning":Object.values(e?.metadata.discovered??{}).some(r=>r.processing)?"bundling":"transforming",progress:Le.get(t)??0}}async function wn(t,e,n,r,o=Qo){let i=vt.get(e);i||(i=gn(),vt.set(e,i)),await i(n,()=>mn(async()=>{let s=a(()=>e.moduleGraph.getModulesByFile(n)??e.moduleGraph.getModulesByFile(r),"modules");for(let p of s()??[])e.moduleGraph.invalidateModule(p);if(!await e.transformRequest(o))throw new Error(`Vite did not transform ${o} after registration`);await e.waitForRequestsIdle?.();let l=t.environments?.client?.depsOptimizer;await l?.scanProcessing,await Promise.all(Object.values(l?.metadata.discovered??{}).map(p=>p.processing)),l&&await e.transformRequest(o);let c=[...s()??[]].map(p=>[p,p.transformResult]);return()=>c.length>0&&c.every(([p,d])=>d!=null&&s()?.has(p)&&p.transformResult===d)},(s,u)=>{t.config.logger.info(`[tempo] canvas registration ${JSON.stringify({...kn(t),status:s,module:(0,ye.relative)(t.config.root,n),elapsedMs:u})}`)}))}function xn(t){t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Expose-Headers",gt),t.setHeader(gt,"1")}function Pn(t,e){if(t.replace(/\\/g,"/")!==e.replace(/\\/g,"/"))return!1;try{return(0,z.readFileSync)(t,"utf8").includes("tempo-incremental-canvas-registration")}catch{return!1}}function Tn(t,e,n,r){let o=(0,ye.relative)(e.sourceRoot,t).replace(/\\/g,"/"),i;try{i=(0,z.readFileSync)(e.wrapperPath,"utf8")}catch{return}if(!Cn(i).includes(o))return;let s=n.getModulesByFile(e.wrapperPath);if(s?.size){for(let u of s)n.invalidateModule(u);return[...new Set([...r,...s])]}}function Rn(t){Le.set(t,0),vt.delete(t.environments?.client??t)}function _n(t){Le.set(t,(Le.get(t)??0)+1)}function An(t,e,n){let r=e.url;return r===mt&&e.method==="OPTIONS"?(xn(n),n.writeHead(204,{"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"content-type"}),n.end(),!0):r===mt&&e.method==="POST"?(xn(n),ns(e).then(async o=>{let i=JSON.parse(o),s=typeof i.canvasPath=="string"?Ve(i.canvasPath):"";if(!s)throw Object.assign(new Error("canvasPath must be a non-empty string"),{statusCode:400});let u,l=await hn(es(t,s).then(c=>{u=c}),()=>kn(t),i.poll===!0);n.statusCode=l?202:200,n.setHeader("Content-Type","application/json"),n.setHeader("Cache-Control","no-store"),n.end(JSON.stringify(l??{canvasPath:s,...u?{moduleUrl:u}:{}}))}).catch(o=>{n.statusCode=typeof o=="object"&&o!==null&&"statusCode"in o&&typeof o.statusCode=="number"?o.statusCode:500,n.setHeader("Content-Type","text/plain; charset=utf-8"),n.end(o instanceof Error?o.message:String(o))}),!0):!1}function ns(t){return new Promise((e,n)=>{let r=[];t.on("data",o=>r.push(o)),t.on("end",()=>e(Buffer.concat(r).toString())),t.on("error",n)})}var z,ye,Qo,vt,Le,In=E(()=>{z=require("node:fs"),ye=require("node:path");dn();yn();he();Qo="/.tempo/tempo-host";a(Cn,"readGeneratedCanvasPaths");a(es,"synchronizeCanvasHostRegistrationTransform");a(ts,"viteBasePath");vt=new WeakMap,Le=new WeakMap;a(kn,"registrationProgress");a(wn,"retransformCanvasHostWrapper");a(xn,"writeCanvasRegistrationResponseHeaders");a(Pn,"isIncrementalWrapperFile");a(Tn,"withRegisteredCanvasLoader");a(Rn,"resetCanvasHostRegistration");a(_n,"noteCanvasHostRegistrationActivity");a(An,"handleCanvasHostRegistrationRequest");a(ns,"readBody")});var je,bt,re,De,Nn,Fe=E(()=>{"use strict";je="/@tempo/server-errors",bt="\0tempo:server-errors",re="tempo:server-error-state",De="tempo:subscribe-server-errors",Nn="__tempoViteServerErrors"});var On,Mn=E(()=>{Fe();On=`
|
|
6
|
+
`}function hn(t){let{info:e,filepath:n,modifiedtsMs:r,sourceVersion:o,computeAnnotatedProps:i,elementSupportOverrides:s}=t,u={...i?i(e,n,r,o):us(e,n,r,o),...e.parentType!==void 0&&!gt(e,z)?{[z]:fn(e.element,e.parentType,e.isStaticJsxChild)}:{}};if(ls(e.tagName))return{...u,"data-tempo-supports-children":gt(e,"data-tempo-supports-children")?void 0:!as.has(e.tagName)};let l=s?.get(e.tagName);return l?{...u,"data-tempo-supports-children":gt(e,"data-tempo-supports-children")?void 0:l.supportsChildren}:u}var as,oe=w(()=>{De();re();as=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);a(W,"cleanModuleId");a(ls,"isIntrinsicElement");a(gt,"hasJsxAttribute");a(us,"defaultComputeAnnotatedProps");a(je,"appendModuleVersionRecord");a(hn,"computeTempoAnnotatedProps")});function $e(t){return t.trim().replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/^\/+/,"")}var ht,yt,yn=w(()=>{"use strict";ht="/__tempo/canvas-host-registration",yt="x-tempo-canvas-host-registration";a($e,"normalizeCanvasRegistrationPath")});async function vn(t,e){let n=performance.now(),r=!1,o=setTimeout(()=>{r=!0,e("pending",Math.round(performance.now()-n))},5e3),i=a(s=>{let u=Math.round(performance.now()-n);(r||u>=5e3)&&e(s,u)},"settled");try{let s=await t();return i("ready"),s}catch(s){throw i("error"),s}finally{clearTimeout(o)}}function bn(){let t=new Map;return a(async function(n,r){let o=(0,Sn.readFileSync)(n,"utf8"),i=t.get(n);if(i?.source===o&&(i.pending||i.current()))return i.result;let s={source:o,pending:!0,current:a(()=>!1,"current"),result:Promise.resolve()};return t.set(n,s),s.result=Promise.resolve().then(async()=>{s.current=await r(),s.pending=!1}).catch(u=>{throw t.get(n)===s&&t.delete(n),u}),s.result},"confirm")}async function En(t,e,n,r=1e3){if(!n)return await t,null;let o;try{return await Promise.race([t.then(()=>null),new Promise(i=>{o=setTimeout(()=>i(e()),r)})])}finally{clearTimeout(o)}}var Sn,wn=w(()=>{Sn=require("node:fs");a(vn,"traceSlowRegistration");a(bn,"createRegistrationTransforms");a(En,"registrationReply")});function xn(t){let e=t.now??Date.now,n=t.watcherGraceMs??1e3,r=t.maxEmitsPerRevision??3,o=new Map,i=new Map;return{async sweep(){let s=[];for(let[u,l]of t.listServedFiles()){let c=await t.statMtimeMs(u);if(c===null){i.delete(u);continue}let p=o.get(u);if(p===void 0){let h=t.lastHotUpdateMtimeMs?.(u);if(h===void 0||h>=c){o.set(u,c);continue}p=h,o.set(u,h)}if(c>p){if(e()-c<n)continue;o.set(u,c)}else c<p&&o.set(u,c);let f=i.get(u);if(c<=p&&f===void 0)continue;let g=t.lastHotUpdateMtimeMs?.(u),m;if(g!==void 0)m=g>=c;else{m=!1;for(let h of l)if((h.lastInvalidationTimestamp??0)>=c){m=!0;break}}if(m){i.delete(u);continue}let d=f!==void 0&&f.mtimeMs===c?f:{mtimeMs:c,emits:0};i.set(u,d),!(d.emits>=r)&&(d.emits+=1,t.emitChange(u),s.push(u))}return s}}}var Cn=w(()=>{a(xn,"createMissedChangeSweep")});function kn(t){let e=t?.quietMs??100,n=t?.schedule??setTimeout,r=t?.cancel??clearTimeout,o=new Map,i=a((s,u)=>{s.eventCount<2||(u?.gate&&u.release?(s.gate=u.gate,s.release=u.release,u.release=void 0,u.expiry&&r(u.expiry)):s.gate=new Promise(l=>{s.release=l}),s.expiry=n(()=>s.release?.(),e*2))},"armGate");return{observe(s,u){let l=o.get(s);l?.timer&&r(l.timer);let c={eventCount:(l?.eventCount??0)+1,replay:u};i(c,l),c.timer=n(()=>{if(o.get(s)!==c||(o.delete(s),c.expiry&&r(c.expiry),c.release?.(),c.eventCount<2))return;let p={eventCount:-1,replay:c.replay};p.timer=n(()=>{o.get(s)===p&&o.delete(s)},e),o.set(s,p),c.replay()},e),o.set(s,c)},settled(s){return o.get(s)?.gate??Promise.resolve()},clear(){for(let s of o.values())s.timer&&r(s.timer),s.expiry&&r(s.expiry),s.release?.();o.clear()}}}var Tn=w(()=>{a(kn,"createRapidHotUpdateReplay")});function j(t){return W(t).replace(/^\/@fs\//,"/")}function ve(t){return j(t).replace(/\\/g,"/")}function ps(){let t=kn(),e=new Map,n=a(r=>{let o=j(r),i=ve(r);try{e.set(i,(0,St.statSync)(o).mtimeMs)}catch{e.delete(i)}},"recordCoverage");return{recordCoverage:n,lastHotUpdateMtimeMs(r){return e.get(ve(r))},observeUpdate(r,o){t.observe(ve(o),()=>{r.config.logger.info(`[tempo] replaying settled rapid watcher change: ${o}`,{timestamp:!0}),r.watcher.emit("change",o)})},settled(r){return t.settled(ve(r))},installCoverage(r){for(let o of["change","add","unlink"])r.watcher?.prependListener?.(o,n)},installSweep(r,o={}){let i=r.config.cacheDir?.replace(/\\/g,"/").replace(/\/+$/,""),s=xn({listServedFiles:a(()=>{let c=new Map(r.moduleGraph?.fileToModulesMap??new Map);for(let p of o.listExtraFiles?.()??[]){let f=j(p),g=(0,X.isAbsolute)(f)?f:(0,X.resolve)(r.config.root,f);c.has(g)||c.set(g,[])}if(i)for(let p of c.keys())p.replace(/\\/g,"/").startsWith(`${i}/`)&&c.delete(p);return ds(r,c),c.entries()},"listServedFiles"),statMtimeMs:a(async c=>{try{return(0,St.statSync)(c).mtimeMs}catch{return null}},"statMtimeMs"),emitChange:a(c=>{r.config?.logger?.info?.(`[tempo] re-emitting lost watcher change: ${c}`,{timestamp:!0}),r.watcher?.emit?.("change",c)},"emitChange"),lastHotUpdateMtimeMs:a(c=>e.get(ve(c)),"lastHotUpdateMtimeMs")}),u=!1,l=setInterval(()=>{u||(u=!0,s.sweep().then(()=>o.afterSweep?.()).catch(()=>{}).finally(()=>{u=!1}))},o.sweepIntervalMs??vt);l.unref?.(),r.httpServer?.once("close",()=>clearInterval(l))},clear(){t.clear(),e.clear()}}}function ds(t,e){let r=t.watcher?.getWatched?.();if(r)for(let o of[...e.keys()]){let i=r[(0,X.dirname)(o)];i&&!i.includes((0,X.basename)(o))&&e.delete(o)}}function bt(t={}){let e=ps();return{name:cs,configureServer(n){e.installCoverage(n),e.installSweep(n,{sweepIntervalMs:t.sweepIntervalMs}),n.httpServer?.once("close",()=>e.clear())},load:{async handler(n){return n.startsWith("\0")||await e.settled(n),null}},hotUpdate:{order:"post",handler(n){n.type==="update"&&n.modules.length>0&&e.observeUpdate(n.server,n.file)}},handleHotUpdate:{order:"post",handler(n){n.modules.length>0&&e.observeUpdate(n.server,n.file)}}}}var St,X,cs,vt,be=w(()=>{St=require("node:fs"),X=require("node:path");oe();Cn();Tn();cs="tempo-hot-update-net",vt=3e3;a(j,"fsPathFromModuleId");a(ve,"fileKey");a(ps,"createHotUpdateNet");a(ds,"dropUnwatched");a(bt,"tempoHotUpdateNetPlugin")});function An(t){let e=new Set,n=/\bcanvasPath:\s*("(?:\\.|[^"\\])*")/g;for(let r of t.matchAll(n))try{let o=JSON.parse(r[1]??"");if(typeof o!="string")continue;let i=$e(o);i&&e.add(i)}catch{}return[...e]}async function ms(t,e){let n=(0,Ee.resolve)(t.config.root,".tempo","tempo-host.tsx"),r;try{r=(0,q.readFileSync)(n,"utf8")}catch(c){throw new Error(`Canvas host wrapper is unavailable at ${n}: ${c instanceof Error?c.message:String(c)}`)}if(!An(r).includes(e))throw Object.assign(new Error(`Generated canvas host wrapper does not contain ${JSON.stringify(e)}`),{statusCode:409});let i=(0,q.realpathSync)(n),s=/\bcanvasPath:\s*("(?:\\.|[^"\\])*")\s*,\s*load:\s*\(\)\s*=>\s*import\(\s*("(?:\\.|[^"\\])*")\s*\)/g,u,l=t.environments?.client??t;for(let c of r.matchAll(s)){if($e(JSON.parse(c[1]))!==e)continue;let p=await l.pluginContainer.resolveId(JSON.parse(c[2]),n);if(!p)throw new Error(`Cannot resolve canvas ${e}`);let f=j(p.id),g=`/@fs/${f.replace(/^\/+/,"")}`;u=`${gs(t)}${g.slice(1)}`,await Pn(t,l,(0,q.realpathSync)(f),f,g);break}return await Pn(t,l,i,n),r.includes("tempo-incremental-canvas-registration")?u:void 0}function gs(t){let e=t.config.base||"/",n=e.startsWith("/")?e:new URL(e,"http://tempo.invalid").pathname;return n.endsWith("/")?n:`${n}/`}function _n(t){let e=t.environments?.client?.depsOptimizer;return{status:"compiling",phase:e?.scanProcessing?"scanning":Object.values(e?.metadata.discovered??{}).some(r=>r.processing)?"bundling":"transforming",progress:Ue.get(t)??0}}async function Pn(t,e,n,r,o=fs){let i=Et.get(e);i||(i=bn(),Et.set(e,i)),await i(n,()=>vn(async()=>{let s=a(()=>e.moduleGraph.getModulesByFile(n)??e.moduleGraph.getModulesByFile(r),"modules");for(let p of s()??[])e.moduleGraph.invalidateModule(p);if(!await e.transformRequest(o))throw new Error(`Vite did not transform ${o} after registration`);await e.waitForRequestsIdle?.();let l=t.environments?.client?.depsOptimizer;await l?.scanProcessing,await Promise.all(Object.values(l?.metadata.discovered??{}).map(p=>p.processing)),l&&await e.transformRequest(o);let c=[...s()??[]].map(p=>[p,p.transformResult]);return()=>c.length>0&&c.every(([p,f])=>f!=null&&s()?.has(p)&&p.transformResult===f)},(s,u)=>{t.config.logger.info(`[tempo] canvas registration ${JSON.stringify({..._n(t),status:s,module:(0,Ee.relative)(t.config.root,n),elapsedMs:u})}`)}))}function Rn(t){t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Expose-Headers",yt),t.setHeader(yt,"1")}function Nn(t,e){if(t.replace(/\\/g,"/")!==e.replace(/\\/g,"/"))return!1;try{return(0,q.readFileSync)(t,"utf8").includes("tempo-incremental-canvas-registration")}catch{return!1}}function In(t,e,n,r){let o=(0,Ee.relative)(e.sourceRoot,t).replace(/\\/g,"/"),i;try{i=(0,q.readFileSync)(e.wrapperPath,"utf8")}catch{return}if(!An(i).includes(o))return;let s=n.getModulesByFile(e.wrapperPath);if(s?.size){for(let u of s)n.invalidateModule(u);return[...new Set([...r,...s])]}}function On(t){Ue.set(t,0),Et.delete(t.environments?.client??t)}function Mn(t){Ue.set(t,(Ue.get(t)??0)+1)}function Vn(t,e,n){let r=e.url;return r===ht&&e.method==="OPTIONS"?(Rn(n),n.writeHead(204,{"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"content-type"}),n.end(),!0):r===ht&&e.method==="POST"?(Rn(n),hs(e).then(async o=>{let i=JSON.parse(o),s=typeof i.canvasPath=="string"?$e(i.canvasPath):"";if(!s)throw Object.assign(new Error("canvasPath must be a non-empty string"),{statusCode:400});let u,l=await En(ms(t,s).then(c=>{u=c}),()=>_n(t),i.poll===!0);n.statusCode=l?202:200,n.setHeader("Content-Type","application/json"),n.setHeader("Cache-Control","no-store"),n.end(JSON.stringify(l??{canvasPath:s,...u?{moduleUrl:u}:{}}))}).catch(o=>{n.statusCode=typeof o=="object"&&o!==null&&"statusCode"in o&&typeof o.statusCode=="number"?o.statusCode:500,n.setHeader("Content-Type","text/plain; charset=utf-8"),n.end(o instanceof Error?o.message:String(o))}),!0):!1}function hs(t){return new Promise((e,n)=>{let r=[];t.on("data",o=>r.push(o)),t.on("end",()=>e(Buffer.concat(r).toString())),t.on("error",n)})}var q,Ee,fs,Et,Ue,Ln=w(()=>{q=require("node:fs"),Ee=require("node:path");yn();wn();be();fs="/.tempo/tempo-host";a(An,"readGeneratedCanvasPaths");a(ms,"synchronizeCanvasHostRegistrationTransform");a(gs,"viteBasePath");Et=new WeakMap,Ue=new WeakMap;a(_n,"registrationProgress");a(Pn,"retransformCanvasHostWrapper");a(Rn,"writeCanvasRegistrationResponseHeaders");a(Nn,"isIncrementalWrapperFile");a(In,"withRegisteredCanvasLoader");a(On,"resetCanvasHostRegistration");a(Mn,"noteCanvasHostRegistrationActivity");a(Vn,"handleCanvasHostRegistrationRequest");a(hs,"readBody")});var Be,wt,se,He,Fn,Je=w(()=>{"use strict";Be="/@tempo/server-errors",wt="\0tempo:server-errors",se="tempo:server-error-state",He="tempo:subscribe-server-errors",Fn="__tempoViteServerErrors"});var Dn,jn=w(()=>{Je();Dn=`
|
|
7
7
|
if (import.meta.hot) {
|
|
8
8
|
const hot = import.meta.hot;
|
|
9
|
-
const feed = globalThis.${
|
|
9
|
+
const feed = globalThis.${Fn} ??= (() => {
|
|
10
10
|
const listeners = new Set();
|
|
11
11
|
let hasState = false;
|
|
12
12
|
let state;
|
|
@@ -24,21 +24,21 @@ if (import.meta.hot) {
|
|
|
24
24
|
};
|
|
25
25
|
})();
|
|
26
26
|
const publish = (state) => feed.publish(state);
|
|
27
|
-
const subscribe = () => hot.send(${JSON.stringify(
|
|
28
|
-
hot.on(${JSON.stringify(
|
|
27
|
+
const subscribe = () => hot.send(${JSON.stringify(He)});
|
|
28
|
+
hot.on(${JSON.stringify(se)}, publish);
|
|
29
29
|
hot.on("vite:ws:connect", subscribe);
|
|
30
30
|
subscribe();
|
|
31
31
|
hot.dispose(() => {
|
|
32
|
-
hot.off(${JSON.stringify(
|
|
32
|
+
hot.off(${JSON.stringify(se)}, publish);
|
|
33
33
|
hot.off("vite:ws:connect", subscribe);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
`});function
|
|
36
|
+
`});function ys(t,e){return t.type===e.type&&t.message===e.message&&t.loc?.line===e.loc?.line&&t.loc?.column===e.loc?.column}function Ss(t,e){let n=new Map;function r(){if(n.size===0)return null;let s=null;for(let u of n.values())s=u;return s}a(r,"getMostRecentError");function o(){e?.(i.currentError);let s=JSON.stringify(i.currentError);for(let u of i.clients)u.write(`data: ${s}
|
|
37
37
|
|
|
38
|
-
`)}a(o,"broadcastCurrentState");let i={get currentError(){return r()},get errorFiles(){return[...n.keys()].filter(s=>s!=="unknown")},clients:new Set,setError(s){let u=s.file??s.loc?.file??"unknown",l=n.get(u);l&&
|
|
38
|
+
`)}a(o,"broadcastCurrentState");let i={get currentError(){return r()},get errorFiles(){return[...n.keys()].filter(s=>s!=="unknown")},clients:new Set,setError(s){let u=s.file??s.loc?.file??"unknown",l=n.get(u);l&&ys(l,s)||(u!=="unknown"&&!l&&t?.(u),n.delete(u),n.set(u,s),o())},clearErrorForModules(s){if(n.size===0)return;let u=!1;for(let l of[...n.keys()])l!=="unknown"&&s.some(c=>Bn(l,c))&&(n.delete(l),u=!0);u&&o()},clearAll(){n.clear(),o()}};return i}function Bn(t,e){let n=a(r=>W(r).replace(/^file:\/\//,"").replace(/^\/@fs\//,"/").replace(/\\/g,"/").replace(/^\/+/,""),"normalize");return n(t)===n(e)}function bs(t={}){let e,n=Ss(t.onErrorFile,l=>e?.ws.send(se,l)),r=a(l=>l.replace(/\\/g,"/"),"normalizedFileKey"),o=a(l=>n.errorFiles.some(c=>Bn(c,l)),"hasActiveCompileError"),i=a(async(l,c)=>{if(!o(c))return!1;let p=j(c),f=`/@fs/${p.replace(/^\/+/,"")}`,g=l.environments?.client,m=g??l;try{let d=(0,we.readFileSync)(p,"utf8"),h=/\.canvas\.[cm]?[jt]sx?$/.test(p),S=a(x=>{let k=(0,$n.parseSync)(p,x);return!k.errors.length&&k.program.body.some(P=>P.type==="ExportDefaultDeclaration"||P.type==="ExportNamedDeclaration"&&P.exportKind!=="type"&&P.specifiers.some(A=>A.exportKind!=="type"&&(A.exported.type==="Identifier"?A.exported.name:A.exported.value)==="default"))},"hasDefault");if(h&&!S(d))return!1;let y=p;try{y=(0,we.realpathSync)(p)}catch{}let E=new Set([...m.moduleGraph.getModulesByFile(y)??[],...m.moduleGraph.getModulesByFile(p)??[]]);for(let x of E)m.moduleGraph.invalidateModule(x);let b=await m.transformRequest(f);if(!b||(0,we.readFileSync)(p,"utf8")!==d||h&&(typeof b!="object"||!("code"in b)||typeof b.code!="string"||!S(b.code)))return!1}catch{return!1}return n.clearErrorForModules([c,p,f]),l.config.logger.info(`[tempo] recovered compile-error module after validated transform: ${p}`,{timestamp:!0}),(g?.hot??l.ws).send({type:"full-reload",path:"*"}),!0},"recoverActiveCompileError"),s=new Map;return{errorServer:n,attach(l){e=l,l.ws.on?.(He,(c,p)=>{p.send(se,n.currentError)})},handleRequest(l,c){let p=l.url;return p==="/__tempo/report-error"&&l.method==="POST"?(Es(l).then(f=>{try{n.setError(JSON.parse(f))}catch{}c.statusCode=200,c.end("ok")}),!0):p==="/__tempo/report-clear"&&l.method==="POST"?(n.clearAll(),c.statusCode=200,c.end("ok"),!0):p==="/__tempo/errors"&&l.method==="OPTIONS"?(c.writeHead(204,{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"*"}),c.end(),!0):p==="/__tempo/errors"&&l.method==="GET"?(c.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","Access-Control-Allow-Origin":"*"}),c.write(`data: ${JSON.stringify(n.currentError)}
|
|
39
39
|
|
|
40
|
-
`),n.clients.add(c),l.on("close",()=>{n.clients.delete(c)}),!0):!1},recordHmrError(l){n.setError({type:"compile",message:l?.message??"Unknown error",stack:l?.stack,file:l?.id??l?.loc?.file,frame:l?.frame,plugin:l?.plugin,loc:l?.loc})},hasActiveCompileError:o,recover:i,pollRecovery:a(async l=>{let c=new Map(n.errorFiles.map(
|
|
41
|
-
`));return e.ast}function
|
|
40
|
+
`),n.clients.add(c),l.on("close",()=>{n.clients.delete(c)}),!0):!1},recordHmrError(l){n.setError({type:"compile",message:l?.message??"Unknown error",stack:l?.stack,file:l?.id??l?.loc?.file,frame:l?.frame,plugin:l?.plugin,loc:l?.loc})},hasActiveCompileError:o,recover:i,pollRecovery:a(async l=>{let c=new Map(n.errorFiles.map(f=>[r(j(f)),f]));for(let f of[...s.keys()])c.has(f)||s.delete(f);let p=Date.now();for(let[f,g]of c){let m=s.get(f);if(m&&p<m.nextAttemptAtMs)continue;if(await i(l,g)){s.delete(f);continue}let d=m?.intervalMs??Un;s.set(f,{nextAttemptAtMs:p+d,intervalMs:Math.min(d*2,vs)})}},"pollCompileErrorRecovery"),reset(){s.clear()}}}function Hn(){let t=bs(),e=a(r=>{if(typeof r!="object"||r===null)return;let o=r;if(o.type==="error"&&t.recordHmrError(o.err),o.type==="update"){let i=(o.updates??[]).map(s=>s.path).filter(s=>typeof s=="string");t.errorServer.clearErrorForModules(i)}},"observe"),n=a((r,o)=>{if(o.has(r))return;o.add(r);let i=r.send.bind(r);r.send=(...s)=>(e(s[0]),i(...s))},"tap");return{name:"tempo-compile-error-stream",apply:"serve",resolveId(r){return r===Be?wt:null},load(r){return r===wt?Dn:null},configureServer(r){t.attach(r),r.middlewares.use((s,u,l)=>{t.handleRequest(s,u)||l()});let o=new WeakSet;n(r.ws,o);let i=setInterval(()=>{t.pollRecovery(r)},Un);return i.unref?.(),r.watcher.once("close",()=>{clearInterval(i),t.reset()}),()=>{let s=r.environments?.client?.hot;s&&n(s,o)}},hotUpdate:{order:"post",async handler(r){if(this.environment.config.consumer==="client"&&r.type==="update"&&t.hasActiveCompileError(r.file)&&await t.recover(r.server,r.file))return[]}}}}function Es(t){return new Promise((e,n)=>{let r=[];t.on("data",o=>r.push(o)),t.on("end",()=>e(Buffer.concat(r).toString())),t.on("error",n)})}var we,$n,Un,vs,Jn=w(()=>{jn();we=require("node:fs"),$n=require("oxc-parser");oe();be();Je();Un=vt;a(ys,"isSameError");a(Ss,"createErrorServer");a(Bn,"moduleIdsMatch");vs=3e4;a(bs,"createCompileErrorStream");a(Hn,"compileErrorStreamPlugin");a(Es,"readBody")});function xt(t){switch(t.type){case"JSXIdentifier":return t.name;case"JSXNamespacedName":return`${t.namespace.name}:${t.name.name}`;case"JSXMemberExpression":return Kn(t)}}function Kn(t){return`${t.object.type==="JSXIdentifier"?t.object.name:Kn(t.object)}.${t.property.name}`}var Wn=w(()=>{"use strict";a(xt,"getTagName");a(Kn,"getJSXMemberExpressionName")});function Ke(t,e,n=null){if(t==null||typeof t!="object")return;if(Array.isArray(t)){for(let s of t)Ke(s,e,n);return}let r=t,o=r.type;typeof o=="string"&&o in e&&e[o](t,n);let i=typeof o=="string"?t:n;for(let s of Object.values(r))s!==null&&typeof s=="object"&&Ke(s,e,i)}var Gn,Xn,nu,zn=w(()=>{"use strict";Gn=tn(require("oxc-parser/src-js/generated/visit/keys.js"),1),Xn=Gn.default,nu=Xn.default??Xn;a(Ke,"walk")});function xs(t){let e=ws.exec(t);if(e)return e[1].toLowerCase()==="c"?{lang:"jsx",sourceType:"commonjs"}:{lang:"jsx"}}function Yn(t,e){return(0,qn.parseSync)(t,e,xs(t))}var qn,ws,Zn=w(()=>{"use strict";qn=require("oxc-parser"),ws=/\.([cm]?)js$/i;a(xs,"sourceParseOptions");a(Yn,"parseSourceFile")});function Cs(t){return t===void 0?null:typeof t=="function"?t.toString():JSON.stringify(t)}function ks(t){return Object.entries(t).map(([e,n])=>{let r=Cs(n);return r===null?null:` ${e}={${r}}`}).filter(e=>e!==null).join("")}function Ts(t){let e=new Set;for(let n of t.openingElement.attributes??[])n.type==="JSXAttribute"&&e.add(xt(n.name));return e}function Ps(t,e){return Object.fromEntries(Object.entries(t).filter(([n])=>!e.has(n)))}function Qn(t,e,n){let r=Yn(e,t),o=[],i=new WeakSet,s=a(c=>{for(let p of c.children){let f=dt(p);f&&i.add(f)}},"noteChildren");Ke(r.program,{JSXFragment(c){s(c)},JSXElement(c,p){let f=c;s(f);let g=xt(f.openingElement.name);if(Rs.has(g))return;let m=p?.type??null,d=Ps(n({element:f,tagName:g,parentType:m,...i.has(f)?{isStaticJsxChild:!0}:{}}),Ts(f));if(Object.keys(d).length===0)return;let h=f.openingElement,S=h.end-1;if(h.selfClosing)for(S--;S>h.start&&/\s/.test(t[S-1]);)S--;o.push({position:S,text:ks(d)})}}),o.sort((c,p)=>c.position-p.position);let u=[],l=0;for(let{position:c,text:p}of o)u.push(t.slice(l,c)),u.push(p),l=c;return u.push(t.slice(l)),{annotatedSource:u.join(""),elementsAnnotated:o.length,parseResult:r}}var Rs,er=w(()=>{"use strict";Wn();zn();Fe();Zn();a(Cs,"formatPropValue");a(ks,"formatProps");a(Ts,"getExistingAttributeNames");a(Ps,"removeExistingProps");Rs=new Set(["Fragment","React.Fragment"]);a(Qn,"annotateFile")});var As,Ct=w(()=>{"use strict";As=Object.freeze({$unresolved:!0})});function _s(t){let e=(0,rr.createRequire)(__tempoRuntime.sdkModuleUrl("assets/parser.ts"))("@astrojs/compiler-rs").parse(t),n=e.diagnostics.filter(r=>r.severity==="error");if(n.length)throw new Error(n.map(r=>r.text).join(`
|
|
41
|
+
`));return e.ast}function Ns(t,e){try{if(t.endsWith(".astro"))return{program:_s(e).frontmatter?.program??{type:"Program",body:[]},errors:[]};let n=(0,nr.parseSync)(t,e),r=(n.errors??[]).map(o=>({code:"unparseable_source",severity:"structural",message:o?.message??"Unable to parse asset source",span:Ce(o)??Ce(o?.labels?.[0])}));return r.length>0?{program:null,errors:r}:{program:n.program,errors:[]}}catch(n){return{program:null,errors:[{code:"unparseable_source",severity:"structural",message:n instanceof Error?n.message:"Unable to parse asset source"}]}}}function Is(t){let e={trustedDefineControlsNames:new Set,trustedDefineAssetNames:new Set,importedBindings:new Map,referenceableImports:new Map,importDeclarationSpans:[],misimports:[]};for(let n of t?.body??[]){if(n?.type!=="ImportDeclaration"||typeof n.source?.value!="string")continue;let r=Ce(n);if(r&&e.importDeclarationSpans.push(r),n.importKind==="type")continue;let o=n.source.value,i=sr(o);for(let s of n.specifiers??[]){if(s?.importKind==="type")continue;let u=s?.local?.name;if(typeof u!="string")continue;if(e.importedBindings.set(u,o),s.type==="ImportDefaultSpecifier"){e.referenceableImports.set(u,{importSpecifier:o,importedName:"default"});continue}if(s.type!=="ImportSpecifier")continue;let l=s.imported?.name??s.imported?.value??u;e.referenceableImports.set(u,{importSpecifier:o,importedName:l}),i&&l==="defineControls"&&e.trustedDefineControlsNames.add(u),l==="defineAsset"&&(i?e.trustedDefineAssetNames.add(u):Os(o)&&e.misimports.push({source:o,span:Ce(n.source)??r??{start:0,end:0}}))}}return e}function or(t,e,n=Ns(t,e)){let{program:r}=n,o=Is(r),i=r?Ms(r):null,s=new Set;if(t.endsWith(".astro")){for(let u of r?.body??[])if(!(u.type!=="ImportDeclaration"||u.source.value!=="tempo-sdk/astro/controls"||u.importKind==="type"))for(let l of u.specifiers)l.type==="ImportSpecifier"&&l.importKind!=="type"&&(l.imported.name??l.imported.value)==="defineAstroControls"&&s.add(l.local.name)}return(r?.body??[]).flatMap(u=>{let l=u.type==="ExpressionStatement"?u.expression:null;if(l?.type==="CallExpression"&&l.callee.type==="Identifier"&&s.has(l.callee.name)&&l.arguments.length===1)return[{bindingName:"default",exportKind:"default",start:l.start,end:l.end}];if(l?.type!=="CallExpression"||l.callee.type!=="Identifier"||!o.trustedDefineControlsNames?.has(l.callee.name)||l.arguments.length!==2||l.arguments[0]?.type!=="Identifier")return[];let c=l.arguments[0].name,p=o.referenceableImports.get(c),f=i?.bindings.get(c);return!p&&!f?[]:[{bindingName:c,reference:p,exportKind:p?.importedName==="default"?"default":f?.exportKind??"named",start:l.start,end:l.end}]})}function sr(t){return t===tr||t.endsWith(`/${tr}`)}function Os(t){return(t==="tempo-sdk"||t.startsWith("tempo-sdk/"))&&!sr(t)}function Ms(t){let e=new Map,n=new Set,r=new Set,o=new Set,i=a((s,u,l)=>{let c=a(p=>{l==="named"&&r.add(p),l==="default"&&o.add(p)},"markExported");if(s?.type==="FunctionDeclaration"||s?.type==="ClassDeclaration"){let p=s.id?.name;typeof p=="string"&&(e.set(p,{name:p,statementSpan:u,exportKind:"none"}),c(p));return}if(s?.type==="VariableDeclaration")for(let p of s.declarations??[])if(p?.id?.type==="Identifier"){let f=p.id.name;p.init?(e.set(f,{name:f,statementSpan:u,exportKind:"none"}),c(f)):n.add(f)}else xe(p?.id,n)},"register");for(let s of t?.body??[]){let u=Ce(s)??{start:0,end:0};if(s?.type==="ExportNamedDeclaration"){if(s.declaration&&i(s.declaration,u,"named"),!s.source)for(let l of s.specifiers??[]){if(l?.type!=="ExportSpecifier")continue;let c=l.local?.name;if(typeof c!="string")continue;((l.exported?.name??l.exported?.value)==="default"?o:r).add(c)}continue}if(s?.type==="ExportDefaultDeclaration"){let l=s.declaration;if(l?.type==="FunctionDeclaration"||l?.type==="ClassDeclaration")i(l,u,"default");else{let c=Vs(l);c?.type==="Identifier"&&o.add(c.name)}continue}i(s,u,null)}for(let s of e.values())s.exportKind=o.has(s.name)?"default":r.has(s.name)?"named":"none";return{bindings:e,nonSimpleNames:n}}function xe(t,e){if(!(!t||typeof t!="object")){if(t.type==="Identifier"&&typeof t.name=="string"){e.add(t.name);return}if(t.type==="ObjectPattern"){for(let n of t.properties??[])xe(n?.value??n?.argument,e);return}if(t.type==="ArrayPattern"){for(let n of t.elements??[])xe(n,e);return}if(t.type==="AssignmentPattern"){xe(t.left,e);return}t.type==="RestElement"&&xe(t.argument,e)}}function Vs(t){let e=t;for(;e?.type==="TSSatisfiesExpression"||e?.type==="TSAsExpression"||e?.type==="TSNonNullExpression"||e?.type==="ParenthesizedExpression";)e=e.expression;return e}function Ce(t){return typeof t?.start=="number"&&Number.isFinite(t.start)&&typeof t?.end=="number"&&Number.isFinite(t.end)?{start:t.start,end:t.end}:void 0}var nr,rr,tr,ir=w(()=>{nr=require("oxc-parser"),rr=require("node:module");Ct();Ct();a(_s,"parseAstroAssetSource");tr="tempo-sdk/assets";a(Ns,"parseAssetProgram");a(Is,"readAssetImports");a(or,"parseControlsFile");a(sr,"isTrustedAssetImportSource");a(Os,"isMisimportedAssetSdkSource");a(Ms,"collectTopLevelScope");a(xe,"collectPatternNames");a(Vs,"unwrapTsExpression");a(Ce,"toSourceSpan")});function ar(t,e,n=!1){let r=t.includes("defineControls")?or(e,t):[];if(!r.length&&!n)return t;for(let{start:o,end:i}of r.reverse())t=t.slice(0,o)+`((dispose) => { if (import.meta.hot && typeof dispose === "function") import.meta.hot.data.__tempoControlsDisposers.push(dispose); })(${t.slice(o,i)})`+t.slice(i);return`if (import.meta.hot) {
|
|
42
42
|
for (const dispose of import.meta.hot.data.__tempoControlsDisposers ?? []) dispose();
|
|
43
43
|
import.meta.hot.data.__tempoControlsDisposers = [];
|
|
44
44
|
import.meta.hot.dispose(() => {
|
|
@@ -46,24 +46,24 @@ if (import.meta.hot) {
|
|
|
46
46
|
import.meta.hot.data.__tempoControlsDisposers = [];
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
${t}`}var tr=E(()=>{Qn();a(er,"transformControlsForHmr")});function Ee(t){let e=`preview ${JSON.stringify(t)}`;if(t.includes("\\"))return{error:`${e} uses a backslash; use "/" (paths in canvases are POSIX).`};let n=t.lastIndexOf("#");if(n<0)return{error:`${e} needs "#<function>" after the file, e.g. "../../lib/cards.dart#productCard".`};let r=t.slice(0,n),o=t.slice(n+1);return!r.startsWith("./")&&!r.startsWith("../")?{error:r.startsWith("lib/")?`${e} is no longer relative to a Flutter app folder; write the path from this canvas file, starting with "./" or "../".`:`${e} must be a path relative to this canvas file and start with "./" or "../", like a relative import.`}:r.endsWith(".dart")?/[?#]/.test(r)||r.includes("//")?{error:`${e} must not contain "?", "#", or empty path segments.`}:/^[A-Za-z$][A-Za-z0-9_$]*$/.test(o)?{file:r,functionName:o}:{error:`${e}: ${JSON.stringify(o)} is not a public Dart function name.`}:{error:`${e} must name a .dart file.`}}var nr,Ue=E(()=>{"use strict";a(Ee,"parseFlutterPreview");nr="data-tempo-flutter-preview-key"});function we(t){let e=G.default.resolve(t);try{return Be.realpathSync.native(e)}catch(n){let r=n.code;if(r!=="ENOENT"&&r!=="ENOTDIR")throw n;let o=!1;try{o=(0,Be.lstatSync)(e).isSymbolicLink()}catch(s){if(s.code!=="ENOENT"&&s.code!=="ENOTDIR")throw s}if(o)throw n;let i=G.default.dirname(e);if(i===e)throw n;return G.default.join(we(i),G.default.basename(e))}}function rr(t,e,n){return`${G.default.relative(we(t),we(e)).split(G.default.sep).join("/")}#${n}`}var Be,G,or=E(()=>{Ue();Be=require("node:fs"),G=qt(require("node:path"),1);a(we,"canonicalPathAllowMissing");a(rr,"flutterPreviewKey")});var bs,xe,He,xt=E(()=>{"use strict";bs={Storyboard:{importSource:"tempo-sdk/canvas",kind:"component",requiresComponentProp:!0,allowsVrt:!0,componentFileExtension:".tsx"},SvelteStoryboard:{importSource:"tempo-sdk/canvas/svelte",kind:"component",uiFramework:"svelte",requiresComponentProp:!0,allowsVrt:!0,componentFileExtension:".svelte"},VueStoryboard:{importSource:"tempo-sdk/canvas/vue",kind:"component",uiFramework:"vue",requiresComponentProp:!0,allowsVrt:!0,componentFileExtension:".vue"},AstroStoryboard:{importSource:"tempo-sdk/canvas/astro",kind:"component",uiFramework:"astro",requiresComponentProp:!0,allowsVrt:!0,componentFileExtension:".astro",componentImportQuery:"?tempo-component"},FlutterStoryboard:{importSource:"tempo-sdk/canvas",kind:"component",requiresComponentProp:!1,allowsVrt:!0},RouteStoryboard:{importSource:"tempo-sdk/canvas",kind:"route",requiresComponentProp:!1,allowsVrt:!1},HtmlStoryboard:{importSource:"tempo-sdk/canvas",kind:"html",requiresComponentProp:!1,allowsVrt:!0},LegacyStoryboardV1:{importSource:"tempo-sdk/canvas",kind:"component",requiresComponentProp:!1,allowsVrt:!1}},xe=bs,He=Object.keys(xe)});function We(t,e){let n=[],r;try{let y=(0,ar.parseSync)(t,e);r=y.program;for(let b of y.errors??[])n.push({message:b.message??"Unable to parse canvas source",span:S(b)??S(b?.labels?.[0]),kind:"structural"})}catch(y){return{filePath:t,pageName:ir(t),imports:[],misimportedSdkCanvasImports:[],storyboards:[],errors:[{message:y instanceof Error?y.message:"Unable to parse canvas source",kind:"structural"}]}}let o=Ts(r),i=Ps(r),{legacyObjects:s,stringBindings:u}=Rs(r,o,e),l=null,c=[];Pt(r,y=>{if(y.type!=="JSXElement")return;let b=Tt(y.openingElement?.name,o),w=Ks(y.openingElement?.name,o,i);if(w&&i.add(w),b==="Canvas"){l?n.push({message:"Canvas file must declare exactly one <Canvas> element",span:S(y),kind:"structural"}):l=y;return}Rt(b)&&c.push({element:y,component:b})});let p=l?Os(l,o):[],d=new Set(p.map(y=>y.element)),m=p.map(y=>Ns(y.element,y.component,o,s,e,n));for(let y of c)d.has(y.element)||n.push({message:`<${y.component}> declarations must be direct children of the <Canvas> element`,span:S(y.element),kind:"structural"});if(Ms(m,n),l)n.push(...Vs(l,o));else if(i.all.length>0)for(let y of i.all)n.push({message:ks(y),span:y.sourceSpan,kind:"structural"});else n.push({message:Cs,kind:"structural"});let g=l?.openingElement,f=Ct(g,"name",u),h=F(g,"path"),v=Ct(g,"backgroundColor",u)??Ct(g,"background",u);return g&&!f&&n.push({message:'<Canvas> must include a literal "name" prop',span:S(g),kind:"degraded"}),{filePath:t,canvasPath:h?.value,pageName:f?.value??ir(t),backgroundColor:v?.value,canvasElementSpan:S(l),canvasOpeningElementSpan:S(g),canvasChildrenInsertionOffset:typeof l?.closingElement?.start=="number"?l.closingElement.start:void 0,nameSpan:f?.valueSpan,nameAttributeSpan:f?.attributeSpan,pathSpan:h?.valueSpan,pathAttributeSpan:h?.attributeSpan,backgroundColorSpan:v?.valueSpan,backgroundColorAttributeSpan:v?.attributeSpan,imports:o.all,misimportedSdkCanvasImports:i.all,storyboards:m,errors:n}}function ks(t){return`Tempo canvas components must be imported from "tempo-sdk/canvas" \u2014 found import of ${t.importedNames.join(", ")} from "${t.source}"`}function Ps(t){let e=[],n=new Map,r=new Map,o=a(i=>{let s=zs(i.sourceSpan);n.has(s)||(n.set(s,i),e.push(i))},"add");for(let i of t?.body??[]){if(i?.type!=="ImportDeclaration"||typeof i.source?.value!="string"||!mr(i.source.value)||i.importKind==="type")continue;let s=i.source.value,u=S(i.source);if(!u)continue;let l=(i.specifiers??[]).filter(m=>m?.importKind!=="type"),c=l.map(Je),p={source:s,sourceSpan:u,importedNames:c,rewritable:l.length>0&&l.every(m=>m?.type==="ImportSpecifier"&&xs.has(Je(m)))};l.some(m=>m?.type==="ImportSpecifier"&&Ke.has(Je(m)))&&o(p);for(let m of l){if(m?.type!=="ImportNamespaceSpecifier")continue;let g=m.local?.name;typeof g=="string"&&r.set(g,p)}}return{all:e,byDeclarationKey:n,namespaceCandidatesByLocalName:r,add:o}}function Ts(t){let e=[],n=new Map,r=new Map,o=new Set;for(let i of t?.body??[]){if(i?.type!=="ImportDeclaration"||typeof i.source?.value!="string")continue;let s=i.source.value,u=fr(s);for(let l of i.specifiers??[]){let c=l.local?.name;if(typeof c!="string")continue;let p=Je(l),d={localName:c,source:s,importedName:p,kind:Xs(l),importKind:l.importKind==="type"?"type":"value",span:S(l)??S(i)??{start:0,end:0},declarationSpan:S(i)??{start:0,end:0},specifierCount:i.specifiers?.length??0,namedSpecifierCount:(i.specifiers??[]).filter(m=>m?.type==="ImportSpecifier").length,hasDefaultSpecifier:(i.specifiers??[]).some(m=>m?.type==="ImportDefaultSpecifier"),hasNamespaceSpecifier:(i.specifiers??[]).some(m=>m?.type==="ImportNamespaceSpecifier")};if(e.push(d),n.set(c,d),!!u){if(l.type==="ImportNamespaceSpecifier"){o.add(c);continue}Ke.has(p)&&r.set(c,p)}}}return{all:e,byLocalName:n,sdkLocalNames:r,sdkNamespaces:o}}function Rs(t,e,n){let r=new Map,o=new Map;for(let i of _s(t)){if(i.id?.type!=="Identifier")continue;let s=Xe(i.init);if(s?.type!=="ObjectExpression")continue;let u=i.id.name;r.set(u,As(u,s,e,n));let l=Is(s);l.size>0&&o.set(u,l)}return{legacyObjects:r,stringBindings:o}}function _s(t){let e=[];for(let n of t?.body??[]){let r=n?.type==="VariableDeclaration"?n:n?.type==="ExportNamedDeclaration"&&n.declaration?.type==="VariableDeclaration"?n.declaration:null;r&&e.push(...r.declarations??[])}return e}function As(t,e,n,r){let o=[],i=$(e,"name"),s=i?pr(i.value):null,u=$(e,"layout"),l=u?cr(u.value,"LegacyStoryboardV1"):{value:se,errors:[{message:'<LegacyStoryboardV1> storyboard object must include a literal "layout" object',span:S(e),kind:"degraded"}]},c=$(e,"render"),p=Us(c?.value,n,r);return i&&!s&&o.push({message:"<LegacyStoryboardV1> storyboard.name must be a string literal when set",span:S(i),kind:"degraded"}),o.push(...l.errors),{bindingName:t,displayName:s?.value,component:p??void 0,objectSpan:S(e),objectClose:kt(e),nameSpan:s?.span,namePropertySpan:S(i),layoutPropertySpan:S(u),layout:l.value,layoutSpans:l.spans,errors:o}}function Is(t){let e=new Map;for(let n of t.properties??[]){if(n?.type!=="Property"||n.computed)continue;let r=ze(n.key),o=pr(n.value);!r||!o||e.set(r,o)}return e}function Ns(t,e,n,r,o,i){let s=t.openingElement,u=[],l=F(s,"id"),c=F(s,"name"),p=e==="LegacyStoryboardV1"?sr(s,"storyboard",o):void 0,d=p?.expression&&Bs(p.expression)?r.get(p.expression):void 0,m=e==="LegacyStoryboardV1"?{value:d?.layout??se,spans:d?.layoutSpans,attributeSpan:void 0,errors:d?.errors??(p?[{message:"<LegacyStoryboardV1> storyboard prop must reference a same-file object literal",span:p.span,kind:"degraded"}]:[{message:'<LegacyStoryboardV1> must include a "storyboard" expression prop',span:S(s),kind:"degraded"}])}:Hs(s,e),g=xe[e];l||u.push({message:`<${e}> must include a literal "id" prop`,span:S(s),kind:"structural"}),m.errors.length>0&&u.push(...m.errors);let f={storyboardKey:l?.value??"",displayName:c?.value??d?.displayName,kind:g.kind,...g.uiFramework?{componentFramework:g.uiFramework}:{},...g.uiFramework==="svelte"?{uiFramework:g.uiFramework}:g.uiFramework==="astro"?{runtimeFramework:g.uiFramework}:{},layout:m.value,editable:!!l&&m.errors.length===0,jsxElementSpan:S(t)??{start:0,end:0},openingElementSpan:S(s),idSpan:l?.valueSpan,idAttributeSpan:l?.attributeSpan,nameSpan:c?.valueSpan??d?.nameSpan,nameAttributeSpan:c?.attributeSpan??d?.namePropertySpan,layoutAttributeSpan:m.attributeSpan,layoutSpans:m.spans,props:sr(s,"props",o),component:d?.component,legacyV1:p?{storyboard:p,objectName:d?.bindingName,objectSpan:d?.objectSpan,objectClose:d?.objectClose,namePropertySpan:d?.namePropertySpan,layoutPropertySpan:d?.layoutPropertySpan}:void 0,errors:u};if(g.requiresComponentProp){let h=$s(s,n,o);h?f.component=h:u.push({message:`<${e}> must include a "component" expression prop`,span:S(s),kind:"degraded"})}if(g.allowsVrt){let h=ur(s,u);h&&(h.value&&(f.vrt=h.value),f.vrtAttributeSpan=h.attributeSpan)}if(e==="RouteStoryboard"){let h=F(s,"route");h?(f.route=h.value,f.routeSpan=h.valueSpan,f.routeAttributeSpan=h.attributeSpan):u.push({message:'<RouteStoryboard> must include a literal "route" prop',span:S(s),kind:"degraded"})}if(e==="HtmlStoryboard"){let h=F(s,"filepath"),v=F(s,"src");f.filepath=h?.value.trim()?h.value:void 0,f.filepathSpan=h?.valueSpan,f.filepathAttributeSpan=h?.attributeSpan,f.src=v?.value,f.srcSpan=v?.valueSpan,f.srcAttributeSpan=v?.attributeSpan,!h?.value.trim()&&!v?.value.trim()&&u.push({message:'<HtmlStoryboard> must include a literal "filepath" or "src" prop',span:S(s),kind:"degraded"})}if(e==="FlutterStoryboard"){let h=F(s,"preview");if(h?.value.trim()){f.preview=h.value,f.previewSpan=h.valueSpan,f.previewAttributeSpan=h.attributeSpan;let v=Ee(h.value);"error"in v&&u.push({message:`flutter_preview_invalid: ${v.error}`,span:h.valueSpan,kind:"structural"})}else u.push({message:'<FlutterStoryboard> must include a literal "preview" prop naming a Flutter @Preview function, e.g. preview="../../lib/cards.dart#productCard"',span:S(q(s,"preview")??s),kind:"structural"})}return i.push(...u),f}function Os(t,e){let n=[];for(let r of t.children??[]){if(r?.type!=="JSXElement")continue;let o=Tt(r.openingElement?.name,e);Rt(o)&&n.push({element:r,component:o})}return n}function Ms(t,e){let n=new Map;for(let r of t){if(!r.storyboardKey)continue;let o=n.get(r.storyboardKey);o?o.push(r):n.set(r.storyboardKey,[r])}for(let[r,o]of n)o.length<2||e.push({message:`Duplicate storyboard id "${r}" (${o.length} declarations) \u2014 storyboard ids must be unique`,span:o[1]?.jsxElementSpan,kind:"structural"})}function Vs(t,e){let n=[];for(let r of t.children??[])if(r&&!(r.type==="JSXText"&&typeof r.value=="string"&&r.value.trim()==="")){if(r.type==="JSXExpressionContainer"){if(r.expression?.type==="JSXEmptyExpression")continue;n.push({message:"<Canvas> children must be static storyboard declarations, not expressions",span:S(r),kind:"structural"});continue}if(r.type==="JSXElement"){let o=Tt(r.openingElement?.name,e);if(Rt(o))continue;let i=js(r.openingElement?.name,e);if(i){n.push(Ds(r,i));continue}}n.push({message:ws,span:S(r),kind:"structural"})}return n}function js(t,e){let n,r;if(t?.type==="JSXIdentifier"){let s=e.byLocalName.get(t.name);if(s?.kind!=="named")return null;n=s.importedName,r=s.source}else if(t?.type==="JSXMemberExpression"&&t.object?.type==="JSXIdentifier"&&t.property?.type==="JSXIdentifier"){let s=e.byLocalName.get(t.object.name);if(s?.kind!=="namespace")return null;n=t.property.name,r=s.source}else return null;let o=Ls.test(r),i=n.endsWith("Storyboard");return o&&i?n:null}function Ds(t,e){let n=t.openingElement,r=F(n,"id")?.value,o=ur(n,[])?.value!=null,i=r?` id="${r}"`:"";return{message:`<${e}${i}> is a storyboard from a newer tempo-sdk than this reader supports`,span:S(t),kind:"structural",newerSdkStoryboard:{component:e,...r?{storyboardKey:r}:{},vrt:o}}}function ur(t,e){let n=q(t,"vrt");if(!n)return null;let r=S(n);if(n.value==null)return{value:{},attributeSpan:r};let o=Xe(ie(n.value));if(o?.type==="Literal"&&o.value===!0)return{value:{},attributeSpan:r};if(o?.type==="Literal"&&o.value===!1)return{value:null,attributeSpan:r};if(o?.type!=="ObjectExpression")return e.push({message:"<Storyboard> vrt must be a boolean literal or an object literal ({ threshold?, skip?, ignore? })",span:S(o)??r,kind:"degraded"}),{value:null,attributeSpan:r};let i={};for(let s of o.properties??[]){if(s?.type!=="Property"||s.computed){e.push({message:"<Storyboard> vrt must contain only literal properties",span:S(s??o),kind:"degraded"});continue}let u=ze(s.key);if(u==="threshold"){let l=oe(s.value);l&&l.value>=0&&l.value<=.5?i.threshold=l.value:e.push({message:"<Storyboard> vrt.threshold must be a number literal between 0 and 0.5",span:S(s),kind:"degraded"});continue}if(u==="skip"){s.value?.type==="Literal"&&typeof s.value.value=="boolean"?s.value.value&&(i.skip=!0):e.push({message:"<Storyboard> vrt.skip must be a boolean literal",span:S(s),kind:"degraded"});continue}if(u==="ignore"){let l=Fs(s.value,e);l&&(i.ignore=l);continue}e.push({message:`<Storyboard> vrt has unknown property "${u??"?"}" \u2014 expected threshold, skip, or ignore`,span:S(s),kind:"degraded"})}return{value:i,attributeSpan:r}}function Fs(t,e){if(t?.type!=="ArrayExpression")return e.push({message:"<Storyboard> vrt.ignore must be an array of { x, y, w, h } literals",span:S(t),kind:"degraded"}),null;let n=[];for(let r of t.elements??[]){let o={};for(let i of["x","y","w","h"]){let s=$(r,i),u=s?oe(s.value):null;u&&(o[i]=u.value)}if(o.x===void 0||o.y===void 0||o.w===void 0||o.h===void 0)return e.push({message:"<Storyboard> vrt.ignore regions must be { x, y, w, h } number literals",span:S(r)??S(t),kind:"degraded"}),null;n.push(o)}return n}function $s(t,e,n){let r=q(t,"component"),o=ie(r?.value),i=S(o);if(!o||!i)return null;let s=o.type==="Identifier"?o.name:o.type==="MemberExpression"&&o.object?.type==="Identifier"?o.object.name:void 0;return{expression:n.slice(i.start,i.end),span:i,attributeSpan:S(r),localName:s,import:s?e.byLocalName.get(s):void 0}}function Us(t,e,n){if(t?.type!=="ArrowFunctionExpression")return null;let r=Xe(t.body);if(r?.type!=="JSXElement")return null;let o=r.openingElement?.name;if(o?.type!=="JSXIdentifier")return null;let i=S(o);return!i||typeof o.name!="string"?null:{expression:n.slice(i.start,i.end),span:i,localName:o.name,import:e.byLocalName.get(o.name)}}function sr(t,e,n){let r=q(t,e),o=ie(r?.value),i=S(o);if(!(!o||!i))return{expression:n.slice(i.start,i.end),span:i,attributeSpan:S(r)}}function Bs(t){return/^[A-Za-z_$][\w$]*$/.test(t)}function Hs(t,e){let n=dr(e),r=q(t,"layout"),o=ie(r?.value);return o?{...cr(o,e),attributeSpan:S(r)}:{value:n?lr:se,attributeSpan:S(r),errors:[{message:`<${e}> must include a literal "layout" object prop`,span:S(t),kind:"degraded"}]}}function cr(t,e){let n=[],r=dr(e);if(t.type!=="ObjectExpression")return{value:r?lr:se,spans:{layoutClose:kt(t)},errors:[{message:`<${e}> layout must be an object literal`,span:S(t),kind:"degraded"}]};let o={layoutClose:kt(t)},i={...se},s=$(t,"width"),u=$(t,"height"),l=$(t,"intrinsicSizing"),c=l?.value?.value==="root-element",d=r||!!(s&&u)&&!c;!r&&!!s!=!!u&&n.push({message:"layout.width and layout.height must be set together",span:S(t),kind:"degraded"});let g=d?{width:s?oe(s.value):null,height:u?oe(u.value):null}:null,f=d?["x","y","width","height"]:["x","y"];for(let y of f){let b=y==="width"?s:y==="height"?u:$(t,y),w=y==="width"||y==="height"?g?.[y]:b?oe(b.value):null,x=y==="x"||y==="y"||r||!!(g?.width&&g.height);if(!w){n.push({message:`<${e}> layout.${y} must be a number literal`,span:S(b??t),kind:"degraded"});continue}x&&(i[y]=w.value,o[y]=w.span)}let h=$(t,"zIndex");if(h){let y=oe(h.value);y?(i.zIndex=y.value,o.zIndex=y.span):n.push({message:`<${e}> layout.zIndex must be a number literal`,span:S(h),kind:"degraded"})}return l&&(l.value?.type!=="Literal"||!c)&&n.push({message:`<${e}> layout.intrinsicSizing must be "root-element" when set`,span:S(l),kind:"degraded"}),{value:i,spans:o,errors:n}}function pr(t){return t?.type==="Literal"&&typeof t.value=="string"?{value:t.value,span:S(t)??{start:0,end:0}}:null}function Xe(t){let e=t;for(;e?.type==="TSSatisfiesExpression"||e?.type==="TSAsExpression"||e?.type==="TSNonNullExpression"||e?.type==="ParenthesizedExpression";)e=e.expression;return e}function Ct(t,e,n){let r=F(t,e);if(r)return r;let o=q(t,e),i=ie(o?.value),s=S(i),u=S(o);if(!i||!s||!u)return null;let l=Js(i,n);return l?{value:l.value,valueSpan:s,attributeSpan:u}:null}function Js(t,e){if(t?.type!=="MemberExpression"||t.object?.type!=="Identifier")return null;let n=ze(t.property);return n?e.get(t.object.name)?.get(n)??null:null}function F(t,e){let n=q(t,e);if(!n)return null;let r=n.value;if(r?.type==="Literal"&&typeof r.value=="string")return{value:r.value,valueSpan:S(r)??S(n)??{start:0,end:0},attributeSpan:S(n)??{start:0,end:0}};let o=Xe(ie(r)),i=o?.type==="Literal"&&typeof o.value=="string"?o.value:o?.type==="TemplateLiteral"&&(o.expressions?.length??0)===0&&o.quasis?.length===1&&typeof o.quasis[0]?.value?.cooked=="string"?o.quasis[0].value.cooked:null;return i!==null?{value:i,valueSpan:S(o)??S(n)??{start:0,end:0},attributeSpan:S(n)??{start:0,end:0}}:null}function q(t,e){for(let n of t?.attributes??[])if(n?.type==="JSXAttribute"&&n.name?.type==="JSXIdentifier"&&n.name.name===e)return n;return null}function ie(t){return t?t.type==="JSXExpressionContainer"?t.expression:t:null}function ze(t){return t?.type==="Identifier"?t.name:t?.type==="Literal"&&typeof t.value=="string"?t.value:null}function $(t,e){if(t?.type!=="ObjectExpression")return null;for(let n of t.properties??[]){if(n?.type!=="Property"||n.computed)continue;if(ze(n.key)===e)return n}return null}function oe(t){return t?.type==="Literal"&&typeof t.value=="number"&&Number.isFinite(t.value)?{value:t.value,span:S(t)??{start:0,end:0}}:t?.type==="UnaryExpression"&&t.operator==="-"&&t.argument?.type==="Literal"&&typeof t.argument.value=="number"&&Number.isFinite(t.argument.value)?{value:-t.argument.value,span:S(t)??{start:0,end:0}}:null}function Tt(t,e){return t?.type==="JSXIdentifier"?e.sdkLocalNames.get(t.name)??null:t?.type==="JSXMemberExpression"&&t.object?.type==="JSXIdentifier"&&t.property?.type==="JSXIdentifier"&&e.sdkNamespaces.has(t.object.name)&&Ke.has(t.property.name)?t.property.name:null}function Ks(t,e,n){if(t?.type!=="JSXMemberExpression"||t.object?.type!=="JSXIdentifier"||t.property?.type!=="JSXIdentifier"||!Ke.has(t.property.name))return null;let r=e.byLocalName.get(t.object.name);return r?.kind!=="namespace"||!mr(r.source)?null:n.namespaceCandidatesByLocalName.get(t.object.name)??null}function Rt(t){return t!==null&&t!=="Canvas"}function Ws(t){return t.length<=1?t.join(""):`${t.slice(0,-1).join(", ")}, or ${t[t.length-1]}`}function dr(t){return t==="RouteStoryboard"||t==="HtmlStoryboard"||t==="FlutterStoryboard"}function Je(t){return t.type==="ImportDefaultSpecifier"?"default":t.type==="ImportNamespaceSpecifier"?"*":t.imported?.name??t.local?.name??"unknown"}function Xs(t){return t.type==="ImportDefaultSpecifier"?"default":t.type==="ImportNamespaceSpecifier"?"namespace":"named"}function fr(t){for(let e of Es)if(t===e||t.endsWith(`/${e}`))return!0;return!1}function mr(t){return(t==="tempo-sdk"||t.startsWith("tempo-sdk/"))&&!fr(t)}function zs(t){return`${t.start}:${t.end}`}function kt(t){return typeof t?.end=="number"&&Number.isFinite(t.end)?t.end-1:void 0}function ir(t){let n=t.replace(/\\/g,"/").split("/").filter(Boolean),r=n.length>0?n[n.length-1]:t,o=n.length>1?n[n.length-2]:r;return(/^index\.canvas\.[tj]sx?$/.test(r)?o:r.replace(/\.canvas\.[tj]sx?$/,"")).split(/[-_\s]+/).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function S(t){return typeof t?.start=="number"&&Number.isFinite(t.start)&&typeof t?.end=="number"&&Number.isFinite(t.end)?{start:t.start,end:t.end}:void 0}function Pt(t,e,n=new Set){if(!(!t||typeof t!="object"||n.has(t))){n.add(t),e(t);for(let r of Object.values(t))if(r)if(Array.isArray(r))for(let o of r)Pt(o,e,n);else typeof r=="object"&&Pt(r,e,n)}}var ar,Es,Ke,ws,xs,se,lr,Cs,Ls,_t=E(()=>{Ue();ar=require("oxc-parser");xt();xt();Es=new Set(["tempo-sdk/canvas",...He.map(t=>xe[t].importSource)]),Ke=new Set(["Canvas",...He]),ws=`<Canvas> children must be ${Ws(He.map(t=>`<${t}>`))} declarations`,xs=new Set(["Canvas","CanvasContext","getCanvasStoryboardRenderId","CanvasHost","buildRenderContentFiberSelector","buildRenderContentSelector","buildRenderSelector","captureStoryboardCombined","captureStoryboardHtml","captureStoryboardImage","stripRenderContentWrapperAttributes","stripRenderContentWrapperFromCombinedCapture","watchStoryboardCombined","getCanvasHostRuntime","getOptionalCanvasHostRuntime","useActiveState","FlutterStoryboard","HtmlStoryboard","LegacyStoryboardV1","RouteStoryboard","Storyboard","StoryboardSlot"]),se={x:0,y:0},lr={...se,width:600,height:400},Cs="No <Canvas> declaration found in canvas file";a(We,"parseCanvasFile");a(ks,"misimportedSdkCanvasImportMessage");a(Ps,"readMisimportedSdkCanvasImports");a(Ts,"readImports");a(Rs,"readObjectExpressionBindings");a(_s,"readTopLevelVariableDeclarators");a(As,"readLegacyStoryboardObject");a(Is,"readObjectStringProperties");a(Ns,"readStoryboard");a(Os,"readDirectCanvasStoryboardElements");a(Ms,"reportDuplicateStoryboardIds");a(Vs,"validateCanvasChildren");Ls=/(^|\/)tempo-sdk\/canvas(\/[^/]+)?$/;a(js,"resolveNewerSdkStoryboardComponent");a(Ds,"newerSdkStoryboardError");a(ur,"readVrt");a(Fs,"readVrtIgnoreRegions");a($s,"readComponentReference");a(Us,"readRenderComponentReference");a(sr,"readExpressionReference");a(Bs,"isIdentifierExpression");a(Hs,"readLayout");a(cr,"readLayoutExpression");a(pr,"readStringLiteralValue");a(Xe,"unwrapTsExpression");a(Ct,"readResolvableStringAttribute");a(Js,"resolveStringMemberExpression");a(F,"readStringAttribute");a(q,"getAttribute");a(ie,"unwrapAttributeExpression");a(ze,"readPropertyKeyName");a($,"getObjectProperty");a(oe,"readNumberLiteral");a(Tt,"resolveSdkComponent");a(Ks,"resolveMisimportedNamespaceSdkComponent");a(Rt,"isStoryboardSdkComponent");a(Ws,"formatAlternatives");a(dr,"requiresFixedLayoutSize");a(Je,"readImportedName");a(Xs,"readImportKind");a(fr,"isSdkImportSource");a(mr,"isWrongTempoSdkCanvasImportSource");a(zs,"spanKey");a(kt,"readLayoutClose");a(ir,"fallbackPageName");a(S,"toSpan");a(Pt,"walk")});function Gs(t,e,n){let r=n?.get(e),o=r?.startsWith("\0tempo:astro-component:")?decodeURIComponent(r.slice(23,-3)):r,i=o===void 0?e:o.replace(/\bt=\d{13}&?\b/,"").replace(/[?&]$/,"");if(i.startsWith("\0"))return i;let s=i.search(/[?#]/),u=(s<0?i:i.slice(0,s)).replace(/\\/g,"/"),l=s<0||i.endsWith(".astro?tempo-component")?"":i.slice(s);if(o===void 0&&u.startsWith(".")&&(u=(0,N.resolve)((0,N.dirname)(t),u)),!(0,N.isAbsolute)(u)&&!/^[A-Za-z]:\//.test(u))return i;if(o!==void 0)try{u=hr.realpathSync.native(u)}catch{}return(0,N.normalize)(u).replace(/\\/g,"/")+l}function yr(t,e,n,r){let o=new Map;if(!e.includes("tempo-sdk/canvas"))return o;let i=We(t,e);for(let s of i.storyboards){if(s.kind!=="component"||s.openingElementSpan===void 0)continue;let u=s.preview?Ee(s.preview):null;if(u&&!("error"in u)&&r){let f;try{let h=(0,N.resolve)((0,N.dirname)(we(t)),u.file);f=rr(r,h,u.functionName)}catch{continue}o.set(s.openingElementSpan.start,{[nr]:f,[gr]:JSON.stringify(["flutter",f.slice(0,f.lastIndexOf("#")),u.functionName]),"data-tempo-external-component":"true"});continue}let l=s.component;if(!l?.localName)continue;let c=l.expression.match(/^\s*([$\w]+)(?:\s*\.\s*([$\w]+))?\s*$/);if(!c)continue;let p;if(l.import)if(l.import.kind==="namespace"){if(!c[2])continue;p=c[2]}else{if(c[2])continue;p=l.import.importedName}else{if(c[2])continue;p=l.localName}let d=l.import?.source.replace(/\\/g,"/").replace(/[?#].*/,""),m=N.posix.dirname(t.replace(/\\/g,"/")),g=d!==void 0&&(!d.startsWith(".")||!N.posix.join(m,d).startsWith(`${m}/`));o.set(s.openingElementSpan.start,{[gr]:JSON.stringify([l.import?"import":"local",Gs(t,l.import?.source??t,n),p]),...g?{"data-tempo-external-component":"true"}:{}})}return o}var hr,N,gr,Sr=E(()=>{hr=require("node:fs"),N=require("node:path");Ue();or();_t();gr="data-tempo-component-reference";a(Gs,"moduleIdentity");a(yr,"canvasComponentAnnotations")});function At(t){let e=/\bexport\s+default\s+/.exec(t);if(!e)return null;let n=t.slice(e.index+e[0].length),r=qs.exec(n);if(r)return{kind:"function",name:r[1]??null};let o=Ys.exec(n);if(o)return{kind:"class",name:o[1]??null};if(Zs.test(n))return{kind:"function",name:null};let i=Qs.exec(n);return i?{kind:"identifier",name:i[1]}:null}function br(t,e){return t?t.name===null?!0:!e||t.name===e.name?!1:vr(t)&&vr(e):!1}function vr(t){return t.name===null||/^[A-Z]/.test(t.name)}var qs,Ys,Zs,Qs,Er=E(()=>{qs=/^(?:async\s+)?function(?:\s*\*)?(?:\s+([A-Za-z_$][\w$]*))?\s*\(/,Ys=/^(?:abstract\s+)?class(?:\s+([A-Za-z_$][\w$]*))?(?=[\s{])/,Zs=/^(?:async\s+)?(?:\([^()]*\)|[A-Za-z_$][\w$]*)\s*=>/,Qs=/^([A-Za-z_$][\w$]*)[ \t]*(?:;|\r?\n|$)/;a(At,"readDefaultExportIdentity");a(br,"isDefaultExportIdentityRewrite");a(vr,"isComponentShaped")});function xr(t){let e=new Set;function n(u,l){let c=er(u,l,e.has(l));return c!==u&&e.add(l),c}a(n,"transformControls");let r=new Map,o=a(u=>{let l=V(u);try{return A.realpathSync.native(l)}catch{return l.replace(/\\/g,"/")}},"canonicalIdentityKey");async function i(u,l,c){let p=t.transformsControls(c)?n(l,c):l,d=t.stampedFilepath(c);if(d===null)return p!==l?{code:p,map:null}:null;try{let m=(0,A.openSync)(c,"r"),g;try{let k=(0,A.fstatSync)(m),T=(0,A.readFileSync)(m,"utf8");g={before:k,rawSource:T,after:(0,A.fstatSync)(m)}}finally{(0,A.closeSync)(m)}let{before:f,after:h,rawSource:v}=g,y=["mtimeMs","ctimeMs","size","ino","dev"],b=l===v?l:void 0;if(b===void 0&&typeof u.getCombinedSourcemap=="function")try{let k=u.getCombinedSourcemap(),T=k.sourceRoot,pe=k.sources.flatMap((st,Wt)=>{let it=st.startsWith("file:")?(0,wr.fileURLToPath)(st):st,Xt=(0,ae.isAbsolute)(it)?it:(0,ae.resolve)((0,ae.dirname)(c),typeof T=="string"?T:"",it),at=H(Xt).replace(/\\/g,"/")===c.replace(/\\/g,"/");if(!at)try{at=A.realpathSync.native(Xt)===A.realpathSync.native(c)}catch{}return at&&typeof k.sourcesContent?.[Wt]=="string"?[k.sourcesContent[Wt]]:[]});pe.length===1&&(b=pe[0])}catch{}let w=b===v&&y.every(k=>f[k]===h[k]),x=w?Math.trunc(f.mtimeMs):0,P=w?B(v):"",R=o(c);r.has(R)||r.set(R,At(v));let O=new Map;if(l.includes("tempo-sdk/canvas")&&typeof u.resolve=="function"){let k=We(c,l).storyboards.flatMap(T=>T.component?.import?.source??[]);await Promise.all([...new Set(k)].map(async T=>{let pe=await u.resolve(T,c,{skipSelf:!0});pe&&O.set(T,pe.id)}))}let j=yr(c,l,O,t.flutterHostRoot?.()),D=Wn(l,c,k=>{let T={...j.get(k.element.openingElement.start),...pn({info:k,filepath:d,modifiedtsMs:x,sourceVersion:P,computeAnnotatedProps:t.computeAnnotatedProps})};return w||(delete T["data-tempo-filepath"],delete T["data-tempo-position"],delete T["data-tempo-source-tag"],delete T["data-tempo-expr"],delete T["data-tempo-modifiedts"],delete T["data-tempo-source-version"]),T});if(D.parseResult.errors.length>0)return null;let _e=D.elementsAnnotated===0?l:D.annotatedSource,Ae=t.transformsControls(c)?n(_e,c):_e;return{code:w?Me(Ae,d,x,P):Ae,map:null}}catch{return null}}a(i,"annotateJsxModule");async function s(u){let{file:l}=u,c=o(l);if(!r.has(c))return!1;let p;try{p=(0,A.readFileSync)(l,"utf8"),p.length===0&&(p=await u.read())}catch{return!1}let d=r.get(c);if(d===void 0)return!1;let m=At(p);return r.set(c,m),br(d,m)}return a(s,"defaultExportIdentityRewritten"),{annotateJsxModule:i,defaultExportIdentityRewritten:s,forgetDefaultExportIdentity(u){r.delete(o(u))}}}var A,ae,wr,Cr=E(()=>{A=require("node:fs"),ae=require("node:path"),wr=require("node:url");Xn();te();ne();tr();Sr();_t();Er();he();a(xr,"createJsxModuleAnnotation")});function qe(){let t=new Map,e=a(n=>{let r=[],o=n,i=!1;for(;;){let s=t.get(o);if(s!==void 0){i=s;break}r.push(o);let u=ti(o);if(u!==void 0){i=u?.name===kr;break}let l=(0,Ce.dirname)(o);if(l===o)break;o=l}for(let s of r)t.set(s,i);return i},"nearestPackageIsSdk");return n=>{if(n.replace(/\\/g,"/").includes(ei))return!0;let r=n;try{r=Ge.realpathSync.native(n)}catch{}return e((0,Ce.dirname)(r))}}function ti(t){let e;try{e=(0,Ge.readFileSync)((0,Ce.join)(t,"package.json"),"utf8")}catch{return}try{let n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}var Ge,Ce,kr,ei,It=E(()=>{Ge=require("node:fs"),Ce=require("node:path"),kr="tempo-sdk",ei=`/node_modules/${kr}/`;a(qe,"createSdkFileMatcher");a(ti,"readPackageManifest")});function ke(t,e,n){let r=e-n;r=r<0?-r<<1|1:r<<1;do{let o=r&31;r>>>=5,r>0&&(o|=32),t.write(_r[o])}while(r>0);return e}function Ar(t){let e=new si,n=0,r=0,o=0,i=0;for(let s=0;s<t.length;s++){let u=t[s];if(s>0&&e.write(ri),u.length===0)continue;let l=0;for(let c=0;c<u.length;c++){let p=u[c];c>0&&e.write(ni),l=ke(e,p[0],l),p.length!==1&&(n=ke(e,p[1],n),r=ke(e,p[2],r),o=ke(e,p[3],o),p.length!==4&&(i=ke(e,p[4],i)))}}return e.flush()}var ni,ri,Pr,_r,oi,Tr,Rr,si,Ir=E(()=>{ni=44,ri=59,Pr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_r=new Uint8Array(64),oi=new Uint8Array(128);for(let t=0;t<Pr.length;t++){let e=Pr.charCodeAt(t);_r[t]=e,oi[e]=t}a(ke,"encodeInteger");Tr=1024*16,Rr=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString()}}:{decode(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}},si=class{static{a(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(Tr)}write(t){let{buffer:e}=this;e[this.pos++]=t,this.pos===Tr&&(this.out+=Rr.decode(e),this.pos=0)}flush(){let{buffer:t,out:e,pos:n}=this;return n>0?e+Rr.decode(t.subarray(0,n)):e}};a(Ar,"encode")});function ii(){return typeof globalThis<"u"&&typeof globalThis.btoa=="function"?t=>globalThis.btoa(unescape(encodeURIComponent(t))):typeof Buffer=="function"?t=>Buffer.from(t,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}function li(t){let e=t.split(`
|
|
50
|
-
`),n=e.filter(i=>/^\t+/.test(i)),r=e.filter(i=>/^ {2,}/.test(i));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return" ";let o=r.reduce((i,s)=>{let u=/^ +/.exec(s)[0].length;return Math.min(u,i)},1/0);return new Array(o+1).join(" ")}function
|
|
51
|
-
`),n=[];for(let r=0,o=0;r<e.length;r++)n.push(o),o+=e[r].length+1;return a(function(o){let i=0,s=n.length;for(;i<s;){let c=i+s>>1;o<n[c]?s=c:i=c+1}let u=i-1,l=o-n[u];return{line:u,column:l}},"locate")}var
|
|
49
|
+
${t}`}var lr=w(()=>{ir();a(ar,"transformControlsForHmr")});function ke(t){let e=`preview ${JSON.stringify(t)}`;if(t.includes("\\"))return{error:`${e} uses a backslash; use "/" (paths in canvases are POSIX).`};let n=t.lastIndexOf("#");if(n<0)return{error:`${e} needs "#<function>" after the file, e.g. "../../lib/cards.dart#productCard".`};let r=t.slice(0,n),o=t.slice(n+1);return!r.startsWith("./")&&!r.startsWith("../")?{error:r.startsWith("lib/")?`${e} is no longer relative to a Flutter app folder; write the path from this canvas file, starting with "./" or "../".`:`${e} must be a path relative to this canvas file and start with "./" or "../", like a relative import.`}:r.endsWith(".dart")?/[?#]/.test(r)||r.includes("//")?{error:`${e} must not contain "?", "#", or empty path segments.`}:/^[A-Za-z$][A-Za-z0-9_$]*$/.test(o)?{file:r,functionName:o}:{error:`${e}: ${JSON.stringify(o)} is not a public Dart function name.`}:{error:`${e} must name a .dart file.`}}var ur,We=w(()=>{"use strict";a(ke,"parseFlutterPreview");ur="data-tempo-flutter-preview-key"});function Te(t){let e=Y.default.resolve(t);try{return Xe.realpathSync.native(e)}catch(n){let r=n.code;if(r!=="ENOENT"&&r!=="ENOTDIR")throw n;let o=!1;try{o=(0,Xe.lstatSync)(e).isSymbolicLink()}catch(s){if(s.code!=="ENOENT"&&s.code!=="ENOTDIR")throw s}if(o)throw n;let i=Y.default.dirname(e);if(i===e)throw n;return Y.default.join(Te(i),Y.default.basename(e))}}function cr(t,e,n){return`${Y.default.relative(Te(t),Te(e)).split(Y.default.sep).join("/")}#${n}`}var Xe,Y,pr=w(()=>{We();Xe=require("node:fs"),Y=tn(require("node:path"),1);a(Te,"canonicalPathAllowMissing");a(cr,"flutterPreviewKey")});var Ls,Pe,Ge,kt=w(()=>{"use strict";Ls={Storyboard:{importSource:"tempo-sdk/canvas",kind:"component",requiresComponentProp:!0,allowsVrt:!0,componentFileExtension:".tsx"},SvelteStoryboard:{importSource:"tempo-sdk/canvas/svelte",kind:"component",uiFramework:"svelte",requiresComponentProp:!0,allowsVrt:!0,componentFileExtension:".svelte"},VueStoryboard:{importSource:"tempo-sdk/canvas/vue",kind:"component",uiFramework:"vue",requiresComponentProp:!0,allowsVrt:!0,componentFileExtension:".vue"},AstroStoryboard:{importSource:"tempo-sdk/canvas/astro",kind:"component",uiFramework:"astro",requiresComponentProp:!0,allowsVrt:!0,componentFileExtension:".astro",componentImportQuery:"?tempo-component"},FlutterStoryboard:{importSource:"tempo-sdk/canvas",kind:"component",requiresComponentProp:!1,allowsVrt:!0},RouteStoryboard:{importSource:"tempo-sdk/canvas",kind:"route",requiresComponentProp:!1,allowsVrt:!1},HtmlStoryboard:{importSource:"tempo-sdk/canvas",kind:"html",requiresComponentProp:!1,allowsVrt:!0},LegacyStoryboardV1:{importSource:"tempo-sdk/canvas",kind:"component",requiresComponentProp:!1,allowsVrt:!1}},Pe=Ls,Ge=Object.keys(Pe)});function Ye(t,e){let n=[],r;try{let y=(0,mr.parseSync)(t,e);r=y.program;for(let E of y.errors??[])n.push({message:E.message??"Unable to parse canvas source",span:v(E)??v(E?.labels?.[0]),kind:"structural"})}catch(y){return{filePath:t,pageName:fr(t),imports:[],misimportedSdkCanvasImports:[],storyboards:[],errors:[{message:y instanceof Error?y.message:"Unable to parse canvas source",kind:"structural"}]}}let o=Hs(r),i=Bs(r),{legacyObjects:s,stringBindings:u}=Js(r,o,e),l=null,c=[];Rt(r,y=>{if(y.type!=="JSXElement")return;let E=At(y.openingElement?.name,o),b=ai(y.openingElement?.name,o,i);if(b&&i.add(b),E==="Canvas"){l?n.push({message:"Canvas file must declare exactly one <Canvas> element",span:v(y),kind:"structural"}):l=y;return}_t(E)&&c.push({element:y,component:E})});let p=l?zs(l,o):[],f=new Set(p.map(y=>y.element)),g=p.map(y=>Gs(y.element,y.component,o,s,e,n));for(let y of c)f.has(y.element)||n.push({message:`<${y.component}> declarations must be direct children of the <Canvas> element`,span:v(y.element),kind:"structural"});if(qs(g,n),l)n.push(...Ys(l,o));else if(i.all.length>0)for(let y of i.all)n.push({message:Us(y),span:y.sourceSpan,kind:"structural"});else n.push({message:$s,kind:"structural"});let m=l?.openingElement,d=Tt(m,"name",u),h=U(m,"path"),S=Tt(m,"backgroundColor",u)??Tt(m,"background",u);return m&&!d&&n.push({message:'<Canvas> must include a literal "name" prop',span:v(m),kind:"degraded"}),{filePath:t,canvasPath:h?.value,pageName:d?.value??fr(t),backgroundColor:S?.value,canvasElementSpan:v(l),canvasOpeningElementSpan:v(m),canvasChildrenInsertionOffset:typeof l?.closingElement?.start=="number"?l.closingElement.start:void 0,nameSpan:d?.valueSpan,nameAttributeSpan:d?.attributeSpan,pathSpan:h?.valueSpan,pathAttributeSpan:h?.attributeSpan,backgroundColorSpan:S?.valueSpan,backgroundColorAttributeSpan:S?.attributeSpan,imports:o.all,misimportedSdkCanvasImports:i.all,storyboards:g,errors:n}}function Us(t){return`Tempo canvas components must be imported from "tempo-sdk/canvas" \u2014 found import of ${t.importedNames.join(", ")} from "${t.source}"`}function Bs(t){let e=[],n=new Map,r=new Map,o=a(i=>{let s=ci(i.sourceSpan);n.has(s)||(n.set(s,i),e.push(i))},"add");for(let i of t?.body??[]){if(i?.type!=="ImportDeclaration"||typeof i.source?.value!="string"||!Er(i.source.value)||i.importKind==="type")continue;let s=i.source.value,u=v(i.source);if(!u)continue;let l=(i.specifiers??[]).filter(g=>g?.importKind!=="type"),c=l.map(ze),p={source:s,sourceSpan:u,importedNames:c,rewritable:l.length>0&&l.every(g=>g?.type==="ImportSpecifier"&&js.has(ze(g)))};l.some(g=>g?.type==="ImportSpecifier"&&qe.has(ze(g)))&&o(p);for(let g of l){if(g?.type!=="ImportNamespaceSpecifier")continue;let m=g.local?.name;typeof m=="string"&&r.set(m,p)}}return{all:e,byDeclarationKey:n,namespaceCandidatesByLocalName:r,add:o}}function Hs(t){let e=[],n=new Map,r=new Map,o=new Set;for(let i of t?.body??[]){if(i?.type!=="ImportDeclaration"||typeof i.source?.value!="string")continue;let s=i.source.value,u=br(s);for(let l of i.specifiers??[]){let c=l.local?.name;if(typeof c!="string")continue;let p=ze(l),f={localName:c,source:s,importedName:p,kind:ui(l),importKind:l.importKind==="type"?"type":"value",span:v(l)??v(i)??{start:0,end:0},declarationSpan:v(i)??{start:0,end:0},specifierCount:i.specifiers?.length??0,namedSpecifierCount:(i.specifiers??[]).filter(g=>g?.type==="ImportSpecifier").length,hasDefaultSpecifier:(i.specifiers??[]).some(g=>g?.type==="ImportDefaultSpecifier"),hasNamespaceSpecifier:(i.specifiers??[]).some(g=>g?.type==="ImportNamespaceSpecifier")};if(e.push(f),n.set(c,f),!!u){if(l.type==="ImportNamespaceSpecifier"){o.add(c);continue}qe.has(p)&&r.set(c,p)}}}return{all:e,byLocalName:n,sdkLocalNames:r,sdkNamespaces:o}}function Js(t,e,n){let r=new Map,o=new Map;for(let i of Ks(t)){if(i.id?.type!=="Identifier")continue;let s=Ze(i.init);if(s?.type!=="ObjectExpression")continue;let u=i.id.name;r.set(u,Ws(u,s,e,n));let l=Xs(s);l.size>0&&o.set(u,l)}return{legacyObjects:r,stringBindings:o}}function Ks(t){let e=[];for(let n of t?.body??[]){let r=n?.type==="VariableDeclaration"?n:n?.type==="ExportNamedDeclaration"&&n.declaration?.type==="VariableDeclaration"?n.declaration:null;r&&e.push(...r.declarations??[])}return e}function Ws(t,e,n,r){let o=[],i=B(e,"name"),s=i?Sr(i.value):null,u=B(e,"layout"),l=u?yr(u.value,"LegacyStoryboardV1"):{value:ae,errors:[{message:'<LegacyStoryboardV1> storyboard object must include a literal "layout" object',span:v(e),kind:"degraded"}]},c=B(e,"render"),p=ri(c?.value,n,r);return i&&!s&&o.push({message:"<LegacyStoryboardV1> storyboard.name must be a string literal when set",span:v(i),kind:"degraded"}),o.push(...l.errors),{bindingName:t,displayName:s?.value,component:p??void 0,objectSpan:v(e),objectClose:Pt(e),nameSpan:s?.span,namePropertySpan:v(i),layoutPropertySpan:v(u),layout:l.value,layoutSpans:l.spans,errors:o}}function Xs(t){let e=new Map;for(let n of t.properties??[]){if(n?.type!=="Property"||n.computed)continue;let r=Qe(n.key),o=Sr(n.value);!r||!o||e.set(r,o)}return e}function Gs(t,e,n,r,o,i){let s=t.openingElement,u=[],l=U(s,"id"),c=U(s,"name"),p=e==="LegacyStoryboardV1"?dr(s,"storyboard",o):void 0,f=p?.expression&&oi(p.expression)?r.get(p.expression):void 0,g=e==="LegacyStoryboardV1"?{value:f?.layout??ae,spans:f?.layoutSpans,attributeSpan:void 0,errors:f?.errors??(p?[{message:"<LegacyStoryboardV1> storyboard prop must reference a same-file object literal",span:p.span,kind:"degraded"}]:[{message:'<LegacyStoryboardV1> must include a "storyboard" expression prop',span:v(s),kind:"degraded"}])}:si(s,e),m=Pe[e];l||u.push({message:`<${e}> must include a literal "id" prop`,span:v(s),kind:"structural"}),g.errors.length>0&&u.push(...g.errors);let d={storyboardKey:l?.value??"",displayName:c?.value??f?.displayName,kind:m.kind,...m.uiFramework?{componentFramework:m.uiFramework}:{},...m.uiFramework==="svelte"?{uiFramework:m.uiFramework}:m.uiFramework==="astro"?{runtimeFramework:m.uiFramework}:{},layout:g.value,editable:!!l&&g.errors.length===0,jsxElementSpan:v(t)??{start:0,end:0},openingElementSpan:v(s),idSpan:l?.valueSpan,idAttributeSpan:l?.attributeSpan,nameSpan:c?.valueSpan??f?.nameSpan,nameAttributeSpan:c?.attributeSpan??f?.namePropertySpan,layoutAttributeSpan:g.attributeSpan,layoutSpans:g.spans,props:dr(s,"props",o),component:f?.component,legacyV1:p?{storyboard:p,objectName:f?.bindingName,objectSpan:f?.objectSpan,objectClose:f?.objectClose,namePropertySpan:f?.namePropertySpan,layoutPropertySpan:f?.layoutPropertySpan}:void 0,errors:u};if(m.requiresComponentProp){let h=ni(s,n,o);h?d.component=h:u.push({message:`<${e}> must include a "component" expression prop`,span:v(s),kind:"degraded"})}if(m.allowsVrt){let h=hr(s,u);h&&(h.value&&(d.vrt=h.value),d.vrtAttributeSpan=h.attributeSpan)}if(e==="RouteStoryboard"){let h=U(s,"route");h?(d.route=h.value,d.routeSpan=h.valueSpan,d.routeAttributeSpan=h.attributeSpan):u.push({message:'<RouteStoryboard> must include a literal "route" prop',span:v(s),kind:"degraded"})}if(e==="HtmlStoryboard"){let h=U(s,"filepath"),S=U(s,"src");d.filepath=h?.value.trim()?h.value:void 0,d.filepathSpan=h?.valueSpan,d.filepathAttributeSpan=h?.attributeSpan,d.src=S?.value,d.srcSpan=S?.valueSpan,d.srcAttributeSpan=S?.attributeSpan,!h?.value.trim()&&!S?.value.trim()&&u.push({message:'<HtmlStoryboard> must include a literal "filepath" or "src" prop',span:v(s),kind:"degraded"})}if(e==="FlutterStoryboard"){let h=U(s,"preview");if(h?.value.trim()){d.preview=h.value,d.previewSpan=h.valueSpan,d.previewAttributeSpan=h.attributeSpan;let S=ke(h.value);"error"in S&&u.push({message:`flutter_preview_invalid: ${S.error}`,span:h.valueSpan,kind:"structural"})}else u.push({message:'<FlutterStoryboard> must include a literal "preview" prop naming a Flutter @Preview function, e.g. preview="../../lib/cards.dart#productCard"',span:v(Z(s,"preview")??s),kind:"structural"})}return i.push(...u),d}function zs(t,e){let n=[];for(let r of t.children??[]){if(r?.type!=="JSXElement")continue;let o=At(r.openingElement?.name,e);_t(o)&&n.push({element:r,component:o})}return n}function qs(t,e){let n=new Map;for(let r of t){if(!r.storyboardKey)continue;let o=n.get(r.storyboardKey);o?o.push(r):n.set(r.storyboardKey,[r])}for(let[r,o]of n)o.length<2||e.push({message:`Duplicate storyboard id "${r}" (${o.length} declarations) \u2014 storyboard ids must be unique`,span:o[1]?.jsxElementSpan,kind:"structural"})}function Ys(t,e){let n=[];for(let r of t.children??[])if(r&&!(r.type==="JSXText"&&typeof r.value=="string"&&r.value.trim()==="")){if(r.type==="JSXExpressionContainer"){if(r.expression?.type==="JSXEmptyExpression")continue;n.push({message:"<Canvas> children must be static storyboard declarations, not expressions",span:v(r),kind:"structural"});continue}if(r.type==="JSXElement"){let o=At(r.openingElement?.name,e);if(_t(o))continue;let i=Qs(r.openingElement?.name,e);if(i){n.push(ei(r,i));continue}}n.push({message:Ds,span:v(r),kind:"structural"})}return n}function Qs(t,e){let n,r;if(t?.type==="JSXIdentifier"){let s=e.byLocalName.get(t.name);if(s?.kind!=="named")return null;n=s.importedName,r=s.source}else if(t?.type==="JSXMemberExpression"&&t.object?.type==="JSXIdentifier"&&t.property?.type==="JSXIdentifier"){let s=e.byLocalName.get(t.object.name);if(s?.kind!=="namespace")return null;n=t.property.name,r=s.source}else return null;let o=Zs.test(r),i=n.endsWith("Storyboard");return o&&i?n:null}function ei(t,e){let n=t.openingElement,r=U(n,"id")?.value,o=hr(n,[])?.value!=null,i=r?` id="${r}"`:"";return{message:`<${e}${i}> is a storyboard from a newer tempo-sdk than this reader supports`,span:v(t),kind:"structural",newerSdkStoryboard:{component:e,...r?{storyboardKey:r}:{},vrt:o}}}function hr(t,e){let n=Z(t,"vrt");if(!n)return null;let r=v(n);if(n.value==null)return{value:{},attributeSpan:r};let o=Ze(le(n.value));if(o?.type==="Literal"&&o.value===!0)return{value:{},attributeSpan:r};if(o?.type==="Literal"&&o.value===!1)return{value:null,attributeSpan:r};if(o?.type!=="ObjectExpression")return e.push({message:"<Storyboard> vrt must be a boolean literal or an object literal ({ threshold?, skip?, ignore? })",span:v(o)??r,kind:"degraded"}),{value:null,attributeSpan:r};let i={};for(let s of o.properties??[]){if(s?.type!=="Property"||s.computed){e.push({message:"<Storyboard> vrt must contain only literal properties",span:v(s??o),kind:"degraded"});continue}let u=Qe(s.key);if(u==="threshold"){let l=ie(s.value);l&&l.value>=0&&l.value<=.5?i.threshold=l.value:e.push({message:"<Storyboard> vrt.threshold must be a number literal between 0 and 0.5",span:v(s),kind:"degraded"});continue}if(u==="skip"){s.value?.type==="Literal"&&typeof s.value.value=="boolean"?s.value.value&&(i.skip=!0):e.push({message:"<Storyboard> vrt.skip must be a boolean literal",span:v(s),kind:"degraded"});continue}if(u==="ignore"){let l=ti(s.value,e);l&&(i.ignore=l);continue}e.push({message:`<Storyboard> vrt has unknown property "${u??"?"}" \u2014 expected threshold, skip, or ignore`,span:v(s),kind:"degraded"})}return{value:i,attributeSpan:r}}function ti(t,e){if(t?.type!=="ArrayExpression")return e.push({message:"<Storyboard> vrt.ignore must be an array of { x, y, w, h } literals",span:v(t),kind:"degraded"}),null;let n=[];for(let r of t.elements??[]){let o={};for(let i of["x","y","w","h"]){let s=B(r,i),u=s?ie(s.value):null;u&&(o[i]=u.value)}if(o.x===void 0||o.y===void 0||o.w===void 0||o.h===void 0)return e.push({message:"<Storyboard> vrt.ignore regions must be { x, y, w, h } number literals",span:v(r)??v(t),kind:"degraded"}),null;n.push(o)}return n}function ni(t,e,n){let r=Z(t,"component"),o=le(r?.value),i=v(o);if(!o||!i)return null;let s=o.type==="Identifier"?o.name:o.type==="MemberExpression"&&o.object?.type==="Identifier"?o.object.name:void 0;return{expression:n.slice(i.start,i.end),span:i,attributeSpan:v(r),localName:s,import:s?e.byLocalName.get(s):void 0}}function ri(t,e,n){if(t?.type!=="ArrowFunctionExpression")return null;let r=Ze(t.body);if(r?.type!=="JSXElement")return null;let o=r.openingElement?.name;if(o?.type!=="JSXIdentifier")return null;let i=v(o);return!i||typeof o.name!="string"?null:{expression:n.slice(i.start,i.end),span:i,localName:o.name,import:e.byLocalName.get(o.name)}}function dr(t,e,n){let r=Z(t,e),o=le(r?.value),i=v(o);if(!(!o||!i))return{expression:n.slice(i.start,i.end),span:i,attributeSpan:v(r)}}function oi(t){return/^[A-Za-z_$][\w$]*$/.test(t)}function si(t,e){let n=vr(e),r=Z(t,"layout"),o=le(r?.value);return o?{...yr(o,e),attributeSpan:v(r)}:{value:n?gr:ae,attributeSpan:v(r),errors:[{message:`<${e}> must include a literal "layout" object prop`,span:v(t),kind:"degraded"}]}}function yr(t,e){let n=[],r=vr(e);if(t.type!=="ObjectExpression")return{value:r?gr:ae,spans:{layoutClose:Pt(t)},errors:[{message:`<${e}> layout must be an object literal`,span:v(t),kind:"degraded"}]};let o={layoutClose:Pt(t)},i={...ae},s=B(t,"width"),u=B(t,"height"),l=B(t,"intrinsicSizing"),c=l?.value?.value==="root-element",f=r||!!(s&&u)&&!c;!r&&!!s!=!!u&&n.push({message:"layout.width and layout.height must be set together",span:v(t),kind:"degraded"});let m=f?{width:s?ie(s.value):null,height:u?ie(u.value):null}:null,d=f?["x","y","width","height"]:["x","y"];for(let y of d){let E=y==="width"?s:y==="height"?u:B(t,y),b=y==="width"||y==="height"?m?.[y]:E?ie(E.value):null,x=y==="x"||y==="y"||r||!!(m?.width&&m.height);if(!b){n.push({message:`<${e}> layout.${y} must be a number literal`,span:v(E??t),kind:"degraded"});continue}x&&(i[y]=b.value,o[y]=b.span)}let h=B(t,"zIndex");if(h){let y=ie(h.value);y?(i.zIndex=y.value,o.zIndex=y.span):n.push({message:`<${e}> layout.zIndex must be a number literal`,span:v(h),kind:"degraded"})}return l&&(l.value?.type!=="Literal"||!c)&&n.push({message:`<${e}> layout.intrinsicSizing must be "root-element" when set`,span:v(l),kind:"degraded"}),{value:i,spans:o,errors:n}}function Sr(t){return t?.type==="Literal"&&typeof t.value=="string"?{value:t.value,span:v(t)??{start:0,end:0}}:null}function Ze(t){let e=t;for(;e?.type==="TSSatisfiesExpression"||e?.type==="TSAsExpression"||e?.type==="TSNonNullExpression"||e?.type==="ParenthesizedExpression";)e=e.expression;return e}function Tt(t,e,n){let r=U(t,e);if(r)return r;let o=Z(t,e),i=le(o?.value),s=v(i),u=v(o);if(!i||!s||!u)return null;let l=ii(i,n);return l?{value:l.value,valueSpan:s,attributeSpan:u}:null}function ii(t,e){if(t?.type!=="MemberExpression"||t.object?.type!=="Identifier")return null;let n=Qe(t.property);return n?e.get(t.object.name)?.get(n)??null:null}function U(t,e){let n=Z(t,e);if(!n)return null;let r=n.value;if(r?.type==="Literal"&&typeof r.value=="string")return{value:r.value,valueSpan:v(r)??v(n)??{start:0,end:0},attributeSpan:v(n)??{start:0,end:0}};let o=Ze(le(r)),i=o?.type==="Literal"&&typeof o.value=="string"?o.value:o?.type==="TemplateLiteral"&&(o.expressions?.length??0)===0&&o.quasis?.length===1&&typeof o.quasis[0]?.value?.cooked=="string"?o.quasis[0].value.cooked:null;return i!==null?{value:i,valueSpan:v(o)??v(n)??{start:0,end:0},attributeSpan:v(n)??{start:0,end:0}}:null}function Z(t,e){for(let n of t?.attributes??[])if(n?.type==="JSXAttribute"&&n.name?.type==="JSXIdentifier"&&n.name.name===e)return n;return null}function le(t){return t?t.type==="JSXExpressionContainer"?t.expression:t:null}function Qe(t){return t?.type==="Identifier"?t.name:t?.type==="Literal"&&typeof t.value=="string"?t.value:null}function B(t,e){if(t?.type!=="ObjectExpression")return null;for(let n of t.properties??[]){if(n?.type!=="Property"||n.computed)continue;if(Qe(n.key)===e)return n}return null}function ie(t){return t?.type==="Literal"&&typeof t.value=="number"&&Number.isFinite(t.value)?{value:t.value,span:v(t)??{start:0,end:0}}:t?.type==="UnaryExpression"&&t.operator==="-"&&t.argument?.type==="Literal"&&typeof t.argument.value=="number"&&Number.isFinite(t.argument.value)?{value:-t.argument.value,span:v(t)??{start:0,end:0}}:null}function At(t,e){return t?.type==="JSXIdentifier"?e.sdkLocalNames.get(t.name)??null:t?.type==="JSXMemberExpression"&&t.object?.type==="JSXIdentifier"&&t.property?.type==="JSXIdentifier"&&e.sdkNamespaces.has(t.object.name)&&qe.has(t.property.name)?t.property.name:null}function ai(t,e,n){if(t?.type!=="JSXMemberExpression"||t.object?.type!=="JSXIdentifier"||t.property?.type!=="JSXIdentifier"||!qe.has(t.property.name))return null;let r=e.byLocalName.get(t.object.name);return r?.kind!=="namespace"||!Er(r.source)?null:n.namespaceCandidatesByLocalName.get(t.object.name)??null}function _t(t){return t!==null&&t!=="Canvas"}function li(t){return t.length<=1?t.join(""):`${t.slice(0,-1).join(", ")}, or ${t[t.length-1]}`}function vr(t){return t==="RouteStoryboard"||t==="HtmlStoryboard"||t==="FlutterStoryboard"}function ze(t){return t.type==="ImportDefaultSpecifier"?"default":t.type==="ImportNamespaceSpecifier"?"*":t.imported?.name??t.local?.name??"unknown"}function ui(t){return t.type==="ImportDefaultSpecifier"?"default":t.type==="ImportNamespaceSpecifier"?"namespace":"named"}function br(t){for(let e of Fs)if(t===e||t.endsWith(`/${e}`))return!0;return!1}function Er(t){return(t==="tempo-sdk"||t.startsWith("tempo-sdk/"))&&!br(t)}function ci(t){return`${t.start}:${t.end}`}function Pt(t){return typeof t?.end=="number"&&Number.isFinite(t.end)?t.end-1:void 0}function fr(t){let n=t.replace(/\\/g,"/").split("/").filter(Boolean),r=n.length>0?n[n.length-1]:t,o=n.length>1?n[n.length-2]:r;return(/^index\.canvas\.[tj]sx?$/.test(r)?o:r.replace(/\.canvas\.[tj]sx?$/,"")).split(/[-_\s]+/).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function v(t){return typeof t?.start=="number"&&Number.isFinite(t.start)&&typeof t?.end=="number"&&Number.isFinite(t.end)?{start:t.start,end:t.end}:void 0}function Rt(t,e,n=new Set){if(!(!t||typeof t!="object"||n.has(t))){n.add(t),e(t);for(let r of Object.values(t))if(r)if(Array.isArray(r))for(let o of r)Rt(o,e,n);else typeof r=="object"&&Rt(r,e,n)}}var mr,Fs,qe,Ds,js,ae,gr,$s,Zs,Nt=w(()=>{We();mr=require("oxc-parser");kt();kt();Fs=new Set(["tempo-sdk/canvas",...Ge.map(t=>Pe[t].importSource)]),qe=new Set(["Canvas",...Ge]),Ds=`<Canvas> children must be ${li(Ge.map(t=>`<${t}>`))} declarations`,js=new Set(["Canvas","CanvasContext","getCanvasStoryboardRenderId","CanvasHost","buildRenderContentFiberSelector","buildRenderContentSelector","buildRenderSelector","captureStoryboardCombined","captureStoryboardHtml","captureStoryboardImage","stripRenderContentWrapperAttributes","stripRenderContentWrapperFromCombinedCapture","watchStoryboardCombined","getCanvasHostRuntime","getOptionalCanvasHostRuntime","useActiveState","FlutterStoryboard","HtmlStoryboard","LegacyStoryboardV1","RouteStoryboard","Storyboard","StoryboardSlot"]),ae={x:0,y:0},gr={...ae,width:600,height:400},$s="No <Canvas> declaration found in canvas file";a(Ye,"parseCanvasFile");a(Us,"misimportedSdkCanvasImportMessage");a(Bs,"readMisimportedSdkCanvasImports");a(Hs,"readImports");a(Js,"readObjectExpressionBindings");a(Ks,"readTopLevelVariableDeclarators");a(Ws,"readLegacyStoryboardObject");a(Xs,"readObjectStringProperties");a(Gs,"readStoryboard");a(zs,"readDirectCanvasStoryboardElements");a(qs,"reportDuplicateStoryboardIds");a(Ys,"validateCanvasChildren");Zs=/(^|\/)tempo-sdk\/canvas(\/[^/]+)?$/;a(Qs,"resolveNewerSdkStoryboardComponent");a(ei,"newerSdkStoryboardError");a(hr,"readVrt");a(ti,"readVrtIgnoreRegions");a(ni,"readComponentReference");a(ri,"readRenderComponentReference");a(dr,"readExpressionReference");a(oi,"isIdentifierExpression");a(si,"readLayout");a(yr,"readLayoutExpression");a(Sr,"readStringLiteralValue");a(Ze,"unwrapTsExpression");a(Tt,"readResolvableStringAttribute");a(ii,"resolveStringMemberExpression");a(U,"readStringAttribute");a(Z,"getAttribute");a(le,"unwrapAttributeExpression");a(Qe,"readPropertyKeyName");a(B,"getObjectProperty");a(ie,"readNumberLiteral");a(At,"resolveSdkComponent");a(ai,"resolveMisimportedNamespaceSdkComponent");a(_t,"isStoryboardSdkComponent");a(li,"formatAlternatives");a(vr,"requiresFixedLayoutSize");a(ze,"readImportedName");a(ui,"readImportKind");a(br,"isSdkImportSource");a(Er,"isWrongTempoSdkCanvasImportSource");a(ci,"spanKey");a(Pt,"readLayoutClose");a(fr,"fallbackPageName");a(v,"toSpan");a(Rt,"walk")});function pi(t,e,n){let r=n?.get(e),o=r?.startsWith("\0tempo:astro-component:")?decodeURIComponent(r.slice(23,-3)):r,i=o===void 0?e:o.replace(/\bt=\d{13}&?\b/,"").replace(/[?&]$/,"");if(i.startsWith("\0"))return i;let s=i.search(/[?#]/),u=(s<0?i:i.slice(0,s)).replace(/\\/g,"/"),l=s<0||i.endsWith(".astro?tempo-component")?"":i.slice(s);if(o===void 0&&u.startsWith(".")&&(u=(0,V.resolve)((0,V.dirname)(t),u)),!(0,V.isAbsolute)(u)&&!/^[A-Za-z]:\//.test(u))return i;if(o!==void 0)try{u=xr.realpathSync.native(u)}catch{}return(0,V.normalize)(u).replace(/\\/g,"/")+l}function Cr(t,e,n,r){let o=new Map;if(!e.includes("tempo-sdk/canvas"))return o;let i=Ye(t,e);for(let s of i.storyboards){if(s.kind!=="component"||s.openingElementSpan===void 0)continue;let u=s.preview?ke(s.preview):null;if(u&&!("error"in u)&&r){let d;try{let h=(0,V.resolve)((0,V.dirname)(Te(t)),u.file);d=cr(r,h,u.functionName)}catch{continue}o.set(s.openingElementSpan.start,{[ur]:d,[wr]:JSON.stringify(["flutter",d.slice(0,d.lastIndexOf("#")),u.functionName]),"data-tempo-external-component":"true"});continue}let l=s.component;if(!l?.localName)continue;let c=l.expression.match(/^\s*([$\w]+)(?:\s*\.\s*([$\w]+))?\s*$/);if(!c)continue;let p;if(l.import)if(l.import.kind==="namespace"){if(!c[2])continue;p=c[2]}else{if(c[2])continue;p=l.import.importedName}else{if(c[2])continue;p=l.localName}let f=l.import?.source.replace(/\\/g,"/").replace(/[?#].*/,""),g=V.posix.dirname(t.replace(/\\/g,"/")),m=f!==void 0&&(!f.startsWith(".")||!V.posix.join(g,f).startsWith(`${g}/`));o.set(s.openingElementSpan.start,{[wr]:JSON.stringify([l.import?"import":"local",pi(t,l.import?.source??t,n),p]),...m?{"data-tempo-external-component":"true"}:{}})}return o}var xr,V,wr,kr=w(()=>{xr=require("node:fs"),V=require("node:path");We();pr();Nt();wr="data-tempo-component-reference";a(pi,"moduleIdentity");a(Cr,"canvasComponentAnnotations")});function It(t){let e=/\bexport\s+default\s+/.exec(t);if(!e)return null;let n=t.slice(e.index+e[0].length),r=di.exec(n);if(r)return{kind:"function",name:r[1]??null};let o=fi.exec(n);if(o)return{kind:"class",name:o[1]??null};if(mi.test(n))return{kind:"function",name:null};let i=gi.exec(n);return i?{kind:"identifier",name:i[1]}:null}function Pr(t,e){return t?t.name===null?!0:!e||t.name===e.name?!1:Tr(t)&&Tr(e):!1}function Tr(t){return t.name===null||/^[A-Z]/.test(t.name)}var di,fi,mi,gi,Rr=w(()=>{di=/^(?:async\s+)?function(?:\s*\*)?(?:\s+([A-Za-z_$][\w$]*))?\s*\(/,fi=/^(?:abstract\s+)?class(?:\s+([A-Za-z_$][\w$]*))?(?=[\s{])/,mi=/^(?:async\s+)?(?:\([^()]*\)|[A-Za-z_$][\w$]*)\s*=>/,gi=/^([A-Za-z_$][\w$]*)[ \t]*(?:;|\r?\n|$)/;a(It,"readDefaultExportIdentity");a(Pr,"isDefaultExportIdentityRewrite");a(Tr,"isComponentShaped")});function _r(t){let e=new Set;function n(u,l){let c=ar(u,l,e.has(l));return c!==u&&e.add(l),c}a(n,"transformControls");let r=new Map,o=a(u=>{let l=j(u);try{return N.realpathSync.native(l)}catch{return l.replace(/\\/g,"/")}},"canonicalIdentityKey");async function i(u,l,c){let p=t.transformsControls(c)?n(l,c):l,f=t.stampedFilepath(c);if(f===null)return p!==l?{code:p,map:null}:null;try{let g=(0,N.openSync)(c,"r"),m;try{let T=(0,N.fstatSync)(g),R=(0,N.readFileSync)(g,"utf8");m={before:T,rawSource:R,after:(0,N.fstatSync)(g)}}finally{(0,N.closeSync)(g)}let{before:d,after:h,rawSource:S}=m,y=["mtimeMs","ctimeMs","size","ino","dev"],E=l===S?l:void 0;if(E===void 0&&typeof u.getCombinedSourcemap=="function")try{let T=u.getCombinedSourcemap(),R=T.sourceRoot,ge=T.sources.flatMap((at,Yt)=>{let lt=at.startsWith("file:")?(0,Ar.fileURLToPath)(at):at,Zt=(0,ue.isAbsolute)(lt)?lt:(0,ue.resolve)((0,ue.dirname)(c),typeof R=="string"?R:"",lt),ut=W(Zt).replace(/\\/g,"/")===c.replace(/\\/g,"/");if(!ut)try{ut=N.realpathSync.native(Zt)===N.realpathSync.native(c)}catch{}return ut&&typeof T.sourcesContent?.[Yt]=="string"?[T.sourcesContent[Yt]]:[]});ge.length===1&&(E=ge[0])}catch{}let b=E===S&&y.every(T=>d[T]===h[T]),x=b?Math.trunc(d.mtimeMs):0,k=b?K(S):"",P=o(c);r.has(P)||r.set(P,It(S));let A=new Map;if(l.includes("tempo-sdk/canvas")&&typeof u.resolve=="function"){let T=Ye(c,l).storyboards.flatMap(R=>R.component?.import?.source??[]);await Promise.all([...new Set(T)].map(async R=>{let ge=await u.resolve(R,c,{skipSelf:!0});ge&&A.set(R,ge.id)}))}let F=Cr(c,l,A,t.flutterHostRoot?.()),O=Qn(l,c,T=>{let R={...F.get(T.element.openingElement.start),...hn({info:T,filepath:f,modifiedtsMs:x,sourceVersion:k,computeAnnotatedProps:t.computeAnnotatedProps})};return b||(delete R["data-tempo-filepath"],delete R["data-tempo-position"],delete R["data-tempo-source-tag"],delete R["data-tempo-expr"],delete R["data-tempo-modifiedts"],delete R["data-tempo-source-version"]),R});if(O.parseResult.errors.length>0)return null;let H=O.elementsAnnotated===0?l:O.annotatedSource,M=t.transformsControls(c)?n(H,c):H;return{code:b?je(M,f,x,k):M,map:null}}catch{return null}}a(i,"annotateJsxModule");async function s(u){let{file:l}=u,c=o(l);if(!r.has(c))return!1;let p;try{p=(0,N.readFileSync)(l,"utf8"),p.length===0&&(p=await u.read())}catch{return!1}let f=r.get(c);if(f===void 0)return!1;let g=It(p);return r.set(c,g),Pr(f,g)}return a(s,"defaultExportIdentityRewritten"),{annotateJsxModule:i,defaultExportIdentityRewritten:s,forgetDefaultExportIdentity(u){r.delete(o(u))}}}var N,ue,Ar,Nr=w(()=>{N=require("node:fs"),ue=require("node:path"),Ar=require("node:url");er();re();oe();lr();kr();Nt();Rr();be();a(_r,"createJsxModuleAnnotation")});function tt(){let t=new Map,e=a(n=>{let r=[],o=n,i=!1;for(;;){let s=t.get(o);if(s!==void 0){i=s;break}r.push(o);let u=yi(o);if(u!==void 0){i=u?.name===Ir;break}let l=(0,Re.dirname)(o);if(l===o)break;o=l}for(let s of r)t.set(s,i);return i},"nearestPackageIsSdk");return n=>{if(n.replace(/\\/g,"/").includes(hi))return!0;let r=n;try{r=et.realpathSync.native(n)}catch{}return e((0,Re.dirname)(r))}}function yi(t){let e;try{e=(0,et.readFileSync)((0,Re.join)(t,"package.json"),"utf8")}catch{return}try{let n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}var et,Re,Ir,hi,Ot=w(()=>{et=require("node:fs"),Re=require("node:path"),Ir="tempo-sdk",hi=`/node_modules/${Ir}/`;a(tt,"createSdkFileMatcher");a(yi,"readPackageManifest")});function Ae(t,e,n){let r=e-n;r=r<0?-r<<1|1:r<<1;do{let o=r&31;r>>>=5,r>0&&(o|=32),t.write(Lr[o])}while(r>0);return e}function Fr(t){let e=new Ei,n=0,r=0,o=0,i=0;for(let s=0;s<t.length;s++){let u=t[s];if(s>0&&e.write(vi),u.length===0)continue;let l=0;for(let c=0;c<u.length;c++){let p=u[c];c>0&&e.write(Si),l=Ae(e,p[0],l),p.length!==1&&(n=Ae(e,p[1],n),r=Ae(e,p[2],r),o=Ae(e,p[3],o),p.length!==4&&(i=Ae(e,p[4],i)))}}return e.flush()}var Si,vi,Or,Lr,bi,Mr,Vr,Ei,Dr=w(()=>{Si=44,vi=59,Or="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lr=new Uint8Array(64),bi=new Uint8Array(128);for(let t=0;t<Or.length;t++){let e=Or.charCodeAt(t);Lr[t]=e,bi[e]=t}a(Ae,"encodeInteger");Mr=1024*16,Vr=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString()}}:{decode(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}},Ei=class{static{a(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(Mr)}write(t){let{buffer:e}=this;e[this.pos++]=t,this.pos===Mr&&(this.out+=Vr.decode(e),this.pos=0)}flush(){let{buffer:t,out:e,pos:n}=this;return n>0?e+Vr.decode(t.subarray(0,n)):e}};a(Fr,"encode")});function wi(){return typeof globalThis<"u"&&typeof globalThis.btoa=="function"?t=>globalThis.btoa(unescape(encodeURIComponent(t))):typeof Buffer=="function"?t=>Buffer.from(t,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}function Ci(t){let e=t.split(`
|
|
50
|
+
`),n=e.filter(i=>/^\t+/.test(i)),r=e.filter(i=>/^ {2,}/.test(i));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return" ";let o=r.reduce((i,s)=>{let u=/^ +/.exec(s)[0].length;return Math.min(u,i)},1/0);return new Array(o+1).join(" ")}function ki(t,e){let n=t.split(/[/\\]/),r=e.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let o=n.length;for(;o--;)n[o]=".."}return n.concat(r).join("/")}function Pi(t){return Ti.call(t)==="[object Object]"}function jr(t){let e=t.split(`
|
|
51
|
+
`),n=[];for(let r=0,o=0;r<e.length;r++)n.push(o),o+=e[r].length+1;return a(function(o){let i=0,s=n.length;for(;i<s;){let c=i+s>>1;o<n[c]?s=c:i=c+1}let u=i-1,l=o-n[u];return{line:u,column:l}},"locate")}var nt,rt,xi,Mt,Ti,Ri,Vt,_e,ce,ot,$r=w(()=>{Dr();nt=class t{static{a(this,"BitSet")}constructor(e){this.bits=e instanceof t?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}},rt=class t{static{a(this,"Chunk")}constructor(e,n,r){this.start=e,this.end=n,this.original=r,this.intro="",this.outro="",this.content=r,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){let e=new t(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e}contains(e){return this.start<e&&e<this.end}eachNext(e){let n=this;for(;n;)e(n),n=n.next}eachPrevious(e){let n=this;for(;n;)e(n),n=n.previous}edit(e,n,r){return this.content=e,r||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(e){let n=e-this.start,r=this.original.slice(0,n),o=this.original.slice(n);this.original=r;let i=new t(e,this.end,o);return i.outro=this.outro,this.outro="",this.end=e,this.edited?(i.edit("",!1),this.content=""):this.content=r,i.next=this.next,i.next&&(i.next.previous=i),i.previous=this,this.next=i,i}toString(){return this.intro+this.content+this.outro}trimEnd(e){if(this.outro=this.outro.replace(e,""),this.outro.length)return!0;let n=this.content.replace(e,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(e,""),this.intro.length)return!0}trimStart(e){if(this.intro=this.intro.replace(e,""),this.intro.length)return!0;let n=this.content.replace(e,"");if(n.length){if(n!==this.content){let r=this.split(this.end-n.length);this.edited&&r.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(e,""),this.outro.length)return!0}};a(wi,"getBtoa");xi=wi(),Mt=class{static{a(this,"SourceMap")}constructor(e){this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=Fr(e.mappings),typeof e.x_google_ignoreList<"u"&&(this.x_google_ignoreList=e.x_google_ignoreList),typeof e.debugId<"u"&&(this.debugId=e.debugId)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+xi(this.toString())}};a(Ci,"guessIndent");a(ki,"getRelativePath");Ti=Object.prototype.toString;a(Pi,"isObject");a(jr,"getLocator");Ri=/\w/,Vt=class{static{a(this,"Mappings")}constructor(e){this.hires=e,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(e,n,r,o){if(n.length){let i=n.length-1,s=n.indexOf(`
|
|
52
52
|
`,0),u=-1;for(;s>=0&&i>s;){let c=[this.generatedCodeColumn,e,r.line,r.column];o>=0&&c.push(o),this.rawSegments.push(c),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,u=s,s=n.indexOf(`
|
|
53
53
|
`,s+1)}let l=[this.generatedCodeColumn,e,r.line,r.column];o>=0&&l.push(o),this.rawSegments.push(l),this.advance(n.slice(u+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(n));this.pending=null}addUneditedChunk(e,n,r,o,i){let s=n.start,u=!0,l=!1;for(;s<n.end;){if(r[s]===`
|
|
54
|
-
`)o.line+=1,o.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,u=!0,l=!1;else{if(this.hires||u||i.has(s)){let c=[this.generatedCodeColumn,e,o.line,o.column];this.hires==="boundary"?
|
|
55
|
-
`);if(n.length>1){for(let r=0;r<n.length-1;r++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=n[n.length-1].length}},
|
|
56
|
-
`,
|
|
54
|
+
`)o.line+=1,o.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,u=!0,l=!1;else{if(this.hires||u||i.has(s)){let c=[this.generatedCodeColumn,e,o.line,o.column];this.hires==="boundary"?Ri.test(r[s])?l||(this.rawSegments.push(c),l=!0):(this.rawSegments.push(c),l=!1):this.rawSegments.push(c)}o.column+=1,this.generatedCodeColumn+=1,u=!1}s+=1}this.pending=null}advance(e){if(!e)return;let n=e.split(`
|
|
55
|
+
`);if(n.length>1){for(let r=0;r<n.length-1;r++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=n[n.length-1].length}},_e=`
|
|
56
|
+
`,ce={insertLeft:!1,insertRight:!1,storeName:!1},ot=class t{static{a(this,"MagicString")}constructor(e,n={}){let r=new rt(0,e.length,e);Object.defineProperties(this,{original:{writable:!0,value:e},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:r},lastChunk:{writable:!0,value:r},lastSearchedChunk:{writable:!0,value:r},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:n.filename},indentExclusionRanges:{writable:!0,value:n.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new nt},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:n.ignoreList},offset:{writable:!0,value:n.offset||0}}),this.byStart[0]=r,this.byEnd[e.length]=r}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!="string")throw new TypeError("outro content must be a string");return this.outro+=e,this}appendLeft(e,n){if(e=e+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);let r=this.byEnd[e];return r?r.appendLeft(n):this.intro+=n,this}appendRight(e,n){if(e=e+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);let r=this.byStart[e];return r?r.appendRight(n):this.outro+=n,this}clone(){let e=new t(this.original,{filename:this.filename,offset:this.offset}),n=this.firstChunk,r=e.firstChunk=e.lastSearchedChunk=n.clone();for(;n;){e.byStart[r.start]=r,e.byEnd[r.end]=r;let o=n.next,i=o&&o.clone();i&&(r.next=i,i.previous=r,r=i),n=o}return e.lastChunk=r,this.indentExclusionRanges&&(e.indentExclusionRanges=this.indentExclusionRanges.slice()),e.sourcemapLocations=new nt(this.sourcemapLocations),e.intro=this.intro,e.outro=this.outro,e}generateDecodedMap(e){e=e||{};let n=0,r=Object.keys(this.storedNames),o=new Vt(e.hires),i=jr(this.original);return this.intro&&o.advance(this.intro),this.firstChunk.eachNext(s=>{let u=i(s.start);s.intro.length&&o.advance(s.intro),s.edited?o.addEdit(n,s.content,u,s.storeName?r.indexOf(s.original):-1):o.addUneditedChunk(n,s,this.original,u,this.sourcemapLocations),s.outro.length&&o.advance(s.outro)}),this.outro&&o.advance(this.outro),{file:e.file?e.file.split(/[/\\]/).pop():void 0,sources:[e.source?ki(e.file||"",e.source):e.file||""],sourcesContent:e.includeContent?[this.original]:void 0,names:r,mappings:o.raw,x_google_ignoreList:this.ignoreList?[n]:void 0}}generateMap(e){return new Mt(this.generateDecodedMap(e))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=Ci(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(e,n){let r=/^[^\r\n]/gm;if(Pi(e)&&(n=e,e=void 0),e===void 0&&(this._ensureindentStr(),e=this.indentStr||" "),e==="")return this;n=n||{};let o={};n.exclude&&(typeof n.exclude[0]=="number"?[n.exclude]:n.exclude).forEach(p=>{for(let f=p[0];f<p[1];f+=1)o[f]=!0});let i=n.indentStart!==!1,s=a(c=>i?`${e}${c}`:(i=!0,c),"replacer");this.intro=this.intro.replace(r,s);let u=0,l=this.firstChunk;for(;l;){let c=l.end;if(l.edited)o[u]||(l.content=l.content.replace(r,s),l.content.length&&(i=l.content[l.content.length-1]===`
|
|
57
57
|
`));else for(u=l.start;u<c;){if(!o[u]){let p=this.original[u];p===`
|
|
58
|
-
`?i=!0:p!=="\r"&&i&&(i=!1,u===l.start||(this._splitChunk(l,u),l=l.next),l.prependRight(e))}u+=1}u=l.end,l=l.next}return this.outro=this.outro.replace(r,s),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,n){return
|
|
59
|
-
`)};let o=n.template;if(o?.src)return{kind:"unsupported",code:"unsupported_template",message:`<template src="${o.src}"> is outside this file, so its offsets cannot describe it`};if(o?.lang&&o.lang!=="html")return{kind:"unsupported",code:"unsupported_template",message:`<template lang="${o.lang}"> offsets would describe the generated HTML, not this file`};if(o&&!o.ast)return{kind:"unsupported",code:"unsupported_template",message:"the template has no parsed AST"};let i=new Map,s=!1,u=a((c,p,d)=>{let m=!0;for(let g of c){if(g.type===gi&&(m=!1),g.type!==Lt)continue;let f=g.props.map(_i);f.some(k=>k.kind==="bind"&&/\$attrs\b/.test(k.expression??""))&&(s=!0);let h=g.loc.start.offset,v=g.loc.end.offset,y=f.length>0?Math.max(...f.map(k=>k.end)):h+1+g.tag.length,b=t.indexOf(">",y)+1,w=g.isSelfClosing===!0,x=!w&&v>b,P=Jr(g),R=Pi(t,h+1+g.tag.length,f,b),O=p!==null&&(p.vPre||p.inVPre),j=P==="dynamic-element"||Ti(g)||g.tag==="template"||R||Y(g,ki),D={kind:P,tagName:g.tag,namespace:g.ns===yi?"svg":g.ns===Si?"mathml":"html",start:h,end:v,propsEnd:y,props:f,dynamicSlot:Mi(g)||Dr(d),expressionSlot:Y(g,Br)||Dr(d),parentStart:p?.start??null,openingEnd:b,selfClosing:w,childrenStart:x?b:null,childrenEnd:x?h+g.loc.source.lastIndexOf("</"):null,vPre:R,inVPre:O,opensScope:j,scopeOwner:p===null?-1:p.opensScope?p.start:p.scopeOwner,staticSubtree:!1};i.set(h,D);let _e=u(g.children,D,g),Ae=!R&&f.every(k=>k.kind==="attribute")&&(P==="native-element"||g.tag==="template");D.staticSubtree=Ae&&_e,D.staticSubtree||(m=!1)}return m},"visit");o?.ast&&u(o.ast.children,null,null);let l=n.scriptSetup?Kr(n.scriptSetup):null;return{kind:"ok",template:o?{contentStart:o.loc.start.offset,contentEnd:o.loc.end.offset}:null,targets:i,rootFallthrough:Vi({descriptor:n,setupBody:l,templateBindsAttrs:s}),script:Ri(n,l)}}function Pi(t,e,n,r){let o=/(?:^|[\s/])v-pre(?=[\s/=>]|$)/,i=e;for(let s of[...n].sort((u,l)=>u.start-l.start)){if(o.test(t.slice(i,s.start)))return!0;i=s.end}return o.test(t.slice(i,r))}function Ti(t){return t.tagType===jt&&Ur.has(t.tag)}function jr(t){return{contentStart:t.loc.start.offset,contentEnd:t.loc.end.offset,lang:t.lang??null,src:t.src??null}}function Ri(t,e){let n=t.scriptSetup,r=[];for(let o of e??[])if(o.type==="ImportDeclaration"&&o.importKind!=="type")for(let i of o.specifiers)i.type==="ImportSpecifier"&&i.importKind==="type"||r.push({local:i.local.name,source:o.source.value,kind:i.type==="ImportDefaultSpecifier"?"default":i.type==="ImportNamespaceSpecifier"?"namespace":"named"});return{setup:n?{...jr(n),imports:r}:null,classic:t.script?jr(t.script):null}}function _i(t){let e=t.loc.start.offset,n=t.loc.end.offset;if(t.type===$r){let s=t.value?.loc,u=s?.source[0],l=u==='"'||u==="'"?u:null;return{kind:"attribute",name:t.name,value:t.value?t.value.content:!0,start:e,end:n,valueStart:s?s.start.offset+(l?1:0):null,valueEnd:s?s.end.offset-(l?1:0):null,quote:l}}let r=t.rawName??t.loc.source.split("=")[0].trim(),o=t.exp?.type===et?t.exp.content:void 0,i=t.exp===void 0?{}:{expression:t.exp.loc.source,...o!==void 0&&o!==t.exp.loc.source?{decodedExpression:o}:{}};if(t.name==="bind"){let s=t.arg,u=s?.type===et&&s.isStatic?s.content:null,l=u==="style"?Ai(t):void 0,c=u!==null&&u!=="style"&&u!=="class"?Ii(t):null;return{kind:"bind",name:u,objectBind:s===void 0,rawName:r,...i,...c?{literal:c}:{},...l===void 0?{}:{styleKeys:l&&l.entries.map(p=>p.key),styleObject:l},start:e,end:n}}return{kind:"directive",name:t.name,rawName:r,...i,start:e,end:n}}function Ai(t){let e=t.exp;if(!e||e.type!==et)return null;let n=e.ast;if(n===void 0&&(n=Hr(e.content)),!n)return null;let r=Te(n);if(r.type!=="ObjectExpression")return null;let o=[];for(let p of r.properties){if(p.type==="SpreadElement"||p.computed)return null;if(p.key.type==="Identifier")o.push(p.key.name);else if(p.key.type==="StringLiteral")o.push(Mr(p.key.value));else return null}let i=t.loc.source[e.loc.start.offset-t.loc.start.offset-1],s=i==='"'||i==="'"?i:null,u=s===null?null:Oi(e.loc.source,e.content),l=a(p=>u&&typeof p=="number"?e.loc.start.offset+u[p-1]:null,"at"),c=r.properties.map((p,d)=>{let m=p.type==="ObjectProperty"?p.value:void 0,g=p.type==="ObjectProperty"&&!p.shorthand&&u?M(p.value):null;return{key:o[d],literal:typeof g=="string"||typeof g=="number"?g:null,start:l(p.start),end:l(p.end),valueStart:l(m?.start),valueEnd:l(m?.end)}});return{start:l(r.start),end:l(r.end),quote:s,entries:c}}function Ii(t){let e=t.exp;if(!e||e.type!==et||e.content!==e.loc.source)return null;let n=t.loc.source[e.loc.start.offset-t.loc.start.offset-1];if(n!=='"'&&n!=="'")return null;let r=e.ast;if(r===void 0&&(r=Hr(e.content)),!r)return null;let o=M(r);return typeof o!="string"&&typeof o!="number"?null:{value:o,start:e.loc.start.offset,end:e.loc.end.offset,quote:n}}function Oi(t,e){let n=[],r="",o=/&(?:quot|#39|lt|gt|amp);/y;for(let i=0;i<t.length;){o.lastIndex=i;let s=o.exec(t)?.[0];n.push(i),r+=s?Ni[s]:t[i],i+=s?s.length:1}return n.push(t.length),r===e?n:null}function Hr(t){try{let n=(0,K.babelParse)(`(${t})`,{plugins:["typescript"]}).program.body[0];return n?.type==="ExpressionStatement"?n.expression:null}catch{return null}}function Jr(t){return t.tag==="template"||t.tag==="slot"?"special-element":t.tagType===hi?"native-element":t.tagType!==jt||Ur.has(t.tag)?"special-element":bi.has(t.tag)?"dynamic-element":"component"}function Y(t,e){return t.props.some(n=>n.type!==$r&&e.has(n.name))}function Mi(t){return Y(t,Ei)}function Dr(t){return t?t.tagType===vi?!0:t.tagType===jt&&Y(t,Ci):!1}function Vi(t){let e=Di(t.descriptor,t.setupBody);if(e==="unknown")return"unknown";if(t.templateBindsAttrs)return"explicit-attrs";if(e===!1)return"inherit-attrs-false";let n=t.descriptor.template?.ast;return n?Li(n.children):"unknown"}function Li(t){let e=[],n=!1;for(let s of t){let u=s.type===mi,l=s.type===fi&&s.content.trim()==="";if(u||l)continue;let c=s.type===Lt?s:null,p=n&&c!==null&&Y(c,xi),d=e[e.length-1];p&&d?d.push(s):e.push([s]),n=c!==null&&Y(c,wi)}let[r,...o]=e;if(!r)return"unknown";if(o.length>0)return"multi-root";let i=r.map(ji);return i.includes("list")?"multi-root":i.every(s=>s==="element")?"single-element":i.every(s=>s==="component")?"single-component":"unknown"}function ji(t){if(t.type!==Lt)return"other";if(Y(t,Br))return"list";let e=Jr(t);return e==="native-element"?"element":e==="component"?"component":"other"}function Di(t,e){let n=t.scriptSetup?Fr(e,$i):"absent";if(n!=="absent")return n;let r=t.script?Fr(Kr(t.script),Ui):"absent";return r==="absent"?!0:r}function Kr(t){if(t.src)return null;try{return(0,K.babelParse)(t.content,{sourceType:"module",plugins:Fi(t.lang)}).program.body}catch{return null}}function Fr(t,e){if(t===null)return"unknown";let n=e(t);return n==="absent"||n==="unknown"?n:Hi(n)}function Fi(t){return t==="ts"?["typescript"]:t==="tsx"?["typescript","jsx"]:t==="jsx"?["jsx"]:[]}function $i(t){let e="absent";for(let n of t){if(n.type!=="ExpressionStatement")continue;let r=Te(n.expression);if(r.type!=="CallExpression"||r.callee.type!=="Identifier"||r.callee.name!=="defineOptions")continue;let o=r.arguments[0],i=o&&o.type!=="SpreadElement"?Te(o):null;e=i?.type==="ObjectExpression"?i:"unknown"}return e}function Ui(t){for(let e of t){if(e.type==="ExportNamedDeclaration"){if(e.specifiers.some(s=>s.exported.type==="Identifier"&&s.exported.name==="default"))return"unknown";continue}if(e.type!=="ExportDefaultDeclaration")continue;let n=e.declaration;if(!Ji(n))return"unknown";let r=Te(n);return r.type==="ObjectExpression"?r:Bi(r)??"unknown"}return"absent"}function Bi(t){if(t.type!=="CallExpression")return null;let e=t.callee;if((e.type==="Identifier"?e.name:e.type==="MemberExpression"&&!e.computed&&e.property.type==="Identifier"?e.property.name:null)!=="defineComponent")return null;let r=t.arguments[0];if(!r||r.type==="SpreadElement")return null;let o=Te(r);return o.type==="ObjectExpression"?o:null}function Hi(t){let e="absent",n=!1;for(let r of t.properties){if(r.type==="SpreadElement"||r.computed){e="unknown";continue}let o=r.key.type==="Identifier"?r.key.name:r.key.type==="StringLiteral"?r.key.value:null;(o==="extends"||o==="mixins")&&(n=!0),o==="inheritAttrs"&&(e=r.type==="ObjectProperty"&&r.value.type==="BooleanLiteral"?r.value.value:"unknown")}return e==="absent"&&n?"unknown":e}function Ji(t){return t.type!=="FunctionDeclaration"&&t.type!=="ClassDeclaration"&&t.type!=="TSDeclareFunction"&&t.type!=="TSInterfaceDeclaration"&&t.type!=="TSTypeAliasDeclaration"&&t.type!=="TSEnumDeclaration"&&t.type!=="TSModuleDeclaration"}function Te(t){let e=t;for(;e.type==="TSAsExpression"||e.type==="TSSatisfiesExpression"||e.type==="TSTypeAssertion"||e.type==="TSNonNullExpression"||e.type==="ParenthesizedExpression";)e=e.expression;return e}var Lt,fi,mi,et,gi,$r,hi,yi,Si,jt,vi,Ur,bi,Ei,wi,xi,Br,Ci,ki,tt,Ni,rt=E(()=>{"use strict";Oe();Vr();Lr();Lt=1,fi=2,mi=3,et=4,gi=5,$r=6,hi=0,yi=1,Si=2,jt=1,vi=3,Ur=new Set(["Teleport","teleport","KeepAlive","keep-alive","Transition","transition","TransitionGroup","transition-group","Suspense","suspense","BaseTransition","base-transition"]),bi=new Set(["component","Component"]),Ei=new Set(["if","else-if","else","for"]),wi=new Set(["if","else-if"]),xi=new Set(["else-if","else"]),Br=new Set(["for"]),Ci=new Set(["slot"]),ki=new Set(["if","else-if","else","for","slot"]),tt=new Set(["class","style"]);a(nt,"parseVueSource");a(Pi,"carriesVPre");a(Ti,"isBuiltInComponent");a(jr,"blockFacts");a(Ri,"readScriptFacts");a(_i,"readProp");a(Ai,"boundStyleObject");a(Ii,"boundLiteral");Ni={""":'"',"'":"'","<":"<",">":">","&":"&"};a(Oi,"rawOffsets");a(Hr,"parseWrapped");a(Jr,"vueTargetKind");a(Y,"hasDirective");a(Mi,"carriesStructuralDirective");a(Dr,"ownsDynamicSlot");a(Vi,"readRootFallthrough");a(Li,"classifyTemplateRoots");a(ji,"classifyRootBranch");a(Di,"readInheritAttrs");a(Kr,"parseScriptBody");a(Fr,"readScriptInheritAttrs");a(Fi,"babelPluginsFor");a($i,"defineOptionsArgument");a(Ui,"defaultExportOptions");a(Bi,"defineComponentArgument");a(Hi,"readObjectInheritAttrs");a(Ji,"isExpression");a(Te,"unwrapTypeScript")});var Dt,Wr,Xr=E(()=>{"use strict";Dt="__TEMPO_VUE_SOURCE_REGISTRY__",Wr="__tempo_c"});function qr(t,e){let n={props:Object.create(null)};for(let r of e){if(Ki(r)){let s=t.slice(r.start,r.end);n.spread=n.spread?`${n.spread} ${s}`:s;for(let u of Object.keys(n.props))n.props[u]={expression:n.spread};continue}let o=Wi(r);if(!o)continue;let i=Yr(o.written);n.props[i]=o.value===void 0?{expression:Xi(r)}:{value:o.value}}return n}function Ki(t){return t.kind==="bind"&&(t.objectBind||t.name===null)}function Wi(t){if(t.kind==="attribute")return zr.has(t.name)?null:{prop:t,written:t.name,value:t.value};if(t.kind==="bind")return t.name===null||zr.has(t.name)?null:{prop:t,written:t.name,value:t.expression===void 0?void 0:zi(t.decodedExpression??t.expression)};if(t.name!=="model")return null;let e=/^v-model(?::([^.\s[]+))?/.exec(t.rawName);return e?{prop:t,written:e[1]??"modelValue",value:void 0}:null}function Xi(t){return t.kind!=="attribute"&&t.expression!==void 0?t.decodedExpression??t.expression:t.kind==="attribute"?t.name:t.kind==="bind"&&t.name!==null?Yr(t.name):t.rawName}function zi(t){let e;try{let n=(0,Gr.babelParse)(`(${t})`,{sourceType:"module"}).program.body[0];e=n?.type==="ExpressionStatement"?n.expression:void 0}catch{return}return e?Ft(e):void 0}function Ft(t){switch(t.type){case"StringLiteral":case"BooleanLiteral":return t.value;case"NumericLiteral":return Number.isFinite(t.value)?t.value:void 0;case"NullLiteral":return null;case"TemplateLiteral":return t.expressions.length===0?t.quasis[0]?.value.cooked??void 0:void 0;case"UnaryExpression":return t.operator==="-"&&t.argument.type==="NumericLiteral"?-t.argument.value:void 0;case"ArrayExpression":{let e=t.elements.map(n=>n&&n.type!=="SpreadElement"?Ft(n):void 0);return e.includes(void 0)?void 0:e}case"ObjectExpression":{let e=Object.create(null);for(let n of t.properties){if(n.type!=="ObjectProperty"||n.computed)return;let r=n.key.type==="Identifier"?n.key.name:n.key.type==="StringLiteral"?n.key.value:null,o=Ft(n.value);if(r===null||o===void 0)return;e[r]=o}return e}default:return}}function Yr(t){return t.replace(/-(\w)/g,(e,n)=>n.toUpperCase())}var Gr,zr,Zr=E(()=>{"use strict";te();Gr=require("vue/compiler-sfc");Vt();rt();zr=new Set(["key","ref","ref_for","ref_key","is","class","style","slot"]);a(qr,"readVuePassedProps");a(Ki,"opensEverything");a(Wi,"passedProp");a(Xi,"expressionText");a(zi,"literalValue");a(Ft,"literalOf");a(Yr,"camelize")});function Qr(t,e){if(t.kind!=="native-element"||t.namespace!=="svg"||tt.has(e.toLowerCase())||Gi.has(e)||e.toLowerCase().startsWith("on")||t.props.some(o=>o.kind==="bind"&&(o.objectBind||o.name===null)))return null;let n=t.props.filter(o=>(o.kind==="attribute"||o.kind==="bind")&&o.name?.toLowerCase()===e.toLowerCase()),r=n.length===1?n[0]:null;return r?.kind!=="bind"||!r.literal||r.name!==e||r.rawName!==`:${e}`&&r.rawName!==`v-bind:${e}`?null:r}var Gi,eo=E(()=>{"use strict";rt();Gi=new Set(["key","ref","ref_for","ref_key","is"]);a(Qr,"vueLiteralAttribute")});function io(t){if(!t.filepath||!t.filename||!Number.isSafeInteger(t.modifiedTs)||t.modifiedTs<0||t.sourceVersion==="")return ue("invalid_metadata","filename, filepath, a non-negative integer modifiedTs, and a non-empty sourceVersion are required");let e=nt(t.source,t.filename);if(e.kind==="invalid")return ue("invalid_source",e.message);if(e.kind==="unsupported")return ue("unsupported_template",e.message);let n=new Map;for(let f of e.targets.values()){let h=na(t.source,f);if(h!==null){if(h.kind==="refused")return h;n.set(f.start,h)}}let r=[...n.values()].map(f=>f.removal),o=a(f=>f-r.filter(h=>h.end<=f).reduce((h,v)=>h+v.end-v.start,0),"baseOffset"),i=t.sourceVersion??B(ia(t.source,r)),s=[],u=[],l=[],c=[],p=0;for(let f of e.targets.values()){let h=f.kind==="native-element",v=f.kind==="component"||f.kind==="dynamic-element";if(!h&&!v)continue;let y=o(f.start),b=h?lo:uo,w=f.props.filter(j=>!b(j)),x=Qi(f,w,y),P=n.get(f.start);if(h){let j={filepath:t.filepath,position:y,modifiedTs:t.modifiedTs,sourceVersion:i};if(u.push({kind:"host",...x.record}),P){if(!(P.kind==="stamps"&&sa(P.metadata,j)&&P.expressions===x.expressions))return ro(f.start);c.push(y);continue}s.push({start:f.propsEnd,end:f.propsEnd,replacement:co(j,x.expressions)}),p+=1;continue}let R=ta(w);if(R===null)continue;let O=Zi(t.source,w);if(l.push({kind:"component",...x.record,...x.locked,expressions:x.expressions,...O?{literalProps:O}:{}}),P){if(!(P.kind==="marker"&&P.position===y&&P.spelling===R))return ro(f.start);c.push(y);continue}s.push({start:f.propsEnd,end:f.propsEnd,replacement:po(R,y)})}let d=new Qe(t.source);for(let f of s)d.appendLeft(f.start,f.replacement);let m=d.toString(),g=nt(m,t.filename);return g.kind!=="ok"||g.targets.size!==e.targets.size?ue("invalid_output",g.kind==="ok"?"annotation changed the template's tag structure":g.message):{kind:"ok",code:m,map:d.generateMap({source:t.filename,includeContent:!0,hires:!0}),edits:s,elementsAnnotated:p,skippedExistingAnnotations:c,sourceVersion:i,registry:{filename:t.filename,filepath:t.filepath,modifiedTs:t.modifiedTs,sourceVersion:i,components:l,hosts:u,rootFallthrough:e.rootFallthrough}}}function Zi(t,e){let n=e.filter(o=>!(o.kind==="attribute"&&o.name.startsWith("data-tempo-"))),r=Object.entries(qr(t,n).props).filter(([,o])=>"value"in o).map(([o,i])=>[o,i.value]);return r.length>0?Object.fromEntries(r):void 0}function ao(t,e){let n=`(globalThis.${Dt} || (globalThis.${Dt} = {}))`;return`${t}
|
|
58
|
+
`?i=!0:p!=="\r"&&i&&(i=!1,u===l.start||(this._splitChunk(l,u),l=l.next),l.prependRight(e))}u+=1}u=l.end,l=l.next}return this.outro=this.outro.replace(r,s),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,n){return ce.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),ce.insertLeft=!0),this.appendLeft(e,n)}insertRight(e,n){return ce.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),ce.insertRight=!0),this.prependRight(e,n)}move(e,n,r){if(e=e+this.offset,n=n+this.offset,r=r+this.offset,r>=e&&r<=n)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(n),this._split(r);let o=this.byStart[e],i=this.byEnd[n],s=o.previous,u=i.next,l=this.byStart[r];if(!l&&i===this.lastChunk)return this;let c=l?l.previous:this.lastChunk;return s&&(s.next=u),u&&(u.previous=s),c&&(c.next=o),l&&(l.previous=i),o.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=o.previous,this.lastChunk.next=null),o.previous=c,i.next=l||null,c||(this.firstChunk=o),l||(this.lastChunk=i),this}overwrite(e,n,r,o){return o=o||{},this.update(e,n,r,{...o,overwrite:!o.contentOnly})}update(e,n,r,o){if(e=e+this.offset,n=n+this.offset,typeof r!="string")throw new TypeError("replacement content must be a string");if(this.original.length!==0){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length}if(n>this.original.length)throw new Error("end is out of bounds");if(e===n)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(e),this._split(n),o===!0&&(ce.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),ce.storeName=!0),o={storeName:!0});let i=o!==void 0?o.storeName:!1,s=o!==void 0?o.overwrite:!1;if(i){let c=this.original.slice(e,n);Object.defineProperty(this.storedNames,c,{writable:!0,value:!0,enumerable:!0})}let u=this.byStart[e],l=this.byEnd[n];if(u){let c=u;for(;c!==l;){if(c.next!==this.byStart[c.end])throw new Error("Cannot overwrite across a split point");c=c.next,c.edit("",!1)}u.edit(r,i,!s)}else{let c=new rt(e,n,"").edit(r,i);l.next=c,c.previous=l}return this}prepend(e){if(typeof e!="string")throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this}prependLeft(e,n){if(e=e+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);let r=this.byEnd[e];return r?r.prependLeft(n):this.intro=n+this.intro,this}prependRight(e,n){if(e=e+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(e);let r=this.byStart[e];return r?r.prependRight(n):this.outro=n+this.outro,this}remove(e,n){if(e=e+this.offset,n=n+this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length}if(e===n)return this;if(e<0||n>this.original.length)throw new Error("Character is out of bounds");if(e>n)throw new Error("end must be greater than start");this._split(e),this._split(n);let r=this.byStart[e];for(;r;)r.intro="",r.outro="",r.edit(""),r=n>r.end?this.byStart[r.end]:null;return this}reset(e,n){if(e=e+this.offset,n=n+this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length}if(e===n)return this;if(e<0||n>this.original.length)throw new Error("Character is out of bounds");if(e>n)throw new Error("end must be greater than start");this._split(e),this._split(n);let r=this.byStart[e];for(;r;)r.reset(),r=n>r.end?this.byStart[r.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let e=this.outro.lastIndexOf(_e);if(e!==-1)return this.outro.substr(e+1);let n=this.outro,r=this.lastChunk;do{if(r.outro.length>0){if(e=r.outro.lastIndexOf(_e),e!==-1)return r.outro.substr(e+1)+n;n=r.outro+n}if(r.content.length>0){if(e=r.content.lastIndexOf(_e),e!==-1)return r.content.substr(e+1)+n;n=r.content+n}if(r.intro.length>0){if(e=r.intro.lastIndexOf(_e),e!==-1)return r.intro.substr(e+1)+n;n=r.intro+n}}while(r=r.previous);return e=this.intro.lastIndexOf(_e),e!==-1?this.intro.substr(e+1)+n:this.intro+n}slice(e=0,n=this.original.length-this.offset){if(e=e+this.offset,n=n+this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;n<0;)n+=this.original.length}let r="",o=this.firstChunk;for(;o&&(o.start>e||o.end<=e);){if(o.start<n&&o.end>=n)return r;o=o.next}if(o&&o.edited&&o.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);let i=o;for(;o;){o.intro&&(i!==o||o.start===e)&&(r+=o.intro);let s=o.start<n&&o.end>=n;if(s&&o.edited&&o.end!==n)throw new Error(`Cannot use replaced character ${n} as slice end anchor.`);let u=i===o?e-o.start:0,l=s?o.content.length+n-o.end:o.content.length;if(r+=o.content.slice(u,l),o.outro&&(!s||o.end===n)&&(r+=o.outro),s)break;o=o.next}return r}snip(e,n){let r=this.clone();return r.remove(0,e),r.remove(n,r.original.length),r}_split(e){if(this.byStart[e]||this.byEnd[e])return;let n=this.lastSearchedChunk,r=n,o=e>n.end;for(;n;){if(n.contains(e))return this._splitChunk(n,e);if(n=o?this.byStart[n.end]:this.byEnd[n.start],n===r)return;r=n}}_splitChunk(e,n){if(e.edited&&e.content.length){let o=jr(this.original)(n);throw new Error(`Cannot split a chunk that has already been edited (${o.line}:${o.column} \u2013 "${e.original}")`)}let r=e.split(n);return this.byEnd[n]=e,this.byStart[n]=r,this.byEnd[r.end]=r,e===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=e,!0}toString(){let e=this.intro,n=this.firstChunk;for(;n;)e+=n.toString(),n=n.next;return e+this.outro}isEmpty(){let e=this.firstChunk;do if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1;while(e=e.next);return!0}length(){let e=this.firstChunk,n=0;do n+=e.intro.length+e.content.length+e.outro.length;while(e=e.next);return n}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){let n=new RegExp((e||"\\s")+"+$");if(this.outro=this.outro.replace(n,""),this.outro.length)return!0;let r=this.lastChunk;do{let o=r.end,i=r.trimEnd(n);if(r.end!==o&&(this.lastChunk===r&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),i)return!0;r=r.previous}while(r);return!1}trimEnd(e){return this.trimEndAborted(e),this}trimStartAborted(e){let n=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(n,""),this.intro.length)return!0;let r=this.firstChunk;do{let o=r.end,i=r.trimStart(n);if(r.end!==o&&(r===this.lastChunk&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),i)return!0;r=r.next}while(r);return!1}trimStart(e){return this.trimStartAborted(e),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,n){function r(i,s){return typeof n=="string"?n.replace(/\$(\$|&|\d+)/g,(u,l)=>l==="$"?"$":l==="&"?i[0]:+l<i.length?i[+l]:`$${l}`):n(...i,i.index,s,i.groups)}a(r,"getReplacement");function o(i,s){let u,l=[];for(;u=i.exec(s);)l.push(u);return l}if(a(o,"matchAll"),e.global)o(e,this.original).forEach(s=>{if(s.index!=null){let u=r(s,this.original);u!==s[0]&&this.overwrite(s.index,s.index+s[0].length,u)}});else{let i=this.original.match(e);if(i&&i.index!=null){let s=r(i,this.original);s!==i[0]&&this.overwrite(i.index,i.index+i[0].length,s)}}return this}_replaceString(e,n){let{original:r}=this,o=r.indexOf(e);return o!==-1&&(typeof n=="function"&&(n=n(e,o,r)),e!==n&&this.overwrite(o,o+e.length,n)),this}replace(e,n){return typeof e=="string"?this._replaceString(e,n):this._replaceRegexp(e,n)}_replaceAllString(e,n){let{original:r}=this,o=e.length;for(let i=r.indexOf(e);i!==-1;i=r.indexOf(e,i+o)){let s=r.slice(i,i+o),u=n;typeof n=="function"&&(u=n(s,i,r)),s!==u&&this.overwrite(i,i+o,u)}return this}replaceAll(e,n){if(typeof e=="string")return this._replaceAllString(e,n);if(!e.global)throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");return this._replaceRegexp(e,n)}}});function Lt(t,e='"'){let n=t.split("&").join("&").split('"').join(""").split("<").join("<").split(">").join(">");return e==="'"?n.split("'").join("'"):n}var Ft=w(()=>{"use strict";a(Lt,"escapeVueAttributeValue")});function Ur(t){return t.startsWith("--")?t:t.replace(/^-ms-/,"ms-").replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}var Br=w(()=>{"use strict";a(Ur,"camelCaseStyleKey")});var L,Dt=w(()=>{"use strict";L=require("vue/compiler-sfc")});function pe(t,e="Component.vue"){let{descriptor:n,errors:r}=(0,L.parse)(t,{filename:e,sourceMap:!1});if(r.length>0)return{kind:"invalid",code:"invalid_vue",message:r.map(c=>c.message).join(`
|
|
59
|
+
`)};let o=n.template;if(o?.src)return{kind:"unsupported",code:"unsupported_template",message:`<template src="${o.src}"> is outside this file, so its offsets cannot describe it`};if(o?.lang&&o.lang!=="html")return{kind:"unsupported",code:"unsupported_template",message:`<template lang="${o.lang}"> offsets would describe the generated HTML, not this file`};if(o&&!o.ast)return{kind:"unsupported",code:"unsupported_template",message:"the template has no parsed AST"};let i=new Map,s=!1,u=a((c,p,f)=>{let g=!0;for(let m of c){if(m.type===Ni&&(g=!1),m.type!==jt)continue;let d=m.props.map(Ji);d.some(T=>T.kind==="bind"&&/\$attrs\b/.test(T.expression??""))&&(s=!0);let h=m.loc.start.offset,S=m.loc.end.offset,y=d.length>0?Math.max(...d.map(T=>T.end)):h+1+m.tag.length,E=t.indexOf(">",y)+1,b=m.isSelfClosing===!0,x=!b&&S>E,k=qr(m),P=Ui(t,h+1+m.tag.length,d,E),A=p!==null&&(p.vPre||p.inVPre),F=k==="dynamic-element"||Bi(m)||m.tag==="template"||P||Q(m,Gr),O={kind:k,tagName:m.tag,namespace:m.ns===Oi?"svg":m.ns===Mi?"mathml":"html",start:h,end:S,propsEnd:y,props:d,dynamicSlot:zi(m)||Jr(f),expressionSlot:Q(m,Xr)||Jr(f),parentStart:p?.start??null,openingEnd:E,selfClosing:b,childrenStart:x?E:null,childrenEnd:x?h+m.loc.source.lastIndexOf("</"):null,vPre:P,inVPre:A,opensScope:F,scopeOwner:p===null?-1:p.opensScope?p.start:p.scopeOwner,staticSubtree:!1};i.set(h,O);let H=u(m.children,O,m),M=!P&&d.every(T=>T.kind==="attribute")&&(k==="native-element"||m.tag==="template");O.staticSubtree=M&&H,O.staticSubtree||(g=!1)}return g},"visit");o?.ast&&u(o.ast.children,null,null);let l=n.scriptSetup?Yr(n.scriptSetup):null;return{kind:"ok",template:o?{contentStart:o.loc.start.offset,contentEnd:o.loc.end.offset}:null,targets:i,rootFallthrough:Yi({descriptor:n,setupBody:l,templateBindsAttrs:s}),script:Hi(n,l)}}function Ui(t,e,n,r){let o=/(?:^|[\s/])v-pre(?=[\s/=>]|$)/,i=e;for(let s of[...n].sort((u,l)=>u.start-l.start)){if(o.test(t.slice(i,s.start)))return!0;i=s.end}return o.test(t.slice(i,r))}function Bi(t){return t.tagType===Ut&&Wr.has(t.tag)}function Hr(t){return{contentStart:t.loc.start.offset,contentEnd:t.loc.end.offset,lang:t.lang??null,src:t.src??null}}function Hi(t,e){let n=t.scriptSetup,r=[];for(let o of e??[])if(o.type==="ImportDeclaration"&&o.importKind!=="type")for(let i of o.specifiers)i.type==="ImportSpecifier"&&i.importKind==="type"||r.push({local:i.local.name,source:o.source.value,kind:i.type==="ImportDefaultSpecifier"?"default":i.type==="ImportNamespaceSpecifier"?"namespace":"named"});return{setup:n?{...Hr(n),imports:r}:null,classic:t.script?Hr(t.script):null}}function Ji(t){let e=t.loc.start.offset,n=t.loc.end.offset;if(t.type===$t){let s=t.value?.loc,u=s?.source[0],l=u==='"'||u==="'"?u:null;return{kind:"attribute",name:t.name,value:t.value?t.value.content:!0,start:e,end:n,valueStart:s?s.start.offset+(l?1:0):null,valueEnd:s?s.end.offset-(l?1:0):null,quote:l}}let r=t.rawName??t.loc.source.split("=")[0].trim(),o=t.exp?.type===Ne?t.exp.content:void 0,i=t.exp===void 0?{}:{expression:t.exp.loc.source,...o!==void 0&&o!==t.exp.loc.source?{decodedExpression:o}:{}};if(t.name==="bind"){let s=t.arg,u=s?.type===Ne&&s.isStatic?s.content:null,l=u==="style"?Ki(t):void 0,c=u!==null&&u!=="style"&&u!=="class"?Wi(t):null;return{kind:"bind",name:u,objectBind:s===void 0,rawName:r,...i,...c?{literal:c}:{},...l===void 0?{}:{styleKeys:l&&l.entries.map(p=>p.key),styleObject:l},start:e,end:n}}return{kind:"directive",name:t.name,rawName:r,...i,start:e,end:n}}function Ki(t){let e=t.exp;if(!e||e.type!==Ne)return null;let n=e.ast;if(n===void 0&&(n=zr(e.content)),!n)return null;let r=Ie(n);if(r.type!=="ObjectExpression")return null;let o=[];for(let p of r.properties){if(p.type==="SpreadElement"||p.computed)return null;if(p.key.type==="Identifier")o.push(p.key.name);else if(p.key.type==="StringLiteral")o.push(Ur(p.key.value));else return null}let i=t.loc.source[e.loc.start.offset-t.loc.start.offset-1],s=i==='"'||i==="'"?i:null,u=s===null?null:Gi(e.loc.source,e.content),l=a(p=>u&&typeof p=="number"?e.loc.start.offset+u[p-1]:null,"at"),c=r.properties.map((p,f)=>{let g=p.type==="ObjectProperty"?p.value:void 0,m=p.type==="ObjectProperty"&&!p.shorthand&&u?D(p.value):null;return{key:o[f],literal:typeof m=="string"||typeof m=="number"?m:null,start:l(p.start),end:l(p.end),valueStart:l(g?.start),valueEnd:l(g?.end)}});return{start:l(r.start),end:l(r.end),quote:s,entries:c}}function Wi(t){let e=t.exp;if(!e||e.type!==Ne||e.content!==e.loc.source)return null;let n=t.loc.source[e.loc.start.offset-t.loc.start.offset-1];if(n!=='"'&&n!=="'")return null;let r=e.ast;if(r===void 0&&(r=zr(e.content)),!r)return null;let o=D(r);return typeof o!="string"&&typeof o!="number"?null:{value:o,start:e.loc.start.offset,end:e.loc.end.offset,quote:n}}function Gi(t,e){let n=[],r="",o=/&(?:quot|#39|lt|gt|amp);/y;for(let i=0;i<t.length;){o.lastIndex=i;let s=o.exec(t)?.[0];n.push(i),r+=s?Xi[s]:t[i],i+=s?s.length:1}return n.push(t.length),r===e?n:null}function zr(t){try{let n=(0,L.babelParse)(`(${t})`,{plugins:["typescript"]}).program.body[0];return n?.type==="ExpressionStatement"?n.expression:null}catch{return null}}function qr(t){return t.tag==="template"||t.tag==="slot"?"special-element":t.tagType===Ii?"native-element":t.tagType!==Ut||Wr.has(t.tag)?"special-element":Li.has(t.tag)?"dynamic-element":"component"}function Q(t,e){return t.props.some(n=>n.type!==$t&&e.has(n.name))}function zi(t){return Q(t,Fi)}function Jr(t){return t?t.tagType===Vi?!qi(t):t.tagType===Ut&&Q(t,$i):!1}function qi(t){let e=t.props.filter(o=>o.type!==$t&&Gr.has(o.name)),[n,...r]=e;return!n||r.length>0||n.name!=="slot"||n.exp?!1:!n.arg||n.arg.type===Ne&&n.arg.isStatic}function Yi(t){let e=ea(t.descriptor,t.setupBody);if(e==="unknown")return"unknown";if(t.templateBindsAttrs)return"explicit-attrs";if(e===!1)return"inherit-attrs-false";let n=t.descriptor.template?.ast;return n?Zi(n.children):"unknown"}function Zi(t){let e=[],n=!1;for(let s of t){let u=s.type===_i,l=s.type===Ai&&s.content.trim()==="";if(u||l)continue;let c=s.type===jt?s:null,p=n&&c!==null&&Q(c,ji),f=e[e.length-1];p&&f?f.push(s):e.push([s]),n=c!==null&&Q(c,Di)}let[r,...o]=e;if(!r)return"unknown";if(o.length>0)return"multi-root";let i=r.map(Qi);return i.includes("list")?"multi-root":i.every(s=>s==="element")?"single-element":i.every(s=>s==="component")?"single-component":"unknown"}function Qi(t){if(t.type!==jt)return"other";if(Q(t,Xr))return"list";let e=qr(t);return e==="native-element"?"element":e==="component"?"component":"other"}function ea(t,e){let n=t.scriptSetup?Kr(e,na):"absent";if(n!=="absent")return n;let r=t.script?Kr(Yr(t.script),ra):"absent";return r==="absent"?!0:r}function Yr(t){if(t.src)return null;try{return(0,L.babelParse)(t.content,{sourceType:"module",plugins:ta(t.lang)}).program.body}catch{return null}}function Kr(t,e){if(t===null)return"unknown";let n=e(t);return n==="absent"||n==="unknown"?n:sa(n)}function ta(t){return t==="ts"?["typescript"]:t==="tsx"?["typescript","jsx"]:t==="jsx"?["jsx"]:[]}function na(t){let e="absent";for(let n of t){if(n.type!=="ExpressionStatement")continue;let r=Ie(n.expression);if(r.type!=="CallExpression"||r.callee.type!=="Identifier"||r.callee.name!=="defineOptions")continue;let o=r.arguments[0],i=o&&o.type!=="SpreadElement"?Ie(o):null;e=i?.type==="ObjectExpression"?i:"unknown"}return e}function ra(t){for(let e of t){if(e.type==="ExportNamedDeclaration"){if(e.specifiers.some(s=>s.exported.type==="Identifier"&&s.exported.name==="default"))return"unknown";continue}if(e.type!=="ExportDefaultDeclaration")continue;let n=e.declaration;if(!ia(n))return"unknown";let r=Ie(n);return r.type==="ObjectExpression"?r:oa(r)??"unknown"}return"absent"}function oa(t){if(t.type!=="CallExpression")return null;let e=t.callee;if((e.type==="Identifier"?e.name:e.type==="MemberExpression"&&!e.computed&&e.property.type==="Identifier"?e.property.name:null)!=="defineComponent")return null;let r=t.arguments[0];if(!r||r.type==="SpreadElement")return null;let o=Ie(r);return o.type==="ObjectExpression"?o:null}function sa(t){let e="absent",n=!1;for(let r of t.properties){if(r.type==="SpreadElement"||r.computed){e="unknown";continue}let o=r.key.type==="Identifier"?r.key.name:r.key.type==="StringLiteral"?r.key.value:null;(o==="extends"||o==="mixins")&&(n=!0),o==="inheritAttrs"&&(e=r.type==="ObjectProperty"&&r.value.type==="BooleanLiteral"?r.value.value:"unknown")}return e==="absent"&&n?"unknown":e}function ia(t){return t.type!=="FunctionDeclaration"&&t.type!=="ClassDeclaration"&&t.type!=="TSDeclareFunction"&&t.type!=="TSInterfaceDeclaration"&&t.type!=="TSTypeAliasDeclaration"&&t.type!=="TSEnumDeclaration"&&t.type!=="TSModuleDeclaration"}function Ie(t){let e=t;for(;e.type==="TSAsExpression"||e.type==="TSSatisfiesExpression"||e.type==="TSTypeAssertion"||e.type==="TSNonNullExpression"||e.type==="ParenthesizedExpression";)e=e.expression;return e}var jt,Ai,_i,Ne,Ni,$t,Ii,Oi,Mi,Ut,Vi,Wr,Li,Fi,Di,ji,Xr,$i,Gr,st,Xi,Oe=w(()=>{"use strict";De();Br();Dt();jt=1,Ai=2,_i=3,Ne=4,Ni=5,$t=6,Ii=0,Oi=1,Mi=2,Ut=1,Vi=3,Wr=new Set(["Teleport","teleport","KeepAlive","keep-alive","Transition","transition","TransitionGroup","transition-group","Suspense","suspense","BaseTransition","base-transition"]),Li=new Set(["component","Component"]),Fi=new Set(["if","else-if","else","for"]),Di=new Set(["if","else-if"]),ji=new Set(["else-if","else"]),Xr=new Set(["for"]),$i=new Set(["slot"]),Gr=new Set(["if","else-if","else","for","slot"]),st=new Set(["class","style"]);a(pe,"parseVueSource");a(Ui,"carriesVPre");a(Bi,"isBuiltInComponent");a(Hr,"blockFacts");a(Hi,"readScriptFacts");a(Ji,"readProp");a(Ki,"boundStyleObject");a(Wi,"boundLiteral");Xi={""":'"',"'":"'","<":"<",">":">","&":"&"};a(Gi,"rawOffsets");a(zr,"parseWrapped");a(qr,"vueTargetKind");a(Q,"hasDirective");a(zi,"carriesStructuralDirective");a(Jr,"ownsDynamicSlot");a(qi,"isPlainSlotTemplate");a(Yi,"readRootFallthrough");a(Zi,"classifyTemplateRoots");a(Qi,"classifyRootBranch");a(ea,"readInheritAttrs");a(Yr,"parseScriptBody");a(Kr,"readScriptInheritAttrs");a(ta,"babelPluginsFor");a(na,"defineOptionsArgument");a(ra,"defaultExportOptions");a(oa,"defineComponentArgument");a(sa,"readObjectInheritAttrs");a(ia,"isExpression");a(Ie,"unwrapTypeScript")});var Bt,Zr,Qr=w(()=>{"use strict";Bt="__TEMPO_VUE_SOURCE_REGISTRY__",Zr="__tempo_c"});function no(t,e){let n={props:Object.create(null)};for(let r of e){if(aa(r)){let s=t.slice(r.start,r.end);n.spread=n.spread?`${n.spread} ${s}`:s;for(let u of Object.keys(n.props))n.props[u]={expression:n.spread};continue}let o=la(r);if(!o)continue;let i=ro(o.written);n.props[i]=o.value===void 0?{expression:ua(r)}:{value:o.value}}return n}function aa(t){return t.kind==="bind"&&(t.objectBind||t.name===null)}function la(t){if(t.kind==="attribute")return eo.has(t.name)?null:{prop:t,written:t.name,value:t.value};if(t.kind==="bind")return t.name===null||eo.has(t.name)?null:{prop:t,written:t.name,value:t.expression===void 0?void 0:ca(t.decodedExpression??t.expression)};if(t.name!=="model")return null;let e=/^v-model(?::([^.\s[]+))?/.exec(t.rawName);return e?{prop:t,written:e[1]??"modelValue",value:void 0}:null}function ua(t){return t.kind!=="attribute"&&t.expression!==void 0?t.decodedExpression??t.expression:t.kind==="attribute"?t.name:t.kind==="bind"&&t.name!==null?ro(t.name):t.rawName}function ca(t){let e;try{let n=(0,to.babelParse)(`(${t})`,{sourceType:"module"}).program.body[0];e=n?.type==="ExpressionStatement"?n.expression:void 0}catch{return}return e?Ht(e):void 0}function Ht(t){switch(t.type){case"StringLiteral":case"BooleanLiteral":return t.value;case"NumericLiteral":return Number.isFinite(t.value)?t.value:void 0;case"NullLiteral":return null;case"TemplateLiteral":return t.expressions.length===0?t.quasis[0]?.value.cooked??void 0:void 0;case"UnaryExpression":return t.operator==="-"&&t.argument.type==="NumericLiteral"?-t.argument.value:void 0;case"ArrayExpression":{let e=t.elements.map(n=>n&&n.type!=="SpreadElement"?Ht(n):void 0);return e.includes(void 0)?void 0:e}case"ObjectExpression":{let e=Object.create(null);for(let n of t.properties){if(n.type!=="ObjectProperty"||n.computed)return;let r=n.key.type==="Identifier"?n.key.name:n.key.type==="StringLiteral"?n.key.value:null,o=Ht(n.value);if(r===null||o===void 0)return;e[r]=o}return e}default:return}}function ro(t){return t.replace(/-(\w)/g,(e,n)=>n.toUpperCase())}var to,eo,oo=w(()=>{"use strict";re();to=require("vue/compiler-sfc");Ft();Oe();eo=new Set(["key","ref","ref_for","ref_key","is","class","style","slot"]);a(no,"readVuePassedProps");a(aa,"opensEverything");a(la,"passedProp");a(ua,"expressionText");a(ca,"literalValue");a(Ht,"literalOf");a(ro,"camelize")});function so(t,e){if(t.kind!=="native-element"||t.namespace!=="svg"||st.has(e.toLowerCase())||pa.has(e)||e.toLowerCase().startsWith("on")||t.props.some(o=>o.kind==="bind"&&(o.objectBind||o.name===null)))return null;let n=t.props.filter(o=>(o.kind==="attribute"||o.kind==="bind")&&o.name?.toLowerCase()===e.toLowerCase()),r=n.length===1?n[0]:null;return r?.kind!=="bind"||!r.literal||r.name!==e||r.rawName!==`:${e}`&&r.rawName!==`v-bind:${e}`?null:r}var pa,io=w(()=>{"use strict";Oe();pa=new Set(["key","ref","ref_for","ref_key","is"]);a(so,"vueLiteralAttribute")});function lo(t){let e="default";for(let n of t.props){if(n.type!==Ea||n.name!=="name"||!n.value)return null;e=n.value.content}return e}function mo(t,e,n){let r=xa(t,e),o=r?.elements.get(n);if(!r||!o)return{kind:"none"};let i=a(d=>r.elements.get(d)?.node.tagType===Jt,"isOutlet"),s=o.list.children.filter(d=>i(d.start));if(s.length===0)return{kind:"none"};let u=a(d=>({kind:"refused",message:`${d}; inserting into it requires AI`}),"refused"),[l]=s,c=a(d=>d.kind==="text"&&ao.test(t.slice(d.start,d.end)),"blank");if(!o.native||s.length>1||o.list.children.some(d=>d!==l&&!c(d)))return u("This element renders a <slot> beside content of its own");let p=r.elements.get(l.start),f=lo(p.node);if(f===null)return u("This element's <slot> takes props or a name from code");if(!ao.test(t.slice(p.openEnd,p.closeStart)))return u("This element's <slot> has fallback content");let g=0;for(let d of r.elements.values()){if(d.node.tagType!==Jt)continue;let h=lo(d.node);(h===null||h===f)&&g++}if(g!==1)return u(`The template renders slot "${f}" in more than one place`);let m=pe(t,e);if(m.kind!=="ok")return u("The template does not parse");for(let d=m.targets.get(l.start);d;d=d.parentStart===null?void 0:m.targets.get(d.parentStart))if(d.props.some(h=>h.kind==="directive"&&h.name==="for"))return u("This element's <slot> renders once per v-for item");return{kind:"plain",name:f}}function wa(t,e,n){let{descriptor:r,errors:o}=(0,L.parse)(t,{filename:e,sourceMap:!1,templateParseOptions:{whitespace:n.whitespace,comments:n.comments}});if(o.length>0)return null;let i=r.template;return i&&(i.src||i.lang&&i.lang!=="html")?null:{descriptor:r}}function xa(t,e){if(de.has(t))return de.get(t);let n=Ca(t,e);return de.size>=ba&&de.delete(de.keys().next().value),de.set(t,n),n}function Ca(t,e){let n=wa(t,e,va);if(!n)return null;let{descriptor:r}=n,o={descriptor:r,lists:new Map,elements:new Map,textLists:new Map,showings:new Map},i=r.template;if(!i?.ast)return o;let s=a((u,l,c,p,f)=>{let g=u?.tag??null,m=u===null||u.ns===Sa,d=m&&(g==="textarea"||g==="title")?"rcdata":m&&(g==="script"||g==="style")?"rawtext":"normal",h=f.pre||m&&g==="pre",S={owner:u?.loc.start.offset??-1,ownerTag:g,start:c,end:p,children:[],mode:d,inPre:h,dropsFirstNewline:m&&(g==="pre"||g==="textarea"),node:u?{start:u.loc.start.offset,end:u.loc.end.offset}:{start:-1,end:-1}},y=c,E=a(b=>{b>y&&S.children.push(co(t,y,b,S))},"gap");for(let b of l){let x=b.loc.start.offset;if(E(x),y=b.loc.end.offset,b.type===fo){S.children.push(co(t,x,y,S));continue}if(b.type===fa){S.children.push({start:x,end:y,kind:"comment",content:b.content,units:null,tag:null,node:{start:x,end:y}});continue}if(b.type===ga){let M=Ta(b);S.children.push(M===null?uo(x,y):{start:x,end:y,kind:"literal",content:M,units:null,tag:null,node:{start:x,end:y}});continue}if(b.type!==da){S.children.push(uo(x,y));continue}let k=b,P=k.tagType===ha&&k.tag!=="template"&&k.tag!=="slot",A=f.slot||k.tagType===Jt,F=ka(t,k,(M,T,R)=>s(k,M,T,R,{pre:h,slot:A})),O=k.props.some(M=>M.type===7&&(M.name==="html"||M.name==="text")),H=k.tagType===ya;S.children.push({start:x,end:y,kind:P?"element":H?"component":"boundary",content:null,units:null,tag:P||H?k.tag:null,node:F.list.node}),o.elements.set(x,{...F,native:P,boundaryContent:A||O})}E(p),o.lists.set(S.owner,S);for(let b of S.children)b.kind==="text"&&o.textLists.set(b.start,S);return S},"visit");return s(null,i.ast.children,i.loc.start.offset,i.loc.end.offset,{pre:!1,slot:!1}),o}function ka(t,e,n){let r=e.loc.start.offset,o=e.loc.end.offset,i=e.props.reduce((c,p)=>Math.max(c,p.loc.end.offset),r+1+e.tag.length),s=t.indexOf(">",i)+1,u=e.isSelfClosing!==!0&&o>s,l=u?r+e.loc.source.lastIndexOf("</"):s;return{node:e,openEnd:s,closeStart:l,selfClosing:!u,list:n(e.children,s,l)}}function Ta(t){let e=t.content;if(e.type!==ma)return null;let n;try{let o=(0,L.babelParse)(`(${e.content})`,{plugins:["typescript"]}).program.body;if(o.length!==1)return null;n=o[0]}catch{return null}if(n?.type!=="ExpressionStatement")return null;let r=n.expression;if(r.type==="StringLiteral"&&typeof r.value=="string")return r.value.length>0?r.value:null;if(r.type==="NumericLiteral"&&typeof r.value=="number")return Number.isFinite(r.value)?String(r.value):null;if(r.type==="TemplateLiteral"&&r.expressions?.length===0&&r.quasis?.length===1){let o=r.quasis[0].value.cooked;return typeof o=="string"&&o.length>0?o:null}return null}function uo(t,e){return{start:t,end:e,kind:"boundary",content:null,units:null,tag:null,node:{start:t,end:e}}}function co(t,e,n,r){let o=Pa(t.slice(e,n),e,r);return{start:e,end:n,kind:"text",content:o?o.map(i=>i.text).join(""):null,units:o,tag:null,node:{start:e,end:n}}}function Pa(t,e,n){let r=[],o=a((u,l)=>{for(let c=u;c<l;){let p=t.charCodeAt(c),f=t.charCodeAt(c+1),m=c+1<l&&(p===13&&f===10||p>=55296&&p<=56319&&f>=56320&&f<=57343)?2:1;r.push({start:e+c,end:e+c+m,text:t.slice(c,c+m)}),c+=m}},"pushRaw");if(n.mode==="rawtext"||!t.includes("&"))return o(0,t.length),r;let i=t.indexOf("&");o(0,i);let s=i;for(;s<t.length;){let u=t.indexOf("&",s+1),l=u<0?t.length:u,c=t.slice(s,l),p=po(c,n);if(p===null)return null;let f=-1;for(let m=c.length;m>=0;m--){let d=c.slice(c.length-m);if(!p.endsWith(d))continue;let h=c.slice(0,c.length-m),S=p.slice(0,p.length-m);if(m===c.length||po(h,n)===S){f=m;break}}if(f<0)return null;let g=s+c.length-f;g>s&&r.push({start:e+s,end:e+g,text:p.slice(0,p.length-f)}),o(g,l),s=l}return r}function po(t,e){let n=e.mode==="rcdata"?e.ownerTag:"div",r=`${n}\0${t}`;if(Me.has(r))return Me.get(r);let o=null;try{let{descriptor:i}=(0,L.parse)(`<template><${n} v-pre>a${t}</${n}></template>`,{sourceMap:!1,templateParseOptions:{whitespace:"preserve",comments:!0}}),s=i.template?.ast?.children[0]?.children[0];s?.type===fo&&(o=s.content.slice(1))}catch{o=null}return Me.size>2048&&Me.clear(),Me.set(r,o),o}var da,fo,fa,ma,ga,ha,ya,Jt,Sa,va,de,ba,Ea,ao,Me,go=w(()=>{"use strict";Dt();Oe();da=1,fo=2,fa=3,ma=4,ga=5,ha=0,ya=1,Jt=2,Sa=0,va={whitespace:"preserve",comments:!0},de=new Map,ba=8,Ea=6,ao=/^[ \t\n\r\f]*$/;a(lo,"outletName");a(mo,"readVueSlotOutlet");a(wa,"parseFor");a(xa,"authoredFile");a(Ca,"buildAuthoredFile");a(ka,"elementEntry");a(Ta,"literalInterpolation");a(uo,"boundaryChild");a(co,"textChild");Me=new Map;a(Pa,"textUnits");a(po,"decodeSegment")});function Eo(t){if(!t.filepath||!t.filename||!Number.isSafeInteger(t.modifiedTs)||t.modifiedTs<0||t.sourceVersion==="")return fe("invalid_metadata","filename, filepath, a non-negative integer modifiedTs, and a non-empty sourceVersion are required");let e=pe(t.source,t.filename);if(e.kind==="invalid")return fe("invalid_source",e.message);if(e.kind==="unsupported")return fe("unsupported_template",e.message);let n=new Map;for(let d of e.targets.values()){let h=Ma(t.source,d);if(h!==null){if(h.kind==="refused")return h;n.set(d.start,h)}}let r=[...n.values()].map(d=>d.removal),o=a(d=>d-r.filter(h=>h.end<=d).reduce((h,S)=>h+S.end-S.start,0),"baseOffset"),i=t.sourceVersion??K(Da(t.source,r)),s=[],u=[],l=[],c=[],p=0;for(let d of e.targets.values()){let h=d.kind==="native-element",S=d.kind==="component"||d.kind==="dynamic-element";if(!h&&!S)continue;let y=o(d.start),E=h?xo:Co,b=d.props.filter(F=>!E(F)),x=Na(d,b,y),k=n.get(d.start);if(h){let F={filepath:t.filepath,position:y,modifiedTs:t.modifiedTs,sourceVersion:i},O=t.source.includes("<slot")?mo(t.source,t.filename,d.start):null;if(u.push({kind:"host",...x.record,...O?.kind==="plain"?{slot:O.name}:{}}),k){if(!(k.kind==="stamps"&&Fa(k.metadata,F)&&k.expressions===x.expressions))return So(d.start);c.push(y);continue}s.push({start:d.propsEnd,end:d.propsEnd,replacement:ko(F,x.expressions)}),p+=1;continue}let P=Oa(b);if(P===null)continue;let A=_a(t.source,b);if(l.push({kind:"component",...x.record,...x.locked,expressions:x.expressions,...A?{literalProps:A}:{}}),k){if(!(k.kind==="marker"&&k.position===y&&k.spelling===P))return So(d.start);c.push(y);continue}s.push({start:d.propsEnd,end:d.propsEnd,replacement:To(P,y)})}let f=new ot(t.source);for(let d of s)f.appendLeft(d.start,d.replacement);let g=f.toString(),m=pe(g,t.filename);return m.kind!=="ok"||m.targets.size!==e.targets.size?fe("invalid_output",m.kind==="ok"?"annotation changed the template's tag structure":m.message):{kind:"ok",code:g,map:f.generateMap({source:t.filename,includeContent:!0,hires:!0}),edits:s,elementsAnnotated:p,skippedExistingAnnotations:c,sourceVersion:i,registry:{filename:t.filename,filepath:t.filepath,modifiedTs:t.modifiedTs,sourceVersion:i,components:l,hosts:u,rootFallthrough:e.rootFallthrough}}}function _a(t,e){let n=e.filter(o=>!(o.kind==="attribute"&&o.name.startsWith("data-tempo-"))),r=Object.entries(no(t,n).props).filter(([,o])=>"value"in o).map(([o,i])=>[o,i.value]);return r.length>0?Object.fromEntries(r):void 0}function wo(t,e){let n=`(globalThis.${Bt} || (globalThis.${Bt} = {}))`;return`${t}
|
|
60
60
|
;typeof window !== "undefined" && (${n}[${JSON.stringify(e.filepath)}] = ${JSON.stringify(e)});
|
|
61
|
-
`}function Qi(t,e,n){let r=to(e,f=>f.kind==="bind"&&f.objectBind),o=to(e,f=>f.kind==="bind"&&f.name===null&&!f.objectBind),i=r>=0||o>=0,s=new Set;t.expressionSlot&&s.add(dt);let u=new Map,l=new Set;e.forEach((f,h)=>{if(f.kind==="directive"){f.name!=="for"&&s.add(f.rawName);return}if(f.name===null||!ea(f.name))return;if(f.kind==="bind"){if(f.name==="style"&&Array.isArray(f.styleKeys)){let b=!i&&e.filter(x=>x.kind==="bind"&&x.name==="style").length===1,w=new Map;for(let x of b?f.styleObject?.entries??[]:[])w.set(x.key,x.literal);for(let x of f.styleKeys)(w.get(x)??null)===null&&s.add(`style.${x}`);return}if(Qr(t,f.name))return;l.add(f.name),s.add(no(f.name));return}u.set(f.name,f.value);let v=h<r&&!tt.has(f.name),y=h<o;(v||y)&&s.add(no(f.name))});let c=u.get("class"),p=u.get("style"),d=t.props.find(f=>f.kind==="attribute"&&f.name==="data-tempo-locked"),m=d?.kind==="attribute"?d.value:void 0,g=[...s].join(" ");return{record:{name:t.tagName,position:n,...typeof c=="string"?{className:c}:{},...typeof p=="string"?{style:p}:{},supportsClassName:!i&&!l.has("class")&&(c===void 0||typeof c=="string"),supportsStyle:!i&&!l.has("style")&&(p===void 0||typeof p=="string")},expressions:g||i?g:void 0,locked:m===!0||m==="true"||m===""?{locked:!0}:m==="false"?{locked:!1}:{}}}function to(t,e){for(let n=t.length-1;n>=0;n--)if(e(t[n]))return n;return-1}function ea(t){return!Yi.has(t)&&!t.startsWith("data-tempo-")}function no(t){return t==="class"?"className":t}function lo(t){return t.kind!=="directive"&&t.name!==null&&qi.has(t.name)}function uo(t){return t.kind==="directive"&&oo.includes(t.rawName)&&so.test(t.expression??"")}function ta(t){let e=new Set(t.flatMap(n=>n.kind==="attribute"?[]:[n.rawName]));return oo.find(n=>!e.has(n))??null}function na(t,e){return e.kind==="native-element"?ra(t,e):e.kind==="component"||e.kind==="dynamic-element"?oa(t,e):null}function ra(t,e){let n=e.props.filter(lo);if(n.length===0)return null;let r=[...$t,...n.length>$t.length?[X]:[]],o=e.props.slice(-n.length),i=o.map(w=>w.kind==="attribute"&&typeof w.value=="string"?w.value:null);if(!(n.length===r.length&&o.every((w,x)=>w===n[x]&&w.kind==="attribute"&&w.name===r[x]&&i[x]!==null)))return Re(e.start);let[u,l,c,p,d]=i,m=Number(l),g=Number(c),f=o[0],h=o[o.length-1];if(!u||!p||!Number.isSafeInteger(m)||m<0||!Number.isSafeInteger(g)||g<0)return Re(e.start);let v={filepath:u,position:m,modifiedTs:g,sourceVersion:p},y={start:f.start-1,end:h.end,replacement:""};return t.slice(y.start,y.end)!==co(v,d)?Re(e.start):{kind:"stamps",metadata:v,expressions:d,removal:y}}function oa(t,e){let n=e.props.filter(uo);if(n.length===0)return null;let r=n[0];if(n.length>1||r!==e.props[e.props.length-1]||r.kind!=="directive")return Re(e.start);let o=Number(so.exec(r.expression??"")?.[1]),i={start:r.start-1,end:r.end,replacement:""};return t.slice(i.start,i.end)!==po(r.rawName,o)?Re(e.start):{kind:"marker",spelling:r.rawName,position:o,removal:i}}function sa(t,e){return t.filepath===e.filepath&&t.position===e.position&&t.modifiedTs===e.modifiedTs&&t.sourceVersion===e.sourceVersion}function co(t,e){return[["data-tempo-filepath",t.filepath],["data-tempo-position",String(t.position)],["data-tempo-modifiedts",String(t.modifiedTs)],["data-tempo-source-version",t.sourceVersion],...e===void 0?[]:[[X,e]]].map(([r,o])=>` ${r}="${Mt(o)}"`).join("")}function po(t,e){return` ${t}="function ${Wr}${e}(){}"`}function ia(t,e){let n="",r=0;for(let o of e)n+=t.slice(r,o.start),r=o.end;return n+t.slice(r)}function ue(t,e){return{kind:"refused",code:t,message:e}}function Re(t){return ue("annotation_conflict",`tag at UTF-16 offset ${t} has partial, dynamic, reordered, or conflicting Tempo annotations`)}function ro(t){return ue("annotation_conflict",`existing Tempo annotation at UTF-16 offset ${t} does not exactly match the recovered source identity`)}var $t,qi,oo,so,Yi,fo=E(()=>{"use strict";Oe();te();Or();Vt();rt();Xr();Zr();eo();$t=["data-tempo-filepath","data-tempo-position","data-tempo-modifiedts","data-tempo-source-version"],qi=new Set([...$t,X]),oo=["@vue:before-mount","v-on:vue:before-mount","@vue:beforeMount","v-on:vue:beforeMount"],so=/^function __tempo_c(\d+)\(\)\{\}$/,Yi=new Set(["key","ref","ref_for","ref_key"]);a(io,"annotateVueSource");a(Zi,"literalPropsOf");a(ao,"appendVueSourceRegistryRecord");a(Qi,"authoredFacts");a(to,"lastIndexWhere");a(ea,"isRenderedName");a(no,"factName");a(lo,"isStampProp");a(uo,"isMarkerProp");a(ta,"markerSpellingFor");a(na,"readExistingAnnotation");a(ra,"readExistingStamps");a(oa,"readExistingMarker");a(sa,"sameStampMetadata");a(co,"serializeStamps");a(po,"serializeMarker");a(ia,"removeRanges");a(ue,"refused");a(Re,"annotationConflict");a(ro,"identityConflict")});var sc,mo=E(()=>{sc=Promise.resolve()});function Bt(t={}){let e=(0,W.resolve)(t.root??process.cwd()),n=(0,W.resolve)(t.sourceRoot??sn(e)),r=t.enabled??!!process.env.TEMPO,o=(t.exclude??[]).map(c=>(0,W.resolve)(c)),i=qe(),s=new Map,u=new Set,l=a(c=>{if(!r||c.startsWith("\0")||!Ut.test(c))return null;let p=Ie(c,{root:e,sourceRoot:n});return!p||i(p.absoluteFilename)||aa(p.absoluteFilename,o)?null:p},"identityFor");return[{name:ho.TEMPO_VUE_ANNOTATION_PLUGIN_NAME,enforce:"pre",api:{enabled:r},transform:{order:"pre",filter:{id:Ut},handler(c,p){s.delete(p);let d=l(p);if(!d)return;let m;try{m=(0,go.readFileSync)(d.absoluteFilename,"utf8")}catch{return}let g=a((h,v)=>{let y=`${p}\0${h}`;u.has(y)||(u.add(y),this.warn(`Tempo did not annotate ${d.filepath}: ${v}`))},"warnOnce");if(c!==m){g("drift","an earlier Vite plugin changed the source; put tempoVuePlugin() first");return}let f=io({source:c,filename:p,filepath:d.filepath,modifiedTs:on(d.absoluteFilename),sourceVersion:B(m)});if(f.kind==="refused"){f.code!=="invalid_source"&&g(f.code,`${f.code}: ${f.message}`);return}if(s.set(p,f.registry),f.edits.length!==0)return{code:f.code,map:f.map}}}},{name:"tempo-vue-source-records",enforce:"post",hotUpdate:{order:"post",handler(c){if(c.type!=="update"||this.environment.config.consumer!=="client"||!l(c.file)||!s.has(c.file))return;let d=[...this.environment.moduleGraph.getModulesByFile(c.file)??[]].filter(m=>m.id===c.file||m.id?.startsWith(`${c.file}?vue&type=template`));if(d.length)return[...new Set([...c.modules,...d])]}},transform:{filter:{id:Ut},handler(c,p){let d=s.get(p);if(!d)return;let m=ao(c,d);return{code:Me(m,d.filepath,d.modifiedTs,d.sourceVersion),map:null}}}}]}function aa(t,e){return e.some(n=>{let r=(0,W.relative)(n,t);return r===""||!r.startsWith("..")&&!(0,W.isAbsolute)(r)})}var go,W,ho,Ut,yo=E(()=>{go=require("node:fs"),W=require("node:path");fo();te();ho=require("@tempo-sdk-public/host-identity");ut();ne();mo();It();Ut=/\.vue$/;a(Bt,"tempoVuePlugin");a(aa,"isUnderAny")});var _o={};zt(_o,{BOARD_PLUGIN_SOURCES_TEMPLATE:()=>Po,boardPluginSourcesModule:()=>To,default:()=>ma,nuxtDefinition:()=>ko,pinHostTransformOptions:()=>Ro,tempoHostPageMetas:()=>Jt});function L(t,e){(0,I.addVitePlugin)(t,e)}function la(t){let e=t.options.tempo??{};return{enabled:typeof e.enabled=="boolean"?e.enabled:!!process.env.TEMPO,role:e.role==="host"?"host":"app"}}async function ua(t){let e=[(0,C.resolve)(t,"package.json"),typeof fe("nuxt.ts")=="string"?fe("nuxt.ts"):void 0].filter(s=>s!==void 0),n=null;for(let s of e)try{n=(0,wo.createRequire)(s).resolve("@vitejs/plugin-react");break}catch{}if(!n)throw new Error(`tempo-sdk/nuxt: @vitejs/plugin-react is not installed in the Tempo sidecar at ${t}. Add it to that package.json's devDependencies (the Tempo project initializer writes it) and install.`);let r=await import((0,xo.pathToFileURL)(n).href),o=typeof r.default=="function"?r.default:r.default?.default,i=typeof r.preambleCode=="string"?r.preambleCode:o?.preambleCode;if(typeof o!="function"||typeof i!="string")throw new Error(`tempo-sdk/nuxt: ${n} does not look like @vitejs/plugin-react (no plugin factory or preamble); install @vitejs/plugin-react ^5.`);return{react:o,preambleCode:i}}function Ht(t){let e=t.replace(/[.*+?^${}()|[\]]/g,"\\$&").replace(/[\\/]+/g,"[\\\\/]");return new RegExp(`^${e}[\\\\/].*\\.[jt]sx$`)}function ca(t,e){try{let r=JSON.parse((0,ce.readFileSync)((0,C.resolve)(t,"tempo.config.json"),"utf8")).paths?.canvases;if(typeof r=="string"&&r.length>0)return(0,C.isAbsolute)(r)?r:(0,C.resolve)(t,r)}catch{}return(0,C.resolve)(e,"designs","canvases")}function pa(t){let e={app:(0,C.resolve)(t,"app","app.vue"),page:(0,C.resolve)(t,"app","pages","tempo-host.vue"),mount:(0,C.resolve)(t,"app","components","TempoHostMount.vue")},n=Object.values(e).filter(r=>!(0,ce.existsSync)(r));if(n.length>0)throw new Error(`tempo-sdk/nuxt: the Tempo Nuxt sidecar is missing its host files: ${n.join(", ")}. Re-run the Tempo project initialization.`);return e}function Co(t,e){return(t.options._layers??[]).find(n=>(0,C.resolve)(n.cwd)!==e)}function da(t,e){let n=Co(t,e);return n?(0,C.resolve)(n.cwd):(0,C.dirname)(e)}function So(t){return{"~~":(0,C.resolve)(t.rootDir),"@@":(0,C.resolve)(t.rootDir),"#shared":(0,C.resolve)(t.rootDir,t.dir?.shared??"shared"),"#server":(0,C.resolve)(t.rootDir,t.serverDir??"server")}}function fa(t,e){let n=So(t.options),r=So({...e.config,rootDir:e.config.rootDir??e.cwd}),o=t.options.alias;for(let[i,s]of Object.entries(r)){let u=o[i];typeof u=="string"&&(0,C.resolve)(u)===n[i]&&(o[i]=`${s.replace(/\\/g,"/")}/`)}}function ot(t){let e=(t.options.app.baseURL||"/").replace(/^\.\/?/,"/"),n=t.options.app.buildAssetsDir||"/_nuxt/",r=`${e.replace(/\/+$/,"")}/${n.replace(/^\/+/,"")}`;return r.endsWith("/")?r:`${r}/`}function ga(t){let e=(0,C.resolve)(t.options.rootDir);L(Bt({root:e,enabled:!0})),L(St());let n=t.options.app.head;n.meta??=[],n.meta.push(...Jt(e,e)),(0,I.addServerHandler)({route:Z.TEMPO_HOST_IDENTITY_ENDPOINT,handler:(0,I.createResolver)(fe("nuxt.ts")).resolve("./nuxt/runtime/identity")})}function Jt(t,e){let n=vo(t),r=[{name:"tempo-project-root",content:n},{name:"tempo-source-identity-root",content:vo(e)}],o=(0,Z.readTempoWorkspaceNonce)(n);return o&&r.push({name:Z.TEMPO_WORKSPACE_NONCE_META_NAME,content:o}),r}function vo(t){try{return ce.realpathSync.native(t)}catch{return t}}function ha(t){t.options.ignore.push(bo),t._ignore?.add(bo)}function ya(t,e){let n=t.server?.watch;if(!n)return;let r=a(i=>{let s=(0,C.resolve)(i);return s===e||s.startsWith(`${e}${C.sep}`)},"insideTempoDirectory"),o=n.ignored===void 0?[]:[n.ignored].flat();n.ignored=o.map(i=>typeof i=="function"?(s,u)=>!r(s)&&i(s,u):i)}function To(t,e){let n=t.filter(i=>i.mode!=="server"),r=n.map((i,s)=>`import plugin${s} from ${JSON.stringify(i.src)};`),o=n.map((i,s)=>` [plugin${s}, ${JSON.stringify(Sa(i.src,e))}],`);return`${r.join(`
|
|
61
|
+
`}function Na(t,e,n){let r=ho(e,d=>d.kind==="bind"&&d.objectBind),o=ho(e,d=>d.kind==="bind"&&d.name===null&&!d.objectBind),i=r>=0||o>=0,s=new Set;t.expressionSlot&&s.add(mt);let u=new Map,l=new Set;e.forEach((d,h)=>{if(d.kind==="directive"){d.name!=="for"&&s.add(d.rawName);return}if(d.name===null||!Ia(d.name))return;if(d.kind==="bind"){if(d.name==="style"&&Array.isArray(d.styleKeys)){let E=!i&&e.filter(x=>x.kind==="bind"&&x.name==="style").length===1,b=new Map;for(let x of E?d.styleObject?.entries??[]:[])b.set(x.key,x.literal);for(let x of d.styleKeys)(b.get(x)??null)===null&&s.add(`style.${x}`);return}if(so(t,d.name))return;l.add(d.name),s.add(yo(d.name));return}u.set(d.name,d.value);let S=h<r&&!st.has(d.name),y=h<o;(S||y)&&s.add(yo(d.name))});let c=u.get("class"),p=u.get("style"),f=t.props.find(d=>d.kind==="attribute"&&d.name==="data-tempo-locked"),g=f?.kind==="attribute"?f.value:void 0,m=[...s].join(" ");return{record:{name:t.tagName,position:n,...typeof c=="string"?{className:c}:{},...typeof p=="string"?{style:p}:{},supportsClassName:!i&&!l.has("class")&&(c===void 0||typeof c=="string"),supportsStyle:!i&&!l.has("style")&&(p===void 0||typeof p=="string")},expressions:m||i?m:void 0,locked:g===!0||g==="true"||g===""?{locked:!0}:g==="false"?{locked:!1}:{}}}function ho(t,e){for(let n=t.length-1;n>=0;n--)if(e(t[n]))return n;return-1}function Ia(t){return!Aa.has(t)&&!t.startsWith("data-tempo-")}function yo(t){return t==="class"?"className":t}function xo(t){return t.kind!=="directive"&&t.name!==null&&Ra.has(t.name)}function Co(t){return t.kind==="directive"&&vo.includes(t.rawName)&&bo.test(t.expression??"")}function Oa(t){let e=new Set(t.flatMap(n=>n.kind==="attribute"?[]:[n.rawName]));return vo.find(n=>!e.has(n))??null}function Ma(t,e){return e.kind==="native-element"?Va(t,e):e.kind==="component"||e.kind==="dynamic-element"?La(t,e):null}function Va(t,e){let n=e.props.filter(xo);if(n.length===0)return null;let r=[...Kt,...n.length>Kt.length?[z]:[]],o=e.props.slice(-n.length),i=o.map(b=>b.kind==="attribute"&&typeof b.value=="string"?b.value:null);if(!(n.length===r.length&&o.every((b,x)=>b===n[x]&&b.kind==="attribute"&&b.name===r[x]&&i[x]!==null)))return Ve(e.start);let[u,l,c,p,f]=i,g=Number(l),m=Number(c),d=o[0],h=o[o.length-1];if(!u||!p||!Number.isSafeInteger(g)||g<0||!Number.isSafeInteger(m)||m<0)return Ve(e.start);let S={filepath:u,position:g,modifiedTs:m,sourceVersion:p},y={start:d.start-1,end:h.end,replacement:""};return t.slice(y.start,y.end)!==ko(S,f)?Ve(e.start):{kind:"stamps",metadata:S,expressions:f,removal:y}}function La(t,e){let n=e.props.filter(Co);if(n.length===0)return null;let r=n[0];if(n.length>1||r!==e.props[e.props.length-1]||r.kind!=="directive")return Ve(e.start);let o=Number(bo.exec(r.expression??"")?.[1]),i={start:r.start-1,end:r.end,replacement:""};return t.slice(i.start,i.end)!==To(r.rawName,o)?Ve(e.start):{kind:"marker",spelling:r.rawName,position:o,removal:i}}function Fa(t,e){return t.filepath===e.filepath&&t.position===e.position&&t.modifiedTs===e.modifiedTs&&t.sourceVersion===e.sourceVersion}function ko(t,e){return[["data-tempo-filepath",t.filepath],["data-tempo-position",String(t.position)],["data-tempo-modifiedts",String(t.modifiedTs)],["data-tempo-source-version",t.sourceVersion],...e===void 0?[]:[[z,e]]].map(([r,o])=>` ${r}="${Lt(o)}"`).join("")}function To(t,e){return` ${t}="function ${Zr}${e}(){}"`}function Da(t,e){let n="",r=0;for(let o of e)n+=t.slice(r,o.start),r=o.end;return n+t.slice(r)}function fe(t,e){return{kind:"refused",code:t,message:e}}function Ve(t){return fe("annotation_conflict",`tag at UTF-16 offset ${t} has partial, dynamic, reordered, or conflicting Tempo annotations`)}function So(t){return fe("annotation_conflict",`existing Tempo annotation at UTF-16 offset ${t} does not exactly match the recovered source identity`)}var Kt,Ra,vo,bo,Aa,Po=w(()=>{"use strict";De();re();$r();Ft();Oe();Qr();oo();io();go();Kt=["data-tempo-filepath","data-tempo-position","data-tempo-modifiedts","data-tempo-source-version"],Ra=new Set([...Kt,z]),vo=["@vue:before-mount","v-on:vue:before-mount","@vue:beforeMount","v-on:vue:beforeMount"],bo=/^function __tempo_c(\d+)\(\)\{\}$/,Aa=new Set(["key","ref","ref_for","ref_key"]);a(Eo,"annotateVueSource");a(_a,"literalPropsOf");a(wo,"appendVueSourceRegistryRecord");a(Na,"authoredFacts");a(ho,"lastIndexWhere");a(Ia,"isRenderedName");a(yo,"factName");a(xo,"isStampProp");a(Co,"isMarkerProp");a(Oa,"markerSpellingFor");a(Ma,"readExistingAnnotation");a(Va,"readExistingStamps");a(La,"readExistingMarker");a(Fa,"sameStampMetadata");a(ko,"serializeStamps");a(To,"serializeMarker");a(Da,"removeRanges");a(fe,"refused");a(Ve,"annotationConflict");a(So,"identityConflict")});var Kc,Ro=w(()=>{Kc=Promise.resolve()});function Xt(t={}){let e=(0,G.resolve)(t.root??process.cwd()),n=(0,G.resolve)(t.sourceRoot??pn(e)),r=t.enabled??!!process.env.TEMPO,o=(t.exclude??[]).map(c=>(0,G.resolve)(c)),i=tt(),s=new Map,u=new Set,l=a(c=>{if(!r||c.startsWith("\0")||!Wt.test(c))return null;let p=Le(c,{root:e,sourceRoot:n});return!p||i(p.absoluteFilename)||ja(p.absoluteFilename,o)?null:p},"identityFor");return[{name:_o.TEMPO_VUE_ANNOTATION_PLUGIN_NAME,enforce:"pre",api:{enabled:r},transform:{order:"pre",filter:{id:Wt},handler(c,p){s.delete(p);let f=l(p);if(!f)return;let g;try{g=(0,Ao.readFileSync)(f.absoluteFilename,"utf8")}catch{return}let m=a((h,S)=>{let y=`${p}\0${h}`;u.has(y)||(u.add(y),this.warn(`Tempo did not annotate ${f.filepath}: ${S}`))},"warnOnce");if(c!==g){m("drift","an earlier Vite plugin changed the source; put tempoVuePlugin() first");return}let d=Eo({source:c,filename:p,filepath:f.filepath,modifiedTs:cn(f.absoluteFilename),sourceVersion:K(g)});if(d.kind==="refused"){d.code!=="invalid_source"&&m(d.code,`${d.code}: ${d.message}`);return}if(s.set(p,d.registry),d.edits.length!==0)return{code:d.code,map:d.map}}}},{name:"tempo-vue-source-records",enforce:"post",hotUpdate:{order:"post",handler(c){if(c.type!=="update"||this.environment.config.consumer!=="client"||!l(c.file)||!s.has(c.file))return;let f=[...this.environment.moduleGraph.getModulesByFile(c.file)??[]].filter(g=>g.id===c.file||g.id?.startsWith(`${c.file}?vue&type=template`));if(f.length)return[...new Set([...c.modules,...f])]}},transform:{filter:{id:Wt},handler(c,p){let f=s.get(p);if(!f)return;let g=wo(c,f);return{code:je(g,f.filepath,f.modifiedTs,f.sourceVersion),map:null}}}}]}function ja(t,e){return e.some(n=>{let r=(0,G.relative)(n,t);return r===""||!r.startsWith("..")&&!(0,G.isAbsolute)(r)})}var Ao,G,_o,Wt,No=w(()=>{Ao=require("node:fs"),G=require("node:path");Po();re();_o=require("@tempo-sdk-public/host-identity");pt();oe();Ro();Ot();Wt=/\.vue$/;a(Xt,"tempoVuePlugin");a(ja,"isUnderAny")});var Ho={};Qt(Ho,{BOARD_PLUGIN_SOURCES_TEMPLATE:()=>$o,boardPluginSourcesModule:()=>Uo,default:()=>Wa,nuxtDefinition:()=>jo,pinHostTransformOptions:()=>Bo,tempoHostPageMetas:()=>zt});function $(t,e){(0,I.addVitePlugin)(t,e)}function $a(t){let e=t.options.tempo??{};return{enabled:typeof e.enabled=="boolean"?e.enabled:!!process.env.TEMPO,role:e.role==="host"?"host":"app"}}async function Ua(t){let e=[(0,C.resolve)(t,"package.json"),typeof ye("nuxt.ts")=="string"?ye("nuxt.ts"):void 0].filter(s=>s!==void 0),n=null;for(let s of e)try{n=(0,Lo.createRequire)(s).resolve("@vitejs/plugin-react");break}catch{}if(!n)throw new Error(`tempo-sdk/nuxt: @vitejs/plugin-react is not installed in the Tempo sidecar at ${t}. Add it to that package.json's devDependencies (the Tempo project initializer writes it) and install.`);let r=await import((0,Fo.pathToFileURL)(n).href),o=typeof r.default=="function"?r.default:r.default?.default,i=typeof r.preambleCode=="string"?r.preambleCode:o?.preambleCode;if(typeof o!="function"||typeof i!="string")throw new Error(`tempo-sdk/nuxt: ${n} does not look like @vitejs/plugin-react (no plugin factory or preamble); install @vitejs/plugin-react ^5.`);return{react:o,preambleCode:i}}function Gt(t){let e=t.replace(/[.*+?^${}()|[\]]/g,"\\$&").replace(/[\\/]+/g,"[\\\\/]");return new RegExp(`^${e}[\\\\/].*\\.[jt]sx$`)}function Ba(t,e){try{let r=JSON.parse((0,me.readFileSync)((0,C.resolve)(t,"tempo.config.json"),"utf8")).paths?.canvases;if(typeof r=="string"&&r.length>0)return(0,C.isAbsolute)(r)?r:(0,C.resolve)(t,r)}catch{}return(0,C.resolve)(e,"designs","canvases")}function Ha(t){let e={app:(0,C.resolve)(t,"app","app.vue"),page:(0,C.resolve)(t,"app","pages","tempo-host.vue"),mount:(0,C.resolve)(t,"app","components","TempoHostMount.vue")},n=Object.values(e).filter(r=>!(0,me.existsSync)(r));if(n.length>0)throw new Error(`tempo-sdk/nuxt: the Tempo Nuxt sidecar is missing its host files: ${n.join(", ")}. Re-run the Tempo project initialization.`);return e}function Do(t,e){return(t.options._layers??[]).find(n=>(0,C.resolve)(n.cwd)!==e)}function Ja(t,e){let n=Do(t,e);return n?(0,C.resolve)(n.cwd):(0,C.dirname)(e)}function Io(t){return{"~~":(0,C.resolve)(t.rootDir),"@@":(0,C.resolve)(t.rootDir),"#shared":(0,C.resolve)(t.rootDir,t.dir?.shared??"shared"),"#server":(0,C.resolve)(t.rootDir,t.serverDir??"server")}}function Ka(t,e){let n=Io(t.options),r=Io({...e.config,rootDir:e.config.rootDir??e.cwd}),o=t.options.alias;for(let[i,s]of Object.entries(r)){let u=o[i];typeof u=="string"&&(0,C.resolve)(u)===n[i]&&(o[i]=`${s.replace(/\\/g,"/")}/`)}}function it(t){let e=(t.options.app.baseURL||"/").replace(/^\.\/?/,"/"),n=t.options.app.buildAssetsDir||"/_nuxt/",r=`${e.replace(/\/+$/,"")}/${n.replace(/^\/+/,"")}`;return r.endsWith("/")?r:`${r}/`}function Xa(t){let e=(0,C.resolve)(t.options.rootDir);$(Xt({root:e,enabled:!0})),$(bt());let n=t.options.app.head;n.meta??=[],n.meta.push(...zt(e,e)),(0,I.addServerHandler)({route:ee.TEMPO_HOST_IDENTITY_ENDPOINT,handler:(0,I.createResolver)(ye("nuxt.ts")).resolve("./nuxt/runtime/identity")})}function zt(t,e){let n=Oo(t),r=[{name:"tempo-project-root",content:n},{name:"tempo-source-identity-root",content:Oo(e)}],o=(0,ee.readTempoWorkspaceNonce)(n);return o&&r.push({name:ee.TEMPO_WORKSPACE_NONCE_META_NAME,content:o}),r}function Oo(t){try{return me.realpathSync.native(t)}catch{return t}}function Ga(t){t.options.ignore.push(Mo),t._ignore?.add(Mo)}function za(t,e){let n=t.server?.watch;if(!n)return;let r=a(i=>{let s=(0,C.resolve)(i);return s===e||s.startsWith(`${e}${C.sep}`)},"insideTempoDirectory"),o=n.ignored===void 0?[]:[n.ignored].flat();n.ignored=o.map(i=>typeof i=="function"?(s,u)=>!r(s)&&i(s,u):i)}function Uo(t,e){let n=t.filter(i=>i.mode!=="server"),r=n.map((i,s)=>`import plugin${s} from ${JSON.stringify(i.src)};`),o=n.map((i,s)=>` [plugin${s}, ${JSON.stringify(qa(i.src,e))}],`);return`${r.join(`
|
|
62
62
|
`)}
|
|
63
63
|
export default new Map([
|
|
64
64
|
${o.join(`
|
|
65
65
|
`)}
|
|
66
66
|
]);
|
|
67
|
-
`}function
|
|
67
|
+
`}function qa(t,e){let n=t.replace(/\\/g,"/"),r=n.split("/node_modules/").at(-1)??n;if(r!==n)return r;let o=(0,C.relative)(e,t).replace(/\\/g,"/");return o.startsWith("../")?n:o}function Vo(t){return[...t===void 0?[]:[t].flat(),Za]}function Bo(t){if(t.plugins=(t.plugins??[]).flat(Number.POSITIVE_INFINITY).filter(n=>!nl(n,"vite:vue-jsx")),t.esbuild&&typeof t.esbuild=="object"){t.esbuild={...t.esbuild,include:Vo(t.esbuild.include),jsx:"automatic",jsxImportSource:"react",jsxFactory:void 0,jsxFragment:void 0};return}if(t.oxc===!1)return;let e=t.oxc&&typeof t.oxc=="object"?t.oxc:null;t.oxc={...e,include:Vo(e?.include),...e?{jsx:{runtime:"automatic",importSource:"react"}}:{}}}function Qa(t){let e=null;return{name:"tempo-canvas-host-registration",apply:"serve",configureServer(n){e=n,On(n),n.middlewares.use((r,o,i)=>{Vn(n,r,o)||i()})},transform(){return e&&Mn(e),null},hotUpdate:{order:"pre",handler(n){if(this.environment.config.consumer==="client"){if(Nn(n.file,t.wrapperPath))return[];if(n.type==="update")return In(n.file,t,this.environment.moduleGraph,n.modules)}}}}}function el(){return{name:"tempo-nuxt-sdk-singleton",enforce:"pre",async resolveId(t,e,n){if(t!=="tempo-sdk"&&!t.startsWith("tempo-sdk/"))return null;let r=await this.resolve(t,e,{...n,skipSelf:!0});return r?{...r,id:r.id.replace(/\?v=[\w.-]+$/,"")}:null}}}function tl(t){let e=tt(),n=a(o=>{let i=Le(o,t);return!i||e(i.absoluteFilename)?null:i.filepath},"ownFilepath"),r=_r({stampedFilepath:a(o=>t.files.some(i=>i.test(o))?n(o):null,"stampedFilepath"),transformsControls:a(o=>/\.[jt]sx?$/.test(o)&&n(o)!==null,"transformsControls")});return{name:"tempo-canvas-jsx-annotation",enforce:"pre",async transform(o,i){return i.startsWith("\0")?null:r.annotateJsxModule(this,o,W(i))},hotUpdate:{order:"post",async handler(o){if(this.environment.config.consumer==="client"){if(o.type==="delete"){r.forgetDefaultExportIdentity(o.file);return}if(o.type==="update"&&await r.defaultExportIdentityRewritten(o))return o.server.ws.send({type:"full-reload",path:"*"}),[]}}}}}function nl(t,e){return typeof t=="object"&&t!==null&&t.name===e}var me,Lo,C,Fo,I,ee,jo,Wa,Mo,$o,Ya,Za,Jo=w(()=>{ln();un();me=require("node:fs"),Lo=require("node:module"),C=require("node:path"),Fo=require("node:url"),I=require("nuxt/kit");pt();oe();Ln();Jn();ee=require("@tempo-sdk-public/host-identity");be();Nr();Ot();Je();No();a($,"addSidecarVitePlugin");a($a,"configuredOptions");a(Ua,"loadReactPlugin");a(Gt,"jsxFilesUnder");a(Ba,"resolveCanvasesDirectory");a(Ha,"resolveHostFiles");a(Do,"findAppLayer");a(Ja,"resolveProjectRoot");a(Io,"rootDirAliasTargets");a(Ka,"pointRootDirAliasesAtApp");a(it,"viteBase");jo={meta:{name:"tempo",configKey:"tempo"},async setup(t,e){let{enabled:n,role:r}=$a(e);if(!n)return;if(Ga(e),r==="app"){Xa(e);return}let o=(0,C.resolve)(e.options.rootDir),i=Ja(e,o),s=Do(e,o);s&&Ka(e,s);let u=Ha(o),l=Ba(o,i),c=[Gt((0,C.resolve)(o,".tempo")),/\.canvas\.[jt]sx$/,Gt(l)],{react:p,preambleCode:f}=await Ua(o),g=e.options.vite;e.options.pages=!0,g.root=o,e.hook("app:resolve",E=>{E.mainComponent=u.app}),e.hook("pages:extend",E=>{E.unshift({name:"tempo-host",path:"/tempo-host",file:u.page,meta:{layout:!1}})}),(0,I.addComponent)({name:"TempoHostMount",filePath:u.mount}),g.optimizeDeps??={};let m=g.optimizeDeps;m.exclude=[...m.exclude??[],"tempo-sdk"],$(el()),m.include=[...m.include??[],"react","react-dom","react-dom/client","react/jsx-runtime","react/jsx-dev-runtime"],g.resolve??={};let d=g.resolve;d.dedupe=[...d.dedupe??[],"react","react-dom","vue"],g.server??={};let h=g.server;h.fs??={};let S=h.fs;S.allow=[...S.allow??[],i],h.hmr!==!1&&(h.hmr={...typeof h.hmr=="object"?h.hmr:{},overlay:!0}),$(Xt({root:o,sourceRoot:i,enabled:!0,exclude:[o]})),$(tl({root:o,sourceRoot:i,files:[/\.canvas\.[jt]sx$/,Gt(l)]})),$(bt()),$(p({include:c,jsxImportSource:"react"}));let y=e.options.app.head;e.options.dev&&(y.script??=[],$({name:"tempo:browser-runtime",apply:"serve",configureServer(E){E.middlewares.use(an(it(e)))}},{server:!1}),y.script.unshift({src:ct(it(e)),tagPosition:"head"},{type:"module",innerHTML:f.replace("__BASE__",it(e)),tagPosition:"head"},{type:"module",src:`${it(e)}${Be.replace(/^\//,"")}`,tagPosition:"head"})),y.meta??=[],y.meta.push(...zt(o,i)),$(Hn(),{server:!1}),e.hook("vite:configResolved",E=>{Bo(E),za(E,(0,C.resolve)(o,".tempo"))}),e.options.ssr===!1&&e.hook("app:resolve",E=>{E.plugins=E.plugins.filter(b=>!Ya.test(b.src))}),(0,I.addTemplate)({filename:$o,dependsOn:["plugins"],getContents:a(({app:E})=>Uo(E.plugins,i),"getContents")}),e.hook("app:resolve",E=>{E.middleware=E.middleware.filter(b=>!b.global)}),(0,I.addServerHandler)({route:ee.TEMPO_HOST_IDENTITY_ENDPOINT,handler:(0,I.createResolver)(ye("nuxt.ts")).resolve("./nuxt/runtime/identity")}),$(Qa({wrapperPath:(0,C.resolve)(o,".tempo","tempo-host.tsx"),sourceRoot:i}),{server:!1})}},Wa=(0,I.defineNuxtModule)(jo);a(Xa,"annotateAppRoutes");a(zt,"tempoHostPageMetas");a(Oo,"canonicalPath");Mo=".tempo/";a(Ga,"ignoreTempoRuntimeDirectories");a(za,"watchTempoHostDirectory");$o="tempo-board-plugin-sources.mjs";a(Uo,"boardPluginSourcesModule");a(qa,"displayPluginSource");Ya=/[\\/]plugins[\\/]revive-payload\.client(?:\.[cm]?[jt]s)?$/,Za=/\.(m?ts|[jt]sx)$/;a(Vo,"withDefaultTransformInclude");a(Bo,"pinHostTransformOptions");a(Qa,"canvasHostRegistrationPlugin");a(el,"sdkSingletonPlugin");a(tl,"canvasJsxAnnotationPlugin");a(nl,"isPluginNamed")});var ol={};Qt(ol,{getEntry:()=>rl});module.exports=nn(ol);var qt={};function rl(t){if(qt[t])return qt[t];if(t==="nuxt")return qt[t]=(Jo(),nn(Ho));throw new Error("Unknown Tempo runtime entry: "+t)}a(rl,"getEntry");0&&(module.exports={getEntry});
|
|
68
68
|
|
|
69
69
|
return module.exports;};
|