@arcgis/lumina-compiler 4.33.0-next.55 → 4.33.0-next.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ ${e.content}`}:e,Gs=(e,t)=>{t._htmlElementReferencesReplacer??={regex:new RegExp
7
7
  `)){let i=t===`
8
8
  `,o=e.lastIndexOf(`
9
9
  `),a=e.slice(o+1).trim().length===0,p=i?e.trimStart():e;return a?p.trimEnd():p}return e.trim().length===0?t:e}var ge=e=>kr(Fr(e)),Nr=e=>!Ia.test(e),Ia=/^[^\s"'=<>`]+$/u,Na=/[&<>]/gu,La={"&":"&amp;","<":"&lt;",">":"&gt;"},at=e=>e.replace(Na,t=>La[t]);import J from"typescript";import{path as on,toSystemPathSeparators as qa,retrievePackageJson as Ga}from"@arcgis/components-build-utils";import{isNotUndefined as $a}from"@arcgis/components-utils";import{readdir as Ra}from"node:fs/promises";import{path as He}from"@arcgis/components-build-utils";var Lr=async e=>Object.fromEntries((await e.componentFilesPromise).map(t=>[Zt(t),t])),Zt=(e,t=He.resolve("src"))=>He.relative(t,He.join(e,"..",Ee.slice(0,-3))),we=async(e,t,n=t)=>await Ra(n,{recursive:!0}).catch(r=>{if(String(r).includes("ENOENT"))return console.error(`@arcgis/lumina: Unable to find the ${n} directory (cwd: ${process.cwd()})`),[];throw r}).then(r=>{let i=r.map(o=>{if(!o.endsWith(".tsx"))return;let s=He.join(n,o);return se(s,t)?s:void 0}).filter($a);return e.componentFiles=i,i});function se(e,t){if(!e.startsWith(t)||!e.endsWith(".tsx"))return!1;let[n,r]=e.slice(0,-4).split(He.sep).slice(Ma);return n===r}var Ma=-2;import Ja from"typescript";var $r=5,Rr=1,Mr=1,Jr=3,jr=4,pt=Ja;ja(pt.createSourceMapGenerator);Oa(pt.createTextWriter);Ba(pt.getNewLineCharacter);var he=pt;function ja(e){if(typeof e!="function")throw new Error("Failed to find ts.createSourceMapGenerator() function. Lumina needs to be updated to support the new TypeScript version");if(e.length!==$r)throw new Error(`ts.createSourceMapGenerator() signature changed. Expected ${$r} arguments. Lumina needs to be updated to support the new TypeScript version`)}function Oa(e){if(typeof e!="function")throw new Error("Failed to find ts.createTextWriter() function. Lumina needs to be updated to support the new TypeScript version");if(e.length!==Rr)throw new Error(`ts.createTextWriter() signature changed. Expected ${Rr} arguments. Lumina needs to be updated to support the new TypeScript version`)}function Ba(e){if(typeof e!="function")throw new Error("Failed to find ts.getNewLineCharacter() function. Lumina needs to be updated to support the new TypeScript version");if(e.length!==Mr)throw new Error(`ts.getNewLineCharacter() signature changed. Expected ${Mr} argument. Lumina needs to be updated to support the new TypeScript version`)}function Wa(e){if(typeof e!="function")throw new Error("Failed to find ts.Printer.writeFile() function. Lumina needs to be updated to support the new TypeScript version");if(e.length!==Jr)throw new Error(`ts.Printer.writeFile() signature changed. Expected ${Jr} arguments. Lumina needs to be updated to support the new TypeScript version`)}function Ha(e){if(typeof e!="function")throw new Error("Failed to find ts.Printer.writeNode() function. Lumina needs to be updated to support the new TypeScript version");if(e.length!==jr)throw new Error(`ts.Printer.writeNode() signature changed. Expected ${jr} arguments. Lumina needs to be updated to support the new TypeScript version`)}function lt(e){let t=he.createPrinter(e);return Wa(t.writeFile),Ha(t.writeNode),t}import{globalPackageIdentifier as Xa}from"@arcgis/api-extractor";import{mappedFind as Qa}from"@arcgis/components-utils";import Ka from"typescript";function tn(e){let t=Ka.isUnionTypeNode(e)?e.types.map(en):[en(e)],n=new Set(t),r=n.delete("true"),i=n.delete("false");(r||i)&&n.add("boolean");let o=Array.from(n).sort();if(o.length>1&&(o=o.map(s=>s.includes("=>")?`(${s})`:s)),!(o.length>_a))return o.map(Ua)}var _a=40,Or=e=>e?.some(t=>t.type==="number"||t.type==="boolean"||t.type==="string"||t.type==="any")??!1,Br=e=>e.length===1&&e[0].type!=="string"&&e[0].type!=="number"&&e[0].type!=="boolean"&&e[0].type!=="any"?void 0:e,ct=e=>e.map(nn).join(" | "),nn=e=>e.type==="string"&&e.value!==void 0?`"${e.value}"`:e.value??e.type;function Ua(e){return e==="boolean"?{type:"boolean"}:Number.isNaN(Number.parseFloat(e))?e.startsWith('"')||e.startsWith("'")?{value:e.slice(1,-1),type:"string"}:{type:e}:{value:e,type:"number"}}import Va from"typescript";var Wr=(e,t,n,r)=>{let i=e.typeScriptTypeChecker,o=Va.isSetAccessor(t)?t.parameters[0]:t,s=i.getTypeAtLocation(o),a=!n;return Ce(i,s,r,e.dir,a)};function Hr(e,t){if(e.length===0)return;let n=t.matchAll(za),r=[];for(let i of n){let o=e.find(s=>s.name===i[0]);o!==void 0&&r.push({...o,start:i.index,end:i.index+o.name.length})}return r.length===0?void 0:r}var za=/"[^"]+"|'[^"]+'|\w+/gu;function Ce(e,t,n,r,i=!1){let{typeNode:o,references:s}=_r(e,t,n,r),a=tn(o);a===void 0&&({typeNode:o,references:s}=_r(e,t,n,r,!1),a=tn(o)??[]);let p=i?a.filter(m=>m.type!=="null"&&m.type!=="undefined"):a,l=ct(p),c=Br(p),d=Hr(s,l);return{text:l,references:d,values:c}}function en(e){Ya.writeNode(J.EmitHint.Unspecified,e,void 0,rn);let t=rn.getText();return rn.clear(),t}var Ya=lt({removeComments:!0}),rn=he.createTextWriter(`
10
- `),sn=J.TypeFormatFlags.NoTruncation|J.TypeFormatFlags.WriteArrayAsGenericType|J.TypeFormatFlags.SuppressAnyReturnType|J.TypeFormatFlags.MultilineObjectLiterals,Za=sn&J.TypeFormatFlags.NodeBuilderFlagsMask,ep=Za|J.NodeBuilderFlags.IgnoreErrors|J.NodeBuilderFlags.NoTruncation;function tp(e,t,n,r=!0){let i=new Map;Pe(t,i,n,r);let o=t.flags&J.TypeFlags.Union?t.types.every(Kr):Kr(t),s=e.typeToTypeNode(t,void 0,ep&(o?~J.TypeFormatFlags.MultilineObjectLiterals:-1));return i.forEach(np),s===void 0?(console.error("Failed to convert type to type node."),J.factory.createTypeReferenceNode(J.factory.createIdentifier("unknown"),void 0)):s}var Kr=e=>e.flags&J.TypeFlags.Object?e.getProperties().length===1:!!(e.flags&J.TypeFlags.PossiblyFalsy);function _r(e,t,n,r,i=!0){let o=[],s=new Set;function a(l,c){let d=l.aliasSymbol??l.symbol;if(d===void 0)return;let m=c?l.aliasTypeArguments?.[0]?.symbol?.escapedName??"":d.name;if(m.startsWith("_")){let f=d.declarations?.[0];if(f?.kind===J.SyntaxKind.FunctionType){let h=f;if(h.parameters.forEach(y=>{if(y.type===void 0)return;let T=e.getTypeFromTypeNode(y.type);Pe(T,new Map,a,!1)}),h.type!==void 0){let y=e.getTypeFromTypeNode(h.type);Pe(y,new Map,a,!1)}}return}if(s.has(m))return;let u=c?{name:m,package:void 0,module:"index.js"}:rp(d,m,n,r);o.push(u),s.add(m)}return{typeNode:tp(e,t,a,i),references:o}}function Pe(e,t,n,r=!0){if(typeof e!="object"||e===null||!("checker"in e))return;let i=e;if(t.has(i))return;let o=(i.flags&J.TypeFlags.Object)!==0&&(i.aliasTypeArguments?.[0]?.objectFlags??0&J.ObjectFlags.Class)!==0&&i.aliasSymbol?.escapedName==="ToElement";n?.(i,o);let s=i.origin;if(o||!r)t.set(i,{origin:void 0,aliasSymbol:void 0,aliasTypeArguments:void 0}),Pe(s,t,n,r);else{let a=i.aliasSymbol,p=i.aliasTypeArguments;s!==void 0&&(i.origin=void 0),a!==void 0&&(i.aliasSymbol=void 0),p!==void 0&&(i.aliasTypeArguments=void 0),t.set(i,{origin:s,aliasSymbol:a,aliasTypeArguments:p})}Object.entries(i).forEach(([a,p])=>{(a.includes("type")||a.includes("Type")||a==="constraint")&&a!=="resolvedBaseConstructorType"&&a!=="resolvedBaseTypes"&&a!=="typeParameters"&&a!=="typeParameter"&&(Array.isArray(p)?p.forEach(l=>Pe(l,t,n,r)):Pe(p,t,n,r))})}function np(e,t){e.origin!==void 0&&(t.origin=e.origin),e.aliasSymbol!==void 0&&(t.aliasSymbol=e.aliasSymbol),e.aliasTypeArguments!==void 0&&(t.aliasTypeArguments=e.aliasTypeArguments)}function rp(e,t,n,r){let i=e?.declarations?.map(a=>a.getSourceFile())??[];if(i.length===0){if(t==="Array")return{name:"Array",package:"typescript",module:"lib/lib.es5.d.ts"};console.error(`@arcgis/lumina: Unable to resolve the declaration file name for type ${t} in ${qa(n.fileName)}`)}if(i.length===0)return{name:t,package:Xa,module:void 0};let{packageName:o,moduleName:s}=ip(i[0].fileName,r);return o?{name:t,package:o,module:s.length>0?s:void 0,viewUrl:o==="@arcgis/core"&&s==="interfaces.d.ts"?ap(e,i[0]):void 0}:{name:t,package:void 0,module:s}}function ip(e,t){let n=e.split("/node_modules/");if(n.length>1){let s=n.at(-1);return an(s)}let i=e.split("/dist/");if(i.length>1){let s=i.slice(0,-1).join("/"),p=Ga(s).name,l=i.at(-1);return{packageName:p,moduleName:l}}return{packageName:void 0,moduleName:on.relative(t.root,sp(op(e,t)))}}function op(e,t){return se(e,t.srcComponents)?on.join(t.dist,Zt(e,t.src)):e.startsWith(t.src)?on.join(t.dist,e.slice(t.src.length)):e}var sp=e=>e.endsWith(".js")||e.endsWith(".d.ts")?e:`${e.endsWith(".ts")?e.slice(0,-3):e.endsWith(".tsx")?e.slice(0,-4):e}.d.ts`;function an(e){let t=e.split("/"),r=e[0].startsWith("@")?2:1,i=t.slice(0,r).join("/"),o=t.slice(r).join("/");return{packageName:i,moduleName:o}}var Vr=e=>e.includes("/node_modules/")||e.includes("/dist/");function ap(e,t){let n=e.declarations;if(n!==void 0)for(let r of n){let i=Ur(r,t);if(i!==void 0)return i;if(!("members"in r))continue;let o=r.members;for(let s of o){let a=Ur(s,t);if(a!==void 0)return a}}}function Ur(e,t){let n=e.jsDoc?.[0]?.comment;if(Array.isArray(n))return Qa(n,r=>{if(!J.isJSDocLinkLike(r))return;let i=r.getText(t);if(i.endsWith("Read more...}"))return i.split(" ")[1]})}import{getCwd as qr,path as Gr,toSystemPathSeparators as pn}from"@arcgis/components-build-utils";function zr(e){let t=[];for(let n of e.matchAll(pp)){let r=n.groups.name,i=n.groups.description.replaceAll(lp," ").trim();t.push({name:r,description:i.endsWith("*")?i.slice(0,-1).trim():i})}return t.length===0?void 0:t}var pp=/@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu,lp=/\n\s+\*? ?/gu;var cp=["css","less","sass","scss","styl","stylus","pcss","postcss","sss"],Ae=new RegExp(`\\.(${cp.join("|")})(\\?|$)`,"u"),dp=/^import ["'](?<specifier>[^"']+)["'];$/gmu,mp=()=>"throwError",Xr="@arcgis/lumina:loadLitCss",K="?layered",Ke="?global",Qr=e=>({name:Xr,enforce:"pre",configResolved(t){let n=t.plugins.find(({name:i})=>i==="vite:css-post");if(n===void 0)throw new Error("Unable to find the vite's built-in vite:css-post plugin");let r=n.transform;if(typeof r!="function")throw new Error("Expected vite:css-post to declare a transform() function");n.transform=async function(o,s){let a=s.endsWith(K);a&&(s=s.slice(0,-K.length));let p=s.endsWith(Ke);if(p&&(s=s.slice(0,-Ke.length)),!Ae.test(s)||s.includes("?"))return await r.call(this,o,s);let l=`${s}?inline`,c=await r.call(this,o,l),{code:d,...m}=typeof c=="string"?{code:c}:c??{};if(typeof d!="string"||!d.startsWith(Yr)||!d.endsWith(Zr))return console.warn(`${Xr} Expected vite:css-post to return a JS module with a string literal for ${pn(s)}.`),console.log(c),c;if(p)return e._globalCssString=ei(d),{code:"",map:{mappings:""}};{let u=e.isFullApiExtraction?zr(o):void 0;if(u!==void 0){e._cssDocs??=new Map,e._cssDocs.set(s,u);let f=e._cssImports.get(s);if(f!==void 0){for(let h of e.apiJsonComponents)if(f.has(h.tagName))if(h.cssProperties===void 0)h.cssProperties=Array.from(u);else{let y=new Set(h.cssProperties.map(T=>T.name));h.cssProperties=[...h.cssProperties,...u.filter(T=>!y.has(T.name))]}}}return{...m,code:gp(d,e.hmrEnabled,e.shouldMinify,a),map:{mappings:""}}}}},transform(t,n){if(!(n.endsWith(".js")||n.endsWith(".ts")||n.endsWith(".tsx")||e.isInStorybook&&n.endsWith(".mdx")))return;let i=0,o=Vr(n),s=!1,a=t.replaceAll(dp,(p,l)=>{if(!Ae.test(l)||l.includes("?"))return p;if(o){if((e.options.css?.sideEffectImportHandling??mp)(l,n)==="drop")return s=!0,Cr(p);{let m=pn(Gr.relative(qr(),n));throw new Error(`Found a side-effect CSS import \`${p}\` in "${m}". Such import is not allowed as it won't work with shadow DOM. This file appears to be external so such import may not be under your control. To ignore this import, please set the css.sideEffectImportHandling property in useLumina() plugin to a function that will return "drop" for this import to indicate that you wish to have this style import dropped. Then, you would have to import the dropped manually in your component like so: \`import { styles } from "example.css";\` and then add \`static override styles = styles;\` to your component`)}}else if(e.isInStorybook&&Cp(n,e)){s=!0;let c=`storybookCss$${i}`;return i+=1,["import ",c," from ",p.slice(6),`
10
+ `),sn=J.TypeFormatFlags.NoTruncation|J.TypeFormatFlags.WriteArrayAsGenericType|J.TypeFormatFlags.SuppressAnyReturnType|J.TypeFormatFlags.MultilineObjectLiterals,Za=sn&J.TypeFormatFlags.NodeBuilderFlagsMask,ep=Za|J.NodeBuilderFlags.IgnoreErrors|J.NodeBuilderFlags.NoTruncation;function tp(e,t,n,r=!0){let i=new Map;Pe(t,i,n,r);let o=t.flags&J.TypeFlags.Union?t.types.every(Kr):Kr(t),s=e.typeToTypeNode(t,void 0,ep&(o?~J.TypeFormatFlags.MultilineObjectLiterals:-1));return i.forEach(np),s===void 0?(console.error("Failed to convert type to type node."),J.factory.createTypeReferenceNode(J.factory.createIdentifier("unknown"),void 0)):s}var Kr=e=>e.flags&J.TypeFlags.Object?e.getProperties().length===1:!!(e.flags&J.TypeFlags.PossiblyFalsy);function _r(e,t,n,r,i=!0){let o=[],s=new Set;function a(l,c){let d=l.aliasSymbol??l.symbol;if(d===void 0)return;let m=c?l.aliasTypeArguments?.[0]?.symbol?.escapedName??"":d.name;if(m.startsWith("_")){let f=d.declarations?.[0];if(f?.kind===J.SyntaxKind.FunctionType){let h=f;if(h.parameters.forEach(y=>{if(y.type===void 0)return;let T=e.getTypeFromTypeNode(y.type);Pe(T,new Map,a,!1)}),h.type!==void 0){let y=e.getTypeFromTypeNode(h.type);Pe(y,new Map,a,!1)}}return}if(s.has(m))return;let u=c?{name:m,package:void 0,module:"index.js"}:rp(d,m,n,r);o.push(u),s.add(m)}return{typeNode:tp(e,t,a,i),references:o}}function Pe(e,t,n,r=!0){if(typeof e!="object"||e===null||!("checker"in e))return;let i=e;if(t.has(i))return;let o=(i.flags&J.TypeFlags.Object)!==0&&(i.aliasTypeArguments?.[0]?.objectFlags??0&J.ObjectFlags.Class)!==0&&i.aliasSymbol?.escapedName==="ToElement";n?.(i,o);let s=i.origin;if(o||!r)t.set(i,{origin:void 0,aliasSymbol:void 0,aliasTypeArguments:void 0}),Pe(s,t,n,r);else{let a=i.aliasSymbol,p=i.aliasTypeArguments;s!==void 0&&(i.origin=void 0),a!==void 0&&(i.aliasSymbol=void 0),p!==void 0&&(i.aliasTypeArguments=void 0),t.set(i,{origin:s,aliasSymbol:a,aliasTypeArguments:p})}Object.entries(i).forEach(([a,p])=>{(a.includes("type")||a.includes("Type")||a==="constraint")&&a!=="resolvedBaseConstructorType"&&a!=="resolvedBaseTypes"&&a!=="typeParameters"&&a!=="typeParameter"&&(Array.isArray(p)?p.forEach(l=>Pe(l,t,n,r)):Pe(p,t,n,r))})}function np(e,t){e.origin!==void 0&&(t.origin=e.origin),e.aliasSymbol!==void 0&&(t.aliasSymbol=e.aliasSymbol),e.aliasTypeArguments!==void 0&&(t.aliasTypeArguments=e.aliasTypeArguments)}function rp(e,t,n,r){let i=e?.declarations?.map(a=>a.getSourceFile())??[];if(i.length===0){if(t==="Array")return{name:"Array",package:"typescript",module:"lib/lib.es5.d.ts"};console.error(`@arcgis/lumina: Unable to resolve the declaration file name for type ${t} in ${qa(n.fileName)}`)}if(i.length===0)return{name:t,package:Xa,module:void 0};let{packageName:o,moduleName:s}=ip(i[0].fileName,r);return o?{name:t,package:o,module:s.length>0?s:void 0,viewUrl:o==="@arcgis/core"&&s==="interfaces.d.ts"?ap(e,i[0]):void 0}:{name:t,package:void 0,module:s}}function ip(e,t){let n=e.split("/node_modules/");if(n.length>1){let s=n.at(-1);return an(s)}let i=e.split("/dist/");if(i.length>1){let s=i.slice(0,-1).join("/"),p=Ga(s).name,l=i.at(-1);return{packageName:p,moduleName:l}}return{packageName:void 0,moduleName:on.relative(t.root,sp(op(e,t)))}}function op(e,t){return se(e,t.srcComponents)?on.join(t.dist,Zt(e,t.src)):e.startsWith(t.src)?on.join(t.dist,e.slice(t.src.length)):e}var sp=e=>e.endsWith(".js")||e.endsWith(".d.ts")?e:`${e.endsWith(".ts")?e.slice(0,-3):e.endsWith(".tsx")?e.slice(0,-4):e}.d.ts`;function an(e){let t=e.split("/"),r=e[0].startsWith("@")?2:1,i=t.slice(0,r).join("/"),o=t.slice(r).join("/");return{packageName:i,moduleName:o}}var Vr=e=>e.includes("/node_modules/")||e.includes("/dist/");function ap(e,t){let n=e.declarations;if(n!==void 0)for(let r of n){let i=Ur(r,t,!0);if(i!==void 0)return i;if(!("members"in r))continue;let o=r.members;for(let s of o){let a=Ur(s,t,!1);if(a!==void 0)return a}}}function Ur(e,t,n){let r=e.jsDoc?.[0]?.comment;if(Array.isArray(r))return Qa(r,i=>{if(!J.isJSDocLinkLike(i))return;let o=i.getText(t);if(!o.endsWith("Read more...}"))return;let s=o.split(" ")[1];return n?s:s?.split("#")[0]})}import{getCwd as qr,path as Gr,toSystemPathSeparators as pn}from"@arcgis/components-build-utils";function zr(e){let t=[];for(let n of e.matchAll(pp)){let r=n.groups.name,i=n.groups.description.replaceAll(lp," ").trim();t.push({name:r,description:i.endsWith("*")?i.slice(0,-1).trim():i})}return t.length===0?void 0:t}var pp=/@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu,lp=/\n\s+\*? ?/gu;var cp=["css","less","sass","scss","styl","stylus","pcss","postcss","sss"],Ae=new RegExp(`\\.(${cp.join("|")})(\\?|$)`,"u"),dp=/^import ["'](?<specifier>[^"']+)["'];$/gmu,mp=()=>"throwError",Xr="@arcgis/lumina:loadLitCss",K="?layered",Ke="?global",Qr=e=>({name:Xr,enforce:"pre",configResolved(t){let n=t.plugins.find(({name:i})=>i==="vite:css-post");if(n===void 0)throw new Error("Unable to find the vite's built-in vite:css-post plugin");let r=n.transform;if(typeof r!="function")throw new Error("Expected vite:css-post to declare a transform() function");n.transform=async function(o,s){let a=s.endsWith(K);a&&(s=s.slice(0,-K.length));let p=s.endsWith(Ke);if(p&&(s=s.slice(0,-Ke.length)),!Ae.test(s)||s.includes("?"))return await r.call(this,o,s);let l=`${s}?inline`,c=await r.call(this,o,l),{code:d,...m}=typeof c=="string"?{code:c}:c??{};if(typeof d!="string"||!d.startsWith(Yr)||!d.endsWith(Zr))return console.warn(`${Xr} Expected vite:css-post to return a JS module with a string literal for ${pn(s)}.`),console.log(c),c;if(p)return e._globalCssString=ei(d),{code:"",map:{mappings:""}};{let u=e.isFullApiExtraction?zr(o):void 0;if(u!==void 0){e._cssDocs??=new Map,e._cssDocs.set(s,u);let f=e._cssImports.get(s);if(f!==void 0){for(let h of e.apiJsonComponents)if(f.has(h.tagName))if(h.cssProperties===void 0)h.cssProperties=Array.from(u);else{let y=new Set(h.cssProperties.map(T=>T.name));h.cssProperties=[...h.cssProperties,...u.filter(T=>!y.has(T.name))]}}}return{...m,code:gp(d,e.hmrEnabled,e.shouldMinify,a),map:{mappings:""}}}}},transform(t,n){if(!(n.endsWith(".js")||n.endsWith(".ts")||n.endsWith(".tsx")||e.isInStorybook&&n.endsWith(".mdx")))return;let i=0,o=Vr(n),s=!1,a=t.replaceAll(dp,(p,l)=>{if(!Ae.test(l)||l.includes("?"))return p;if(o){if((e.options.css?.sideEffectImportHandling??mp)(l,n)==="drop")return s=!0,Cr(p);{let m=pn(Gr.relative(qr(),n));throw new Error(`Found a side-effect CSS import \`${p}\` in "${m}". Such import is not allowed as it won't work with shadow DOM. This file appears to be external so such import may not be under your control. To ignore this import, please set the css.sideEffectImportHandling property in useLumina() plugin to a function that will return "drop" for this import to indicate that you wish to have this style import dropped. Then, you would have to import the dropped manually in your component like so: \`import { styles } from "example.css";\` and then add \`static override styles = styles;\` to your component`)}}else if(e.isInStorybook&&Cp(n,e)){s=!0;let c=`storybookCss$${i}`;return i+=1,["import ",c," from ",p.slice(6),`
11
11
  `,"document.adoptedStyleSheets = [...document.adoptedStyleSheets, ",c,".styleSheet];"].join("")}else{if(l.endsWith(Ke))return p;{let c=pn(Gr.relative(qr(),n));throw new Error(`Found a side-effect CSS import \`${p}\` in "${c}". Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "example.css";\` instead and then add \`static override styles = styles;\` to your component`)}}});return s?{code:a,map:null}:void 0}}),Yr='export default "',Zr='"',up="import { css } from '@lit/reactive-element/css-tag.js';\nexport const styles = css`",fp="`;\nexport default styles;",yp=`
12
12
 
13
13
  if(import.meta.hot) {
@@ -1,5 +1,5 @@
1
1
  import"../chunk-JFKSI6I7.js";import{render as Q}from"lit-html";import{html as X,unsafeStatic as R}from"lit-html/static.js";import{camelToKebab as Le}from"@arcgis/components-utils";import{onTestFinished as xe}from"vitest";async function De(e,{parent:t=document.body,afterConnect:n,dynamicComponents:o,cleanupAfterTest:s=!0}={}){let r=document.createElement("div");r.style.display="contents",t.append(r),s&&xe(()=>Oe(r)),Z(e);let a=o?.some(Z),i;if(typeof e=="string")i=X`<${R(e)}></${R(e)}>`;else if(typeof e=="function")i="tagName"in e?X`<${R(e.tagName)}></${R(e.tagName)}>`:e();else{if(a)throw new Error('When rendering a dynamically created custom element using Lit\'s html`` function, you must ensure that the custom element class name is unique in the test file, or the class should explicitly have the `static override tagName = "some-tag-name";` property with a unique tag name within the test file');i=e}let l=[];function d(h){l.push(h.error),h.preventDefault(),h.stopPropagation()}if(window.addEventListener("error",d),Q(i,r),window.removeEventListener("error",d),l.length===1)throw l[0];if(l.length>1)throw new AggregateError(l,"Multiple errors occurred while creating the custom element");let c=ee(r),p=V,k=n?.(c);k?.then!==void 0&&await k;let _=c;typeof _?.componentOnReady=="function"&&await _.componentOnReady();let g=_?._litElement??p??c;return{el:c,component:g,async reRender(){return typeof e=="function"&&!("tagName"in e)&&Q(e(),t),g.requestUpdate(),await g.updateComplete}}}var V,ke=globalThis;ke.devOnly$luminaComponentRefCallback=e=>{V=e};function Oe(e){for(;e.firstChild;)e.removeChild(e.firstChild);e instanceof HTMLElement&&e.remove()}function Z(e){if(!Te(e)||e.runtime!==void 0)return!1;let t=!1,n=e.tagName;if(!n){t=!1;let o=Le((e.name.length>1?e.name.replaceAll(Ne,""):"")||"Test"),s=o==="test"?"te-st":o.includes("-")?o:`${o}-`;n=s;for(let r=2,a=customElements.get(n);a!==e&&a!==void 0;r+=1)t=!0,n=`${s}-${r}`,a=customElements.get(n)}return globalThis.devOnly$luminaRuntime?.customElement(n,e),Object.defineProperty(e.prototype,"tagName",{value:n.toUpperCase()}),t}var Te=e=>typeof e=="function"&&"lumina"in e,Ne=/\d+$/gu;function ee(e){for(let t of e.children)if("lumina"in t.constructor)return t;for(let t of e.children){let n=ee(t);if(n!=null)return n}return e.firstElementChild??V?.el}import Ue from"vitest-fail-on-console";import{expect as Pe}from"vitest";import Re from"js-beautify";function te(){Pe.addSnapshotSerializer({test(e){return typeof e=="object"&&e!==null&&"innerHTML"in e&&"onslotchange"in e},serialize(e){let t=e.innerHTML.replaceAll(Se,"");return Re.html(t,{indent_size:2,indent_char:" ",preserve_newlines:!1,wrap_line_length:70,indent_inner_html:!1,indent_empty_lines:!1})}})}var Se=/<!--\??(?:lit\$\d+\$)?-->/gu;function $e(){if(ne[oe])return;ne[oe]=!0;let e={...console};Ue({silenceMessage(t,n){return e[n](t),!1}}),te()}var oe=Symbol.for("lumina:didSetupTest"),ne=globalThis;import{isEsriInternalEnv as Me,isNotUndefined as je}from"@arcgis/components-utils";function re(e,t){if(t){let n=e.constructor.elementProperties;e.manager.internals.members=Object.fromEntries(Array.from(n,([o,s])=>s.noAccessor?void 0:[o,[(s.readOnly?2048:0)|(s.state?32:16)]]).filter(je))}else{let n=e.constructor,o=n.__registerControllers?.(e)??void 0;if(n.__registerControllers=void 0,typeof o!="object")throw new Error(process.env.NODE_ENV!=="production"&&Me()?"Failed to retrieve internal component meta. Make sure you have the useComponentsControllers() Rollup Plugin for Stencil Controllers configured in your Stencil config.":"Failed to retrieve component meta");e.manager.internals.members=Object.fromEntries(Object.entries(o).filter(([s,[r]])=>(r&63)!==0))}}function se(e,t=8){return e==null||typeof e=="object"||typeof e=="function"?e:(t&4)!==0?e==="false"?!1:e===""||!!e:(t&2)!==0?Number.parseFloat(e):(t&1)!==0?String(e):e}var W=(e,t)=>e.manager.internals.members?.[t]?.[0];import{isEsriInternalEnv as de}from"@arcgis/components-utils";import{isEsriInternalEnv as U}from"@arcgis/components-utils";import{Deferred as He,isEsriInternalEnv as P,safeAsyncCall as ie,safeCall as u}from"@arcgis/components-utils";import{safeCall as qe}from"@arcgis/components-utils";import{isEsriInternalEnv as Je,safeCall as Be}from"@arcgis/components-utils";import{safeCall as Ke}from"@arcgis/components-utils";import{isEsriInternalEnv as ze}from"@arcgis/components-utils";import{isEsriInternalEnv as St}from"@arcgis/components-utils";var $=Symbol.for("controller"),F="@arcgis/components-controllers",pe=e=>typeof e=="object"&&e!==null&&($ in e||"hostConnected"in e||"hostDisconnected"in e||"hostUpdate"in e||"hostUpdated"in e),he=process.env.NODE_ENV!=="production"&&de()?(e,t)=>{let n=e.component.manager,o="_controllers"in n?n._controllers:void 0;if(o===void 0)return;let s=Array.from(o).indexOf(e);if(s===-1)return;let r=Symbol.for(`${F}: devOnlyControllerData`),a=e.component.el;a[r]??(a[r]={}),a[r][s]=t}:void 0,xt=process.env.NODE_ENV!=="production"&&de()?e=>{let t=e.component.manager,n="_controllers"in t?t._controllers:void 0;if(n===void 0)return;let o=Array.from(n).indexOf(e),s=Symbol.for(`${F}: devOnlyControllerData`);return e.component.el[s]?.[o]}:void 0,L;function E(e){L!==e&&(L=e,queueMicrotask(()=>{L===e&&(L=void 0)}))}function M(e){if(process.env.NODE_ENV!=="production"&&L===void 0)throw new Error([`Unable to find out which component ${e||"this"} controller `,`belongs to. Possible causes:
2
- `,"- You might also have multiple versions of ",`@arcgis/components-controllers package installed
2
+ `,"- You might have multiple versions of ",`@arcgis/components-controllers package installed
3
3
  `,...U()?["- You tried to create controller outside the component. If so, ","please wrap your controller definition in an arrow function (like","`const myController = ()=>makeController(...);`) and call that","function inside the component (`my = myController();`), or ","define your controller using makeGenericController/GenericController ",`instead.
4
4
  `,"- You tried to create a controller inside an async function. ","This is allowed without calling controller.use(). Make sure you ","use it like `await controller.use(useController())`."]:[]].join(""));return L}var v=[];function j(e){if(e===void 0){v=[];return}let t=v.indexOf(e);v=t===-1?[...v,e]:v.slice(0,t+1),queueMicrotask(()=>{v=[]})}function I(){return v}var x;function Ie(e){x!==e&&(x=e,queueMicrotask(()=>{x===e&&(x=void 0)}))}function Ae(){let e=x;return x=void 0,e}var Ve=async(e,t)=>{let n=q(e);if(n===void 0){if(process.env.NODE_ENV!=="production"&&U()&&typeof t=="function")throw new Error("Unable to resolve a controller from the provided value, so can't watch it's exports. The value you passed is not a controller and not a controller exports. If your controller exports a literal value, try making your controller export an object instead");return e}if(await n.ready,typeof t=="function"){if(process.env.NODE_ENV!=="production"&&U()&&n.watchExports===void 0)throw new Error("The controller must implement watchExports method to support watching exports");let o=n.watchExports(s=>t(s,o))}return n.exports},We=async e=>{let t=q(e);if(process.env.NODE_ENV!=="production"&&U()&&t===void 0)throw new Error("Unable to resolve a controller from the provided value. The value you passed is not a controller and not a controller exports. If your controller exports a literal value, try making your controller export an object instead");return await t.ready,t},q=e=>{let n=M().manager.internals.resolveExports(e);if(n!==void 0)return n;if(pe(e))return e;let o=Ae();if(o!==void 0)return o},T={setter:!1,getter:!1,readOnly:!1},N=new WeakMap,ue;ue=$;var J=class{constructor(e){this._callbacks={hostConnected:[],hostDisconnected:[],hostLoad:[],hostLoaded:[],hostUpdate:[],hostUpdated:[],hostDestroy:[],hostLifecycle:[]},this._ready=new He,this._lifecycleCleanups=[],this.connectedCalled=!1,this._loadCalled=!1,this.loadedCalled=!1,this[ue]=!0,this.ready=this._ready.promise,this._exports=le(this),this._exportWatchers=new Set;let t=Fe(e??M(new.target.name));process.env.NODE_ENV!=="production"?(Object.defineProperty(this,"component",{writable:!1,enumerable:!1,configurable:!0,value:t}),"hostDestroy"in this&&this.component.manager.ensureHasDestroy?.()):this.component=t,this.component.addController(this),this.component.manager===void 0||(j(this),queueMicrotask(()=>this.catchUpLifecycle()))}catchUpLifecycle(){let{manager:e}=this.component;e.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),e._loadCalled&&this.triggerLoad().then(()=>{e.loadedCalled&&this.triggerLoaded()}).catch(console.error)}get exports(){return this._exports}set exports(e){let t=this._exports;t!==e&&(this._exports=e,this._exportWatchers.forEach(u),this.connectedCalled&&this.assignedProperty!==!1&&this.component.requestUpdate(this.assignedProperty,t)),this._ready.resolve(e)}setProvisionalExports(e,t=!0){this._exports=t?le(e):e,this._exportWatchers.forEach(u)}watchExports(e){let t=()=>e(this._exports);return this._exportWatchers.add(t),()=>void this._exportWatchers.delete(t)}get use(){return E(this.component),Ve}get useRef(){return E(this.component),We}get useRefSync(){return E(this.component),q}controllerRemoved(){this.component.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(e){this._callbacks.hostConnected.push(e)}onDisconnected(e){this._callbacks.hostDisconnected.push(e)}onLoad(e){this._callbacks.hostLoad.push(e)}onLoaded(e){this._callbacks.hostLoaded.push(e)}onUpdate(e){this._callbacks.hostUpdate.push(e)}onUpdated(e){this._callbacks.hostUpdated.push(e)}onDestroy(e){process.env.NODE_ENV!=="production"&&P()&&this.component.manager.ensureHasDestroy?.(),this._callbacks.hostDestroy.push(e)}onLifecycle(e){this._callbacks.hostLifecycle.push(e),this.connectedCalled&&this.component.el.isConnected&&this._callLifecycle(e)}triggerConnected(){let e=this;e.hostConnected&&u(e.hostConnected,e),this._callbacks.hostConnected.forEach(u),this.triggerLifecycle(),this.connectedCalled=!0}triggerDisconnected(){let e=this;e.hostDisconnected&&u(e.hostDisconnected,e),this._callbacks.hostDisconnected.forEach(u),this._lifecycleCleanups.forEach(u),this._lifecycleCleanups=[]}async triggerLoad(){if(this._loadCalled)return;this._loadCalled=!0;let e=this;e.hostLoad&&await ie(e.hostLoad,e),this._callbacks.hostLoad.length>0&&await Promise.allSettled(this._callbacks.hostLoad.map(ie)),this._ready.resolve(this._exports)}triggerLoaded(){if(this.loadedCalled)return;let e=this;e.hostLoaded&&u(e.hostLoaded,e),this._callbacks.hostLoaded.forEach(u),this.loadedCalled=!0}triggerUpdate(e){let t=this;t.hostUpdate&&u(t.hostUpdate,t,e),this._callbacks.hostUpdate.forEach(ae,e)}triggerUpdated(e){let t=this;t.hostUpdated&&u(t.hostUpdated,t,e),this._callbacks.hostUpdated.forEach(ae,e)}triggerDestroy(){let e=this;e.hostDestroy&&u(e.hostDestroy,e),this._callbacks.hostDestroy.forEach(u)}triggerLifecycle(){let e=this;e.hostLifecycle&&this._callLifecycle(()=>e.hostLifecycle()),this._callbacks.hostLifecycle.forEach(this._callLifecycle,this)}_callLifecycle(e){E(this.component);let t=u(e);(Array.isArray(t)?t:[t]).forEach(o=>{typeof o=="function"?this._lifecycleCleanups.push(o):typeof o=="object"&&typeof o.remove=="function"&&this._lifecycleCleanups.push(o.remove)})}};function ae(e){u(e,void 0,this)}var me=J;function le(e){if(typeof e!="object"&&typeof e!="function"||e===null)return e;let t=new Proxy(e,{get(n,o,s){if(!(Ge.has(o)&&o in n&&n[o]===t)){if(o in n||o in Promise.prototype||typeof o=="symbol")return typeof n=="function"?n[o]:Reflect.get(n,o,s);if(process.env.NODE_ENV!=="production"&&P()){if(process.env.NODE_ENV==="test"&&(o.startsWith("$$")||o.startsWith("@@")||o==="nodeType"||o==="tagName"||o==="toJSON"||o==="hasAttribute"))return;console.error(`Trying to access "${o.toString()}" on the controller before it's loaded. ${ce}`)}}},set:(n,o,s,r)=>(process.env.NODE_ENV!=="production"&&P()&&console.error(`Trying to set "${o.toString()}" on the controller before it's loaded. ${ce}`),Reflect.set(n,o,s,r))});return t}var Ge=new Set(["exports","_exports"]),ce=process.env.NODE_ENV!=="production"&&P()?["This might be the case if you are trying to access an async controller in ","connectedCallback(). Or, if you are using it inside of ","componentWillLoad()/another controller without controller.use. Example correct ",`usage:
5
5
  `,"makeController(async (component, controller)=>{ await controller.use(someOtherController); });"].join(""):void 0;function Fe(e){if(process.env.NODE_ENV!=="production"&&P()){if("addController"in e)return e;throw new Error("Component does not implement ControllerHost. This might be because you forgot to add 'manager: Controller<this> = useControllerManager(this);' in your component, or you tried to use some controller before that line")}else return e}function fe(e,t,n){let o=Object.keys(e),s=o.length;C===void 0&&queueMicrotask(B),C??(C=new Map);let r=C.get(e);return r===void 0&&(r={callbacks:[],keyCount:s},C.set(e,r)),r.keyCount!==s&&(r.callbacks.forEach(a=>a(o)),r.callbacks=[],r.keyCount=s),r.callbacks.push(a=>{let i=d=>qe(t,null,d),l=a[s];l===void 0?i(void 0):e[l]===n?i(l):i(void 0)}),n}var C=void 0;function B(){Array.from(C?.entries()??[]).forEach(([e,{callbacks:t}])=>{let n=Object.keys(e);t.forEach(o=>o(n))}),C=void 0}function K(e,t,n){var o;let s=t;if(process.env.NODE_ENV!=="production"&&Je()&&W(e,s)===void 0)throw new Error(e.manager.isLit?`Trying to watch a non-@property, non-@state property "${s}". Either convert it into a @state() to be able to use watch() on it, or use the get/set syntax`:`Trying to watch a non-@Prop, non-@State property "${s}". Convert it into a @State() or @Prop property if you need to use watch() on it`);let r=e.manager.internals;(o=r.allWatchers)[s]??(o[s]=[]);let a=r.allWatchers[s],i=n,l=(d,c,p)=>Be(i,null,d,c,p);return a.push(l),()=>{let d=a.indexOf(l);d!==-1&&a.splice(d,1)}}var ye=class{constructor(e){this.enabledWatchers={},this.allWatchers={},this.enableReadonly=()=>{if(this.enableReadonly=void 0,!this.component.manager.isLit)return;let t=this.component.manager.internals;Object.entries(t.members).forEach(([n,[o]])=>{var s;o&2048&&((s=t.setters)[n]??(s[n]=[]),t.setters[n].push(t.readonlySetter))})},this.trackedValue=G,this.keyTrackers=[],this.getters={},this.setters={},this.accessorGetter={},this.accessorSetter={},this._exports=new WeakMap,this.readonlySetter=(t,n,o)=>{if(T.readOnly)return t;throw new Error(`Cannot assign to read-only property "${o}" of ${this.component.el.tagName.toLowerCase()}. Trying to assign "${String(t)}"`)},process.env.NODE_ENV!=="production"?Object.defineProperty(this,"component",{writable:!1,enumerable:!1,configurable:!0,value:e}):this.component=e}firePropTrackers(e,t){let n=this.keyTrackers;this.trackedValue=G,this.keyTrackers=[],n.forEach(o=>o(e,t))}getSetProxy(e){let t=this.component,n=t.constructor.prototype;if(this._getSetProxy(n,e,"class"),t.manager.isLit)return;let o=t.el.constructor.prototype;n!==o&&this._getSetProxy(o,e,"html")}_getSetProxy(e,t,n){let o=this.component,s=W(o,t),r;do r=Object.getOwnPropertyDescriptor(e,t);while(!r&&(e=Object.getPrototypeOf(e)));if(process.env.NODE_ENV!=="production"&&ze()){let g=n==="html";if(r?.set===void 0||r.get===void 0){if(r!==void 0&&"value"in r)throw new Error(`getSet() should only be used on @Prop/@property/@State/@state properties. For internal component properties, use regular get/set syntax. Tried to use it on "${t}" in ${o.el.tagName}`);if(g)return;throw new Error(`Unable to find "${t}" property on the ${o.el.tagName} component`)}if(s===void 0)throw new Error("Unable to retrieve prop type")}else if(!r)return;let a=r.get,i=r.set,l=S in a,d=S in i;if(l&&d)return;let c=!l,p=!d,k=c?function(){let h=a.call(this),f=N.get(this);if(T.getter||f===void 0)return h;let w=f.manager.internals;h=w.accessorGetter[t](h,t);let m=w.getters[t]??H;for(let y=0;y<m.length;y++)h=m[y](h,t);return h}:a,_=p?function(h){let f=a.call(this),w=N.get(this);if(w===void 0){i.call(this,h);return}let m=w.manager.isLit?h??void 0:se(h,s),y=w.manager.internals;if(m===f)i.call(this,m);else{let Y=T.setter?H:y.setters[t]??H;for(let O=0;O<Y.length&&(m=Y[O](m,f,t),m!==f);O++);m=y.accessorSetter[t](m,f,t),i.call(this,m),m!==f&&y.enabledWatchers[t]?.forEach(O=>O(m,f,t))}y.keyTrackers.length>0&&y?.firePropTrackers(t,h)}:i;c&&(k[S]=!0),p&&(_[S]=!0),Object.defineProperty(e,t,{...r,get:k,set:_})}markExports(e,t){(typeof t=="object"&&t!==null||typeof t=="function")&&this._exports.set(t,e)}resolveExports(e){if(typeof e=="object"&&e!==null||typeof e=="function")return this._exports.get(e)}},H=[],S=Symbol(),G=process.env.NODE_ENV!=="production"?Symbol.for(`${F}: nothing`):Symbol();function ge(e,t,n){let o=e.manager.internals;return o.trackedValue!==G&&o.trackedValue!==n&&o.firePropTrackers(void 0,void 0),o.keyTrackers.length===0&&queueMicrotask(()=>o.firePropTrackers(void 0,void 0)),o.trackedValue=n,o.keyTrackers.push((s,r)=>Ke(t,void 0,n===r?s:void 0)),n}function ve(e=[M(),...I()],t,n){let o=Array.isArray(e)?e:[e],s=o.length+1,r=i=>{s-=1,i!==void 0&&(s=Math.min(s,0)),s===0&&t(i)};o.forEach(i=>fe(i,l=>r(l===void 0?void 0:{key:l,host:i,isReactive:!1}),n));let a=o.find(i=>"manager"in i&&typeof i.manager=="object"&&i.manager.component===i);return a&&ge(a,i=>r(i===void 0?void 0:{key:i,host:a,isReactive:!0}),n),n}function Ce(e){T.readOnly=!0;try{return e()}finally{T.readOnly=!1}}var Ee=e=>(...t)=>{let n=I(),o=new e(...t),s=o.exports;j(n.at(-1));let r=o.component.manager.internals;r.markExports(o,s),o.watchExports(i=>r.markExports(o,i)),Ie(o);let a=[o.component,...n].reverse();return ve(a,i=>i===void 0?void 0:Ye(o,i,s),s)};function Ye(e,{host:t,key:n,isReactive:o},s){let r=t,a=r[n]!==e.exports,i=r[n]!==s,l=s!==e.exports;if(a&&!i&&l&&(r[n]=e.exports),t===e.component){if(o){let c=e.component.manager.internals;i&&c.markExports(e,r[n]),K(e.component,n,p=>{p!==e.exports&&c.markExports(e,p)})}e.assignedProperty=o?void 0:n}e.watchExports(()=>{if(r[n]===e.exports)return;let c=e.component.manager;c.internals.setters[n]?.includes(c.internals.readonlySetter)?Ce(()=>{r[n]=e.exports}):r[n]=e.exports})}import{Deferred as be,isEsriInternalEnv as b,safeAsyncCall as Qe,safeCall as D}from"@arcgis/components-utils";import{devToolsAwareTimeout as Xe}from"@arcgis/components-utils";import{getElementAttribute as zt,isEsriInternalEnv as Yt,observeAncestorsMutation as Qt}from"@arcgis/components-utils";import{getElementLocales as Zt,startLocaleObserver as eo}from"@arcgis/components-utils";import{isEsriInternalEnv as oo}from"@arcgis/components-utils";var Ze=class extends me{constructor(e,t){let n="addController"in e;process.env.NODE_ENV!=="production"&&b()&&!n&&Object.defineProperty(e.el,"__component",{value:e});let o=new Set;function s(l){o.add(l),!($ in l)&&e.renderRoot&&e.el.isConnected&&l.hostConnected?.()}function r(l){o.delete(l),l.controllerRemoved?.()}let a=e;if(a.addController=s,a.removeController=r,!n){let l=t??e.constructor.__forceUpdate;a.requestUpdate=()=>l(e)}if(process.env.NODE_ENV!=="production"&&b()&&(Object.entries({componentDidLoad:"loaded",componentDidRender:"updated",componentDidUpdate:"updated",componentShouldUpdate:"shouldUpdate",componentWillLoad:"load",componentWillRender:"willUpdate",componentWillUpdate:"willUpdate"}).forEach(([d,c])=>{if(n&&d in e)throw new Error(`Unexpected ${d}() in a Lit component ${e.el.tagName.toLowerCase()}. In Lit, you should use ${c}() instead`);if(!n&&c in e)throw new Error(`Unexpected ${c}() in a Stencil component ${e.el.tagName.toLowerCase()}. In Stencil, you should use ${c}() instead`)}),n)){let d=0,c=!1;for(let p=e;!c;d++){if(p===null)throw new Error("Expected controllers to be used in a LitElement class");if(Object.hasOwn(p,"_load")){c=!0;break}p=Object.getPrototypeOf(p)}if(d<1)throw new Error("It looks like you are trying to call useControllerManager in a component that uses LitElement imported from 'lit'. useControllerManager should only be used in the LitElement coming from `@arcgis/lumina`")}super(e),this.internals=new ye(this.component),this.destroyed=!1,this._updatePromise=new be,this._originalLifecycles={},this.isLit=n,this.component.manager=this,re(e,n),this._controllers=o,this.exports=void 0,this.hasDestroy=A in this.component&&typeof this.component.destroy=="function",this._bindLifecycleMethods();let i=this.internals;Object.keys(i.members).forEach(l=>{i.accessorGetter[l]=_e,i.accessorSetter[l]=_e,i.getSetProxy(l)}),n?this.internals.enabledWatchers=this.internals.allWatchers:Object.defineProperty(e,"updateComplete",{get:async()=>await this._updatePromise.promise}),queueMicrotask(i.enableReadonly),E(e),N.set(e.el,e),N.set(e,e)}_bindLifecycleMethods(){let e=this.component,t=this.isLit,n=e.el===e;this._originalLifecycles={_connectedCallback:t||n?void 0:e.connectedCallback,_disconnectedCallback:t||n?void 0:e.disconnectedCallback,_load:t?e.load:e.componentWillLoad,_loaded:t?e.loaded:e.componentDidLoad,_willUpdate:t?void 0:e.componentWillUpdate,_updated:t?void 0:e.componentDidUpdate,_destroy:e.destroy};let o=this._connectedCallback.bind(this),s=this._disconnectedCallback.bind(this),r=this._update.bind(this),a=this._updated.bind(this);t?e.constructor.prototype.addController.call(e,{hostConnected:o,hostDisconnected:s,hostUpdate:r,hostUpdated:a}):(e.connectedCallback=o,e.disconnectedCallback=s,e.componentWillLoad=this._load.bind(this),e.componentDidLoad=this._loaded.bind(this),e.componentWillUpdate=r,e.componentDidUpdate=a),this.hasDestroy&&(e.destroy=this.destroy.bind(this))}_connectedCallback(){if(this.destroyed){let t=this.component.el.tagName.toLowerCase();throw this.component.el.remove(),new Error(`The ${t} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${A} prop.`)}this._autoDestroyTimeout!==void 0&&clearTimeout(this._autoDestroyTimeout);let e=this.internals;e.enabledWatchers=e.allWatchers,B(),e.enableReadonly?.(),this._controllers.forEach(et),this._originalLifecycles._connectedCallback?.call(this.component),process.env.NODE_ENV!=="production"&&b()&&he?.(this,!0)}_disconnectedCallback(){this.destroyed||(this._controllers.forEach(tt),this._originalLifecycles._disconnectedCallback?.call(this.component),this.hasDestroy&&this._setAutoDestroyTimeout())}async _load(){await Promise.allSettled(Array.from(this._controllers,ot)),await this._originalLifecycles._load?.call(this.component),this.hasDestroy&&K(this.component,A,()=>this._setAutoDestroyTimeout())}_loaded(){this._controllers.forEach(nt),this._originalLifecycles._loaded?.call(this.component)}_update(){let e=this.component;return this._controllers.forEach(rt,e.$changes),this._originalLifecycles._willUpdate?.call(this.component)}_updated(){let e=this.component;if(this._controllers.forEach(st,e.$changes),this._originalLifecycles._updated?.call(this.component),this.isLit)e.$changes=new Map;else{let t=this._updatePromise;this._updatePromise=new be,t.resolve(!0)}}async destroy(){if(process.env.NODE_ENV!=="production"&&b()&&this.ensureHasDestroy?.(),!this.destroyed){if(this.component.el.isConnected){this.hasDestroy=!1;try{this.component.el.remove()}finally{this.hasDestroy=!0}}this._autoDestroyTimeout=void 0,this.destroyed=!0,this._controllers.forEach(it),this._controllers.clear(),await this._originalLifecycles._destroy?.call(this.component)}}_setAutoDestroyTimeout(){if(this._autoDestroyTimeout!==void 0&&clearTimeout(this._autoDestroyTimeout),!this.component.el.isConnected&&!this.component.autoDestroyDisabled){let e=()=>void this.destroy().catch(console.error);process.env.NODE_ENV!=="production"&&b()&&z===0?queueMicrotask(e):this._autoDestroyTimeout=Xe(e,z)}}};process.env.NODE_ENV!=="production"&&b()&&(Ze.prototype.ensureHasDestroy=function(){if(!this.hasDestroy)throw new Error(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina-compiler",
3
- "version": "4.33.0-next.55",
3
+ "version": "4.33.0-next.57",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -18,9 +18,9 @@
18
18
  ],
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
- "@arcgis/api-extractor": "4.33.0-next.55",
22
- "@arcgis/components-build-utils": "4.33.0-next.55",
23
- "@arcgis/components-utils": "4.33.0-next.55",
21
+ "@arcgis/api-extractor": "4.33.0-next.57",
22
+ "@arcgis/components-build-utils": "4.33.0-next.57",
23
+ "@arcgis/components-utils": "4.33.0-next.57",
24
24
  "chalk": "^5.3.0",
25
25
  "esbuild": "^0.24.0",
26
26
  "js-beautify": "^1.15.1",
@@ -36,6 +36,6 @@
36
36
  "vitest-fail-on-console": "^0.7.1"
37
37
  },
38
38
  "peerDependencies": {
39
- "@arcgis/lumina": "~4.33.0-next.55"
39
+ "@arcgis/lumina": "~4.33.0-next.57"
40
40
  }
41
41
  }