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C,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;KACnE;IACD,MAAM,OAAO,GACZ,MAAM,CAAC,OAAO;QACd,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,WAAW,CAAC,CAAC;IACvF,OAAO,OAAO,CAAC,CAAC,CAAC,CAChB,aAAK,GAAG,EAAC,mBAAmB,EAAC,OAAO,EAAE,GAAG,CAAC,SAAS;QAClD,IAAC,OAAO,CAAC,MAAM,OAAG,CACb,CACN,CAAC,CAAC,CAAC,IAAI,CAAC;AACV,CAAC,CAAC,CAAC","sourcesContent":["import { create, tsx } from '@dojo/framework/core/vdom';\nimport theme from '@dojo/framework/core/middleware/theme';\nimport resize from '@dojo/framework/core/middleware/resize';\nimport * as css from './ExampleSandbox.m.css';\n\nconst factory = create({ theme, resize }).properties<{\n\tthemeName: string;\n\tconfig: any;\n\twidgetName: string;\n\texampleName: string;\n}>();\n\nexport default factory(function Example({ properties, middleware: { theme, resize } }) {\n\tconst { themeName, config, widgetName, exampleName } = properties();\n\tlet newTheme = config.themes[0].theme;\n\tconst currentTheme = theme.get();\n\tconfig.themes.forEach((theme: any, i: number) => {\n\t\tif (theme.label === themeName) {\n\t\t\tnewTheme = config.themes[i].theme;\n\t\t}\n\t});\n\tif (currentTheme && currentTheme.theme !== newTheme) {\n\t\ttheme.set(newTheme);\n\t}\n\tconst { height } = resize.get('example-container') || { height: 0 };\n\tif (height) {\n\t\tparent.postMessage(JSON.stringify({ height: `${height}px` }), '*');\n\t}\n\tconst example =\n\t\tconfig.widgets &&\n\t\tconfig.widgets[widgetName].find((e: any) => e.filename.toLowerCase() === exampleName);\n\treturn example ? (\n\t\t<div key=\"example-container\" classes={css.container}>\n\t\t\t<example.module />\n\t\t</div>\n\t) : null;\n});\n"]}