diff --git a/assets/AppCoreExtensions-CJpWn59E.js b/assets/AppCoreExtensions-ChAx3lKK.js similarity index 78% rename from assets/AppCoreExtensions-CJpWn59E.js rename to assets/AppCoreExtensions-ChAx3lKK.js index 0c4b6b8..479c601 100644 --- a/assets/AppCoreExtensions-CJpWn59E.js +++ b/assets/AppCoreExtensions-ChAx3lKK.js @@ -1,2 +1,2 @@ -import{C as e,S as o}from"./CoreExtension-D6FI1p2n.js";function s(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}const t="/solid-demo-app/";class d extends e{async run(n){n.fontManager.addFontFace(new o("Ubuntu",{weight:700},"msdf",n,t+"fonts/Ubuntu-Bold.msdf.png",t+"fonts/Ubuntu-Bold.msdf.json")),n.fontManager.addFontFace(new o("Ubuntu",{weight:400},"msdf",n,t+"fonts/Ubuntu-Regular.msdf.png",t+"fonts/Ubuntu-Regular.msdf.json"))}}export{s as __vite_legacy_guard,d as default}; -//# sourceMappingURL=AppCoreExtensions-CJpWn59E.js.map +import{C as e,S as o}from"./CoreExtension-BfzrAcK3.js";function s(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}const t="/solid-demo-app/";class d extends e{async run(n){n.fontManager.addFontFace(new o("Ubuntu",{weight:700},"msdf",n,t+"fonts/Ubuntu-Bold.msdf.png",t+"fonts/Ubuntu-Bold.msdf.json")),n.fontManager.addFontFace(new o("Ubuntu",{weight:400},"msdf",n,t+"fonts/Ubuntu-Regular.msdf.png",t+"fonts/Ubuntu-Regular.msdf.json"))}}export{s as __vite_legacy_guard,d as default}; +//# sourceMappingURL=AppCoreExtensions-ChAx3lKK.js.map diff --git a/assets/AppCoreExtensions-CJpWn59E.js.map b/assets/AppCoreExtensions-ChAx3lKK.js.map similarity index 97% rename from assets/AppCoreExtensions-CJpWn59E.js.map rename to assets/AppCoreExtensions-ChAx3lKK.js.map index 2917c68..196505b 100644 --- a/assets/AppCoreExtensions-CJpWn59E.js.map +++ b/assets/AppCoreExtensions-ChAx3lKK.js.map @@ -1 +1 @@ -{"version":3,"file":"AppCoreExtensions-CJpWn59E.js","sources":["../../src/AppCoreExtensions.ts"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CoreExtension,\n WebTrFontFace,\n SdfTrFontFace,\n type Stage,\n} from \"@lightningjs/renderer/core\";\n\nconst basePath = import.meta.env.BASE_URL;\n\nexport default class AppCoreExtension extends CoreExtension {\n async run(stage: Stage) {\n // stage.fontManager.addFontFace(\n // new WebTrFontFace(\n // \"NotoSans\",\n // {},\n // basePath + \"fonts/NotoSans-Regular.ttf\",\n // ),\n // );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n { weight: 700 },\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n { weight: 400 },\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Regular.msdf.png\",\n basePath + \"fonts/Ubuntu-Regular.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","AppCoreExtension","CoreExtension","stage","SdfTrFontFace"],"mappings":"0IA0BA,MAAMA,EAAW,mBAEjB,MAAqBC,UAAyBC,CAAc,CAC1D,MAAM,IAAIC,EAAc,CAQtBA,EAAM,YAAY,YAChB,IAAIC,EACF,SACA,CAAE,OAAQ,GAAI,EACd,OACAD,EACAH,EAAW,6BACXA,EAAW,6BACb,CAAA,EAEFG,EAAM,YAAY,YAChB,IAAIC,EACF,SACA,CAAE,OAAQ,GAAI,EACd,OACAD,EACAH,EAAW,gCACXA,EAAW,gCACb,CAAA,CAEJ,CACF"} \ No newline at end of file +{"version":3,"file":"AppCoreExtensions-ChAx3lKK.js","sources":["../../src/AppCoreExtensions.ts"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CoreExtension,\n WebTrFontFace,\n SdfTrFontFace,\n type Stage,\n} from \"@lightningjs/renderer/core\";\n\nconst basePath = import.meta.env.BASE_URL;\n\nexport default class AppCoreExtension extends CoreExtension {\n async run(stage: Stage) {\n // stage.fontManager.addFontFace(\n // new WebTrFontFace(\n // \"NotoSans\",\n // {},\n // basePath + \"fonts/NotoSans-Regular.ttf\",\n // ),\n // );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n { weight: 700 },\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n { weight: 400 },\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Regular.msdf.png\",\n basePath + \"fonts/Ubuntu-Regular.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","AppCoreExtension","CoreExtension","stage","SdfTrFontFace"],"mappings":"0IA0BA,MAAMA,EAAW,mBAEjB,MAAqBC,UAAyBC,CAAc,CAC1D,MAAM,IAAIC,EAAc,CAQtBA,EAAM,YAAY,YAChB,IAAIC,EACF,SACA,CAAE,OAAQ,GAAI,EACd,OACAD,EACAH,EAAW,6BACXA,EAAW,6BACb,CAAA,EAEFG,EAAM,YAAY,YAChB,IAAIC,EACF,SACA,CAAE,OAAQ,GAAI,EACd,OACAD,EACAH,EAAW,gCACXA,EAAW,gCACb,CAAA,CAEJ,CACF"} \ No newline at end of file diff --git a/assets/AppCoreExtensions-legacy-TAdaOCdk.js b/assets/AppCoreExtensions-legacy-KeSumw-d.js similarity index 98% rename from assets/AppCoreExtensions-legacy-TAdaOCdk.js rename to assets/AppCoreExtensions-legacy-KeSumw-d.js index f40a182..7cd5a30 100644 --- a/assets/AppCoreExtensions-legacy-TAdaOCdk.js +++ b/assets/AppCoreExtensions-legacy-KeSumw-d.js @@ -1,2 +1,2 @@ -!function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return e};var r,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function s(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{s({},"")}catch(r){s=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof m?r:m,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:k(t,e,c)}),a}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var p="suspendedStart",y="suspendedYield",v="executing",d="completed",g={};function m(){}function w(){}function b(){}var x={};s(x,c,(function(){return this}));var L=Object.getPrototypeOf,E=L&&L(L(S([])));E&&E!==n&&o.call(E,c)&&(x=E);var j=b.prototype=m.prototype=Object.create(x);function _(t){["next","throw","return"].forEach((function(r){s(t,r,(function(t){return this._invoke(r,t)}))}))}function O(t,r){function e(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var f=u.arg,s=f.value;return s&&"object"==typeof s&&o.call(s,"__await")?r.resolve(s.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(s).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}})}function k(t,e,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=F(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var f=l(t,e,n);if("normal"===f.type){if(o=n.done?d:y,f.arg===g)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=d,n.method="throw",n.arg=f.arg)}}}function F(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,F(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=l(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function P(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function G(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function S(t){if(t||""===t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),G(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;G(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},e}function r(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(f){return void e(f)}c.done?r(u):Promise.resolve(u).then(n,o)}System.register(["./CoreExtension-legacy-SS_VGrQO.js"],(function(e,n){"use strict";var o,i;return{setters:[t=>{o=t.C,i=t.S}],execute:function(){var n="/solid-demo-app/";e("default",class extends o{run(e){return(o=t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.fontManager.addFontFace(new i("Ubuntu",{weight:700},"msdf",e,n+"fonts/Ubuntu-Bold.msdf.png",n+"fonts/Ubuntu-Bold.msdf.json")),e.fontManager.addFontFace(new i("Ubuntu",{weight:400},"msdf",e,n+"fonts/Ubuntu-Regular.msdf.png",n+"fonts/Ubuntu-Regular.msdf.json"));case 2:case"end":return t.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,i){var a=o.apply(t,e);function c(t){r(a,n,i,c,u,"next",t)}function u(t){r(a,n,i,c,u,"throw",t)}c(void 0)}))})();var o}})}}}))}(); -//# sourceMappingURL=AppCoreExtensions-legacy-TAdaOCdk.js.map +!function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return e};var r,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function s(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{s({},"")}catch(r){s=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof m?r:m,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:k(t,e,c)}),a}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var p="suspendedStart",y="suspendedYield",v="executing",d="completed",g={};function m(){}function w(){}function b(){}var x={};s(x,c,(function(){return this}));var L=Object.getPrototypeOf,E=L&&L(L(S([])));E&&E!==n&&o.call(E,c)&&(x=E);var j=b.prototype=m.prototype=Object.create(x);function _(t){["next","throw","return"].forEach((function(r){s(t,r,(function(t){return this._invoke(r,t)}))}))}function O(t,r){function e(n,i,a,c){var u=l(t[n],t,i);if("throw"!==u.type){var f=u.arg,s=f.value;return s&&"object"==typeof s&&o.call(s,"__await")?r.resolve(s.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(s).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}})}function k(t,e,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=F(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var f=l(t,e,n);if("normal"===f.type){if(o=n.done?d:y,f.arg===g)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=d,n.method="throw",n.arg=f.arg)}}}function F(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,F(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=l(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function P(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function G(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function S(t){if(t||""===t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),G(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;G(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},e}function r(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(f){return void e(f)}c.done?r(u):Promise.resolve(u).then(n,o)}System.register(["./CoreExtension-legacy-1r1p_2oI.js"],(function(e,n){"use strict";var o,i;return{setters:[t=>{o=t.C,i=t.S}],execute:function(){var n="/solid-demo-app/";e("default",class extends o{run(e){return(o=t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.fontManager.addFontFace(new i("Ubuntu",{weight:700},"msdf",e,n+"fonts/Ubuntu-Bold.msdf.png",n+"fonts/Ubuntu-Bold.msdf.json")),e.fontManager.addFontFace(new i("Ubuntu",{weight:400},"msdf",e,n+"fonts/Ubuntu-Regular.msdf.png",n+"fonts/Ubuntu-Regular.msdf.json"));case 2:case"end":return t.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,i){var a=o.apply(t,e);function c(t){r(a,n,i,c,u,"next",t)}function u(t){r(a,n,i,c,u,"throw",t)}c(void 0)}))})();var o}})}}}))}(); +//# sourceMappingURL=AppCoreExtensions-legacy-KeSumw-d.js.map diff --git a/assets/AppCoreExtensions-legacy-TAdaOCdk.js.map b/assets/AppCoreExtensions-legacy-KeSumw-d.js.map similarity index 97% rename from assets/AppCoreExtensions-legacy-TAdaOCdk.js.map rename to assets/AppCoreExtensions-legacy-KeSumw-d.js.map index cdb3feb..c43cd68 100644 --- a/assets/AppCoreExtensions-legacy-TAdaOCdk.js.map +++ b/assets/AppCoreExtensions-legacy-KeSumw-d.js.map @@ -1 +1 @@ -{"version":3,"file":"AppCoreExtensions-legacy-TAdaOCdk.js","sources":["../../src/AppCoreExtensions.ts"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CoreExtension,\n WebTrFontFace,\n SdfTrFontFace,\n type Stage,\n} from \"@lightningjs/renderer/core\";\n\nconst basePath = import.meta.env.BASE_URL;\n\nexport default class AppCoreExtension extends CoreExtension {\n async run(stage: Stage) {\n // stage.fontManager.addFontFace(\n // new WebTrFontFace(\n // \"NotoSans\",\n // {},\n // basePath + \"fonts/NotoSans-Regular.ttf\",\n // ),\n // );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n { weight: 700 },\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n { weight: 400 },\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Regular.msdf.png\",\n basePath + \"fonts/Ubuntu-Regular.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","exports","CoreExtension","run","stage","_regeneratorRuntime","mark","_callee","wrap","_callee$","_context","prev","next","fontManager","addFontFace","SdfTrFontFace","weight","stop"],"mappings":"4xNA0BA,IAAMA,EAAW,mBAgCjBC,EAAA,UA9BA,cAA8CC,EACtCC,GAAAA,CAAIC,GAAc,SAAAC,IAAAC,MAAA,SAAAC,IAAA,OAAAF,IAAAG,MAAAC,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAQtBR,EAAMS,YAAYC,YAChB,IAAIC,EACF,SACA,CAAEC,OAAQ,KACV,OACAZ,EACAJ,EAAW,6BACXA,EAAW,gCAGfI,EAAMS,YAAYC,YAChB,IAAIC,EACF,SACA,CAAEC,OAAQ,KACV,OACAZ,EACAJ,EAAW,gCACXA,EAAW,mCAEf,KAAAU,EAAAA,IAAAA,MAAAA,OAAAA,EAAAO,OAAAV,GAAAA,EACF,0LAAA"} \ No newline at end of file +{"version":3,"file":"AppCoreExtensions-legacy-KeSumw-d.js","sources":["../../src/AppCoreExtensions.ts"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CoreExtension,\n WebTrFontFace,\n SdfTrFontFace,\n type Stage,\n} from \"@lightningjs/renderer/core\";\n\nconst basePath = import.meta.env.BASE_URL;\n\nexport default class AppCoreExtension extends CoreExtension {\n async run(stage: Stage) {\n // stage.fontManager.addFontFace(\n // new WebTrFontFace(\n // \"NotoSans\",\n // {},\n // basePath + \"fonts/NotoSans-Regular.ttf\",\n // ),\n // );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n { weight: 700 },\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n { weight: 400 },\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Regular.msdf.png\",\n basePath + \"fonts/Ubuntu-Regular.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","exports","CoreExtension","run","stage","_regeneratorRuntime","mark","_callee","wrap","_callee$","_context","prev","next","fontManager","addFontFace","SdfTrFontFace","weight","stop"],"mappings":"4xNA0BA,IAAMA,EAAW,mBAgCjBC,EAAA,UA9BA,cAA8CC,EACtCC,GAAAA,CAAIC,GAAc,SAAAC,IAAAC,MAAA,SAAAC,IAAA,OAAAF,IAAAG,MAAAC,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAQtBR,EAAMS,YAAYC,YAChB,IAAIC,EACF,SACA,CAAEC,OAAQ,KACV,OACAZ,EACAJ,EAAW,6BACXA,EAAW,gCAGfI,EAAMS,YAAYC,YAChB,IAAIC,EACF,SACA,CAAEC,OAAQ,KACV,OACAZ,EACAJ,EAAW,gCACXA,EAAW,mCAEf,KAAAU,EAAAA,IAAAA,MAAAA,OAAAA,EAAAO,OAAAV,GAAAA,EACF,0LAAA"} \ No newline at end of file diff --git a/assets/CoreExtension-BfzrAcK3.js b/assets/CoreExtension-BfzrAcK3.js new file mode 100644 index 0000000..9c3540f --- /dev/null +++ b/assets/CoreExtension-BfzrAcK3.js @@ -0,0 +1,2 @@ +var de=Object.defineProperty;var le=(n,t,e)=>t in n?de(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var a=(n,t,e)=>(le(n,typeof t!="symbol"?t+"":t,e),e);function Te(n,t){const e={alpha:!0,antialias:!1,depth:!1,stencil:!0,desynchronized:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:!1},r=n.getContext("webgl",e)||n.getContext("experimental-webgl",e);if(!r)throw new Error("Unable to create WebGL context");return t?new Proxy(r,{get(s,i){const o=s[i];return typeof o=="function"?(t.increment(String(i)),o.bind(s)):o}}):r}function g(n,t){if(!Ee()&&!n)throw new Error(t||"Assertion failed")}function We(n,t,e){const r=Math.trunc(n>>>24),s=Math.trunc(n>>>16&255),i=Math.trunc(n>>>8&255),o=Math.trunc(n&255),h=Math.trunc(t>>>24),c=Math.trunc(t>>>16&255),u=Math.trunc(t>>>8&255),l=Math.trunc(t&255),d=Math.round(h*e+r*(1-e)),E=Math.round(c*e+s*(1-e)),x=Math.round(u*e+i*(1-e)),_=Math.round(l*e+o*(1-e));return(d<<24|E<<16|x<<8|_)>>>0}function He(n,t){const e=n>>>24,r=n>>>16&255,s=n>>>8&255,i=Math.trunc((n&255)*t);return(e<<24|r<<16|s<<8|i)>>>0}function Ve(n,t,e=!1){const r=(n&255)/255*t,s=Math.trunc((n>>>24)*r),i=Math.trunc((n>>>16&255)*r),o=Math.trunc((n>>>8&255)*r),h=Math.trunc(r*255);return e?(h<<24|o<<16|i<<8|s)>>>0:(s<<24|i<<16|o<<8|h)>>>0}function H(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function Ee(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!0}class te{constructor(){a(this,"eventListeners",{})}on(t,e){let r=this.eventListeners[t];r||(r=[]),r.push(e),this.eventListeners[t]=r}off(t,e){const r=this.eventListeners[t];if(!r)return;if(!e){delete this.eventListeners[t];return}const s=r.indexOf(e);s>=0&&r.splice(s,1)}once(t,e){const r=(s,i)=>{this.off(t,r),e(s,i)};this.on(t,r)}emit(t,e){const r=this.eventListeners[t];r&&[...r].forEach(s=>{s(this,e)})}removeAllListeners(){this.eventListeners={}}}class _e{static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}function Q(n,t,e){const r=n.createShader(t);if(!r)throw new Error;if(n.shaderSource(r,e),n.compileShader(r),n.getShaderParameter(r,n.COMPILE_STATUS))return r;console.log(n.getShaderInfoLog(r)),n.deleteShader(r)}function xe(n,t,e){const r=n.createProgram();if(!r)throw new Error;if(n.attachShader(r,t),n.attachShader(r,e),n.linkProgram(r),n.getProgramParameter(r,n.LINK_STATUS))return r;console.log(n.getProgramInfoLog(r)),n.deleteProgram(r)}function Re(n){return self.WebGL2RenderingContext&&n instanceof self.WebGL2RenderingContext}class re extends _e{constructor(e){super();a(this,"boundBufferCollection",null);a(this,"buffersBound",!1);a(this,"program");a(this,"vao");a(this,"renderer");a(this,"glw");a(this,"attributeBuffers");a(this,"attributeLocations");a(this,"attributeNames");a(this,"uniformLocations");a(this,"uniformTypes");a(this,"supportsIndexedTextures");const r=this.renderer=e.renderer,s=this.glw=this.renderer.glw;this.supportsIndexedTextures=e.supportsIndexedTextures||!1;const i=s.isWebGl2(),o=i&&e.webgl2Extensions||!i&&e.webgl1Extensions||[],h=i?"2.0":"1.0";o.forEach(T=>{if(!s.getExtension(T))throw new Error('Shader "'.concat(this.constructor.name,'" requires extension "').concat(T,'" for WebGL ').concat(h," but wasn't found"))});const c=e.shaderSources||this.constructor.shaderSources;if(c)i&&(c!=null&&c.webGl2)&&(c.fragment=c.webGl2.fragment,c.vertex=c.webGl2.vertex,delete c.webGl2);else throw new Error('Shader "'.concat(this.constructor.name,'" is missing shaderSources.'));const u=r.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,l=c.vertex instanceof Function?c.vertex(u):c.vertex,d=c.fragment instanceof Function?c.fragment(u):c.fragment,E=Q(s,s.VERTEX_SHADER,l),x=Q(s,s.FRAGMENT_SHADER,d);if(!E||!x)throw new Error;const _=xe(s,E,x);if(!_)throw new Error;if(this.program=_,i){const T=s.createVertexArray();if(!T)throw new Error;this.vao=T,s.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...e.attributes].forEach(T=>{const R=s.getAttribLocation(this.program,T);if(R<0)throw new Error("".concat(this.constructor.name,': Vertex shader must have an attribute "').concat(T,'"!'));const A=s.createBuffer();if(!A)throw new Error("".concat(this.constructor.name,': Could not create buffer for attribute "').concat(T,'"'));this.attributeLocations[T]=R,this.attributeBuffers[T]=A,this.attributeNames.push(T)}),this.uniformLocations={},this.uniformTypes={},e.uniforms.forEach(T=>{const R=s.getUniformLocation(this.program,T.name);if(this.uniformTypes[T.name]=T.uniform,!R){console.warn('Shader "'.concat(this.constructor.name,'" could not get uniform location for "').concat(T.name,'"'));return}this.uniformLocations[T.name]=R})}bindBufferAttribute(e,r,s){const{glw:i}=this;i.enableVertexAttribArray(e),i.vertexAttribPointer(r,e,s.size,s.type,s.normalized,s.stride,s.offset)}disableAttribute(e){this.glw.disableVertexAttribArray(e)}disableAttributes(){for(const e in this.attributeLocations)this.disableAttribute(this.attributeLocations[e]);this.boundBufferCollection=null}canBatchShaderProps(e,r){return!1}bindRenderOp(e,r){this.bindBufferCollection(e.buffers),e.textures.length>0&&this.bindTextures(e.textures);const{glw:s,parentHasRenderTexture:i,renderToTexture:o}=e;if(!(o&&i)){if(i){const{width:h,height:c}=e.framebufferDimensions||{};this.setUniform("u_pixelRatio",1),this.setUniform("u_resolution",new Float32Array([h!=null?h:0,c!=null?c:0]))}else this.setUniform("u_pixelRatio",e.options.pixelRatio),this.setUniform("u_resolution",new Float32Array([s.canvas.width,s.canvas.height]));if(r){if(H(r,"$dimensions")){let h=r.$dimensions;h||(h=e.dimensions),this.setUniform("u_dimensions",[h.width,h.height])}if(H(r,"$alpha")){let h=r.$alpha;h||(h=e.alpha),this.setUniform("u_alpha",h)}this.bindProps(r)}}}setUniform(e,...r){this.glw.setUniform(this.uniformTypes[e],this.uniformLocations[e],...r)}bindBufferCollection(e){if(this.boundBufferCollection!==e){for(const r in this.attributeLocations){const s=e.getBuffer(r),i=e.getAttributeInfo(r);g(s,'Buffer for "'.concat(r,'" not found')),g(i),this.bindBufferAttribute(this.attributeLocations[r],s,i)}this.boundBufferCollection=e}}bindProps(e){}bindTextures(e){}attach(){this.glw.useProgram(this.program),this.glw.useProgram(this.program),this.glw.isWebGl2()&&this.vao&&this.glw.bindVertexArray(this.vao)}detach(){this.disableAttributes()}}a(re,"shaderSources");class O extends te{constructor(e){super();a(this,"txManager");a(this,"dimensions",null);a(this,"error",null);a(this,"state","freed");a(this,"renderableOwners",new Set);this.txManager=e}setRenderableOwner(e,r){r?this.renderableOwners.add(e):this.renderableOwners.delete(e)}get renderable(){return this.renderableOwners.size>0}setState(e,...r){if(this.state!==e){if(this.state=e,e==="loaded"){const s=r;this.dimensions=s[0]}else if(e==="failed"){const s=r;this.error=s[0]}this.emit(e,...r)}}static makeCacheKey(e){return!1}static resolveDefaults(e){return{}}}const Ae=n=>{const t=n>>>24,e=n>>>16&255,r=n>>>8&255,s=n&255;return[t/255,e/255,r/255,s/255]};function Ye(n){return(n&255)/255}function ke(n){const t=Math.floor(n[0]*255),e=Math.floor(n[1]*255),r=Math.floor(n[2]*255),s=Math.floor(n[3]*255);return"rgba(".concat(t,",").concat(e,",").concat(r,",").concat(s.toFixed(4),")")}function j(n,t,e,r,s){return s?(s.x1=n,s.y1=t,s.x2=e,s.y2=r,s):{x1:n,y1:t,x2:e,y2:r}}function $e(n,t,e){const r=j(Math.max(n.x1,t.x1),Math.max(n.y1,t.y1),Math.min(n.x2,t.x2),Math.min(n.y2,t.y2),e);return r.x1t.x1&&n.y1t.y1}function qe(n,t){return t?(t.x=n.x1,t.y=n.y1,t.width=n.x2-n.x1,t.height=n.y2-n.y1,t):{x:n.x1,y:n.y1,width:n.x2-n.x1,height:n.y2-n.y1}}function Ke(n,t,e){const r=Math.max(n.x,t.x),s=Math.max(n.y,t.y),i=Math.min(n.x+n.width,t.x+t.width)-r,o=Math.min(n.y+n.height,t.y+t.height)-s;return i>0&&o>0?e?(e.x=r,e.y=s,e.width=i,e.height=o,e):{x:r,y:s,width:i,height:o}:e?(e.x=0,e.y=0,e.width=0,e.height=0,e):{x:0,y:0,width:0,height:0}}function Ze(n,t){return t?(t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height,t):{x:n.x,y:n.y,width:n.width,height:n.height}}function ge(n,t){return n===t?!0:n===null||t===null?!1:n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Qe(n,t){return n.x1<=t.x2&&n.y1<=t.y2&&n.x2>=t.x1&&n.y2>=t.y1}function je(n){return n.x1h===e);if(i!==-1)return i;const o=r.length;return o>=s?4294967295:(this.textures.push(e),o)}draw(){const{glw:e,shader:r,shaderProps:s,options:i}=this,{shManager:o}=i;o.useShader(r),r.bindRenderOp(this,s);const h=this.bufferIdx/24*6*2;if(this.clippingRect.valid){const{x:c,y:u,width:l,height:d}=this.clippingRect,E=i.pixelRatio,x=i.canvas.height,_=Math.round(c*E),T=Math.round(l*E),R=Math.round(d*E),A=Math.round(x-R-u*E);e.setScissorTest(!0),e.scissor(_,A,T,R)}else e.setScissorTest(!1);e.drawElements(e.TRIANGLES,6*this.numQuads,e.UNSIGNED_SHORT,h)}}function Ne(n){const t={MAX_RENDERBUFFER_SIZE:0,MAX_TEXTURE_SIZE:0,MAX_VIEWPORT_DIMS:0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:0,MAX_TEXTURE_IMAGE_UNITS:0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:0,MAX_VERTEX_ATTRIBS:0,MAX_VARYING_VECTORS:0,MAX_VERTEX_UNIFORM_VECTORS:0,MAX_FRAGMENT_UNIFORM_VECTORS:0};return Object.keys(t).forEach(r=>{t[r]=n.getParameter(n[r])}),t}function be(n){const t={ANGLE_instanced_arrays:null,WEBGL_compressed_texture_s3tc:null,WEBGL_compressed_texture_astc:null,WEBGL_compressed_texture_etc:null,WEBGL_compressed_texture_etc1:null,WEBGL_compressed_texture_pvrtc:null,WEBKIT_WEBGL_compressed_texture_pvrtc:null,WEBGL_compressed_texture_s3tc_srgb:null,OES_vertex_array_object:null};return Object.keys(t).forEach(r=>{t[r]=n.getExtension(r)}),t}function we(n,t){const e=~~(t/80),r=new Uint16Array(e*6);for(let i=0,o=0;in&&!(n&n-1),m=(n,t,e,r)=>{const s=3*n,i=3*(e-n)-s,o=1-s-i,h=3*t,c=3*(r-t)-h,u=1-h-c;return function(l){if(l>=1)return 1;if(l<=0)return 0;let d=.5,E,x,_;for(let A=0;A<20;A++){if(E=d*(d*(d*o+i)+s),_=l-E,_>-1e-8&&_<1e-8)return d*(d*(d*u+c)+h);if(x=d*(d*(3*o)+2*i)+s,x>1e-10&&x<1e-10)break;d+=_/x}let T=0,R=1;for(let A=0;A<20;A++){if(d=.5*(T+R),E=d*(d*(d*o+i)+s),_=l-E,_>-1e-8&&_<1e-8)return d*(d*(d*u+c)+h);_<0?R=d:T=d}}},Je=ye(n=>{switch(n){case"linear":return function(e){return e};case"ease":return m(.25,.1,.25,1);case"ease-in":return m(.42,0,1,1);case"ease-out":return m(0,0,.58,1);case"ease-in-out":return m(.42,0,.58,1);case"ease-in-sine":return m(.12,0,.39,0);case"ease-out-sine":return m(.12,0,.39,0);case"ease-in-out-sine":return m(.37,0,.63,1);case"ease-in-cubic":return m(.32,0,.67,0);case"ease-out-cubic":return m(.33,1,.68,1);case"ease-in-out-cubic":return m(.65,0,.35,1);case"ease-in-circ":return m(.55,0,1,.45);case"ease-out-circ":return m(0,.55,.45,1);case"ease-in-out-circ":return m(.85,0,.15,1);case"ease-in-back":return m(.36,0,.66,-.56);case"ease-out-back":return m(.34,1.56,.64,1);case"ease-in-out-back":return m(.68,-.6,.32,1.6);case"step-start":return function(){return 1};case"step-end":return function(e){return e===1?1:0};default:const t="cubic-bezier(";if(n&&n.indexOf(t)===0){const e=n.substr(t.length,n.length-t.length-1).split(",");if(e.length!==4)return console.warn("Unknown timing function: "+n),function(h){return h};const r=parseFloat(e[0]||"0.42"),s=parseFloat(e[1]||"0"),i=parseFloat(e[2]||"1"),o=parseFloat(e[3]||"1");return isNaN(r)||isNaN(s)||isNaN(i)||isNaN(o)?(console.warn(" Unknown timing function: "+n),function(h){return h}):m(r,s,i,o)}else return console.warn("Unknown timing function: "+n),function(e){return e}}});Math.hypot||(Math.hypot=(...n)=>{let t=0,e=n.length;for(;e--;)t+=n[e]*n[e];return Math.sqrt(t)});const W=new Uint8Array([0,0,0,0]);class P extends pe{constructor(e,r,s){super(r,s);a(this,"glw");a(this,"_nativeCtxTexture",null);a(this,"_state","freed");a(this,"_w",0);a(this,"_h",0);this.glw=e}get ctxTexture(){return this._state==="freed"&&this.load(),g(this._nativeCtxTexture),this._nativeCtxTexture}get renderable(){return this.textureSource.renderable}get w(){return this._w}get h(){return this._h}load(){this._state==="loading"||this._state==="loaded"||(this._state="loading",this.textureSource.setState("loading"),this._nativeCtxTexture=this.createNativeCtxTexture(),this.onLoadRequest().then(({width:e,height:r})=>{this._state!=="freed"&&(this._state="loaded",this._w=e,this._h=r,this.textureSource.setState("loaded",{width:e,height:r}))}).catch(e=>{this._state="failed",this.textureSource.setState("failed",e),console.error(e)}))}async onLoadRequest(){var h,c;const{glw:e,memManager:r}=this;e.texImage2D(0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null),r.setTextureMemUse(this,W.byteLength);const s=await((h=this.textureSource)==null?void 0:h.getTextureData());if(!this._nativeCtxTexture)return g(this._state==="freed"),{width:0,height:0};let i=0,o=0;if(g(this._nativeCtxTexture),e.activeTexture(0),s.data instanceof ImageBitmap||s.data instanceof ImageData||Le(s.data)){const u=s.data;i=u.width,o=u.height,e.bindTexture(this._nativeCtxTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!!s.premultiplyAlpha),e.texImage2D(0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,u),r.setTextureMemUse(this,i*o*4),(e.isWebGl2()||J(i)&&J(o))&&e.generateMipmap()}else if(s.data===null)i=0,o=0,e.bindTexture(this._nativeCtxTexture),e.texImage2D(0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,W),r.setTextureMemUse(this,W.byteLength);else if("mipmaps"in s.data&&s.data.mipmaps){const{mipmaps:u,width:l=0,height:d=0,type:E,glInternalFormat:x}=s.data,_=E==="ktx"?new DataView((c=u[0])!=null?c:new ArrayBuffer(0)):u[0];e.bindTexture(this._nativeCtxTexture),e.compressedTexImage2D(0,x,l,d,0,_),e.texParameteri(e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_MIN_FILTER,e.LINEAR),r.setTextureMemUse(this,_.byteLength)}else console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",s);return{width:i,height:o}}free(){if(this._state==="freed"||(this._state="freed",this.textureSource.setState("freed"),this._w=0,this._h=0,!this._nativeCtxTexture))return;const{glw:e,memManager:r}=this;e.deleteTexture(this._nativeCtxTexture),r.setTextureMemUse(this,0),this._nativeCtxTexture=null}createNativeCtxTexture(){const{glw:e}=this,r=e.createTexture();if(!r)throw new Error("Could not create WebGL Texture");return e.activeTexture(0),e.bindTexture(r),e.texParameteri(e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r}}const y=class y extends O{constructor(e,r){super(e);a(this,"props");this.props=y.resolveDefaults(r||{})}get color(){return this.props.color}set color(e){this.props.color=e}async getTextureData(){const e=new Uint32Array([this.color]),r=new Uint8ClampedArray(e.buffer);return{data:new ImageData(r,1,1),premultiplyAlpha:!0}}static makeCacheKey(e){const r=y.resolveDefaults(e);return"ColorTexture,".concat(r.color)}static resolveDefaults(e){return{color:e.color||4294967295}}};a(y,"z$__type__Props");let V=y;const C=class C extends O{constructor(e,r){super(e);a(this,"props");a(this,"parentTexture");a(this,"onParentTxLoaded",()=>{this.setState("loaded",{width:this.props.width,height:this.props.height})});a(this,"onParentTxFailed",(e,r)=>{this.setState("failed",r)});this.parentTexture=this.txManager.loadTexture(r.texture.txType,r.texture.props,r.texture.options),this.props=C.resolveDefaults(r||{}),queueMicrotask(()=>{const s=this.parentTexture;s.state==="loaded"?this.onParentTxLoaded(s,s.dimensions):s.state==="failed"&&this.onParentTxFailed(s,s.error),s.on("loaded",this.onParentTxLoaded),s.on("failed",this.onParentTxFailed)})}async getTextureData(){return{data:this.props}}static makeCacheKey(e){return!1}static resolveDefaults(e){return{texture:e.texture,x:e.x||0,y:e.y||0,width:e.width||0,height:e.height||0}}};a(C,"z$__type__Props");let B=C;class Ue extends P{constructor(t,e,r){super(t,e,r)}async onLoadRequest(){var e,r;const t=await this.textureSource.getTextureData();return{width:((e=t.data)==null?void 0:e.width)||0,height:((r=t.data)==null?void 0:r.height)||0}}}class Pe{constructor(t){a(this,"config");this.config=t}getBuffer(t){var e;return(e=this.config.find(r=>r.attributes[t]))==null?void 0:e.buffer}getAttributeInfo(t){var e;return(e=this.config.find(r=>r.attributes[t]))==null?void 0:e.attributes[t]}}class Be{constructor(t){a(this,"gl");a(this,"activeTextureUnit",0);a(this,"texture2dUnits");a(this,"texture2dParams",new WeakMap);a(this,"scissorEnabled");a(this,"scissorX");a(this,"scissorY");a(this,"scissorWidth");a(this,"scissorHeight");a(this,"blendEnabled");a(this,"blendSrcRgb");a(this,"blendDstRgb");a(this,"blendSrcAlpha");a(this,"blendDstAlpha");a(this,"boundArrayBuffer");a(this,"boundElementArrayBuffer");a(this,"curProgram");a(this,"programUniforms",new WeakMap);a(this,"canvas");a(this,"MAX_RENDERBUFFER_SIZE");a(this,"MAX_TEXTURE_SIZE");a(this,"MAX_VIEWPORT_DIMS");a(this,"MAX_VERTEX_TEXTURE_IMAGE_UNITS");a(this,"MAX_TEXTURE_IMAGE_UNITS");a(this,"MAX_COMBINED_TEXTURE_IMAGE_UNITS");a(this,"MAX_VERTEX_ATTRIBS");a(this,"MAX_VARYING_VECTORS");a(this,"MAX_VERTEX_UNIFORM_VECTORS");a(this,"MAX_FRAGMENT_UNIFORM_VECTORS");a(this,"TEXTURE_MAG_FILTER");a(this,"TEXTURE_MIN_FILTER");a(this,"TEXTURE_WRAP_S");a(this,"TEXTURE_WRAP_T");a(this,"LINEAR");a(this,"CLAMP_TO_EDGE");a(this,"RGBA");a(this,"UNSIGNED_BYTE");a(this,"UNPACK_PREMULTIPLY_ALPHA_WEBGL");a(this,"UNPACK_FLIP_Y_WEBGL");a(this,"FLOAT");a(this,"TRIANGLES");a(this,"UNSIGNED_SHORT");a(this,"ONE");a(this,"ONE_MINUS_SRC_ALPHA");a(this,"VERTEX_SHADER");a(this,"FRAGMENT_SHADER");a(this,"STATIC_DRAW");a(this,"COMPILE_STATUS");a(this,"LINK_STATUS");a(this,"DYNAMIC_DRAW");a(this,"COLOR_ATTACHMENT0");this.gl=t,this.activeTextureUnit=t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0;const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.texture2dUnits=new Array(e).fill(void 0).map((s,i)=>(this.activeTexture(i),t.getParameter(t.TEXTURE_BINDING_2D))),this.activeTexture(this.activeTextureUnit),this.scissorEnabled=t.isEnabled(t.SCISSOR_TEST);const r=t.getParameter(t.SCISSOR_BOX);this.scissorX=r[0],this.scissorY=r[1],this.scissorWidth=r[2],this.scissorHeight=r[3],this.blendEnabled=t.isEnabled(t.BLEND),this.blendSrcRgb=t.getParameter(t.BLEND_SRC_RGB),this.blendDstRgb=t.getParameter(t.BLEND_DST_RGB),this.blendSrcAlpha=t.getParameter(t.BLEND_SRC_ALPHA),this.blendDstAlpha=t.getParameter(t.BLEND_DST_ALPHA),this.boundArrayBuffer=t.getParameter(t.ARRAY_BUFFER_BINDING),this.boundElementArrayBuffer=t.getParameter(t.ELEMENT_ARRAY_BUFFER_BINDING),this.curProgram=t.getParameter(t.CURRENT_PROGRAM),this.canvas=t.canvas,this.MAX_RENDERBUFFER_SIZE=t.MAX_RENDERBUFFER_SIZE,this.MAX_TEXTURE_SIZE=t.MAX_TEXTURE_SIZE,this.MAX_VIEWPORT_DIMS=t.MAX_VIEWPORT_DIMS,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.MAX_TEXTURE_IMAGE_UNITS=t.MAX_TEXTURE_IMAGE_UNITS,this.MAX_COMBINED_TEXTURE_IMAGE_UNITS=t.MAX_COMBINED_TEXTURE_IMAGE_UNITS,this.MAX_VERTEX_ATTRIBS=t.MAX_VERTEX_ATTRIBS,this.MAX_VARYING_VECTORS=t.MAX_VARYING_VECTORS,this.MAX_VERTEX_UNIFORM_VECTORS=t.MAX_VERTEX_UNIFORM_VECTORS,this.MAX_FRAGMENT_UNIFORM_VECTORS=t.MAX_FRAGMENT_UNIFORM_VECTORS,this.TEXTURE_MAG_FILTER=t.TEXTURE_MAG_FILTER,this.TEXTURE_MIN_FILTER=t.TEXTURE_MIN_FILTER,this.TEXTURE_WRAP_S=t.TEXTURE_WRAP_S,this.TEXTURE_WRAP_T=t.TEXTURE_WRAP_T,this.LINEAR=t.LINEAR,this.CLAMP_TO_EDGE=t.CLAMP_TO_EDGE,this.RGBA=t.RGBA,this.UNSIGNED_BYTE=t.UNSIGNED_BYTE,this.UNPACK_PREMULTIPLY_ALPHA_WEBGL=t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.UNPACK_FLIP_Y_WEBGL=t.UNPACK_FLIP_Y_WEBGL,this.FLOAT=t.FLOAT,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.ONE=t.ONE,this.ONE_MINUS_SRC_ALPHA=t.ONE_MINUS_SRC_ALPHA,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.VERTEX_SHADER=t.VERTEX_SHADER,this.FRAGMENT_SHADER=t.FRAGMENT_SHADER,this.STATIC_DRAW=t.STATIC_DRAW,this.COMPILE_STATUS=t.COMPILE_STATUS,this.LINK_STATUS=t.LINK_STATUS,this.DYNAMIC_DRAW=t.DYNAMIC_DRAW,this.COLOR_ATTACHMENT0=t.COLOR_ATTACHMENT0}isWebGl2(){return Re(this.gl)}activeTexture(t){const{gl:e}=this;this.activeTextureUnit!==t&&(e.activeTexture(t+e.TEXTURE0),this.activeTextureUnit=t)}bindTexture(t){const{gl:e,activeTextureUnit:r,texture2dUnits:s}=this;s[r]!==t&&(s[r]=t,e.bindTexture(this.gl.TEXTURE_2D,t))}_getActiveTexture(){const{activeTextureUnit:t,texture2dUnits:e}=this;return e[t]}texParameteri(t,e){const{gl:r,texture2dParams:s}=this,i=this._getActiveTexture();if(!i)throw new Error("No active texture");let o=s.get(i);o||(o={},s.set(i,o)),o[t]!==e&&(o[t]=e,r.texParameteri(r.TEXTURE_2D,t,e))}texImage2D(t,e,r,s,i,o,h,c){const{gl:u}=this;o?u.texImage2D(u.TEXTURE_2D,t,e,r,s,i,o,h,c):u.texImage2D(u.TEXTURE_2D,t,e,r,s,i)}compressedTexImage2D(t,e,r,s,i,o){const{gl:h}=this;h.compressedTexImage2D(h.TEXTURE_2D,t,e,r,s,i,o)}pixelStorei(t,e){const{gl:r}=this;r.pixelStorei(t,e)}generateMipmap(){const{gl:t}=this;t.generateMipmap(t.TEXTURE_2D)}createTexture(){const{gl:t}=this;return t.createTexture()}deleteTexture(t){const{gl:e}=this;t&&this.texture2dParams.delete(t),e.deleteTexture(t)}viewport(t,e,r,s){const{gl:i}=this;i.viewport(t,e,r,s)}clearColor(t,e,r,s){const{gl:i}=this;i.clearColor(t,e,r,s)}setScissorTest(t){const{gl:e,scissorEnabled:r}=this;t!==r&&(t?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST),this.scissorEnabled=t)}scissor(t,e,r,s){const{gl:i,scissorX:o,scissorY:h,scissorWidth:c,scissorHeight:u}=this;(t!==o||e!==h||r!==c||s!==u)&&(i.scissor(t,e,r,s),this.scissorX=t,this.scissorY=e,this.scissorWidth=r,this.scissorHeight=s)}setBlend(t){const{gl:e,blendEnabled:r}=this;t!==r&&(t?e.enable(e.BLEND):e.disable(e.BLEND),this.blendEnabled=t)}blendFunc(t,e){const{gl:r,blendSrcRgb:s,blendDstRgb:i,blendSrcAlpha:o,blendDstAlpha:h}=this;(t!==s||e!==i||t!==o||e!==h)&&(r.blendFunc(t,e),this.blendSrcRgb=t,this.blendDstRgb=e,this.blendSrcAlpha=t,this.blendDstAlpha=e)}createBuffer(){const{gl:t}=this;return t.createBuffer()}createFramebuffer(){const{gl:t}=this;return t.createFramebuffer()}bindFramebuffer(t){const{gl:e}=this;e.bindFramebuffer(e.FRAMEBUFFER,t)}framebufferTexture2D(t,e,r){const{gl:s}=this;s.framebufferTexture2D(s.FRAMEBUFFER,t,s.TEXTURE_2D,e,r)}clear(){const{gl:t}=this;t.clear(t.COLOR_BUFFER_BIT)}arrayBufferData(t,e,r){const{gl:s,boundArrayBuffer:i}=this;i!==t&&(s.bindBuffer(s.ARRAY_BUFFER,t),this.boundArrayBuffer=t),s.bufferData(s.ARRAY_BUFFER,e,r)}elementArrayBufferData(t,e,r){const{gl:s,boundElementArrayBuffer:i}=this;i!==t&&(s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,t),this.boundElementArrayBuffer=t),s.bufferData(s.ELEMENT_ARRAY_BUFFER,e,r)}vertexAttribPointer(t,e,r,s,i,o,h){const{gl:c,boundArrayBuffer:u}=this;u!==t&&(c.bindBuffer(c.ARRAY_BUFFER,t),this.boundArrayBuffer=t),c.vertexAttribPointer(e,r,s,i,o,h)}useProgram(t){const{gl:e,curProgram:r}=this;r!==t&&(e.useProgram(t),this.curProgram=t)}setUniform(t,e,...r){const{gl:s,programUniforms:i}=this;let o=i.get(this.curProgram);o||(o=new Map,i.set(this.curProgram,o));const h=o.get(e);(!h||!Ce(h,r))&&(o.set(e,r),s[t](e,...r))}getParameter(t){const{gl:e}=this;return e.getParameter(t)}drawElements(t,e,r,s){const{gl:i}=this;i.drawElements(t,e,r,s)}getExtension(t){const{gl:e}=this;return e.getExtension(t)}createVertexArray(){const{gl:t}=this;return g(t instanceof WebGL2RenderingContext),t.createVertexArray()}bindVertexArray(t){const{gl:e}=this;g(e instanceof WebGL2RenderingContext),e.bindVertexArray(t)}getAttribLocation(t,e){const{gl:r}=this;return r.getAttribLocation(t,e)}getUniformLocation(t,e){const{gl:r}=this;return r.getUniformLocation(t,e)}enableVertexAttribArray(t){const{gl:e}=this;e.enableVertexAttribArray(t)}disableVertexAttribArray(t){const{gl:e}=this;e.disableVertexAttribArray(t)}createShader(t){const{gl:e}=this;return e.createShader(t)}compileShader(t){const{gl:e}=this;e.compileShader(t)}attachShader(t,e){const{gl:r}=this;r.attachShader(t,e)}linkProgram(t){const{gl:e}=this;e.linkProgram(t)}deleteProgram(t){const{gl:e}=this;e.deleteProgram(t)}getShaderParameter(t,e){const{gl:r}=this;return r.getShaderParameter(t,e)}getShaderInfoLog(t){const{gl:e}=this;return e.getShaderInfoLog(t)}createProgram(){const{gl:t}=this;return t.createProgram()}getProgramParameter(t,e){const{gl:r}=this;return r.getProgramParameter(t,e)}getProgramInfoLog(t){const{gl:e}=this;return e.getProgramInfoLog(t)}shaderSource(t,e){const{gl:r}=this;r.shaderSource(t,e)}deleteShader(t){const{gl:e}=this;e.deleteShader(t)}}function Ce(n,t){return n.length!==t.length?!1:n.every((e,r)=>Array.isArray(e)||e instanceof Float32Array?!1:e===t[r])}const D=class D extends O{constructor(e,r){super(e);a(this,"props");this.props=D.resolveDefaults(r||{})}get width(){return this.props.width}set width(e){this.props.width=e}get height(){return this.props.height}set height(e){this.props.height=e}async getTextureData(){return{data:null,premultiplyAlpha:null}}static resolveDefaults(e){return{width:e.width||256,height:e.height||256}}};a(D,"z$__type__Props");let Y=D;class ee extends P{constructor(e,r,s){super(e,r,s);a(this,"framebuffer");const i=e.createFramebuffer();g(i,"Unable to create framebuffer"),this.framebuffer=i}async onLoadRequest(){const{glw:e,memManager:r}=this,s=this._nativeCtxTexture=this.createNativeCtxTexture(),{width:i,height:o}=this.textureSource;return e.texImage2D(0,e.RGBA,i,o,0,e.RGBA,e.UNSIGNED_BYTE,null),r.setTextureMemUse(this,i*o*4),e.bindFramebuffer(this.framebuffer),e.framebufferTexture2D(e.COLOR_ATTACHMENT0,s,0),e.bindFramebuffer(null),{width:i,height:o}}}const De=24;class Oe extends Ie{constructor(e){super(e.stage);a(this,"glw");a(this,"system");a(this,"txManager");a(this,"txMemManager");a(this,"shManager");a(this,"options");a(this,"quadBuffer",new ArrayBuffer(1024*1024*4));a(this,"fQuadBuffer",new Float32Array(this.quadBuffer));a(this,"uiQuadBuffer",new Uint32Array(this.quadBuffer));a(this,"renderOps",[]);a(this,"curBufferIdx",0);a(this,"curRenderOp",null);a(this,"rttNodes",[]);a(this,"activeRttNode",null);a(this,"defaultShader");a(this,"quadBufferCollection");a(this,"defaultTexture");a(this,"renderToTextureActive",!1);const{canvas:r,clearColor:s,bufferMemory:i}=e;this.options=e,this.txManager=e.txManager,this.txMemManager=e.txMemManager,this.shManager=e.shManager,this.defaultTexture=new V(this.txManager),this.defaultTexture.once("loaded",()=>{this.stage.requestRender()});const o=Te(r,e.contextSpy),h=this.glw=new Be(o),c=Ae(s);h.viewport(0,0,r.width,r.height),h.clearColor(c[0],c[1],c[2],c[3]),h.setBlend(!0),h.blendFunc(h.ONE,h.ONE_MINUS_SRC_ALPHA),we(h,i),this.system={parameters:Ne(this.glw),extensions:be(this.glw)},this.shManager.renderer=this,this.defaultShader=this.shManager.loadShader("DefaultShader").shader;const u=h.createBuffer();g(u);const l=6*Float32Array.BYTES_PER_ELEMENT;this.quadBufferCollection=new Pe([{buffer:u,attributes:{a_position:{name:"a_position",size:2,type:h.FLOAT,normalized:!1,stride:l,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:h.FLOAT,normalized:!1,stride:l,offset:2*Float32Array.BYTES_PER_ELEMENT},a_color:{name:"a_color",size:4,type:h.UNSIGNED_BYTE,normalized:!0,stride:l,offset:4*Float32Array.BYTES_PER_ELEMENT},a_textureIndex:{name:"a_textureIndex",size:1,type:h.FLOAT,normalized:!1,stride:l,offset:5*Float32Array.BYTES_PER_ELEMENT}}}])}reset(){const{glw:e}=this;this.curBufferIdx=0,this.curRenderOp=null,this.renderOps.length=0,e.setScissorTest(!1),e.clear()}getShaderManager(){return this.shManager}createCtxTexture(e){return e instanceof B?new Ue(this.glw,this.txMemManager,e):e instanceof Y?new ee(this.glw,this.txMemManager,e):new P(this.glw,this.txMemManager,e)}addQuad(e){var z,q;const{fQuadBuffer:r,uiQuadBuffer:s}=this,{width:i,height:o,colorTl:h,colorTr:c,colorBl:u,colorBr:l,textureOptions:d,shader:E,shaderProps:x,alpha:_,clippingRect:T,tx:R,ty:A,ta:G,tb:X,tc:F,td:v,rtt:se,parentHasRenderTexture:ne,framebufferDimensions:ie}=e;let{texture:p}=e;if(x&&H(x,"$dimensions")){const w=x.$dimensions;w.width=i,w.height=o}p=p!=null?p:this.defaultTexture,g(p instanceof O,"Invalid texture type");let{curBufferIdx:f,curRenderOp:L}=this;const ae={width:i,height:o},k=E||this.defaultShader;g(k instanceof re),this.reuseRenderOp(e)||(this.newRenderOp(k,x,_,ae,T,f,se,ne,ie),L=this.curRenderOp,g(L));const oe=(z=d==null?void 0:d.flipX)!=null?z:!1,he=(q=d==null?void 0:d.flipY)!=null?q:!1;let I=0,S=0,N=1,b=1;if(p instanceof B){const{x:w,y:U,width:ue,height:fe}=p.props,{width:K=0,height:Z=0}=p.parentTexture.dimensions||{width:0,height:0};I=w/K,N=I+ue/K,S=U/Z,b=S+fe/Z,p=p.parentTexture}oe&&([I,N]=[N,I]),he&&([S,b]=[b,S]);const{txManager:ce}=this.stage,$=ce.getCtxTexture(p);g($ instanceof P);const M=this.addTexture($,f);if(L=this.curRenderOp,g(L),X!==0||F!==0)r[f++]=R,r[f++]=A,r[f++]=I,r[f++]=S,s[f++]=h,r[f++]=M,r[f++]=R+i*G,r[f++]=A+i*F,r[f++]=N,r[f++]=S,s[f++]=c,r[f++]=M,r[f++]=R+o*X,r[f++]=A+o*v,r[f++]=I,r[f++]=b,s[f++]=u,r[f++]=M,r[f++]=R+i*G+o*X,r[f++]=A+i*F+o*v,r[f++]=N,r[f++]=b,s[f++]=l,r[f++]=M;else{const w=R+i*G,U=A+o*v;r[f++]=R,r[f++]=A,r[f++]=I,r[f++]=S,s[f++]=h,r[f++]=M,r[f++]=w,r[f++]=A,r[f++]=N,r[f++]=S,s[f++]=c,r[f++]=M,r[f++]=R,r[f++]=U,r[f++]=I,r[f++]=b,s[f++]=u,r[f++]=M,r[f++]=w,r[f++]=U,r[f++]=N,r[f++]=b,s[f++]=l,r[f++]=M}L.length+=De,L.numQuads++,this.curBufferIdx=f}newRenderOp(e,r,s,i,o,h,c,u,l){const d=new Me(this.glw,this.options,this.quadBufferCollection,e,r,s,o,i,h,0,c,u,l);this.curRenderOp=d,this.renderOps.push(d)}addTexture(e,r,s){const{curRenderOp:i}=this;g(i);const o=i.addTexture(e);if(o===4294967295){if(s)throw new Error("Unable to add texture to render op");const{shader:h,shaderProps:c,dimensions:u,clippingRect:l,alpha:d}=i;return this.newRenderOp(h,c,d,u,l,r),this.addTexture(e,r,!0)}return o}reuseRenderOp(e){var u;const{shader:r,shaderProps:s,parentHasRenderTexture:i,rtt:o,clippingRect:h}=e,c=r||this.defaultShader;return!(((u=this.curRenderOp)==null?void 0:u.shader)!==c||!ge(this.curRenderOp.clippingRect,h)||i||o||this.curRenderOp.shader!==this.defaultShader&&(!s||!this.curRenderOp.shader.canBatchShaderProps(this.curRenderOp.shaderProps,s)))}addRenderOp(e){this.renderOps.push(e),this.curRenderOp=null}render(e="screen"){var h;const{glw:r,quadBuffer:s}=this,i=new Float32Array(s,0,this.curBufferIdx),o=(h=this.quadBufferCollection.getBuffer("a_position"))!=null?h:null;r.arrayBufferData(o,i,r.STATIC_DRAW),this.renderOps.forEach((c,u)=>{c.draw()})}renderToTexture(e){for(let r=0;r{const o=i.second,h=s[o]=s[o]||{};h[i.first]=i.amount}),this.kernings=s}*shapeText(e,r){var o;let s,i;for(;(s=r.peek())&&!s.done;){const h=s.value,c=this.glyphMap.get(h);if(r.next(),c!==void 0){const u=i!==void 0?(((o=this.kernings[c.id])==null?void 0:o[i])||0)+e.letterSpacing:0;i=c.id,yield{mapped:!0,glyphId:c.id,codepoint:h,cluster:r.lastIndex,xAdvance:c.xadvance+u,yAdvance:0,xOffset:c.xoffset+u,yOffset:c.yoffset,xBearing:0,yBearing:0,width:c.width,height:c.height}}else h===Ge.LINE_FEED&&(i=void 0),yield{mapped:!1,codepoint:h,cluster:r.lastIndex}}}}class et extends me{constructor(e,r,s,i,o,h){super(e,r);a(this,"type");a(this,"texture");a(this,"maxCharHeight",0);a(this,"data");a(this,"shaper");a(this,"glyphMap",new Map);this.type=s;const c=i.renderer;g(c instanceof Oe,"SDF Font Faces can only be used with the WebGL Renderer"),this.texture=i.txManager.loadTexture("ImageTexture",{src:o,premultiplyAlpha:!1},{preload:!0}),this.texture.on("loaded",()=>{this.checkLoaded()}),fetch(h).then(async u=>{this.data=await u.json();let l=0;this.data.chars.forEach(d=>{this.glyphMap.set(d.id,d);const E=d.yoffset+d.height;E>l&&(l=E)}),this.maxCharHeight=l,this.shaper=new Fe(this.data,this.glyphMap),this.checkLoaded()}).catch(console.error)}getAtlasEntry(e){const r=this.glyphMap.get(e);if(r===void 0)throw new Error("Glyph ".concat(e," not found in font ").concat(this.fontFamily));return{x:r.x,y:r.y,width:r.width,height:r.height}}checkLoaded(){this.loaded||this.texture.state==="loaded"&&this.data&&(this.loaded=!0,this.emit("loaded"))}}class tt{}export{Pe as B,tt as C,te as E,Y as R,et as S,me as T,re as W,g as a,Ae as b,j as c,$e as d,Ke as e,Ye as f,ke as g,ye as h,Ee as i,O as j,je as k,ze as l,Ve as m,qe as n,Ze as o,Me as p,He as q,Je as r,We as s,Qe as t,V as u,B as v,Oe as w}; +//# sourceMappingURL=CoreExtension-BfzrAcK3.js.map diff --git a/assets/CoreExtension-D6FI1p2n.js.map b/assets/CoreExtension-BfzrAcK3.js.map similarity index 99% rename from assets/CoreExtension-D6FI1p2n.js.map rename to assets/CoreExtension-BfzrAcK3.js.map index bbc4802..1fdcfc2 100644 --- a/assets/CoreExtension-D6FI1p2n.js.map +++ b/assets/CoreExtension-BfzrAcK3.js.map @@ -1 +1 @@ -{"version":3,"file":"CoreExtension-D6FI1p2n.js","sources":["../../../../../renderer/dist/src/utils.js","../../../../../renderer/dist/src/common/EventEmitter.js","../../../../../renderer/dist/src/core/renderers/CoreShader.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/ShaderUtils.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/WebGlUtils.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreShader.js","../../../../../renderer/dist/src/core/textures/Texture.js","../../../../../renderer/dist/src/core/lib/utils.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/TrFontFace.js","../../../../../renderer/dist/src/core/renderers/CoreContextTexture.js","../../../../../renderer/dist/src/core/renderers/CoreRenderer.js","../../../../../renderer/dist/src/core/renderers/CoreRenderOp.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreRenderOp.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/RendererUtils.js","../../../../../renderer/node_modules/.pnpm/memize@2.1.0/node_modules/memize/dist/index.js","../../../../../renderer/dist/src/core/utils.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js","../../../../../renderer/dist/src/core/textures/ColorTexture.js","../../../../../renderer/dist/src/core/textures/SubTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxSubTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/BufferCollection.js","../../../../../renderer/dist/src/core/lib/WebGlContextWrapper.js","../../../../../renderer/dist/src/core/textures/RenderTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxRenderTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/SpecialCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/FontShaper.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/SdfFontShaper.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js","../../../../../renderer/dist/src/core/CoreExtension.js"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createWebGLContext(canvas, contextSpy) {\n const config = {\n alpha: true,\n antialias: false,\n depth: false,\n stencil: true,\n desynchronized: false,\n // Disabled because it prevents Visual Regression Tests from working\n // failIfMajorPerformanceCaveat: true,\n powerPreference: 'high-performance',\n premultipliedAlpha: true,\n preserveDrawingBuffer: false,\n };\n const gl = \n // TODO: Remove this assertion once this issue is fixed in TypeScript\n // https://github.com/microsoft/TypeScript/issues/53614\n (canvas.getContext('webgl', config) ||\n canvas.getContext('experimental-webgl', config));\n if (!gl) {\n throw new Error('Unable to create WebGL context');\n }\n if (contextSpy) {\n // Proxy the GL context to log all GL calls\n return new Proxy(gl, {\n get(target, prop) {\n const value = target[prop];\n if (typeof value === 'function') {\n contextSpy.increment(String(prop));\n return value.bind(target);\n }\n return value;\n },\n });\n }\n return gl;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (isProductionEnvironment())\n return;\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n/**\n * Merges two colors based on a given progress value.\n *\n * This function takes two colors (c1 and c2) represented as 32-bit integers\n * in RGBA format and blends them based on the provided progress value (p).\n * The result is a new color that is a weighted combination of the input colors,\n * where the weight is determined by the progress value.\n *\n * @param {number} c1 - The first color in RGBA format (32-bit integer).\n * @param {number} c2 - The second color in RGBA format (32-bit integer).\n * @param {number} p - The progress value between 0 and 1.\n * @returns {number} The merged color as a 32-bit integer in RGBA format.\n */\nexport function mergeColorProgress(rgba1, rgba2, p) {\n const r1 = Math.trunc(rgba1 >>> 24);\n const g1 = Math.trunc((rgba1 >>> 16) & 0xff);\n const b1 = Math.trunc((rgba1 >>> 8) & 0xff);\n const a1 = Math.trunc(rgba1 & 0xff);\n const r2 = Math.trunc(rgba2 >>> 24);\n const g2 = Math.trunc((rgba2 >>> 16) & 0xff);\n const b2 = Math.trunc((rgba2 >>> 8) & 0xff);\n const a2 = Math.trunc(rgba2 & 0xff);\n const r = Math.round(r2 * p + r1 * (1 - p));\n const g = Math.round(g2 * p + g1 * (1 - p));\n const b = Math.round(b2 * p + b1 * (1 - p));\n const a = Math.round(a2 * p + a1 * (1 - p));\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter.\n *\n * @internalRemarks\n * This method does NOT premultiply the alpha into the color channels. If that\n * is required (for internal use only) use {@link mergeColorAlphaPremultiplied}\n * instead.\n *\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @returns\n */\nexport function mergeColorAlpha(rgba, alpha) {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = Math.trunc((rgba & 0xff) * alpha);\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter. Before returning, the\n * final alpha value is multiplied into the color channels.\n *\n * @remarks\n * If `flipEndianess` is set to true, the function will returned an ABGR encoded number\n * which is useful when the color value needs to be passed into a shader attribute.\n *\n * NOTE: This method returns a PREMULTIPLIED alpha color which is generally only useful\n * in the context of the internal rendering process. Use {@link mergeColorAlpha} if you\n * need to blend an alpha value into a color in the context of the Renderer's\n * main API.\n *\n * @internalRemarks\n * Do not expose this method in the main API because Renderer users should instead use\n * {@link mergeColorAlpha} to manipulate the alpha value of a color.\n *\n * @internal\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @param flipEndianess Flip the endianess. RGBA becomes encoded as ABGR (for inserting colors into shader attributes)\n * @returns\n */\nexport function mergeColorAlphaPremultiplied(rgba, alpha, flipEndianess = false) {\n const newAlpha = ((rgba & 0xff) / 255) * alpha;\n const r = Math.trunc((rgba >>> 24) * newAlpha);\n const g = Math.trunc(((rgba >>> 16) & 0xff) * newAlpha);\n const b = Math.trunc(((rgba >>> 8) & 0xff) * newAlpha);\n const a = Math.trunc(newAlpha * 255);\n if (flipEndianess) {\n return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0;\n }\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Returns true if the given object has the given \"own\" property.\n *\n * @param obj\n * @param prop\n * @returns\n */\nexport function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n/**\n * Converts degrees to radians\n *\n * @param degrees\n * @returns\n */\nexport function deg2Rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * Returns image aspect ratio\n *\n * @param width\n * @param height\n * @returns\n */\nexport function getImageAspectRatio(width, height) {\n return width / height;\n}\n/**\n * Checks import.meta if env is production\n *\n * @returns\n */\nexport function isProductionEnvironment() {\n return import.meta.env && import.meta.env.PROD;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * EventEmitter base class\n */\nexport class EventEmitter {\n eventListeners = {};\n on(event, listener) {\n let listeners = this.eventListeners[event];\n if (!listeners) {\n listeners = [];\n }\n listeners.push(listener);\n this.eventListeners[event] = listeners;\n }\n off(event, listener) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n if (!listener) {\n delete this.eventListeners[event];\n return;\n }\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n once(event, listener) {\n const onceListener = (target, data) => {\n this.off(event, onceListener);\n listener(target, data);\n };\n this.on(event, onceListener);\n }\n emit(event, data) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n [...listeners].forEach((listener) => {\n listener(this, data);\n });\n }\n removeAllListeners() {\n this.eventListeners = {};\n }\n}\n//# sourceMappingURL=EventEmitter.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreShader {\n // abstract draw(): void;\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {};\n }\n}\n//# sourceMappingURL=CoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion Types\nexport function createShader(glw, type, source) {\n const shader = glw.createShader(type);\n if (!shader) {\n throw new Error();\n }\n glw.shaderSource(shader, source);\n glw.compileShader(shader);\n const success = glw.getShaderParameter(shader, glw.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.log(glw.getShaderInfoLog(shader));\n glw.deleteShader(shader);\n}\nexport function createProgram(glw, vertexShader, fragmentShader) {\n const program = glw.createProgram();\n if (!program) {\n throw new Error();\n }\n glw.attachShader(program, vertexShader);\n glw.attachShader(program, fragmentShader);\n glw.linkProgram(program);\n const success = glw.getProgramParameter(program, glw.LINK_STATUS);\n if (success) {\n return program;\n }\n console.log(glw.getProgramInfoLog(program));\n glw.deleteProgram(program);\n return undefined;\n}\n//# sourceMappingURL=ShaderUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generic WebGL Utility Functions\n *\n * @remarks\n * Nothing here should be coupled to Renderer logic / types.\n *\n * @param gl\n * @returns\n */\nexport function isWebGl2(gl) {\n return (self.WebGL2RenderingContext && gl instanceof self.WebGL2RenderingContext);\n}\n//# sourceMappingURL=WebGlUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, hasOwn } from '../../../utils.js';\nimport { CoreShader } from '../CoreShader.js';\nimport { createProgram, createShader, } from './internal/ShaderUtils.js';\nimport { isWebGl2 } from './internal/WebGlUtils.js';\nexport class WebGlCoreShader extends CoreShader {\n boundBufferCollection = null;\n buffersBound = false;\n program;\n /**\n * Vertex Array Object\n *\n * @remarks\n * Used by WebGL2 Only\n */\n vao;\n renderer;\n glw;\n attributeBuffers;\n attributeLocations;\n attributeNames;\n uniformLocations;\n uniformTypes;\n supportsIndexedTextures;\n constructor(options) {\n super();\n const renderer = (this.renderer = options.renderer);\n const glw = (this.glw = this.renderer.glw);\n this.supportsIndexedTextures = options.supportsIndexedTextures || false;\n // Check that extensions are supported\n const webGl2 = glw.isWebGl2();\n const requiredExtensions = (webGl2 && options.webgl2Extensions) ||\n (!webGl2 && options.webgl1Extensions) ||\n [];\n const glVersion = webGl2 ? '2.0' : '1.0';\n requiredExtensions.forEach((extensionName) => {\n if (!glw.getExtension(extensionName)) {\n throw new Error(`Shader \"${this.constructor.name}\" requires extension \"${extensionName}\" for WebGL ${glVersion} but wasn't found`);\n }\n });\n // Gather shader sources\n // - If WebGL 2 and special WebGL 2 sources are provided, we copy those sources and delete\n // the extra copy of them to save memory.\n // TODO: This could be further made optimal by just caching the compiled shaders and completely deleting\n // the source code\n const shaderSources = options.shaderSources ||\n this.constructor.shaderSources;\n if (!shaderSources) {\n throw new Error(`Shader \"${this.constructor.name}\" is missing shaderSources.`);\n }\n else if (webGl2 && shaderSources?.webGl2) {\n shaderSources.fragment = shaderSources.webGl2.fragment;\n shaderSources.vertex = shaderSources.webGl2.vertex;\n delete shaderSources.webGl2;\n }\n const textureUnits = renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n const vertexSource = shaderSources.vertex instanceof Function\n ? shaderSources.vertex(textureUnits)\n : shaderSources.vertex;\n const fragmentSource = shaderSources.fragment instanceof Function\n ? shaderSources.fragment(textureUnits)\n : shaderSources.fragment;\n const vertexShader = createShader(glw, glw.VERTEX_SHADER, vertexSource);\n const fragmentShader = createShader(glw, glw.FRAGMENT_SHADER, fragmentSource);\n if (!vertexShader || !fragmentShader) {\n throw new Error();\n }\n const program = createProgram(glw, vertexShader, fragmentShader);\n if (!program) {\n throw new Error();\n }\n this.program = program;\n if (webGl2) {\n const vao = glw.createVertexArray();\n if (!vao) {\n throw new Error();\n }\n this.vao = vao;\n glw.bindVertexArray(this.vao);\n }\n this.attributeLocations = {};\n this.attributeBuffers = {};\n this.attributeNames = [];\n [...options.attributes].forEach((attributeName) => {\n const location = glw.getAttribLocation(this.program, attributeName);\n if (location < 0) {\n throw new Error(`${this.constructor.name}: Vertex shader must have an attribute \"${attributeName}\"!`);\n }\n const buffer = glw.createBuffer();\n if (!buffer) {\n throw new Error(`${this.constructor.name}: Could not create buffer for attribute \"${attributeName}\"`);\n }\n this.attributeLocations[attributeName] = location;\n this.attributeBuffers[attributeName] = buffer;\n this.attributeNames.push(attributeName);\n });\n this.uniformLocations = {};\n this.uniformTypes = {};\n options.uniforms.forEach((uniform) => {\n const location = glw.getUniformLocation(this.program, uniform.name);\n this.uniformTypes[uniform.name] = uniform.uniform;\n if (!location) {\n console.warn(`Shader \"${this.constructor.name}\" could not get uniform location for \"${uniform.name}\"`);\n return;\n }\n this.uniformLocations[uniform.name] = location;\n });\n }\n bindBufferAttribute(location, buffer, attribute) {\n const { glw } = this;\n glw.enableVertexAttribArray(location);\n glw.vertexAttribPointer(buffer, location, attribute.size, attribute.type, attribute.normalized, attribute.stride, attribute.offset);\n }\n disableAttribute(location) {\n this.glw.disableVertexAttribArray(location);\n }\n disableAttributes() {\n for (const loc in this.attributeLocations) {\n this.disableAttribute(this.attributeLocations[loc]);\n }\n this.boundBufferCollection = null;\n }\n /**\n * Given two sets of Shader props destined for this Shader, determine if they can be batched together\n * to reduce the number of draw calls.\n *\n * @remarks\n * This is used by the {@link WebGlCoreRenderer} to determine if it can batch multiple consecutive draw\n * calls into a single draw call.\n *\n * By default, this returns false (meaning no batching is allowed), but can be\n * overridden by child classes to provide more efficient batching.\n *\n * @param propsA\n * @param propsB\n * @returns\n */\n canBatchShaderProps(propsA, propsB) {\n return false;\n }\n bindRenderOp(renderOp, props) {\n this.bindBufferCollection(renderOp.buffers);\n if (renderOp.textures.length > 0) {\n this.bindTextures(renderOp.textures);\n }\n const { glw, parentHasRenderTexture, renderToTexture } = renderOp;\n // Skip if the parent and current operation both have render textures\n if (renderToTexture && parentHasRenderTexture) {\n return;\n }\n // Bind render texture framebuffer dimensions as resolution\n // if the parent has a render texture\n if (parentHasRenderTexture) {\n const { width, height } = renderOp.framebufferDimensions || {};\n // Force pixel ratio to 1.0 for render textures since they are always 1:1\n // the final render texture will be rendered to the screen with the correct pixel ratio\n this.setUniform('u_pixelRatio', 1.0);\n // Set resolution to the framebuffer dimensions\n this.setUniform('u_resolution', new Float32Array([width ?? 0, height ?? 0]));\n }\n else {\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\n this.setUniform('u_resolution', new Float32Array([glw.canvas.width, glw.canvas.height]));\n }\n if (props) {\n // Bind optional automatic uniforms\n // These are only bound if their keys are present in the props.\n if (hasOwn(props, '$dimensions')) {\n let dimensions = props.$dimensions;\n if (!dimensions) {\n dimensions = renderOp.dimensions;\n }\n this.setUniform('u_dimensions', [dimensions.width, dimensions.height]);\n }\n if (hasOwn(props, '$alpha')) {\n let alpha = props.$alpha;\n if (!alpha) {\n alpha = renderOp.alpha;\n }\n this.setUniform('u_alpha', alpha);\n }\n this.bindProps(props);\n }\n }\n setUniform(name, ...value) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-argument\n this.glw.setUniform(this.uniformTypes[name], this.uniformLocations[name], ...value);\n }\n bindBufferCollection(buffer) {\n if (this.boundBufferCollection === buffer) {\n return;\n }\n for (const attributeName in this.attributeLocations) {\n const resolvedBuffer = buffer.getBuffer(attributeName);\n const resolvedInfo = buffer.getAttributeInfo(attributeName);\n assertTruthy(resolvedBuffer, `Buffer for \"${attributeName}\" not found`);\n assertTruthy(resolvedInfo);\n this.bindBufferAttribute(this.attributeLocations[attributeName], resolvedBuffer, resolvedInfo);\n }\n this.boundBufferCollection = buffer;\n }\n bindProps(props) {\n // Implement in child class\n }\n bindTextures(textures) {\n // no defaults\n }\n attach() {\n this.glw.useProgram(this.program);\n this.glw.useProgram(this.program);\n if (this.glw.isWebGl2() && this.vao) {\n this.glw.bindVertexArray(this.vao);\n }\n }\n detach() {\n this.disableAttributes();\n }\n static shaderSources;\n}\n//# sourceMappingURL=WebGlCoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../common/EventEmitter.js';\n/**\n * Represents a source of texture data for a CoreContextTexture.\n *\n * @remarks\n * Texture sources are used to populate a CoreContextTexture when that texture\n * is loaded. Texture data retrieved by the CoreContextTexture by the\n * `getTextureData` method. It's the responsibility of the concerete `Texture`\n * subclass to implement this method appropriately.\n */\nexport class Texture extends EventEmitter {\n txManager;\n /**\n * The dimensions of the texture\n *\n * @remarks\n * Until the texture data is loaded for the first time the value will be\n * `null`.\n */\n dimensions = null;\n error = null;\n state = 'freed';\n renderableOwners = new Set();\n constructor(txManager) {\n super();\n this.txManager = txManager;\n }\n /**\n * Add/remove an owner to/from the Texture based on its renderability.\n *\n * @remarks\n * Any object can own a texture, be it a CoreNode or even the state object\n * from a Text Renderer.\n *\n * When the reference to the texture that an owner object holds is replaced\n * or cleared it must call this with `renderable=false` to release the owner\n * association.\n *\n * @param owner\n * @param renderable\n */\n setRenderableOwner(owner, renderable) {\n if (renderable) {\n this.renderableOwners.add(owner);\n }\n else {\n this.renderableOwners.delete(owner);\n }\n }\n /**\n * Returns true if the texture is assigned to any Nodes that are renderable.\n */\n get renderable() {\n return this.renderableOwners.size > 0;\n }\n /**\n * Set the state of the texture\n *\n * @remark\n * Intended for internal-use only but declared public so that it can be set\n * by it's associated {@link CoreContextTexture}\n *\n * @param state\n * @param args\n */\n setState(state, ...args) {\n if (this.state !== state) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.state = state;\n if (state === 'loaded') {\n const loadedArgs = args;\n this.dimensions = loadedArgs[0];\n }\n else if (state === 'failed') {\n const failedArgs = args;\n this.error = failedArgs[0];\n }\n this.emit(state, ...args);\n }\n }\n /**\n * Make a cache key for this texture.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide an\n * appropriate cache key for the texture type including the texture's\n * properties that uniquely identify a copy of the texture. If the texture\n * type does not support caching, then this method should return `false`.\n *\n * @param props\n * @returns\n * A cache key for this texture or `false` if the texture type does not\n * support caching.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n /**\n * Resolve the default values for the texture's properties.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide\n * default values for the texture's optional properties.\n *\n * @param props\n * @returns\n * The default values for the texture's properties.\n */\n static resolveDefaults(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props) {\n return {};\n }\n}\n//# sourceMappingURL=Texture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNormalizedRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r / 255, g / 255, b / 255, a / 255];\n};\nexport const getRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r, g, b, a];\n};\nexport const norm = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n const rgbaArr = [r / 255, g / 255, b / 255, a / 255];\n rgbaArr[0] = Math.max(0, Math.min(255, rgbaArr[0]));\n rgbaArr[1] = Math.max(0, Math.min(255, rgbaArr[1]));\n rgbaArr[2] = Math.max(0, Math.min(255, rgbaArr[2]));\n rgbaArr[3] = Math.max(0, Math.min(255, rgbaArr[3]));\n let v = ((rgbaArr[3] | 0) << 24) +\n ((rgbaArr[0] | 0) << 16) +\n ((rgbaArr[1] | 0) << 8) +\n (rgbaArr[2] | 0);\n if (v < 0) {\n v = 0xffffffff + v + 1;\n }\n return v;\n};\nexport function getNormalizedAlphaComponent(rgba) {\n return (rgba & 0xff) / 255.0;\n}\n/**\n * Get a CSS color string from a RGBA color\n *\n * @param color\n * @returns\n */\nexport function getRgbaString(color) {\n const r = Math.floor(color[0] * 255.0);\n const g = Math.floor(color[1] * 255.0);\n const b = Math.floor(color[2] * 255.0);\n const a = Math.floor(color[3] * 255.0);\n return `rgba(${r},${g},${b},${a.toFixed(4)})`;\n}\nexport function createBound(x1, y1, x2, y2, out) {\n if (out) {\n out.x1 = x1;\n out.y1 = y1;\n out.x2 = x2;\n out.y2 = y2;\n return out;\n }\n return {\n x1,\n y1,\n x2,\n y2,\n };\n}\nexport function intersectBound(a, b, out) {\n const intersection = createBound(Math.max(a.x1, b.x1), Math.max(a.y1, b.y1), Math.min(a.x2, b.x2), Math.min(a.y2, b.y2), out);\n if (intersection.x1 < intersection.x2 && intersection.y1 < intersection.y2) {\n return intersection;\n }\n return createBound(0, 0, 0, 0, intersection);\n}\nexport function boundsOverlap(a, b) {\n return a.x1 < b.x2 && a.x2 > b.x1 && a.y1 < b.y2 && a.y2 > b.y1;\n}\nexport function convertBoundToRect(bound, out) {\n if (out) {\n out.x = bound.x1;\n out.y = bound.y1;\n out.width = bound.x2 - bound.x1;\n out.height = bound.y2 - bound.y1;\n return out;\n }\n return {\n x: bound.x1,\n y: bound.y1,\n width: bound.x2 - bound.x1,\n height: bound.y2 - bound.y1,\n };\n}\nexport function intersectRect(a, b, out) {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const width = Math.min(a.x + a.width, b.x + b.width) - x;\n const height = Math.min(a.y + a.height, b.y + b.height) - y;\n if (width > 0 && height > 0) {\n if (out) {\n out.x = x;\n out.y = y;\n out.width = width;\n out.height = height;\n return out;\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n if (out) {\n out.x = 0;\n out.y = 0;\n out.width = 0;\n out.height = 0;\n return out;\n }\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n}\nexport function copyRect(a, out) {\n if (out) {\n out.x = a.x;\n out.y = a.y;\n out.width = a.width;\n out.height = a.height;\n return out;\n }\n return {\n x: a.x,\n y: a.y,\n width: a.width,\n height: a.height,\n };\n}\nexport function compareRect(a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n return (a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height);\n}\nexport function boundInsideBound(bound1, bound2) {\n return (bound1.x1 <= bound2.x2 &&\n bound1.y1 <= bound2.y2 &&\n bound1.x2 >= bound2.x1 &&\n bound1.y2 >= bound2.y1);\n}\nexport function isBoundPositive(bound) {\n return bound.x1 < bound.x2 && bound.y1 < bound.y2;\n}\nexport function isRectPositive(rect) {\n return rect.width > 0 && rect.height > 0;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nexport class TrFontFace extends EventEmitter {\n fontFamily;\n descriptors;\n loaded = false;\n constructor(fontFamily, descriptors) {\n super();\n this.fontFamily = fontFamily;\n this.descriptors = {\n style: 'normal',\n weight: 'normal',\n stretch: 'normal',\n ...descriptors,\n };\n }\n /**\n * Convert a TrFontFaceDescriptors to a FontFaceDescriptors which differ slightly\n *\n * @param descriptors\n * @returns\n */\n static convertToCssFontFaceDescriptors(descriptors) {\n return {\n style: descriptors.style,\n weight: typeof descriptors.weight === 'number'\n ? `${descriptors.weight}`\n : descriptors.weight,\n stretch: descriptors.stretch,\n unicodeRange: descriptors.unicodeRange,\n variant: descriptors.variant,\n featureSettings: descriptors.featureSettings,\n display: descriptors.display,\n };\n }\n}\n//# sourceMappingURL=TrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreContextTexture {\n memManager;\n textureSource;\n constructor(memManager, textureSource) {\n this.memManager = memManager;\n this.textureSource = textureSource;\n }\n}\n//# sourceMappingURL=CoreContextTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreContextTexture } from './CoreContextTexture.js';\nexport class CoreRenderer {\n stage;\n constructor(stage) {\n this.stage = stage;\n }\n}\n//# sourceMappingURL=CoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreRenderOp {\n}\n//# sourceMappingURL=CoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreRenderOp } from '../CoreRenderOp.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nconst MAX_TEXTURES = 8; // TODO: get from gl\n/**\n * Can render multiple quads with multiple textures (up to vertex shader texture limit)\n *\n */\nexport class WebGlCoreRenderOp extends CoreRenderOp {\n glw;\n options;\n buffers;\n shader;\n shaderProps;\n alpha;\n clippingRect;\n dimensions;\n bufferIdx;\n zIndex;\n renderToTexture;\n parentHasRenderTexture;\n framebufferDimensions;\n length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex, renderToTexture, parentHasRenderTexture, framebufferDimensions) {\n super();\n this.glw = glw;\n this.options = options;\n this.buffers = buffers;\n this.shader = shader;\n this.shaderProps = shaderProps;\n this.alpha = alpha;\n this.clippingRect = clippingRect;\n this.dimensions = dimensions;\n this.bufferIdx = bufferIdx;\n this.zIndex = zIndex;\n this.renderToTexture = renderToTexture;\n this.parentHasRenderTexture = parentHasRenderTexture;\n this.framebufferDimensions = framebufferDimensions;\n this.maxTextures = shader.supportsIndexedTextures\n ? glw.getParameter(glw.MAX_VERTEX_TEXTURE_IMAGE_UNITS)\n : 1;\n }\n addTexture(texture) {\n const { textures, maxTextures } = this;\n const existingIdx = textures.findIndex((t) => t === texture);\n if (existingIdx !== -1) {\n return existingIdx;\n }\n const newIdx = textures.length;\n if (newIdx >= maxTextures) {\n return 0xffffffff;\n }\n this.textures.push(texture);\n return newIdx;\n }\n draw() {\n const { glw, shader, shaderProps, options } = this;\n const { shManager } = options;\n shManager.useShader(shader);\n shader.bindRenderOp(this, shaderProps);\n // TODO: Reduce calculations required\n const quadIdx = (this.bufferIdx / 24) * 6 * 2;\n // Clipping\n if (this.clippingRect.valid) {\n const { x, y, width, height } = this.clippingRect;\n const pixelRatio = options.pixelRatio;\n const canvasHeight = options.canvas.height;\n const clipX = Math.round(x * pixelRatio);\n const clipWidth = Math.round(width * pixelRatio);\n const clipHeight = Math.round(height * pixelRatio);\n const clipY = Math.round(canvasHeight - clipHeight - y * pixelRatio);\n glw.setScissorTest(true);\n glw.scissor(clipX, clipY, clipWidth, clipHeight);\n }\n else {\n glw.setScissorTest(false);\n }\n glw.drawElements(glw.TRIANGLES, 6 * this.numQuads, glw.UNSIGNED_SHORT, quadIdx);\n }\n}\n//# sourceMappingURL=WebGlCoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Get device specific webgl parameters\n * @param glw\n */\nexport function getWebGlParameters(glw) {\n const params = {\n MAX_RENDERBUFFER_SIZE: 0,\n MAX_TEXTURE_SIZE: 0,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n MAX_VIEWPORT_DIMS: 0,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0,\n MAX_TEXTURE_IMAGE_UNITS: 0,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0,\n MAX_VERTEX_ATTRIBS: 0,\n MAX_VARYING_VECTORS: 0,\n MAX_VERTEX_UNIFORM_VECTORS: 0,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0,\n };\n // Map over all parameters and get them\n const keys = Object.keys(params);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params[key] = glw.getParameter(glw[key]);\n });\n return params;\n}\n/**\n * Get device webgl extensions\n * @param glw\n */\nexport function getWebGlExtensions(glw) {\n const extensions = {\n ANGLE_instanced_arrays: null,\n WEBGL_compressed_texture_s3tc: null,\n WEBGL_compressed_texture_astc: null,\n WEBGL_compressed_texture_etc: null,\n WEBGL_compressed_texture_etc1: null,\n WEBGL_compressed_texture_pvrtc: null,\n WEBKIT_WEBGL_compressed_texture_pvrtc: null,\n WEBGL_compressed_texture_s3tc_srgb: null,\n OES_vertex_array_object: null,\n };\n // Map over all extensions and get them\n const keys = Object.keys(extensions);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n extensions[key] = glw.getExtension(key);\n });\n return extensions;\n}\n/**\n * Allocate big memory chunk that we\n * can re-use to draw quads\n *\n * @param glw\n * @param size\n */\nexport function createIndexBuffer(glw, size) {\n const maxQuads = ~~(size / 80);\n const indices = new Uint16Array(maxQuads * 6);\n for (let i = 0, j = 0; i < maxQuads; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 2;\n indices[i + 4] = j + 1;\n indices[i + 5] = j + 3;\n }\n const buffer = glw.createBuffer();\n glw.elementArrayBufferData(buffer, indices, glw.STATIC_DRAW);\n}\n/**\n * Checks if an object is of type HTMLImageElement.\n * This is used because we cant check for HTMLImageElement directly when the\n * renderer is running in a seperate web worker context.\n *\n * @param obj\n * @returns\n */\nexport function isHTMLImageElement(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n obj.constructor &&\n obj.constructor.name === 'HTMLImageElement');\n}\n//# sourceMappingURL=RendererUtils.js.map","/**\n * Memize options object.\n *\n * @typedef MemizeOptions\n *\n * @property {number} [maxSize] Maximum size of the cache.\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef MemizeCacheNode\n *\n * @property {?MemizeCacheNode|undefined} [prev] Previous node.\n * @property {?MemizeCacheNode|undefined} [next] Next node.\n * @property {Array<*>} args Function arguments for cache\n * entry.\n * @property {*} val Function result.\n */\n\n/**\n * Properties of the enhanced function for controlling cache.\n *\n * @typedef MemizeMemoizedFunction\n *\n * @property {()=>void} clear Clear the cache.\n */\n\n/**\n * Accepts a function to be memoized, and returns a new memoized function, with\n * optional options.\n *\n * @template {(...args: any[]) => any} F\n *\n * @param {F} fn Function to memoize.\n * @param {MemizeOptions} [options] Options object.\n *\n * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function.\n */\nfunction memize(fn, options) {\n\tvar size = 0;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar head;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar tail;\n\n\toptions = options || {};\n\n\tfunction memoized(/* ...args */) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs,\n\t\t\ti;\n\n\t\tsearchCache: while (node) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif (node.args.length !== arguments.length) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (node.args[i] !== arguments[i]) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== head) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif (node === tail) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\t/** @type {MemizeCacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {MemizeCacheNode} */ (head).prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply(null, args),\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (head) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif (size === /** @type {MemizeOptions} */ (options).maxSize) {\n\t\t\ttail = /** @type {MemizeCacheNode} */ (tail).prev;\n\t\t\t/** @type {MemizeCacheNode} */ (tail).next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function () {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\t// Ignore reason: There's not a clear solution to create an intersection of\n\t// the function with additional properties, where the goal is to retain the\n\t// function signature of the incoming argument and add control properties\n\t// on the return value.\n\n\t// @ts-ignore\n\treturn memoized;\n}\n\nexport { memize as default };\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Core Utility Functions\n *\n * @module\n */\nimport memo from 'memize';\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\nconst degree = Math.PI / 180;\nexport const setMatrixArrayType = (type) => {\n ARRAY_TYPE = type;\n};\nexport const toRadian = (a) => {\n return a * degree;\n};\nexport const equals = (a, b) => {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n};\nexport const rand = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\nexport const isPowerOfTwo = (value) => {\n return value && !(value & (value - 1));\n};\nconst getTimingBezier = (a, b, c, d) => {\n const xc = 3.0 * a;\n const xb = 3.0 * (c - a) - xc;\n const xa = 1.0 - xc - xb;\n const yc = 3.0 * b;\n const yb = 3.0 * (d - b) - yc;\n const ya = 1.0 - yc - yb;\n return function (time) {\n if (time >= 1.0) {\n return 1;\n }\n if (time <= 0) {\n return 0;\n }\n let t = 0.5, cbx, cbxd, dx;\n for (let it = 0; it < 20; it++) {\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n return t * (t * (t * ya + yb) + yc);\n }\n // Cubic bezier derivative.\n cbxd = t * (t * (3 * xa) + 2 * xb) + xc;\n if (cbxd > 1e-10 && cbxd < 1e-10) {\n // Problematic. Fall back to binary search method.\n break;\n }\n t += dx / cbxd;\n }\n // Fallback: binary search method. This is more reliable when there are near-0 slopes.\n let minT = 0;\n let maxT = 1;\n for (let it = 0; it < 20; it++) {\n t = 0.5 * (minT + maxT);\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n // Solution found!\n return t * (t * (t * ya + yb) + yc);\n }\n if (dx < 0) {\n maxT = t;\n }\n else {\n minT = t;\n }\n }\n };\n};\nexport const getTimingFunction = memo((str) => {\n switch (str) {\n case 'linear':\n return function (time) {\n return time;\n };\n case 'ease':\n return getTimingBezier(0.25, 0.1, 0.25, 1.0);\n case 'ease-in':\n return getTimingBezier(0.42, 0, 1.0, 1.0);\n case 'ease-out':\n return getTimingBezier(0, 0, 0.58, 1.0);\n case 'ease-in-out':\n return getTimingBezier(0.42, 0, 0.58, 1.0);\n case 'ease-in-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-out-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-in-out-sine':\n return getTimingBezier(0.37, 0, 0.63, 1);\n case 'ease-in-cubic':\n return getTimingBezier(0.32, 0, 0.67, 0);\n case 'ease-out-cubic':\n return getTimingBezier(0.33, 1, 0.68, 1);\n case 'ease-in-out-cubic':\n return getTimingBezier(0.65, 0, 0.35, 1);\n case 'ease-in-circ':\n return getTimingBezier(0.55, 0, 1, 0.45);\n case 'ease-out-circ':\n return getTimingBezier(0, 0.55, 0.45, 1);\n case 'ease-in-out-circ':\n return getTimingBezier(0.85, 0, 0.15, 1);\n case 'ease-in-back':\n return getTimingBezier(0.36, 0, 0.66, -0.56);\n case 'ease-out-back':\n return getTimingBezier(0.34, 1.56, 0.64, 1);\n case 'ease-in-out-back':\n return getTimingBezier(0.68, -0.6, 0.32, 1.6);\n case 'step-start':\n return function () {\n return 1;\n };\n case 'step-end':\n return function (time) {\n return time === 1 ? 1 : 0;\n };\n default:\n // eslint-disable-next-line no-case-declarations\n const s = 'cubic-bezier(';\n if (str && str.indexOf(s) === 0) {\n const parts = str\n .substr(s.length, str.length - s.length - 1)\n .split(',');\n if (parts.length !== 4) {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n const a = parseFloat(parts[0] || '0.42');\n const b = parseFloat(parts[1] || '0');\n const c = parseFloat(parts[2] || '1');\n const d = parseFloat(parts[3] || '1');\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\n console.warn(' Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n return getTimingBezier(a, b, c, d);\n }\n else {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n }\n});\nif (!Math.hypot)\n Math.hypot = (...args) => {\n let y = 0, i = args.length;\n while (i--) {\n y += args[i] * args[i];\n }\n return Math.sqrt(y);\n };\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { isPowerOfTwo } from '../../utils.js';\nimport { CoreContextTexture } from '../CoreContextTexture.js';\nimport { isHTMLImageElement } from './internal/RendererUtils.js';\nconst TRANSPARENT_TEXTURE_DATA = new Uint8Array([0, 0, 0, 0]);\n/**\n * A wrapper around a WebGLTexture that handles loading the texture data\n * from a Texture source and uploading it to the GPU as well as freeing\n * the uploaded texture.\n *\n * @remarks\n * When accessing the ctxTexture property, the texture will be loaded if\n * it hasn't been already. ctxTexture will always return a valid WebGLTexture\n * and trigger the loading/uploading of the texture's data if it hasn't been\n * loaded yet.\n */\nexport class WebGlCoreCtxTexture extends CoreContextTexture {\n glw;\n _nativeCtxTexture = null;\n _state = 'freed';\n _w = 0;\n _h = 0;\n constructor(glw, memManager, textureSource) {\n super(memManager, textureSource);\n this.glw = glw;\n }\n get ctxTexture() {\n if (this._state === 'freed') {\n this.load();\n }\n assertTruthy(this._nativeCtxTexture);\n return this._nativeCtxTexture;\n }\n get renderable() {\n return this.textureSource.renderable;\n }\n get w() {\n return this._w;\n }\n get h() {\n return this._h;\n }\n /**\n * Load the texture data from the Texture source and upload it to the GPU\n *\n * @remarks\n * This method is called automatically when accessing the ctxTexture property\n * if the texture hasn't been loaded yet. But it can also be called manually\n * to force the texture to be pre-loaded prior to accessing the ctxTexture\n * property.\n */\n load() {\n // If the texture is already loading or loaded, don't load it again.\n if (this._state === 'loading' || this._state === 'loaded') {\n return;\n }\n this._state = 'loading';\n this.textureSource.setState('loading');\n this._nativeCtxTexture = this.createNativeCtxTexture();\n this.onLoadRequest()\n .then(({ width, height }) => {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'loaded';\n this._w = width;\n this._h = height;\n // Update the texture source's width and height so that it can be used\n // for rendering.\n this.textureSource.setState('loaded', { width, height });\n })\n .catch((err) => {\n this._state = 'failed';\n this.textureSource.setState('failed', err);\n console.error(err);\n });\n }\n /**\n * Called when the texture data needs to be loaded and uploaded to a texture\n */\n async onLoadRequest() {\n const { glw, memManager } = this;\n // Set to a 1x1 transparent texture\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, null);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n const textureData = await this.textureSource?.getTextureData();\n // If the texture has been freed while loading, return early.\n if (!this._nativeCtxTexture) {\n assertTruthy(this._state === 'freed');\n return { width: 0, height: 0 };\n }\n let width = 0;\n let height = 0;\n assertTruthy(this._nativeCtxTexture);\n glw.activeTexture(0);\n // If textureData is null, the texture is empty (0, 0) and we don't need to\n // upload any data to the GPU.\n if (textureData.data instanceof ImageBitmap ||\n textureData.data instanceof ImageData ||\n // not using typeof HTMLImageElement due to web worker\n isHTMLImageElement(textureData.data)) {\n const data = textureData.data;\n width = data.width;\n height = data.height;\n glw.bindTexture(this._nativeCtxTexture);\n glw.pixelStorei(glw.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !!textureData.premultiplyAlpha);\n glw.texImage2D(0, glw.RGBA, glw.RGBA, glw.UNSIGNED_BYTE, data);\n memManager.setTextureMemUse(this, width * height * 4);\n // generate mipmaps for power-of-2 textures or in WebGL2RenderingContext\n if (glw.isWebGl2() || (isPowerOfTwo(width) && isPowerOfTwo(height))) {\n glw.generateMipmap();\n }\n }\n else if (textureData.data === null) {\n width = 0;\n height = 0;\n // Reset to a 1x1 transparent texture\n glw.bindTexture(this._nativeCtxTexture);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n }\n else if ('mipmaps' in textureData.data && textureData.data.mipmaps) {\n const { mipmaps, width = 0, height = 0, type, glInternalFormat, } = textureData.data;\n const view = type === 'ktx'\n ? new DataView(mipmaps[0] ?? new ArrayBuffer(0))\n : mipmaps[0];\n glw.bindTexture(this._nativeCtxTexture);\n glw.compressedTexImage2D(0, glInternalFormat, width, height, 0, view);\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n memManager.setTextureMemUse(this, view.byteLength);\n }\n else {\n console.error(`WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned`, textureData);\n }\n return {\n width,\n height,\n };\n }\n /**\n * Free the WebGLTexture from the GPU\n *\n * @returns\n */\n free() {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'freed';\n this.textureSource.setState('freed');\n this._w = 0;\n this._h = 0;\n if (!this._nativeCtxTexture) {\n return;\n }\n const { glw, memManager } = this;\n glw.deleteTexture(this._nativeCtxTexture);\n memManager.setTextureMemUse(this, 0);\n this._nativeCtxTexture = null;\n }\n /**\n * Create native context texture\n *\n * @remarks\n * When this method returns the returned texture will be bound to the GL context state.\n *\n * @param width\n * @param height\n * @returns\n */\n createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\n // On initial load request, create a 1x1 transparent texture to use until\n // the texture data is finally loaded.\n glw.activeTexture(0);\n glw.bindTexture(nativeTexture);\n // linear texture filtering\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n // texture wrapping method\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n return nativeTexture;\n }\n}\n//# sourceMappingURL=WebGlCoreCtxTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of only a 1x1 color pixel\n *\n * @remarks\n * The pixel color is set with the {@link ColorTextureProps.color} prop.\n *\n * This is the default texture used for a Node if it's\n * {@link INodeWritableProps.texture} prop is set to `null` (the default)\n *\n * Generally the 1x1 color pixel is stretched to whatever the set dimensions of\n * a Node are.\n */\nexport class ColorTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ColorTexture.resolveDefaults(props || {});\n }\n get color() {\n return this.props.color;\n }\n set color(color) {\n this.props.color = color;\n }\n async getTextureData() {\n const pixelData32 = new Uint32Array([this.color]);\n const pixelData8 = new Uint8ClampedArray(pixelData32.buffer);\n return {\n data: new ImageData(pixelData8, 1, 1),\n premultiplyAlpha: true,\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = ColorTexture.resolveDefaults(props);\n return `ColorTexture,${resolvedProps.color}`;\n }\n static resolveDefaults(props) {\n return {\n color: props.color || 0xffffffff,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ColorTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture, } from './Texture.js';\n/**\n * A Texture that is a sub-region of another Texture.\n *\n * @remarks\n * The parent texture can be a Sprite Sheet/Texture Atlas and set using the\n * {@link SubTextureProps.texture} prop. The sub-region relative to the parent\n * texture is defined with the {@link SubTextureProps.x},\n * {@link SubTextureProps.y}, {@link SubTextureProps.width}, and\n * {@link SubTextureProps.height} pixel values.\n */\nexport class SubTexture extends Texture {\n props;\n parentTexture;\n constructor(txManager, props) {\n super(txManager);\n this.parentTexture = this.txManager.loadTexture(props.texture.txType, props.texture.props, props.texture.options);\n this.props = SubTexture.resolveDefaults(props || {});\n // If parent texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n const parentTx = this.parentTexture;\n if (parentTx.state === 'loaded') {\n this.onParentTxLoaded(parentTx, parentTx.dimensions);\n }\n else if (parentTx.state === 'failed') {\n this.onParentTxFailed(parentTx, parentTx.error);\n }\n parentTx.on('loaded', this.onParentTxLoaded);\n parentTx.on('failed', this.onParentTxFailed);\n });\n }\n onParentTxLoaded = () => {\n // We ignore the parent's passed dimensions, and simply use the SubTexture's\n // configured dimensions (because that's all that matters here)\n this.setState('loaded', {\n width: this.props.width,\n height: this.props.height,\n });\n };\n onParentTxFailed = (target, error) => {\n this.setState('failed', error);\n };\n async getTextureData() {\n return {\n data: this.props,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {\n texture: props.texture,\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 0,\n height: props.height || 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=SubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxSubTexture extends WebGlCoreCtxTexture {\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n }\n async onLoadRequest() {\n const props = await this.textureSource.getTextureData();\n return {\n width: props.data?.width || 0,\n height: props.data?.height || 0,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxSubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a collection of WebGL Buffers along with their associated\n * vertex attribute formats.\n */\nexport class BufferCollection {\n config;\n constructor(config) {\n this.config = config;\n }\n /**\n * Get the WebGLBuffer associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getBuffer(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])?.buffer;\n }\n /**\n * Get the AttributeInfo associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getAttributeInfo(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])\n ?.attributes[attributeName];\n }\n}\n//# sourceMappingURL=BufferCollection.js.map","/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport { assertTruthy } from '../../utils.js';\nimport { isWebGl2 } from '../renderers/webgl/internal/WebGlUtils.js';\n/**\n * Optimized WebGL Context Wrapper\n *\n * @remarks\n * This class contains the subset of the WebGLRenderingContext & WebGL2RenderingContext\n * API that is used by the renderer. Select high volume WebGL methods include\n * caching optimizations to avoid making WebGL calls if the state is already set\n * to the desired value.\n *\n * While most methods contained are direct passthroughs to the WebGL context,\n * some methods combine multiple WebGL calls into one for convenience, modify\n * arguments to be more convenient, or are replaced by more specific methods.\n *\n * Not all methods are optimized. Only methods that are called frequently\n * and/or have a high cost are optimized.\n *\n * A subset of GLenum constants are also exposed as properties on this class\n * for convenience.\n */\nexport class WebGlContextWrapper {\n gl;\n //#region Cached WebGL State\n activeTextureUnit = 0;\n texture2dUnits;\n texture2dParams = new WeakMap();\n scissorEnabled;\n scissorX;\n scissorY;\n scissorWidth;\n scissorHeight;\n blendEnabled;\n blendSrcRgb;\n blendDstRgb;\n blendSrcAlpha;\n blendDstAlpha;\n boundArrayBuffer;\n boundElementArrayBuffer;\n curProgram;\n programUniforms = new WeakMap();\n //#endregion Cached WebGL State\n //#region Canvas\n canvas;\n //#endregion Canvas\n //#region WebGL Enums\n MAX_RENDERBUFFER_SIZE;\n MAX_TEXTURE_SIZE;\n MAX_VIEWPORT_DIMS;\n MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n MAX_TEXTURE_IMAGE_UNITS;\n MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n MAX_VERTEX_ATTRIBS;\n MAX_VARYING_VECTORS;\n MAX_VERTEX_UNIFORM_VECTORS;\n MAX_FRAGMENT_UNIFORM_VECTORS;\n TEXTURE_MAG_FILTER;\n TEXTURE_MIN_FILTER;\n TEXTURE_WRAP_S;\n TEXTURE_WRAP_T;\n LINEAR;\n CLAMP_TO_EDGE;\n RGBA;\n UNSIGNED_BYTE;\n UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n UNPACK_FLIP_Y_WEBGL;\n FLOAT;\n TRIANGLES;\n UNSIGNED_SHORT;\n ONE;\n ONE_MINUS_SRC_ALPHA;\n VERTEX_SHADER;\n FRAGMENT_SHADER;\n STATIC_DRAW;\n COMPILE_STATUS;\n LINK_STATUS;\n DYNAMIC_DRAW;\n COLOR_ATTACHMENT0;\n //#endregion WebGL Enums\n constructor(gl) {\n this.gl = gl;\n // The following code extracts the current state of the WebGL context\n // to our local JavaScript cached version of it. This is so we can\n // avoid making WebGL calls if we don't need to.\n // We could assume that the WebGL context is in a default state, but\n // in the future we may want to support restoring a broken WebGL context\n // and this will help with that.\n this.activeTextureUnit =\n gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0;\n const maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // save current texture units\n this.texture2dUnits = new Array(maxTextureUnits)\n .fill(undefined)\n .map((_, i) => {\n this.activeTexture(i);\n return gl.getParameter(gl.TEXTURE_BINDING_2D);\n });\n // restore active texture unit\n this.activeTexture(this.activeTextureUnit);\n this.scissorEnabled = gl.isEnabled(gl.SCISSOR_TEST);\n const scissorBox = gl.getParameter(gl.SCISSOR_BOX);\n this.scissorX = scissorBox[0];\n this.scissorY = scissorBox[1];\n this.scissorWidth = scissorBox[2];\n this.scissorHeight = scissorBox[3];\n this.blendEnabled = gl.isEnabled(gl.BLEND);\n this.blendSrcRgb = gl.getParameter(gl.BLEND_SRC_RGB);\n this.blendDstRgb = gl.getParameter(gl.BLEND_DST_RGB);\n this.blendSrcAlpha = gl.getParameter(gl.BLEND_SRC_ALPHA);\n this.blendDstAlpha = gl.getParameter(gl.BLEND_DST_ALPHA);\n this.boundArrayBuffer = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n this.boundElementArrayBuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);\n this.curProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n this.canvas = gl.canvas;\n // Extract GLenums\n this.MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE;\n this.MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE;\n this.MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS;\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n this.MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS;\n this.MAX_VARYING_VECTORS = gl.MAX_VARYING_VECTORS;\n this.MAX_VERTEX_UNIFORM_VECTORS = gl.MAX_VERTEX_UNIFORM_VECTORS;\n this.MAX_FRAGMENT_UNIFORM_VECTORS = gl.MAX_FRAGMENT_UNIFORM_VECTORS;\n this.TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T;\n this.LINEAR = gl.LINEAR;\n this.CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE;\n this.RGBA = gl.RGBA;\n this.UNSIGNED_BYTE = gl.UNSIGNED_BYTE;\n this.UNPACK_PREMULTIPLY_ALPHA_WEBGL = gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n this.UNPACK_FLIP_Y_WEBGL = gl.UNPACK_FLIP_Y_WEBGL;\n this.FLOAT = gl.FLOAT;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.ONE = gl.ONE;\n this.ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.VERTEX_SHADER = gl.VERTEX_SHADER;\n this.FRAGMENT_SHADER = gl.FRAGMENT_SHADER;\n this.STATIC_DRAW = gl.STATIC_DRAW;\n this.COMPILE_STATUS = gl.COMPILE_STATUS;\n this.LINK_STATUS = gl.LINK_STATUS;\n this.DYNAMIC_DRAW = gl.DYNAMIC_DRAW;\n this.COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0;\n }\n /**\n * Returns true if the WebGL context is WebGL2\n *\n * @returns\n */\n isWebGl2() {\n return isWebGl2(this.gl);\n }\n /**\n * ```\n * gl.activeTexture(textureUnit + gl.TEXTURE0);\n * ```\n *\n * @remarks\n * **WebGL Difference**: `textureUnit` is based from 0, not `gl.TEXTURE0`.\n *\n * @param textureUnit\n */\n activeTexture(textureUnit) {\n const { gl } = this;\n if (this.activeTextureUnit !== textureUnit) {\n gl.activeTexture(textureUnit + gl.TEXTURE0);\n this.activeTextureUnit = textureUnit;\n }\n }\n /**\n * ```\n * gl.bindTexture(gl.TEXTURE_2D, texture);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param texture\n */\n bindTexture(texture) {\n const { gl, activeTextureUnit, texture2dUnits } = this;\n if (texture2dUnits[activeTextureUnit] === texture) {\n return;\n }\n texture2dUnits[activeTextureUnit] = texture;\n gl.bindTexture(this.gl.TEXTURE_2D, texture);\n }\n _getActiveTexture() {\n const { activeTextureUnit, texture2dUnits } = this;\n return texture2dUnits[activeTextureUnit];\n }\n /**\n * ```\n * gl.texParameteri(gl.TEXTURE_2D, pname, param);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param pname\n * @param param\n * @returns\n */\n texParameteri(pname, param) {\n const { gl, texture2dParams } = this;\n const activeTexture = this._getActiveTexture();\n if (!activeTexture) {\n throw new Error('No active texture');\n }\n let textureParams = texture2dParams.get(activeTexture);\n if (!textureParams) {\n textureParams = {};\n texture2dParams.set(activeTexture, textureParams);\n }\n if (textureParams[pname] === param) {\n return;\n }\n textureParams[pname] = param;\n gl.texParameteri(gl.TEXTURE_2D, pname, param);\n }\n texImage2D(level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels) {\n const { gl } = this;\n if (format) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource);\n }\n }\n /**\n * ```\n * gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, data);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n compressedTexImage2D(level, internalformat, width, height, border, data) {\n const { gl } = this;\n gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalformat, width, height, border, data);\n }\n /**\n * ```\n * gl.pixelStorei(pname, param);\n * ```\n *\n * @param pname\n * @param param\n */\n pixelStorei(pname, param) {\n const { gl } = this;\n gl.pixelStorei(pname, param);\n }\n /**\n * ```\n * gl.generateMipmap(gl.TEXTURE_2D);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n generateMipmap() {\n const { gl } = this;\n gl.generateMipmap(gl.TEXTURE_2D);\n }\n /**\n * ```\n * gl.createTexture();\n * ```\n *\n * @returns\n */\n createTexture() {\n const { gl } = this;\n return gl.createTexture();\n }\n /**\n * ```\n * gl.deleteTexture(texture);\n * ```\n *\n * @param texture\n */\n deleteTexture(texture) {\n const { gl } = this;\n if (texture) {\n this.texture2dParams.delete(texture);\n }\n gl.deleteTexture(texture);\n }\n /**\n * ```\n * gl.viewport(x, y, width, height);\n * ```\n */\n viewport(x, y, width, height) {\n const { gl } = this;\n gl.viewport(x, y, width, height);\n }\n /**\n * ```\n * gl.clearColor(red, green, blue, alpha);\n * ```\n *\n * @param red\n * @param green\n * @param blue\n * @param alpha\n */\n clearColor(red, green, blue, alpha) {\n const { gl } = this;\n gl.clearColor(red, green, blue, alpha);\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.SCISSOR_TEST);\n * ```\n * @param enable\n */\n setScissorTest(enable) {\n const { gl, scissorEnabled } = this;\n if (enable === scissorEnabled) {\n return;\n }\n if (enable) {\n gl.enable(gl.SCISSOR_TEST);\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n this.scissorEnabled = enable;\n }\n /**\n * ```\n * gl.scissor(x, y, width, height);\n * ```\n *\n * @param x\n * @param y\n * @param width\n * @param height\n */\n scissor(x, y, width, height) {\n const { gl, scissorX, scissorY, scissorWidth, scissorHeight } = this;\n if (x !== scissorX ||\n y !== scissorY ||\n width !== scissorWidth ||\n height !== scissorHeight) {\n gl.scissor(x, y, width, height);\n this.scissorX = x;\n this.scissorY = y;\n this.scissorWidth = width;\n this.scissorHeight = height;\n }\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.BLEND);\n * ```\n *\n * @param blend\n * @returns\n */\n setBlend(blend) {\n const { gl, blendEnabled } = this;\n if (blend === blendEnabled) {\n return;\n }\n if (blend) {\n gl.enable(gl.BLEND);\n }\n else {\n gl.disable(gl.BLEND);\n }\n this.blendEnabled = blend;\n }\n /**\n * ```\n * gl.blendFunc(src, dst);\n * ```\n *\n * @param src\n * @param dst\n */\n blendFunc(src, dst) {\n const { gl, blendSrcRgb, blendDstRgb, blendSrcAlpha, blendDstAlpha } = this;\n if (src !== blendSrcRgb ||\n dst !== blendDstRgb ||\n src !== blendSrcAlpha ||\n dst !== blendDstAlpha) {\n gl.blendFunc(src, dst);\n this.blendSrcRgb = src;\n this.blendDstRgb = dst;\n this.blendSrcAlpha = src;\n this.blendDstAlpha = dst;\n }\n }\n /**\n * ```\n * gl.createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\n }\n /**\n * ```\n * gl.createFramebuffer();\n * ```\n * @returns\n */\n createFramebuffer() {\n const { gl } = this;\n return gl.createFramebuffer();\n }\n /**\n * ```\n * gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n * ```\n *\n * @param framebuffer\n */\n bindFramebuffer(framebuffer) {\n const { gl } = this;\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n }\n /**\n * ```\n * gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.FRAMEBUFFER` and textarget is always `gl.TEXTURE_2D`\n */\n framebufferTexture2D(attachment, texture, level) {\n const { gl } = this;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, texture, level);\n }\n /**\n * ```\n * gl.clear(gl.COLOR_BUFFER_BIT);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Clear mask is always `gl.COLOR_BUFFER_BIT`\n */\n clear() {\n const { gl } = this;\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n arrayBufferData(buffer, data, usage) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n * ```\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n elementArrayBufferData(buffer, data, usage) {\n const { gl, boundElementArrayBuffer } = this;\n if (boundElementArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n this.boundElementArrayBuffer = buffer;\n }\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.vertexAttribPointer` are combined into one function.\n *\n * @param buffer\n * @param index\n * @param size\n * @param type\n * @param normalized\n * @param stride\n * @param offset\n */\n vertexAttribPointer(buffer, index, size, type, normalized, stride, offset) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n }\n /**\n * ```\n * gl.useProgram(program);\n * ```\n *\n * @param program\n * @returns\n */\n useProgram(program) {\n const { gl, curProgram } = this;\n if (curProgram === program) {\n return;\n }\n gl.useProgram(program);\n this.curProgram = program;\n }\n setUniform(type, location, ...args) {\n const { gl, programUniforms } = this;\n let uniforms = programUniforms.get(this.curProgram);\n if (!uniforms) {\n uniforms = new Map();\n programUniforms.set(this.curProgram, uniforms);\n }\n const uniformArgs = uniforms.get(location);\n if (!uniformArgs || !compareArrays(uniformArgs, args)) {\n uniforms.set(location, args);\n gl[type](location, ...args);\n }\n }\n /**\n * ```\n * gl.getParameter(pname);\n * ```\n *\n * @param pname\n * @returns\n */\n getParameter(pname) {\n const { gl } = this;\n return gl.getParameter(pname);\n }\n /**\n * ```\n * gl.drawElements(mode, count, type, offset);\n * ```\n *\n * @param mode\n * @param count\n * @param type\n * @param offset\n */\n drawElements(mode, count, type, offset) {\n const { gl } = this;\n gl.drawElements(mode, count, type, offset);\n }\n /**\n * ```\n * gl.drawArrays(mode, first, count);\n * ```\n *\n * @param name\n * @returns\n */\n getExtension(name) {\n const { gl } = this;\n return gl.getExtension(name);\n }\n /**\n * ```\n * gl.createVertexArray();\n * ```\n *\n * @returns\n */\n createVertexArray() {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n return gl.createVertexArray();\n }\n /**\n * ```\n * gl.bindVertexArray(vertexArray);\n * ```\n *\n * @param vertexArray\n */\n bindVertexArray(vertexArray) {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n gl.bindVertexArray(vertexArray);\n }\n /**\n * ```\n * gl.getAttribLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getAttribLocation(program, name) {\n const { gl } = this;\n return gl.getAttribLocation(program, name);\n }\n /**\n * ```\n * gl.getUniformLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getUniformLocation(program, name) {\n const { gl } = this;\n return gl.getUniformLocation(program, name);\n }\n /**\n * ```\n * gl.enableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n enableVertexAttribArray(index) {\n const { gl } = this;\n gl.enableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.disableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n disableVertexAttribArray(index) {\n const { gl } = this;\n gl.disableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.createShader(type);\n * ```\n *\n * @param type\n * @returns\n */\n createShader(type) {\n const { gl } = this;\n return gl.createShader(type);\n }\n /**\n * ```\n * gl.compileShader(shader);\n * ```\n *\n * @param shader\n * @returns\n */\n compileShader(shader) {\n const { gl } = this;\n gl.compileShader(shader);\n }\n /**\n * ```\n * gl.attachShader(program, shader);\n * ```\n *\n * @param program\n * @param shader\n */\n attachShader(program, shader) {\n const { gl } = this;\n gl.attachShader(program, shader);\n }\n /**\n * ```\n * gl.linkProgram(program);\n * ```\n *\n * @param program\n */\n linkProgram(program) {\n const { gl } = this;\n gl.linkProgram(program);\n }\n /**\n * ```\n * gl.deleteProgram(shader);\n * ```\n *\n * @param shader\n */\n deleteProgram(shader) {\n const { gl } = this;\n gl.deleteProgram(shader);\n }\n /**\n * ```\n * gl.getShaderParameter(shader, pname);\n * ```\n *\n * @param shader\n * @param pname\n */\n getShaderParameter(shader, pname) {\n const { gl } = this;\n return gl.getShaderParameter(shader, pname);\n }\n /**\n * ```\n * gl.getShaderInfoLog(shader);\n * ```\n *\n * @param shader\n */\n getShaderInfoLog(shader) {\n const { gl } = this;\n return gl.getShaderInfoLog(shader);\n }\n /**\n * ```\n * gl.createProgram();\n * ```\n *\n * @returns\n */\n createProgram() {\n const { gl } = this;\n return gl.createProgram();\n }\n /**\n * ```\n * gl.getProgramParameter(program, pname);\n * ```\n *\n * @param program\n * @param pname\n * @returns\n */\n getProgramParameter(program, pname) {\n const { gl } = this;\n return gl.getProgramParameter(program, pname);\n }\n /**\n * ```\n * gl.getProgramInfoLog(program);\n * ```\n *\n * @param program\n * @returns\n */\n getProgramInfoLog(program) {\n const { gl } = this;\n return gl.getProgramInfoLog(program);\n }\n /**\n * ```\n * gl.shaderSource(shader, source);\n * ```\n *\n * @param shader\n * @param source\n */\n shaderSource(shader, source) {\n const { gl } = this;\n gl.shaderSource(shader, source);\n }\n /**\n * ```\n * gl.deleteShader(shader);\n * ```\n *\n * @param shader\n */\n deleteShader(shader) {\n const { gl } = this;\n gl.deleteShader(shader);\n }\n}\n/**\n * Compare two arrays for equality.\n *\n * @remarks\n * This function will not try to compare nested arrays or Float32Arrays and\n * instead will always return false when they are encountered.\n *\n * @param a\n * @param b\n * @returns\n */\nexport function compareArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((v, i) => {\n // Don't bother to compare nested arrays or Float32Arrays\n if (Array.isArray(v) || v instanceof Float32Array) {\n return false;\n }\n else {\n return v === b[i];\n }\n });\n}\n//# sourceMappingURL=WebGlContextWrapper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nexport class RenderTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = RenderTexture.resolveDefaults(props || {});\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n }\n async getTextureData() {\n return {\n data: null,\n premultiplyAlpha: null,\n };\n }\n static resolveDefaults(props) {\n return {\n width: props.width || 256,\n height: props.height || 256,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=RenderTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2024 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxRenderTexture extends WebGlCoreCtxTexture {\n framebuffer;\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n // Create Framebuffer object\n const framebuffer = glw.createFramebuffer();\n assertTruthy(framebuffer, 'Unable to create framebuffer');\n this.framebuffer = framebuffer;\n }\n async onLoadRequest() {\n const { glw, memManager } = this;\n const nativeTexture = (this._nativeCtxTexture =\n this.createNativeCtxTexture());\n const { width, height } = this.textureSource;\n // Set the dimensions of the render texture\n glw.texImage2D(0, glw.RGBA, width, height, 0, glw.RGBA, glw.UNSIGNED_BYTE, null);\n // Update the texture memory manager\n memManager.setTextureMemUse(this, width * height * 4);\n // Bind the framebuffer\n glw.bindFramebuffer(this.framebuffer);\n // Attach the texture to the framebuffer\n glw.framebufferTexture2D(glw.COLOR_ATTACHMENT0, nativeTexture, 0);\n // Unbind the framebuffer\n glw.bindFramebuffer(null);\n return {\n width,\n height,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxRenderTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, createWebGLContext, hasOwn, mergeColorAlphaPremultiplied, } from '../../../utils.js';\nimport { CoreRenderer } from '../CoreRenderer.js';\nimport { WebGlCoreRenderOp } from './WebGlCoreRenderOp.js';\nimport { createIndexBuffer, getWebGlParameters, getWebGlExtensions, } from './internal/RendererUtils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nimport { Texture } from '../../textures/Texture.js';\nimport { ColorTexture } from '../../textures/ColorTexture.js';\nimport { SubTexture } from '../../textures/SubTexture.js';\nimport { WebGlCoreCtxSubTexture } from './WebGlCoreCtxSubTexture.js';\nimport { CoreShaderManager } from '../../CoreShaderManager.js';\nimport { BufferCollection } from './internal/BufferCollection.js';\nimport { compareRect, getNormalizedRgbaComponents, } from '../../lib/utils.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nimport { RoundedRectangle } from './shaders/RoundedRectangle.js';\nimport { ContextSpy } from '../../lib/ContextSpy.js';\nimport { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';\nimport { RenderTexture } from '../../textures/RenderTexture.js';\nimport { WebGlCoreCtxRenderTexture } from './WebGlCoreCtxRenderTexture.js';\nconst WORDS_PER_QUAD = 24;\nconst BYTES_PER_QUAD = WORDS_PER_QUAD * 4;\nexport class WebGlCoreRenderer extends CoreRenderer {\n //// WebGL Native Context and Data\n glw;\n system;\n //// Core Managers\n txManager;\n txMemManager;\n shManager;\n //// Options\n options;\n //// Persistent data\n quadBuffer = new ArrayBuffer(1024 * 1024 * 4);\n fQuadBuffer = new Float32Array(this.quadBuffer);\n uiQuadBuffer = new Uint32Array(this.quadBuffer);\n renderOps = [];\n //// Render Op / Buffer Filling State\n curBufferIdx = 0;\n curRenderOp = null;\n rttNodes = [];\n activeRttNode = null;\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\n /**\n * Whether the renderer is currently rendering to a texture.\n */\n renderToTextureActive = false;\n constructor(options) {\n super(options.stage);\n const { canvas, clearColor, bufferMemory } = options;\n this.options = options;\n this.txManager = options.txManager;\n this.txMemManager = options.txMemManager;\n this.shManager = options.shManager;\n this.defaultTexture = new ColorTexture(this.txManager);\n // When the default texture is loaded, request a render in case the\n // RAF is paused. Fixes: https://github.com/lightning-js/renderer/issues/123\n this.defaultTexture.once('loaded', () => {\n this.stage.requestRender();\n });\n const gl = createWebGLContext(canvas, options.contextSpy);\n const glw = (this.glw = new WebGlContextWrapper(gl));\n const color = getNormalizedRgbaComponents(clearColor);\n glw.viewport(0, 0, canvas.width, canvas.height);\n glw.clearColor(color[0], color[1], color[2], color[3]);\n glw.setBlend(true);\n glw.blendFunc(glw.ONE, glw.ONE_MINUS_SRC_ALPHA);\n createIndexBuffer(glw, bufferMemory);\n this.system = {\n parameters: getWebGlParameters(this.glw),\n extensions: getWebGlExtensions(this.glw),\n };\n this.shManager.renderer = this;\n this.defaultShader = this.shManager.loadShader('DefaultShader').shader;\n const quadBuffer = glw.createBuffer();\n assertTruthy(quadBuffer);\n const stride = 6 * Float32Array.BYTES_PER_ELEMENT;\n this.quadBufferCollection = new BufferCollection([\n {\n buffer: quadBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_color: {\n name: 'a_color',\n size: 4,\n type: glw.UNSIGNED_BYTE,\n normalized: true,\n stride,\n offset: 4 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_textureIndex: {\n name: 'a_textureIndex',\n size: 1,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 5 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n }\n reset() {\n const { glw } = this;\n this.curBufferIdx = 0;\n this.curRenderOp = null;\n this.renderOps.length = 0;\n glw.setScissorTest(false);\n glw.clear();\n }\n getShaderManager() {\n return this.shManager;\n }\n createCtxTexture(textureSource) {\n if (textureSource instanceof SubTexture) {\n return new WebGlCoreCtxSubTexture(this.glw, this.txMemManager, textureSource);\n }\n else if (textureSource instanceof RenderTexture) {\n return new WebGlCoreCtxRenderTexture(this.glw, this.txMemManager, textureSource);\n }\n return new WebGlCoreCtxTexture(this.glw, this.txMemManager, textureSource);\n }\n /**\n * This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.\n *\n * It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix.\n * The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided.\n * It then checks if a new render operation is needed, based on the current shader and clipping rectangle.\n * If a new render operation is needed, it creates one and updates the current render operation.\n * The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.\n *\n * Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer.\n * The function updates the length and number of quads in the current render operation, and updates the current buffer index.\n */\n addQuad(params) {\n const { fQuadBuffer, uiQuadBuffer } = this;\n const { width, height, colorTl, colorTr, colorBl, colorBr, textureOptions, shader, shaderProps, alpha, clippingRect, tx, ty, ta, tb, tc, td, rtt: renderToTexture, parentHasRenderTexture, framebufferDimensions, } = params;\n let { texture } = params;\n /**\n * If the shader props contain any automatic properties, update it with the\n * current dimensions that will be used to render the quad.\n */\n if (shaderProps && hasOwn(shaderProps, '$dimensions')) {\n const dimensions = shaderProps.$dimensions;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n dimensions.width = width;\n dimensions.height = height;\n }\n texture = texture ?? this.defaultTexture;\n assertTruthy(texture instanceof Texture, 'Invalid texture type');\n let { curBufferIdx: bufferIdx, curRenderOp } = this;\n const targetDims = {\n width,\n height,\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (!this.reuseRenderOp(params)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx, renderToTexture, parentHasRenderTexture, framebufferDimensions);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n }\n const flipX = textureOptions?.flipX ?? false;\n const flipY = textureOptions?.flipY ?? false;\n let texCoordX1 = 0;\n let texCoordY1 = 0;\n let texCoordX2 = 1;\n let texCoordY2 = 1;\n if (texture instanceof SubTexture) {\n const { x: tx, y: ty, width: tw, height: th } = texture.props;\n const { width: parentW = 0, height: parentH = 0 } = texture.parentTexture\n .dimensions || { width: 0, height: 0 };\n texCoordX1 = tx / parentW;\n texCoordX2 = texCoordX1 + tw / parentW;\n texCoordY1 = ty / parentH;\n texCoordY2 = texCoordY1 + th / parentH;\n texture = texture.parentTexture;\n }\n // Flip texture coordinates if dictated by texture options\n if (flipX) {\n [texCoordX1, texCoordX2] = [texCoordX2, texCoordX1];\n }\n if (flipY) {\n [texCoordY1, texCoordY2] = [texCoordY2, texCoordY1];\n }\n const { txManager } = this.stage;\n const ctxTexture = txManager.getCtxTexture(texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxTexture);\n const textureIdx = this.addTexture(ctxTexture, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n // render quad advanced\n if (tb !== 0 || tc !== 0) {\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta;\n fQuadBuffer[bufferIdx++] = ty + width * tc;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx + height * tb;\n fQuadBuffer[bufferIdx++] = ty + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta + height * tb;\n fQuadBuffer[bufferIdx++] = ty + width * tc + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n else {\n // Calculate the right corner of the quad\n // multiplied by the scale\n const rightCornerX = tx + width * ta;\n const rightCornerY = ty + height * td;\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = ty;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n // Update the length of the current render op\n curRenderOp.length += WORDS_PER_QUAD;\n curRenderOp.numQuads++;\n this.curBufferIdx = bufferIdx;\n }\n /**\n * Replace the existing RenderOp with a new one that uses the specified Shader\n * and starts at the specified buffer index.\n *\n * @param shader\n * @param bufferIdx\n */\n newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx, renderToTexture, parentHasRenderTexture, framebufferDimensions) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0, // Z-Index is only used for explictly added Render Ops\n renderToTexture, parentHasRenderTexture, framebufferDimensions);\n this.curRenderOp = curRenderOp;\n this.renderOps.push(curRenderOp);\n }\n /**\n * Add a texture to the current RenderOp. If the texture cannot be added to the\n * current RenderOp, a new RenderOp will be created and the texture will be added\n * to that one.\n *\n * If the texture cannot be added to the new RenderOp, an error will be thrown.\n *\n * @param texture\n * @param bufferIdx\n * @param recursive\n * @returns Assigned Texture Index of the texture in the render op\n */\n addTexture(texture, bufferIdx, recursive) {\n const { curRenderOp } = this;\n assertTruthy(curRenderOp);\n const textureIdx = curRenderOp.addTexture(texture);\n // TODO: Refactor to be more DRY\n if (textureIdx === 0xffffffff) {\n if (recursive) {\n throw new Error('Unable to add texture to render op');\n }\n const { shader, shaderProps, dimensions, clippingRect, alpha } = curRenderOp;\n this.newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx);\n return this.addTexture(texture, bufferIdx, true);\n }\n return textureIdx;\n }\n /**\n * Test if the current Render operation can be reused for the specified parameters.\n * @param params\n * @returns\n */\n reuseRenderOp(params) {\n const { shader, shaderProps, parentHasRenderTexture, rtt, clippingRect } = params;\n const targetShader = shader || this.defaultShader;\n // Switching shader program will require a new render operation\n if (this.curRenderOp?.shader !== targetShader) {\n return false;\n }\n // Switching clipping rect will require a new render operation\n if (!compareRect(this.curRenderOp.clippingRect, clippingRect)) {\n return false;\n }\n // Force new render operation if rendering to texture\n // @todo: This needs to be improved, render operations could also be reused\n // for rendering to texture\n if (parentHasRenderTexture || rtt) {\n return false;\n }\n // Check if the shader can batch the shader properties\n if (this.curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !this.curRenderOp.shader.canBatchShaderProps(this.curRenderOp.shaderProps, shaderProps))) {\n return false;\n }\n // Render operation can be reused\n return true;\n }\n /**\n * add RenderOp to the render pipeline\n */\n addRenderOp(renderable) {\n this.renderOps.push(renderable);\n this.curRenderOp = null;\n }\n /**\n * Render the current set of RenderOps to render to the specified surface.\n *\n * TODO: 'screen' is the only supported surface at the moment.\n *\n * @param surface\n */\n render(surface = 'screen') {\n const { glw, quadBuffer } = this;\n const arr = new Float32Array(quadBuffer, 0, this.curBufferIdx);\n const buffer = this.quadBufferCollection.getBuffer('a_position') ?? null;\n glw.arrayBufferData(buffer, arr, glw.STATIC_DRAW);\n const doLog = false; // idx++ % 100 === 0;\n if (doLog) {\n console.log('renderOps', this.renderOps.length);\n }\n this.renderOps.forEach((renderOp, i) => {\n if (doLog) {\n console.log('Quads per operation', renderOp.numQuads);\n }\n renderOp.draw();\n });\n }\n renderToTexture(node) {\n for (let i = 0; i < this.rttNodes.length; i++) {\n if (this.rttNodes[i] === node) {\n return;\n }\n }\n // @todo: Better bottom up rendering order\n this.rttNodes.unshift(node);\n }\n renderRTTNodes() {\n const { glw } = this;\n const { txManager } = this.stage;\n // Render all associated RTT nodes to their textures\n for (let i = 0; i < this.rttNodes.length; i++) {\n const node = this.rttNodes[i];\n // Skip nodes that don't have RTT updates\n if (!node || !node.hasRTTupdates) {\n continue;\n }\n // Set the active RTT node to the current node\n // So we can prevent rendering children of nested RTT nodes\n this.activeRttNode = node;\n assertTruthy(node.texture, 'RTT node missing texture');\n const ctxTexture = txManager.getCtxTexture(node.texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxRenderTexture);\n this.renderToTextureActive = true;\n // Bind the the texture's framebuffer\n glw.bindFramebuffer(ctxTexture.framebuffer);\n glw.viewport(0, 0, ctxTexture.w, ctxTexture.h);\n glw.clear();\n // Render all associated quads to the texture\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n child.update(this.stage.deltaTime, {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n });\n this.stage.addQuads(child);\n child.hasRTTupdates = false;\n }\n // Render all associated quads to the texture\n this.render();\n // Reset render operations\n this.renderOps.length = 0;\n node.hasRTTupdates = false;\n }\n // Bind the default framebuffer\n glw.bindFramebuffer(null);\n glw.viewport(0, 0, this.glw.canvas.width, this.glw.canvas.height);\n this.renderToTextureActive = false;\n }\n}\n//# sourceMappingURL=WebGlCoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const SpecialCodepoints = {\n LINE_FEED: 0x0a,\n CARRIAGE_RETURN: 0x0d,\n SPACE: 0x20,\n TAB: 0x09,\n ZERO_WIDTH_SPACE: 0x200b,\n ZERO_WIDTH_NON_JOINER: 0x200c,\n ZERO_WIDTH_JOINER: 0x200d,\n LEFT_TO_RIGHT_MARK: 0x200e,\n RIGHT_TO_LEFT_MARK: 0x200f,\n LEFT_TO_RIGHT_EMBEDDING: 0x202a,\n RIGHT_TO_LEFT_EMBEDDING: 0x202b,\n POP_DIRECTIONAL_FORMATTING: 0x202c,\n LEFT_TO_RIGHT_OVERRIDE: 0x202d,\n RIGHT_TO_LEFT_OVERRIDE: 0x202e,\n LINE_SEPARATOR: 0x2028,\n PARAGRAPH_SEPARATOR: 0x2029,\n OBJECT_REPLACEMENT_CHARACTER: 0xfffc,\n REPLACEMENT_CHARACTER: 0xfffd,\n ZERO_WIDTH_NO_BREAK_SPACE: 0xfeff,\n LEFT_TO_RIGHT_ISOLATE: 0x2066,\n RIGHT_TO_LEFT_ISOLATE: 0x2067,\n FIRST_STRONG_ISOLATE: 0x2068,\n POP_DIRECTIONAL_ISOLATE: 0x2069,\n INHIBIT_SYMMETRIC_SWAPPING: 0x206a,\n ACTIVATE_SYMMETRIC_SWAPPING: 0x206b,\n INHIBIT_ARABIC_FORM_SHAPING: 0x206c,\n ACTIVATE_ARABIC_FORM_SHAPING: 0x206d,\n NATIONAL_DIGIT_SHAPES: 0x206e,\n NOMINAL_DIGIT_SHAPES: 0x206f,\n LEFT_TO_RIGHT_BOUNDARY: 0x200e,\n RIGHT_TO_LEFT_BOUNDARY: 0x200f,\n};\n//# sourceMappingURL=SpecialCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FontShaper {\n}\n//# sourceMappingURL=FontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SpecialCodepoints } from '../../../renderers/SdfTextRenderer/internal/SpecialCodepoints.js';\nimport { FontShaper, } from './FontShaper.js';\nexport class SdfFontShaper extends FontShaper {\n data;\n glyphMap;\n kernings;\n constructor(data, glyphMap) {\n super();\n this.data = data;\n this.glyphMap = glyphMap;\n const kernings = (this.kernings = {});\n data.kernings.forEach((kerning) => {\n const second = kerning.second;\n const firsts = (kernings[second] = kernings[second] || {});\n firsts[kerning.first] = kerning.amount;\n });\n this.kernings = kernings;\n }\n *shapeText(props, codepoints) {\n let codepointResult;\n let lastGlyphId = undefined;\n while ((codepointResult = codepoints.peek()) && !codepointResult.done) {\n const codepoint = codepointResult.value;\n const glyph = this.glyphMap.get(codepoint);\n codepoints.next();\n if (glyph !== undefined) {\n // We found a glyph for this codepoint\n // Yield the mapped glyph info\n /**\n * Kerning includes any possible additional letter spacing\n */\n const kerning = lastGlyphId !== undefined\n ? (this.kernings[glyph.id]?.[lastGlyphId] || 0) +\n props.letterSpacing\n : 0;\n lastGlyphId = glyph.id;\n yield {\n mapped: true,\n glyphId: glyph.id,\n codepoint,\n cluster: codepoints.lastIndex,\n xAdvance: glyph.xadvance + kerning,\n yAdvance: 0,\n xOffset: glyph.xoffset + kerning,\n yOffset: glyph.yoffset,\n xBearing: 0,\n yBearing: 0,\n width: glyph.width,\n height: glyph.height,\n };\n }\n else {\n // We didn't find a glyph for this codepoint\n // Yield the unmapped codepoint info\n // If this codepoint is a linebreak, we should reset the last glyph id\n // so that the next glyph will not be kerned with the last glyph of the\n // previous line.\n if (codepoint === SpecialCodepoints.LINE_FEED) {\n lastGlyphId = undefined;\n }\n yield {\n mapped: false,\n codepoint,\n cluster: codepoints.lastIndex,\n };\n }\n }\n }\n}\n//# sourceMappingURL=SdfFontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// import type { Renderer } from '../../../Renderer';\nimport { assertTruthy } from '../../../../utils.js';\nimport { WebGlCoreRenderer } from '../../../renderers/webgl/WebGlCoreRenderer.js';\nimport { ImageTexture } from '../../../textures/ImageTexture.js';\nimport { TrFontFace } from '../TrFontFace.js';\nimport { SdfFontShaper } from './internal/SdfFontShaper.js';\nexport class SdfTrFontFace extends TrFontFace {\n type;\n texture;\n /**\n * Height of the tallest character in the font including the whitespace above it\n */\n maxCharHeight = 0;\n data;\n shaper;\n glyphMap = new Map();\n constructor(fontFamily, descriptors, type, stage, atlasUrl, atlasDataUrl) {\n super(fontFamily, descriptors);\n this.type = type;\n const renderer = stage.renderer;\n assertTruthy(renderer instanceof WebGlCoreRenderer, 'SDF Font Faces can only be used with the WebGL Renderer');\n this.texture = stage.txManager.loadTexture('ImageTexture', {\n src: atlasUrl,\n // IMPORTANT: The SDF shader requires the alpha channel to NOT be\n // premultiplied on the atlas texture. If it is premultiplied, the\n // rendering of SDF glyphs (especially single-channel SDF fonts) will\n // be very jagged.\n premultiplyAlpha: false,\n }, {\n preload: true,\n });\n this.texture.on('loaded', () => {\n this.checkLoaded();\n });\n // Set this.data to the fetched data from dataUrl\n fetch(atlasDataUrl)\n .then(async (response) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.data = await response.json();\n // Add all the glyphs to the glyph map\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let maxCharHeight = 0;\n this.data.chars.forEach((glyph) => {\n this.glyphMap.set(glyph.id, glyph);\n const charHeight = glyph.yoffset + glyph.height;\n if (charHeight > maxCharHeight) {\n maxCharHeight = charHeight;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.maxCharHeight = maxCharHeight;\n // We know `data` is defined here, because we just set it\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shaper = new SdfFontShaper(this.data, this.glyphMap);\n this.checkLoaded();\n })\n .catch(console.error);\n }\n getAtlasEntry(glyphId) {\n const glyph = this.glyphMap.get(glyphId);\n if (glyph === undefined) {\n throw new Error(`Glyph ${glyphId} not found in font ${this.fontFamily}`);\n }\n return {\n x: glyph.x,\n y: glyph.y,\n width: glyph.width,\n height: glyph.height,\n };\n }\n checkLoaded() {\n if (this.loaded)\n return;\n if (this.texture.state === 'loaded' && this.data) {\n this.loaded = true;\n this.emit('loaded');\n }\n }\n}\n//# sourceMappingURL=SdfTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Base class for Core extensions.\n *\n * @remarks\n * Core extensions are used to extend the Core Renderer with custom code such as\n * custom fonts, custom shaders, custom textures, custom animation functions,\n * and more.\n */\nexport class CoreExtension {\n}\n//# sourceMappingURL=CoreExtension.js.map"],"names":["createWebGLContext","canvas","contextSpy","config","gl","target","prop","value","assertTruthy","condition","message","isProductionEnvironment","mergeColorProgress","rgba1","rgba2","p","r1","g1","b1","a1","r2","g2","b2","a2","r","g","b","a","mergeColorAlpha","rgba","alpha","mergeColorAlphaPremultiplied","flipEndianess","newAlpha","hasOwn","obj","EventEmitter","__publicField","event","listener","listeners","index","onceListener","data","CoreShader","props","createShader","glw","type","source","shader","createProgram","vertexShader","fragmentShader","program","isWebGl2","WebGlCoreShader","options","renderer","webGl2","requiredExtensions","glVersion","extensionName","shaderSources","textureUnits","vertexSource","fragmentSource","vao","attributeName","location","buffer","uniform","attribute","loc","propsA","propsB","renderOp","parentHasRenderTexture","renderToTexture","width","height","dimensions","name","resolvedBuffer","resolvedInfo","textures","Texture","txManager","owner","renderable","state","args","loadedArgs","failedArgs","getNormalizedRgbaComponents","getNormalizedAlphaComponent","getRgbaString","color","createBound","x1","y1","x2","y2","out","intersectBound","intersection","boundsOverlap","convertBoundToRect","bound","intersectRect","x","y","copyRect","compareRect","boundInsideBound","bound1","bound2","isBoundPositive","TrFontFace","fontFamily","descriptors","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","buffers","shaderProps","clippingRect","bufferIdx","zIndex","framebufferDimensions","texture","maxTextures","existingIdx","t","newIdx","shManager","quadIdx","pixelRatio","canvasHeight","clipX","clipWidth","clipHeight","clipY","getWebGlParameters","params","key","getWebGlExtensions","extensions","createIndexBuffer","size","maxQuads","indices","j","isHTMLImageElement","memize","fn","head","tail","memoized","node","len","i","searchCache","isPowerOfTwo","getTimingBezier","c","d","xc","xb","xa","yc","yb","ya","time","cbx","cbxd","dx","it","minT","maxT","getTimingFunction","memo","str","s","parts","TRANSPARENT_TEXTURE_DATA","WebGlCoreCtxTexture","err","_a","_b","textureData","mipmaps","glInternalFormat","view","nativeTexture","_ColorTexture","pixelData32","pixelData8","resolvedProps","ColorTexture","_SubTexture","error","parentTx","SubTexture","WebGlCoreCtxSubTexture","BufferCollection","item","WebGlContextWrapper","maxTextureUnits","_","scissorBox","textureUnit","activeTextureUnit","texture2dUnits","pname","param","texture2dParams","activeTexture","textureParams","level","internalFormat","widthOrFormat","heightOrType","borderOrSource","format","pixels","internalformat","border","red","green","blue","enable","scissorEnabled","scissorX","scissorY","scissorWidth","scissorHeight","blend","blendEnabled","src","dst","blendSrcRgb","blendDstRgb","blendSrcAlpha","blendDstAlpha","framebuffer","attachment","usage","boundArrayBuffer","boundElementArrayBuffer","normalized","stride","offset","curProgram","programUniforms","uniforms","uniformArgs","compareArrays","mode","count","vertexArray","v","_RenderTexture","RenderTexture","WebGlCoreCtxRenderTexture","WORDS_PER_QUAD","WebGlCoreRenderer","clearColor","bufferMemory","quadBuffer","fQuadBuffer","uiQuadBuffer","colorTl","colorTr","colorBl","colorBr","textureOptions","tx","ty","ta","tb","tc","td","curRenderOp","targetDims","targetShader","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","tw","th","parentW","parentH","ctxTexture","textureIdx","rightCornerX","rightCornerY","recursive","rtt","surface","arr","child","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","firsts","codepoints","codepointResult","lastGlyphId","codepoint","glyph","SdfTrFontFace","atlasUrl","atlasDataUrl","response","maxCharHeight","charHeight","glyphId","CoreExtension"],"mappings":"4KAkBgB,SAAAA,GAAmBC,EAAQC,EAAY,CACnD,MAAMC,EAAS,CACX,MAAO,GACP,UAAW,GACX,MAAO,GACP,QAAS,GACT,eAAgB,GAGhB,gBAAiB,mBACjB,mBAAoB,GACpB,sBAAuB,EAAA,EAErBC,EAGLH,EAAO,WAAW,QAASE,CAAM,GAC9BF,EAAO,WAAW,qBAAsBE,CAAM,EAClD,GAAI,CAACC,EACK,MAAA,IAAI,MAAM,gCAAgC,EAEpD,OAAIF,EAEO,IAAI,MAAME,EAAI,CACjB,IAAIC,EAAQC,EAAM,CACR,MAAAC,EAAQF,EAAOC,CAAI,EACrB,OAAA,OAAOC,GAAU,YACNL,EAAA,UAAU,OAAOI,CAAI,CAAC,EAC1BC,EAAM,KAAKF,CAAM,GAErBE,CACX,CAAA,CACH,EAEEH,CACX,CAagB,SAAAI,EAAaC,EAAWC,EAAS,CAC7C,GAAI,CAAAC,GAAwB,GAExB,CAACF,EACK,MAAA,IAAI,MAAMC,GAAW,kBAAkB,CAErD,CAcgB,SAAAE,GAAmBC,EAAOC,EAAOC,EAAG,CAChD,MAAMC,EAAK,KAAK,MAAMH,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KAAK,YAAW,CAC5B,CAAS,EACI,MAAM,QAAQ,KAAK,CAC3B,CACD,cAAciB,EAAS,CACnB,MAAMP,EAAQ,KAAK,SAAS,IAAIO,CAAO,EACvC,GAAIP,IAAU,OACV,MAAM,IAAI,MAAM,SAAS,OAAAO,EAAO,uBAAsB,YAAK,WAAY,EAE3E,MAAO,CACH,EAAGP,EAAM,EACT,EAAGA,EAAM,EACT,MAAOA,EAAM,MACb,OAAQA,EAAM,MAC1B,CACK,CACD,aAAc,CACN,KAAK,QAEL,KAAK,QAAQ,QAAU,UAAY,KAAK,OACxC,KAAK,OAAS,GACd,KAAK,KAAK,QAAQ,EAEzB,CACL,CCtEO,MAAMQ,EAAc,CAC3B","x_google_ignoreList":[14]} \ No newline at end of file +{"version":3,"file":"CoreExtension-BfzrAcK3.js","sources":["../../../../../renderer/dist/src/utils.js","../../../../../renderer/dist/src/common/EventEmitter.js","../../../../../renderer/dist/src/core/renderers/CoreShader.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/ShaderUtils.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/WebGlUtils.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreShader.js","../../../../../renderer/dist/src/core/textures/Texture.js","../../../../../renderer/dist/src/core/lib/utils.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/TrFontFace.js","../../../../../renderer/dist/src/core/renderers/CoreContextTexture.js","../../../../../renderer/dist/src/core/renderers/CoreRenderer.js","../../../../../renderer/dist/src/core/renderers/CoreRenderOp.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreRenderOp.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/RendererUtils.js","../../../../../renderer/node_modules/.pnpm/memize@2.1.0/node_modules/memize/dist/index.js","../../../../../renderer/dist/src/core/utils.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js","../../../../../renderer/dist/src/core/textures/ColorTexture.js","../../../../../renderer/dist/src/core/textures/SubTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxSubTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/BufferCollection.js","../../../../../renderer/dist/src/core/lib/WebGlContextWrapper.js","../../../../../renderer/dist/src/core/textures/RenderTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxRenderTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/SpecialCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/FontShaper.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/SdfFontShaper.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js","../../../../../renderer/dist/src/core/CoreExtension.js"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createWebGLContext(canvas, contextSpy) {\n const config = {\n alpha: true,\n antialias: false,\n depth: false,\n stencil: true,\n desynchronized: false,\n // Disabled because it prevents Visual Regression Tests from working\n // failIfMajorPerformanceCaveat: true,\n powerPreference: 'high-performance',\n premultipliedAlpha: true,\n preserveDrawingBuffer: false,\n };\n const gl = \n // TODO: Remove this assertion once this issue is fixed in TypeScript\n // https://github.com/microsoft/TypeScript/issues/53614\n (canvas.getContext('webgl', config) ||\n canvas.getContext('experimental-webgl', config));\n if (!gl) {\n throw new Error('Unable to create WebGL context');\n }\n if (contextSpy) {\n // Proxy the GL context to log all GL calls\n return new Proxy(gl, {\n get(target, prop) {\n const value = target[prop];\n if (typeof value === 'function') {\n contextSpy.increment(String(prop));\n return value.bind(target);\n }\n return value;\n },\n });\n }\n return gl;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (isProductionEnvironment())\n return;\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n/**\n * Merges two colors based on a given progress value.\n *\n * This function takes two colors (c1 and c2) represented as 32-bit integers\n * in RGBA format and blends them based on the provided progress value (p).\n * The result is a new color that is a weighted combination of the input colors,\n * where the weight is determined by the progress value.\n *\n * @param {number} c1 - The first color in RGBA format (32-bit integer).\n * @param {number} c2 - The second color in RGBA format (32-bit integer).\n * @param {number} p - The progress value between 0 and 1.\n * @returns {number} The merged color as a 32-bit integer in RGBA format.\n */\nexport function mergeColorProgress(rgba1, rgba2, p) {\n const r1 = Math.trunc(rgba1 >>> 24);\n const g1 = Math.trunc((rgba1 >>> 16) & 0xff);\n const b1 = Math.trunc((rgba1 >>> 8) & 0xff);\n const a1 = Math.trunc(rgba1 & 0xff);\n const r2 = Math.trunc(rgba2 >>> 24);\n const g2 = Math.trunc((rgba2 >>> 16) & 0xff);\n const b2 = Math.trunc((rgba2 >>> 8) & 0xff);\n const a2 = Math.trunc(rgba2 & 0xff);\n const r = Math.round(r2 * p + r1 * (1 - p));\n const g = Math.round(g2 * p + g1 * (1 - p));\n const b = Math.round(b2 * p + b1 * (1 - p));\n const a = Math.round(a2 * p + a1 * (1 - p));\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter.\n *\n * @internalRemarks\n * This method does NOT premultiply the alpha into the color channels. If that\n * is required (for internal use only) use {@link mergeColorAlphaPremultiplied}\n * instead.\n *\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @returns\n */\nexport function mergeColorAlpha(rgba, alpha) {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = Math.trunc((rgba & 0xff) * alpha);\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter. Before returning, the\n * final alpha value is multiplied into the color channels.\n *\n * @remarks\n * If `flipEndianess` is set to true, the function will returned an ABGR encoded number\n * which is useful when the color value needs to be passed into a shader attribute.\n *\n * NOTE: This method returns a PREMULTIPLIED alpha color which is generally only useful\n * in the context of the internal rendering process. Use {@link mergeColorAlpha} if you\n * need to blend an alpha value into a color in the context of the Renderer's\n * main API.\n *\n * @internalRemarks\n * Do not expose this method in the main API because Renderer users should instead use\n * {@link mergeColorAlpha} to manipulate the alpha value of a color.\n *\n * @internal\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @param flipEndianess Flip the endianess. RGBA becomes encoded as ABGR (for inserting colors into shader attributes)\n * @returns\n */\nexport function mergeColorAlphaPremultiplied(rgba, alpha, flipEndianess = false) {\n const newAlpha = ((rgba & 0xff) / 255) * alpha;\n const r = Math.trunc((rgba >>> 24) * newAlpha);\n const g = Math.trunc(((rgba >>> 16) & 0xff) * newAlpha);\n const b = Math.trunc(((rgba >>> 8) & 0xff) * newAlpha);\n const a = Math.trunc(newAlpha * 255);\n if (flipEndianess) {\n return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0;\n }\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Returns true if the given object has the given \"own\" property.\n *\n * @param obj\n * @param prop\n * @returns\n */\nexport function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n/**\n * Converts degrees to radians\n *\n * @param degrees\n * @returns\n */\nexport function deg2Rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * Returns image aspect ratio\n *\n * @param width\n * @param height\n * @returns\n */\nexport function getImageAspectRatio(width, height) {\n return width / height;\n}\n/**\n * Checks import.meta if env is production\n *\n * @returns\n */\nexport function isProductionEnvironment() {\n return import.meta.env && import.meta.env.PROD;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * EventEmitter base class\n */\nexport class EventEmitter {\n eventListeners = {};\n on(event, listener) {\n let listeners = this.eventListeners[event];\n if (!listeners) {\n listeners = [];\n }\n listeners.push(listener);\n this.eventListeners[event] = listeners;\n }\n off(event, listener) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n if (!listener) {\n delete this.eventListeners[event];\n return;\n }\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n once(event, listener) {\n const onceListener = (target, data) => {\n this.off(event, onceListener);\n listener(target, data);\n };\n this.on(event, onceListener);\n }\n emit(event, data) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n [...listeners].forEach((listener) => {\n listener(this, data);\n });\n }\n removeAllListeners() {\n this.eventListeners = {};\n }\n}\n//# sourceMappingURL=EventEmitter.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreShader {\n // abstract draw(): void;\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {};\n }\n}\n//# sourceMappingURL=CoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion Types\nexport function createShader(glw, type, source) {\n const shader = glw.createShader(type);\n if (!shader) {\n throw new Error();\n }\n glw.shaderSource(shader, source);\n glw.compileShader(shader);\n const success = glw.getShaderParameter(shader, glw.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.log(glw.getShaderInfoLog(shader));\n glw.deleteShader(shader);\n}\nexport function createProgram(glw, vertexShader, fragmentShader) {\n const program = glw.createProgram();\n if (!program) {\n throw new Error();\n }\n glw.attachShader(program, vertexShader);\n glw.attachShader(program, fragmentShader);\n glw.linkProgram(program);\n const success = glw.getProgramParameter(program, glw.LINK_STATUS);\n if (success) {\n return program;\n }\n console.log(glw.getProgramInfoLog(program));\n glw.deleteProgram(program);\n return undefined;\n}\n//# sourceMappingURL=ShaderUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generic WebGL Utility Functions\n *\n * @remarks\n * Nothing here should be coupled to Renderer logic / types.\n *\n * @param gl\n * @returns\n */\nexport function isWebGl2(gl) {\n return (self.WebGL2RenderingContext && gl instanceof self.WebGL2RenderingContext);\n}\n//# sourceMappingURL=WebGlUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, hasOwn } from '../../../utils.js';\nimport { CoreShader } from '../CoreShader.js';\nimport { createProgram, createShader, } from './internal/ShaderUtils.js';\nimport { isWebGl2 } from './internal/WebGlUtils.js';\nexport class WebGlCoreShader extends CoreShader {\n boundBufferCollection = null;\n buffersBound = false;\n program;\n /**\n * Vertex Array Object\n *\n * @remarks\n * Used by WebGL2 Only\n */\n vao;\n renderer;\n glw;\n attributeBuffers;\n attributeLocations;\n attributeNames;\n uniformLocations;\n uniformTypes;\n supportsIndexedTextures;\n constructor(options) {\n super();\n const renderer = (this.renderer = options.renderer);\n const glw = (this.glw = this.renderer.glw);\n this.supportsIndexedTextures = options.supportsIndexedTextures || false;\n // Check that extensions are supported\n const webGl2 = glw.isWebGl2();\n const requiredExtensions = (webGl2 && options.webgl2Extensions) ||\n (!webGl2 && options.webgl1Extensions) ||\n [];\n const glVersion = webGl2 ? '2.0' : '1.0';\n requiredExtensions.forEach((extensionName) => {\n if (!glw.getExtension(extensionName)) {\n throw new Error(`Shader \"${this.constructor.name}\" requires extension \"${extensionName}\" for WebGL ${glVersion} but wasn't found`);\n }\n });\n // Gather shader sources\n // - If WebGL 2 and special WebGL 2 sources are provided, we copy those sources and delete\n // the extra copy of them to save memory.\n // TODO: This could be further made optimal by just caching the compiled shaders and completely deleting\n // the source code\n const shaderSources = options.shaderSources ||\n this.constructor.shaderSources;\n if (!shaderSources) {\n throw new Error(`Shader \"${this.constructor.name}\" is missing shaderSources.`);\n }\n else if (webGl2 && shaderSources?.webGl2) {\n shaderSources.fragment = shaderSources.webGl2.fragment;\n shaderSources.vertex = shaderSources.webGl2.vertex;\n delete shaderSources.webGl2;\n }\n const textureUnits = renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n const vertexSource = shaderSources.vertex instanceof Function\n ? shaderSources.vertex(textureUnits)\n : shaderSources.vertex;\n const fragmentSource = shaderSources.fragment instanceof Function\n ? shaderSources.fragment(textureUnits)\n : shaderSources.fragment;\n const vertexShader = createShader(glw, glw.VERTEX_SHADER, vertexSource);\n const fragmentShader = createShader(glw, glw.FRAGMENT_SHADER, fragmentSource);\n if (!vertexShader || !fragmentShader) {\n throw new Error();\n }\n const program = createProgram(glw, vertexShader, fragmentShader);\n if (!program) {\n throw new Error();\n }\n this.program = program;\n if (webGl2) {\n const vao = glw.createVertexArray();\n if (!vao) {\n throw new Error();\n }\n this.vao = vao;\n glw.bindVertexArray(this.vao);\n }\n this.attributeLocations = {};\n this.attributeBuffers = {};\n this.attributeNames = [];\n [...options.attributes].forEach((attributeName) => {\n const location = glw.getAttribLocation(this.program, attributeName);\n if (location < 0) {\n throw new Error(`${this.constructor.name}: Vertex shader must have an attribute \"${attributeName}\"!`);\n }\n const buffer = glw.createBuffer();\n if (!buffer) {\n throw new Error(`${this.constructor.name}: Could not create buffer for attribute \"${attributeName}\"`);\n }\n this.attributeLocations[attributeName] = location;\n this.attributeBuffers[attributeName] = buffer;\n this.attributeNames.push(attributeName);\n });\n this.uniformLocations = {};\n this.uniformTypes = {};\n options.uniforms.forEach((uniform) => {\n const location = glw.getUniformLocation(this.program, uniform.name);\n this.uniformTypes[uniform.name] = uniform.uniform;\n if (!location) {\n console.warn(`Shader \"${this.constructor.name}\" could not get uniform location for \"${uniform.name}\"`);\n return;\n }\n this.uniformLocations[uniform.name] = location;\n });\n }\n bindBufferAttribute(location, buffer, attribute) {\n const { glw } = this;\n glw.enableVertexAttribArray(location);\n glw.vertexAttribPointer(buffer, location, attribute.size, attribute.type, attribute.normalized, attribute.stride, attribute.offset);\n }\n disableAttribute(location) {\n this.glw.disableVertexAttribArray(location);\n }\n disableAttributes() {\n for (const loc in this.attributeLocations) {\n this.disableAttribute(this.attributeLocations[loc]);\n }\n this.boundBufferCollection = null;\n }\n /**\n * Given two sets of Shader props destined for this Shader, determine if they can be batched together\n * to reduce the number of draw calls.\n *\n * @remarks\n * This is used by the {@link WebGlCoreRenderer} to determine if it can batch multiple consecutive draw\n * calls into a single draw call.\n *\n * By default, this returns false (meaning no batching is allowed), but can be\n * overridden by child classes to provide more efficient batching.\n *\n * @param propsA\n * @param propsB\n * @returns\n */\n canBatchShaderProps(propsA, propsB) {\n return false;\n }\n bindRenderOp(renderOp, props) {\n this.bindBufferCollection(renderOp.buffers);\n if (renderOp.textures.length > 0) {\n this.bindTextures(renderOp.textures);\n }\n const { glw, parentHasRenderTexture, renderToTexture } = renderOp;\n // Skip if the parent and current operation both have render textures\n if (renderToTexture && parentHasRenderTexture) {\n return;\n }\n // Bind render texture framebuffer dimensions as resolution\n // if the parent has a render texture\n if (parentHasRenderTexture) {\n const { width, height } = renderOp.framebufferDimensions || {};\n // Force pixel ratio to 1.0 for render textures since they are always 1:1\n // the final render texture will be rendered to the screen with the correct pixel ratio\n this.setUniform('u_pixelRatio', 1.0);\n // Set resolution to the framebuffer dimensions\n this.setUniform('u_resolution', new Float32Array([width ?? 0, height ?? 0]));\n }\n else {\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\n this.setUniform('u_resolution', new Float32Array([glw.canvas.width, glw.canvas.height]));\n }\n if (props) {\n // Bind optional automatic uniforms\n // These are only bound if their keys are present in the props.\n if (hasOwn(props, '$dimensions')) {\n let dimensions = props.$dimensions;\n if (!dimensions) {\n dimensions = renderOp.dimensions;\n }\n this.setUniform('u_dimensions', [dimensions.width, dimensions.height]);\n }\n if (hasOwn(props, '$alpha')) {\n let alpha = props.$alpha;\n if (!alpha) {\n alpha = renderOp.alpha;\n }\n this.setUniform('u_alpha', alpha);\n }\n this.bindProps(props);\n }\n }\n setUniform(name, ...value) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-argument\n this.glw.setUniform(this.uniformTypes[name], this.uniformLocations[name], ...value);\n }\n bindBufferCollection(buffer) {\n if (this.boundBufferCollection === buffer) {\n return;\n }\n for (const attributeName in this.attributeLocations) {\n const resolvedBuffer = buffer.getBuffer(attributeName);\n const resolvedInfo = buffer.getAttributeInfo(attributeName);\n assertTruthy(resolvedBuffer, `Buffer for \"${attributeName}\" not found`);\n assertTruthy(resolvedInfo);\n this.bindBufferAttribute(this.attributeLocations[attributeName], resolvedBuffer, resolvedInfo);\n }\n this.boundBufferCollection = buffer;\n }\n bindProps(props) {\n // Implement in child class\n }\n bindTextures(textures) {\n // no defaults\n }\n attach() {\n this.glw.useProgram(this.program);\n this.glw.useProgram(this.program);\n if (this.glw.isWebGl2() && this.vao) {\n this.glw.bindVertexArray(this.vao);\n }\n }\n detach() {\n this.disableAttributes();\n }\n static shaderSources;\n}\n//# sourceMappingURL=WebGlCoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../common/EventEmitter.js';\n/**\n * Represents a source of texture data for a CoreContextTexture.\n *\n * @remarks\n * Texture sources are used to populate a CoreContextTexture when that texture\n * is loaded. Texture data retrieved by the CoreContextTexture by the\n * `getTextureData` method. It's the responsibility of the concerete `Texture`\n * subclass to implement this method appropriately.\n */\nexport class Texture extends EventEmitter {\n txManager;\n /**\n * The dimensions of the texture\n *\n * @remarks\n * Until the texture data is loaded for the first time the value will be\n * `null`.\n */\n dimensions = null;\n error = null;\n state = 'freed';\n renderableOwners = new Set();\n constructor(txManager) {\n super();\n this.txManager = txManager;\n }\n /**\n * Add/remove an owner to/from the Texture based on its renderability.\n *\n * @remarks\n * Any object can own a texture, be it a CoreNode or even the state object\n * from a Text Renderer.\n *\n * When the reference to the texture that an owner object holds is replaced\n * or cleared it must call this with `renderable=false` to release the owner\n * association.\n *\n * @param owner\n * @param renderable\n */\n setRenderableOwner(owner, renderable) {\n if (renderable) {\n this.renderableOwners.add(owner);\n }\n else {\n this.renderableOwners.delete(owner);\n }\n }\n /**\n * Returns true if the texture is assigned to any Nodes that are renderable.\n */\n get renderable() {\n return this.renderableOwners.size > 0;\n }\n /**\n * Set the state of the texture\n *\n * @remark\n * Intended for internal-use only but declared public so that it can be set\n * by it's associated {@link CoreContextTexture}\n *\n * @param state\n * @param args\n */\n setState(state, ...args) {\n if (this.state !== state) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.state = state;\n if (state === 'loaded') {\n const loadedArgs = args;\n this.dimensions = loadedArgs[0];\n }\n else if (state === 'failed') {\n const failedArgs = args;\n this.error = failedArgs[0];\n }\n this.emit(state, ...args);\n }\n }\n /**\n * Make a cache key for this texture.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide an\n * appropriate cache key for the texture type including the texture's\n * properties that uniquely identify a copy of the texture. If the texture\n * type does not support caching, then this method should return `false`.\n *\n * @param props\n * @returns\n * A cache key for this texture or `false` if the texture type does not\n * support caching.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n /**\n * Resolve the default values for the texture's properties.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide\n * default values for the texture's optional properties.\n *\n * @param props\n * @returns\n * The default values for the texture's properties.\n */\n static resolveDefaults(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props) {\n return {};\n }\n}\n//# sourceMappingURL=Texture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNormalizedRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r / 255, g / 255, b / 255, a / 255];\n};\nexport const getRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r, g, b, a];\n};\nexport const norm = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n const rgbaArr = [r / 255, g / 255, b / 255, a / 255];\n rgbaArr[0] = Math.max(0, Math.min(255, rgbaArr[0]));\n rgbaArr[1] = Math.max(0, Math.min(255, rgbaArr[1]));\n rgbaArr[2] = Math.max(0, Math.min(255, rgbaArr[2]));\n rgbaArr[3] = Math.max(0, Math.min(255, rgbaArr[3]));\n let v = ((rgbaArr[3] | 0) << 24) +\n ((rgbaArr[0] | 0) << 16) +\n ((rgbaArr[1] | 0) << 8) +\n (rgbaArr[2] | 0);\n if (v < 0) {\n v = 0xffffffff + v + 1;\n }\n return v;\n};\nexport function getNormalizedAlphaComponent(rgba) {\n return (rgba & 0xff) / 255.0;\n}\n/**\n * Get a CSS color string from a RGBA color\n *\n * @param color\n * @returns\n */\nexport function getRgbaString(color) {\n const r = Math.floor(color[0] * 255.0);\n const g = Math.floor(color[1] * 255.0);\n const b = Math.floor(color[2] * 255.0);\n const a = Math.floor(color[3] * 255.0);\n return `rgba(${r},${g},${b},${a.toFixed(4)})`;\n}\nexport function createBound(x1, y1, x2, y2, out) {\n if (out) {\n out.x1 = x1;\n out.y1 = y1;\n out.x2 = x2;\n out.y2 = y2;\n return out;\n }\n return {\n x1,\n y1,\n x2,\n y2,\n };\n}\nexport function intersectBound(a, b, out) {\n const intersection = createBound(Math.max(a.x1, b.x1), Math.max(a.y1, b.y1), Math.min(a.x2, b.x2), Math.min(a.y2, b.y2), out);\n if (intersection.x1 < intersection.x2 && intersection.y1 < intersection.y2) {\n return intersection;\n }\n return createBound(0, 0, 0, 0, intersection);\n}\nexport function boundsOverlap(a, b) {\n return a.x1 < b.x2 && a.x2 > b.x1 && a.y1 < b.y2 && a.y2 > b.y1;\n}\nexport function convertBoundToRect(bound, out) {\n if (out) {\n out.x = bound.x1;\n out.y = bound.y1;\n out.width = bound.x2 - bound.x1;\n out.height = bound.y2 - bound.y1;\n return out;\n }\n return {\n x: bound.x1,\n y: bound.y1,\n width: bound.x2 - bound.x1,\n height: bound.y2 - bound.y1,\n };\n}\nexport function intersectRect(a, b, out) {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const width = Math.min(a.x + a.width, b.x + b.width) - x;\n const height = Math.min(a.y + a.height, b.y + b.height) - y;\n if (width > 0 && height > 0) {\n if (out) {\n out.x = x;\n out.y = y;\n out.width = width;\n out.height = height;\n return out;\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n if (out) {\n out.x = 0;\n out.y = 0;\n out.width = 0;\n out.height = 0;\n return out;\n }\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n}\nexport function copyRect(a, out) {\n if (out) {\n out.x = a.x;\n out.y = a.y;\n out.width = a.width;\n out.height = a.height;\n return out;\n }\n return {\n x: a.x,\n y: a.y,\n width: a.width,\n height: a.height,\n };\n}\nexport function compareRect(a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n return (a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height);\n}\nexport function boundInsideBound(bound1, bound2) {\n return (bound1.x1 <= bound2.x2 &&\n bound1.y1 <= bound2.y2 &&\n bound1.x2 >= bound2.x1 &&\n bound1.y2 >= bound2.y1);\n}\nexport function isBoundPositive(bound) {\n return bound.x1 < bound.x2 && bound.y1 < bound.y2;\n}\nexport function isRectPositive(rect) {\n return rect.width > 0 && rect.height > 0;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nexport class TrFontFace extends EventEmitter {\n fontFamily;\n descriptors;\n loaded = false;\n constructor(fontFamily, descriptors) {\n super();\n this.fontFamily = fontFamily;\n this.descriptors = {\n style: 'normal',\n weight: 'normal',\n stretch: 'normal',\n ...descriptors,\n };\n }\n /**\n * Convert a TrFontFaceDescriptors to a FontFaceDescriptors which differ slightly\n *\n * @param descriptors\n * @returns\n */\n static convertToCssFontFaceDescriptors(descriptors) {\n return {\n style: descriptors.style,\n weight: typeof descriptors.weight === 'number'\n ? `${descriptors.weight}`\n : descriptors.weight,\n stretch: descriptors.stretch,\n unicodeRange: descriptors.unicodeRange,\n variant: descriptors.variant,\n featureSettings: descriptors.featureSettings,\n display: descriptors.display,\n };\n }\n}\n//# sourceMappingURL=TrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreContextTexture {\n memManager;\n textureSource;\n constructor(memManager, textureSource) {\n this.memManager = memManager;\n this.textureSource = textureSource;\n }\n}\n//# sourceMappingURL=CoreContextTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreContextTexture } from './CoreContextTexture.js';\nexport class CoreRenderer {\n stage;\n constructor(stage) {\n this.stage = stage;\n }\n}\n//# sourceMappingURL=CoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreRenderOp {\n}\n//# sourceMappingURL=CoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreRenderOp } from '../CoreRenderOp.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nconst MAX_TEXTURES = 8; // TODO: get from gl\n/**\n * Can render multiple quads with multiple textures (up to vertex shader texture limit)\n *\n */\nexport class WebGlCoreRenderOp extends CoreRenderOp {\n glw;\n options;\n buffers;\n shader;\n shaderProps;\n alpha;\n clippingRect;\n dimensions;\n bufferIdx;\n zIndex;\n renderToTexture;\n parentHasRenderTexture;\n framebufferDimensions;\n length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex, renderToTexture, parentHasRenderTexture, framebufferDimensions) {\n super();\n this.glw = glw;\n this.options = options;\n this.buffers = buffers;\n this.shader = shader;\n this.shaderProps = shaderProps;\n this.alpha = alpha;\n this.clippingRect = clippingRect;\n this.dimensions = dimensions;\n this.bufferIdx = bufferIdx;\n this.zIndex = zIndex;\n this.renderToTexture = renderToTexture;\n this.parentHasRenderTexture = parentHasRenderTexture;\n this.framebufferDimensions = framebufferDimensions;\n this.maxTextures = shader.supportsIndexedTextures\n ? glw.getParameter(glw.MAX_VERTEX_TEXTURE_IMAGE_UNITS)\n : 1;\n }\n addTexture(texture) {\n const { textures, maxTextures } = this;\n const existingIdx = textures.findIndex((t) => t === texture);\n if (existingIdx !== -1) {\n return existingIdx;\n }\n const newIdx = textures.length;\n if (newIdx >= maxTextures) {\n return 0xffffffff;\n }\n this.textures.push(texture);\n return newIdx;\n }\n draw() {\n const { glw, shader, shaderProps, options } = this;\n const { shManager } = options;\n shManager.useShader(shader);\n shader.bindRenderOp(this, shaderProps);\n // TODO: Reduce calculations required\n const quadIdx = (this.bufferIdx / 24) * 6 * 2;\n // Clipping\n if (this.clippingRect.valid) {\n const { x, y, width, height } = this.clippingRect;\n const pixelRatio = options.pixelRatio;\n const canvasHeight = options.canvas.height;\n const clipX = Math.round(x * pixelRatio);\n const clipWidth = Math.round(width * pixelRatio);\n const clipHeight = Math.round(height * pixelRatio);\n const clipY = Math.round(canvasHeight - clipHeight - y * pixelRatio);\n glw.setScissorTest(true);\n glw.scissor(clipX, clipY, clipWidth, clipHeight);\n }\n else {\n glw.setScissorTest(false);\n }\n glw.drawElements(glw.TRIANGLES, 6 * this.numQuads, glw.UNSIGNED_SHORT, quadIdx);\n }\n}\n//# sourceMappingURL=WebGlCoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Get device specific webgl parameters\n * @param glw\n */\nexport function getWebGlParameters(glw) {\n const params = {\n MAX_RENDERBUFFER_SIZE: 0,\n MAX_TEXTURE_SIZE: 0,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n MAX_VIEWPORT_DIMS: 0,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0,\n MAX_TEXTURE_IMAGE_UNITS: 0,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0,\n MAX_VERTEX_ATTRIBS: 0,\n MAX_VARYING_VECTORS: 0,\n MAX_VERTEX_UNIFORM_VECTORS: 0,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0,\n };\n // Map over all parameters and get them\n const keys = Object.keys(params);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params[key] = glw.getParameter(glw[key]);\n });\n return params;\n}\n/**\n * Get device webgl extensions\n * @param glw\n */\nexport function getWebGlExtensions(glw) {\n const extensions = {\n ANGLE_instanced_arrays: null,\n WEBGL_compressed_texture_s3tc: null,\n WEBGL_compressed_texture_astc: null,\n WEBGL_compressed_texture_etc: null,\n WEBGL_compressed_texture_etc1: null,\n WEBGL_compressed_texture_pvrtc: null,\n WEBKIT_WEBGL_compressed_texture_pvrtc: null,\n WEBGL_compressed_texture_s3tc_srgb: null,\n OES_vertex_array_object: null,\n };\n // Map over all extensions and get them\n const keys = Object.keys(extensions);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n extensions[key] = glw.getExtension(key);\n });\n return extensions;\n}\n/**\n * Allocate big memory chunk that we\n * can re-use to draw quads\n *\n * @param glw\n * @param size\n */\nexport function createIndexBuffer(glw, size) {\n const maxQuads = ~~(size / 80);\n const indices = new Uint16Array(maxQuads * 6);\n for (let i = 0, j = 0; i < maxQuads; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 2;\n indices[i + 4] = j + 1;\n indices[i + 5] = j + 3;\n }\n const buffer = glw.createBuffer();\n glw.elementArrayBufferData(buffer, indices, glw.STATIC_DRAW);\n}\n/**\n * Checks if an object is of type HTMLImageElement.\n * This is used because we cant check for HTMLImageElement directly when the\n * renderer is running in a seperate web worker context.\n *\n * @param obj\n * @returns\n */\nexport function isHTMLImageElement(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n obj.constructor &&\n obj.constructor.name === 'HTMLImageElement');\n}\n//# sourceMappingURL=RendererUtils.js.map","/**\n * Memize options object.\n *\n * @typedef MemizeOptions\n *\n * @property {number} [maxSize] Maximum size of the cache.\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef MemizeCacheNode\n *\n * @property {?MemizeCacheNode|undefined} [prev] Previous node.\n * @property {?MemizeCacheNode|undefined} [next] Next node.\n * @property {Array<*>} args Function arguments for cache\n * entry.\n * @property {*} val Function result.\n */\n\n/**\n * Properties of the enhanced function for controlling cache.\n *\n * @typedef MemizeMemoizedFunction\n *\n * @property {()=>void} clear Clear the cache.\n */\n\n/**\n * Accepts a function to be memoized, and returns a new memoized function, with\n * optional options.\n *\n * @template {(...args: any[]) => any} F\n *\n * @param {F} fn Function to memoize.\n * @param {MemizeOptions} [options] Options object.\n *\n * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function.\n */\nfunction memize(fn, options) {\n\tvar size = 0;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar head;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar tail;\n\n\toptions = options || {};\n\n\tfunction memoized(/* ...args */) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs,\n\t\t\ti;\n\n\t\tsearchCache: while (node) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif (node.args.length !== arguments.length) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (node.args[i] !== arguments[i]) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== head) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif (node === tail) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\t/** @type {MemizeCacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {MemizeCacheNode} */ (head).prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply(null, args),\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (head) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif (size === /** @type {MemizeOptions} */ (options).maxSize) {\n\t\t\ttail = /** @type {MemizeCacheNode} */ (tail).prev;\n\t\t\t/** @type {MemizeCacheNode} */ (tail).next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function () {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\t// Ignore reason: There's not a clear solution to create an intersection of\n\t// the function with additional properties, where the goal is to retain the\n\t// function signature of the incoming argument and add control properties\n\t// on the return value.\n\n\t// @ts-ignore\n\treturn memoized;\n}\n\nexport { memize as default };\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Core Utility Functions\n *\n * @module\n */\nimport memo from 'memize';\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\nconst degree = Math.PI / 180;\nexport const setMatrixArrayType = (type) => {\n ARRAY_TYPE = type;\n};\nexport const toRadian = (a) => {\n return a * degree;\n};\nexport const equals = (a, b) => {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n};\nexport const rand = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\nexport const isPowerOfTwo = (value) => {\n return value && !(value & (value - 1));\n};\nconst getTimingBezier = (a, b, c, d) => {\n const xc = 3.0 * a;\n const xb = 3.0 * (c - a) - xc;\n const xa = 1.0 - xc - xb;\n const yc = 3.0 * b;\n const yb = 3.0 * (d - b) - yc;\n const ya = 1.0 - yc - yb;\n return function (time) {\n if (time >= 1.0) {\n return 1;\n }\n if (time <= 0) {\n return 0;\n }\n let t = 0.5, cbx, cbxd, dx;\n for (let it = 0; it < 20; it++) {\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n return t * (t * (t * ya + yb) + yc);\n }\n // Cubic bezier derivative.\n cbxd = t * (t * (3 * xa) + 2 * xb) + xc;\n if (cbxd > 1e-10 && cbxd < 1e-10) {\n // Problematic. Fall back to binary search method.\n break;\n }\n t += dx / cbxd;\n }\n // Fallback: binary search method. This is more reliable when there are near-0 slopes.\n let minT = 0;\n let maxT = 1;\n for (let it = 0; it < 20; it++) {\n t = 0.5 * (minT + maxT);\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n // Solution found!\n return t * (t * (t * ya + yb) + yc);\n }\n if (dx < 0) {\n maxT = t;\n }\n else {\n minT = t;\n }\n }\n };\n};\nexport const getTimingFunction = memo((str) => {\n switch (str) {\n case 'linear':\n return function (time) {\n return time;\n };\n case 'ease':\n return getTimingBezier(0.25, 0.1, 0.25, 1.0);\n case 'ease-in':\n return getTimingBezier(0.42, 0, 1.0, 1.0);\n case 'ease-out':\n return getTimingBezier(0, 0, 0.58, 1.0);\n case 'ease-in-out':\n return getTimingBezier(0.42, 0, 0.58, 1.0);\n case 'ease-in-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-out-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-in-out-sine':\n return getTimingBezier(0.37, 0, 0.63, 1);\n case 'ease-in-cubic':\n return getTimingBezier(0.32, 0, 0.67, 0);\n case 'ease-out-cubic':\n return getTimingBezier(0.33, 1, 0.68, 1);\n case 'ease-in-out-cubic':\n return getTimingBezier(0.65, 0, 0.35, 1);\n case 'ease-in-circ':\n return getTimingBezier(0.55, 0, 1, 0.45);\n case 'ease-out-circ':\n return getTimingBezier(0, 0.55, 0.45, 1);\n case 'ease-in-out-circ':\n return getTimingBezier(0.85, 0, 0.15, 1);\n case 'ease-in-back':\n return getTimingBezier(0.36, 0, 0.66, -0.56);\n case 'ease-out-back':\n return getTimingBezier(0.34, 1.56, 0.64, 1);\n case 'ease-in-out-back':\n return getTimingBezier(0.68, -0.6, 0.32, 1.6);\n case 'step-start':\n return function () {\n return 1;\n };\n case 'step-end':\n return function (time) {\n return time === 1 ? 1 : 0;\n };\n default:\n // eslint-disable-next-line no-case-declarations\n const s = 'cubic-bezier(';\n if (str && str.indexOf(s) === 0) {\n const parts = str\n .substr(s.length, str.length - s.length - 1)\n .split(',');\n if (parts.length !== 4) {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n const a = parseFloat(parts[0] || '0.42');\n const b = parseFloat(parts[1] || '0');\n const c = parseFloat(parts[2] || '1');\n const d = parseFloat(parts[3] || '1');\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\n console.warn(' Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n return getTimingBezier(a, b, c, d);\n }\n else {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n }\n});\nif (!Math.hypot)\n Math.hypot = (...args) => {\n let y = 0, i = args.length;\n while (i--) {\n y += args[i] * args[i];\n }\n return Math.sqrt(y);\n };\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { isPowerOfTwo } from '../../utils.js';\nimport { CoreContextTexture } from '../CoreContextTexture.js';\nimport { isHTMLImageElement } from './internal/RendererUtils.js';\nconst TRANSPARENT_TEXTURE_DATA = new Uint8Array([0, 0, 0, 0]);\n/**\n * A wrapper around a WebGLTexture that handles loading the texture data\n * from a Texture source and uploading it to the GPU as well as freeing\n * the uploaded texture.\n *\n * @remarks\n * When accessing the ctxTexture property, the texture will be loaded if\n * it hasn't been already. ctxTexture will always return a valid WebGLTexture\n * and trigger the loading/uploading of the texture's data if it hasn't been\n * loaded yet.\n */\nexport class WebGlCoreCtxTexture extends CoreContextTexture {\n glw;\n _nativeCtxTexture = null;\n _state = 'freed';\n _w = 0;\n _h = 0;\n constructor(glw, memManager, textureSource) {\n super(memManager, textureSource);\n this.glw = glw;\n }\n get ctxTexture() {\n if (this._state === 'freed') {\n this.load();\n }\n assertTruthy(this._nativeCtxTexture);\n return this._nativeCtxTexture;\n }\n get renderable() {\n return this.textureSource.renderable;\n }\n get w() {\n return this._w;\n }\n get h() {\n return this._h;\n }\n /**\n * Load the texture data from the Texture source and upload it to the GPU\n *\n * @remarks\n * This method is called automatically when accessing the ctxTexture property\n * if the texture hasn't been loaded yet. But it can also be called manually\n * to force the texture to be pre-loaded prior to accessing the ctxTexture\n * property.\n */\n load() {\n // If the texture is already loading or loaded, don't load it again.\n if (this._state === 'loading' || this._state === 'loaded') {\n return;\n }\n this._state = 'loading';\n this.textureSource.setState('loading');\n this._nativeCtxTexture = this.createNativeCtxTexture();\n this.onLoadRequest()\n .then(({ width, height }) => {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'loaded';\n this._w = width;\n this._h = height;\n // Update the texture source's width and height so that it can be used\n // for rendering.\n this.textureSource.setState('loaded', { width, height });\n })\n .catch((err) => {\n this._state = 'failed';\n this.textureSource.setState('failed', err);\n console.error(err);\n });\n }\n /**\n * Called when the texture data needs to be loaded and uploaded to a texture\n */\n async onLoadRequest() {\n const { glw, memManager } = this;\n // Set to a 1x1 transparent texture\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, null);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n const textureData = await this.textureSource?.getTextureData();\n // If the texture has been freed while loading, return early.\n if (!this._nativeCtxTexture) {\n assertTruthy(this._state === 'freed');\n return { width: 0, height: 0 };\n }\n let width = 0;\n let height = 0;\n assertTruthy(this._nativeCtxTexture);\n glw.activeTexture(0);\n // If textureData is null, the texture is empty (0, 0) and we don't need to\n // upload any data to the GPU.\n if (textureData.data instanceof ImageBitmap ||\n textureData.data instanceof ImageData ||\n // not using typeof HTMLImageElement due to web worker\n isHTMLImageElement(textureData.data)) {\n const data = textureData.data;\n width = data.width;\n height = data.height;\n glw.bindTexture(this._nativeCtxTexture);\n glw.pixelStorei(glw.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !!textureData.premultiplyAlpha);\n glw.texImage2D(0, glw.RGBA, glw.RGBA, glw.UNSIGNED_BYTE, data);\n memManager.setTextureMemUse(this, width * height * 4);\n // generate mipmaps for power-of-2 textures or in WebGL2RenderingContext\n if (glw.isWebGl2() || (isPowerOfTwo(width) && isPowerOfTwo(height))) {\n glw.generateMipmap();\n }\n }\n else if (textureData.data === null) {\n width = 0;\n height = 0;\n // Reset to a 1x1 transparent texture\n glw.bindTexture(this._nativeCtxTexture);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n }\n else if ('mipmaps' in textureData.data && textureData.data.mipmaps) {\n const { mipmaps, width = 0, height = 0, type, glInternalFormat, } = textureData.data;\n const view = type === 'ktx'\n ? new DataView(mipmaps[0] ?? new ArrayBuffer(0))\n : mipmaps[0];\n glw.bindTexture(this._nativeCtxTexture);\n glw.compressedTexImage2D(0, glInternalFormat, width, height, 0, view);\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n memManager.setTextureMemUse(this, view.byteLength);\n }\n else {\n console.error(`WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned`, textureData);\n }\n return {\n width,\n height,\n };\n }\n /**\n * Free the WebGLTexture from the GPU\n *\n * @returns\n */\n free() {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'freed';\n this.textureSource.setState('freed');\n this._w = 0;\n this._h = 0;\n if (!this._nativeCtxTexture) {\n return;\n }\n const { glw, memManager } = this;\n glw.deleteTexture(this._nativeCtxTexture);\n memManager.setTextureMemUse(this, 0);\n this._nativeCtxTexture = null;\n }\n /**\n * Create native context texture\n *\n * @remarks\n * When this method returns the returned texture will be bound to the GL context state.\n *\n * @param width\n * @param height\n * @returns\n */\n createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\n // On initial load request, create a 1x1 transparent texture to use until\n // the texture data is finally loaded.\n glw.activeTexture(0);\n glw.bindTexture(nativeTexture);\n // linear texture filtering\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n // texture wrapping method\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n return nativeTexture;\n }\n}\n//# sourceMappingURL=WebGlCoreCtxTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of only a 1x1 color pixel\n *\n * @remarks\n * The pixel color is set with the {@link ColorTextureProps.color} prop.\n *\n * This is the default texture used for a Node if it's\n * {@link INodeWritableProps.texture} prop is set to `null` (the default)\n *\n * Generally the 1x1 color pixel is stretched to whatever the set dimensions of\n * a Node are.\n */\nexport class ColorTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ColorTexture.resolveDefaults(props || {});\n }\n get color() {\n return this.props.color;\n }\n set color(color) {\n this.props.color = color;\n }\n async getTextureData() {\n const pixelData32 = new Uint32Array([this.color]);\n const pixelData8 = new Uint8ClampedArray(pixelData32.buffer);\n return {\n data: new ImageData(pixelData8, 1, 1),\n premultiplyAlpha: true,\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = ColorTexture.resolveDefaults(props);\n return `ColorTexture,${resolvedProps.color}`;\n }\n static resolveDefaults(props) {\n return {\n color: props.color || 0xffffffff,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ColorTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture, } from './Texture.js';\n/**\n * A Texture that is a sub-region of another Texture.\n *\n * @remarks\n * The parent texture can be a Sprite Sheet/Texture Atlas and set using the\n * {@link SubTextureProps.texture} prop. The sub-region relative to the parent\n * texture is defined with the {@link SubTextureProps.x},\n * {@link SubTextureProps.y}, {@link SubTextureProps.width}, and\n * {@link SubTextureProps.height} pixel values.\n */\nexport class SubTexture extends Texture {\n props;\n parentTexture;\n constructor(txManager, props) {\n super(txManager);\n this.parentTexture = this.txManager.loadTexture(props.texture.txType, props.texture.props, props.texture.options);\n this.props = SubTexture.resolveDefaults(props || {});\n // If parent texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n const parentTx = this.parentTexture;\n if (parentTx.state === 'loaded') {\n this.onParentTxLoaded(parentTx, parentTx.dimensions);\n }\n else if (parentTx.state === 'failed') {\n this.onParentTxFailed(parentTx, parentTx.error);\n }\n parentTx.on('loaded', this.onParentTxLoaded);\n parentTx.on('failed', this.onParentTxFailed);\n });\n }\n onParentTxLoaded = () => {\n // We ignore the parent's passed dimensions, and simply use the SubTexture's\n // configured dimensions (because that's all that matters here)\n this.setState('loaded', {\n width: this.props.width,\n height: this.props.height,\n });\n };\n onParentTxFailed = (target, error) => {\n this.setState('failed', error);\n };\n async getTextureData() {\n return {\n data: this.props,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {\n texture: props.texture,\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 0,\n height: props.height || 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=SubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxSubTexture extends WebGlCoreCtxTexture {\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n }\n async onLoadRequest() {\n const props = await this.textureSource.getTextureData();\n return {\n width: props.data?.width || 0,\n height: props.data?.height || 0,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxSubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a collection of WebGL Buffers along with their associated\n * vertex attribute formats.\n */\nexport class BufferCollection {\n config;\n constructor(config) {\n this.config = config;\n }\n /**\n * Get the WebGLBuffer associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getBuffer(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])?.buffer;\n }\n /**\n * Get the AttributeInfo associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getAttributeInfo(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])\n ?.attributes[attributeName];\n }\n}\n//# sourceMappingURL=BufferCollection.js.map","/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport { assertTruthy } from '../../utils.js';\nimport { isWebGl2 } from '../renderers/webgl/internal/WebGlUtils.js';\n/**\n * Optimized WebGL Context Wrapper\n *\n * @remarks\n * This class contains the subset of the WebGLRenderingContext & WebGL2RenderingContext\n * API that is used by the renderer. Select high volume WebGL methods include\n * caching optimizations to avoid making WebGL calls if the state is already set\n * to the desired value.\n *\n * While most methods contained are direct passthroughs to the WebGL context,\n * some methods combine multiple WebGL calls into one for convenience, modify\n * arguments to be more convenient, or are replaced by more specific methods.\n *\n * Not all methods are optimized. Only methods that are called frequently\n * and/or have a high cost are optimized.\n *\n * A subset of GLenum constants are also exposed as properties on this class\n * for convenience.\n */\nexport class WebGlContextWrapper {\n gl;\n //#region Cached WebGL State\n activeTextureUnit = 0;\n texture2dUnits;\n texture2dParams = new WeakMap();\n scissorEnabled;\n scissorX;\n scissorY;\n scissorWidth;\n scissorHeight;\n blendEnabled;\n blendSrcRgb;\n blendDstRgb;\n blendSrcAlpha;\n blendDstAlpha;\n boundArrayBuffer;\n boundElementArrayBuffer;\n curProgram;\n programUniforms = new WeakMap();\n //#endregion Cached WebGL State\n //#region Canvas\n canvas;\n //#endregion Canvas\n //#region WebGL Enums\n MAX_RENDERBUFFER_SIZE;\n MAX_TEXTURE_SIZE;\n MAX_VIEWPORT_DIMS;\n MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n MAX_TEXTURE_IMAGE_UNITS;\n MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n MAX_VERTEX_ATTRIBS;\n MAX_VARYING_VECTORS;\n MAX_VERTEX_UNIFORM_VECTORS;\n MAX_FRAGMENT_UNIFORM_VECTORS;\n TEXTURE_MAG_FILTER;\n TEXTURE_MIN_FILTER;\n TEXTURE_WRAP_S;\n TEXTURE_WRAP_T;\n LINEAR;\n CLAMP_TO_EDGE;\n RGBA;\n UNSIGNED_BYTE;\n UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n UNPACK_FLIP_Y_WEBGL;\n FLOAT;\n TRIANGLES;\n UNSIGNED_SHORT;\n ONE;\n ONE_MINUS_SRC_ALPHA;\n VERTEX_SHADER;\n FRAGMENT_SHADER;\n STATIC_DRAW;\n COMPILE_STATUS;\n LINK_STATUS;\n DYNAMIC_DRAW;\n COLOR_ATTACHMENT0;\n //#endregion WebGL Enums\n constructor(gl) {\n this.gl = gl;\n // The following code extracts the current state of the WebGL context\n // to our local JavaScript cached version of it. This is so we can\n // avoid making WebGL calls if we don't need to.\n // We could assume that the WebGL context is in a default state, but\n // in the future we may want to support restoring a broken WebGL context\n // and this will help with that.\n this.activeTextureUnit =\n gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0;\n const maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // save current texture units\n this.texture2dUnits = new Array(maxTextureUnits)\n .fill(undefined)\n .map((_, i) => {\n this.activeTexture(i);\n return gl.getParameter(gl.TEXTURE_BINDING_2D);\n });\n // restore active texture unit\n this.activeTexture(this.activeTextureUnit);\n this.scissorEnabled = gl.isEnabled(gl.SCISSOR_TEST);\n const scissorBox = gl.getParameter(gl.SCISSOR_BOX);\n this.scissorX = scissorBox[0];\n this.scissorY = scissorBox[1];\n this.scissorWidth = scissorBox[2];\n this.scissorHeight = scissorBox[3];\n this.blendEnabled = gl.isEnabled(gl.BLEND);\n this.blendSrcRgb = gl.getParameter(gl.BLEND_SRC_RGB);\n this.blendDstRgb = gl.getParameter(gl.BLEND_DST_RGB);\n this.blendSrcAlpha = gl.getParameter(gl.BLEND_SRC_ALPHA);\n this.blendDstAlpha = gl.getParameter(gl.BLEND_DST_ALPHA);\n this.boundArrayBuffer = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n this.boundElementArrayBuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);\n this.curProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n this.canvas = gl.canvas;\n // Extract GLenums\n this.MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE;\n this.MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE;\n this.MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS;\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n this.MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS;\n this.MAX_VARYING_VECTORS = gl.MAX_VARYING_VECTORS;\n this.MAX_VERTEX_UNIFORM_VECTORS = gl.MAX_VERTEX_UNIFORM_VECTORS;\n this.MAX_FRAGMENT_UNIFORM_VECTORS = gl.MAX_FRAGMENT_UNIFORM_VECTORS;\n this.TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T;\n this.LINEAR = gl.LINEAR;\n this.CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE;\n this.RGBA = gl.RGBA;\n this.UNSIGNED_BYTE = gl.UNSIGNED_BYTE;\n this.UNPACK_PREMULTIPLY_ALPHA_WEBGL = gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n this.UNPACK_FLIP_Y_WEBGL = gl.UNPACK_FLIP_Y_WEBGL;\n this.FLOAT = gl.FLOAT;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.ONE = gl.ONE;\n this.ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.VERTEX_SHADER = gl.VERTEX_SHADER;\n this.FRAGMENT_SHADER = gl.FRAGMENT_SHADER;\n this.STATIC_DRAW = gl.STATIC_DRAW;\n this.COMPILE_STATUS = gl.COMPILE_STATUS;\n this.LINK_STATUS = gl.LINK_STATUS;\n this.DYNAMIC_DRAW = gl.DYNAMIC_DRAW;\n this.COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0;\n }\n /**\n * Returns true if the WebGL context is WebGL2\n *\n * @returns\n */\n isWebGl2() {\n return isWebGl2(this.gl);\n }\n /**\n * ```\n * gl.activeTexture(textureUnit + gl.TEXTURE0);\n * ```\n *\n * @remarks\n * **WebGL Difference**: `textureUnit` is based from 0, not `gl.TEXTURE0`.\n *\n * @param textureUnit\n */\n activeTexture(textureUnit) {\n const { gl } = this;\n if (this.activeTextureUnit !== textureUnit) {\n gl.activeTexture(textureUnit + gl.TEXTURE0);\n this.activeTextureUnit = textureUnit;\n }\n }\n /**\n * ```\n * gl.bindTexture(gl.TEXTURE_2D, texture);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param texture\n */\n bindTexture(texture) {\n const { gl, activeTextureUnit, texture2dUnits } = this;\n if (texture2dUnits[activeTextureUnit] === texture) {\n return;\n }\n texture2dUnits[activeTextureUnit] = texture;\n gl.bindTexture(this.gl.TEXTURE_2D, texture);\n }\n _getActiveTexture() {\n const { activeTextureUnit, texture2dUnits } = this;\n return texture2dUnits[activeTextureUnit];\n }\n /**\n * ```\n * gl.texParameteri(gl.TEXTURE_2D, pname, param);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param pname\n * @param param\n * @returns\n */\n texParameteri(pname, param) {\n const { gl, texture2dParams } = this;\n const activeTexture = this._getActiveTexture();\n if (!activeTexture) {\n throw new Error('No active texture');\n }\n let textureParams = texture2dParams.get(activeTexture);\n if (!textureParams) {\n textureParams = {};\n texture2dParams.set(activeTexture, textureParams);\n }\n if (textureParams[pname] === param) {\n return;\n }\n textureParams[pname] = param;\n gl.texParameteri(gl.TEXTURE_2D, pname, param);\n }\n texImage2D(level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels) {\n const { gl } = this;\n if (format) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource);\n }\n }\n /**\n * ```\n * gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, data);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n compressedTexImage2D(level, internalformat, width, height, border, data) {\n const { gl } = this;\n gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalformat, width, height, border, data);\n }\n /**\n * ```\n * gl.pixelStorei(pname, param);\n * ```\n *\n * @param pname\n * @param param\n */\n pixelStorei(pname, param) {\n const { gl } = this;\n gl.pixelStorei(pname, param);\n }\n /**\n * ```\n * gl.generateMipmap(gl.TEXTURE_2D);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n generateMipmap() {\n const { gl } = this;\n gl.generateMipmap(gl.TEXTURE_2D);\n }\n /**\n * ```\n * gl.createTexture();\n * ```\n *\n * @returns\n */\n createTexture() {\n const { gl } = this;\n return gl.createTexture();\n }\n /**\n * ```\n * gl.deleteTexture(texture);\n * ```\n *\n * @param texture\n */\n deleteTexture(texture) {\n const { gl } = this;\n if (texture) {\n this.texture2dParams.delete(texture);\n }\n gl.deleteTexture(texture);\n }\n /**\n * ```\n * gl.viewport(x, y, width, height);\n * ```\n */\n viewport(x, y, width, height) {\n const { gl } = this;\n gl.viewport(x, y, width, height);\n }\n /**\n * ```\n * gl.clearColor(red, green, blue, alpha);\n * ```\n *\n * @param red\n * @param green\n * @param blue\n * @param alpha\n */\n clearColor(red, green, blue, alpha) {\n const { gl } = this;\n gl.clearColor(red, green, blue, alpha);\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.SCISSOR_TEST);\n * ```\n * @param enable\n */\n setScissorTest(enable) {\n const { gl, scissorEnabled } = this;\n if (enable === scissorEnabled) {\n return;\n }\n if (enable) {\n gl.enable(gl.SCISSOR_TEST);\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n this.scissorEnabled = enable;\n }\n /**\n * ```\n * gl.scissor(x, y, width, height);\n * ```\n *\n * @param x\n * @param y\n * @param width\n * @param height\n */\n scissor(x, y, width, height) {\n const { gl, scissorX, scissorY, scissorWidth, scissorHeight } = this;\n if (x !== scissorX ||\n y !== scissorY ||\n width !== scissorWidth ||\n height !== scissorHeight) {\n gl.scissor(x, y, width, height);\n this.scissorX = x;\n this.scissorY = y;\n this.scissorWidth = width;\n this.scissorHeight = height;\n }\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.BLEND);\n * ```\n *\n * @param blend\n * @returns\n */\n setBlend(blend) {\n const { gl, blendEnabled } = this;\n if (blend === blendEnabled) {\n return;\n }\n if (blend) {\n gl.enable(gl.BLEND);\n }\n else {\n gl.disable(gl.BLEND);\n }\n this.blendEnabled = blend;\n }\n /**\n * ```\n * gl.blendFunc(src, dst);\n * ```\n *\n * @param src\n * @param dst\n */\n blendFunc(src, dst) {\n const { gl, blendSrcRgb, blendDstRgb, blendSrcAlpha, blendDstAlpha } = this;\n if (src !== blendSrcRgb ||\n dst !== blendDstRgb ||\n src !== blendSrcAlpha ||\n dst !== blendDstAlpha) {\n gl.blendFunc(src, dst);\n this.blendSrcRgb = src;\n this.blendDstRgb = dst;\n this.blendSrcAlpha = src;\n this.blendDstAlpha = dst;\n }\n }\n /**\n * ```\n * gl.createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\n }\n /**\n * ```\n * gl.createFramebuffer();\n * ```\n * @returns\n */\n createFramebuffer() {\n const { gl } = this;\n return gl.createFramebuffer();\n }\n /**\n * ```\n * gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n * ```\n *\n * @param framebuffer\n */\n bindFramebuffer(framebuffer) {\n const { gl } = this;\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n }\n /**\n * ```\n * gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.FRAMEBUFFER` and textarget is always `gl.TEXTURE_2D`\n */\n framebufferTexture2D(attachment, texture, level) {\n const { gl } = this;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, texture, level);\n }\n /**\n * ```\n * gl.clear(gl.COLOR_BUFFER_BIT);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Clear mask is always `gl.COLOR_BUFFER_BIT`\n */\n clear() {\n const { gl } = this;\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n arrayBufferData(buffer, data, usage) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n * ```\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n elementArrayBufferData(buffer, data, usage) {\n const { gl, boundElementArrayBuffer } = this;\n if (boundElementArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n this.boundElementArrayBuffer = buffer;\n }\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.vertexAttribPointer` are combined into one function.\n *\n * @param buffer\n * @param index\n * @param size\n * @param type\n * @param normalized\n * @param stride\n * @param offset\n */\n vertexAttribPointer(buffer, index, size, type, normalized, stride, offset) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n }\n /**\n * ```\n * gl.useProgram(program);\n * ```\n *\n * @param program\n * @returns\n */\n useProgram(program) {\n const { gl, curProgram } = this;\n if (curProgram === program) {\n return;\n }\n gl.useProgram(program);\n this.curProgram = program;\n }\n setUniform(type, location, ...args) {\n const { gl, programUniforms } = this;\n let uniforms = programUniforms.get(this.curProgram);\n if (!uniforms) {\n uniforms = new Map();\n programUniforms.set(this.curProgram, uniforms);\n }\n const uniformArgs = uniforms.get(location);\n if (!uniformArgs || !compareArrays(uniformArgs, args)) {\n uniforms.set(location, args);\n gl[type](location, ...args);\n }\n }\n /**\n * ```\n * gl.getParameter(pname);\n * ```\n *\n * @param pname\n * @returns\n */\n getParameter(pname) {\n const { gl } = this;\n return gl.getParameter(pname);\n }\n /**\n * ```\n * gl.drawElements(mode, count, type, offset);\n * ```\n *\n * @param mode\n * @param count\n * @param type\n * @param offset\n */\n drawElements(mode, count, type, offset) {\n const { gl } = this;\n gl.drawElements(mode, count, type, offset);\n }\n /**\n * ```\n * gl.drawArrays(mode, first, count);\n * ```\n *\n * @param name\n * @returns\n */\n getExtension(name) {\n const { gl } = this;\n return gl.getExtension(name);\n }\n /**\n * ```\n * gl.createVertexArray();\n * ```\n *\n * @returns\n */\n createVertexArray() {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n return gl.createVertexArray();\n }\n /**\n * ```\n * gl.bindVertexArray(vertexArray);\n * ```\n *\n * @param vertexArray\n */\n bindVertexArray(vertexArray) {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n gl.bindVertexArray(vertexArray);\n }\n /**\n * ```\n * gl.getAttribLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getAttribLocation(program, name) {\n const { gl } = this;\n return gl.getAttribLocation(program, name);\n }\n /**\n * ```\n * gl.getUniformLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getUniformLocation(program, name) {\n const { gl } = this;\n return gl.getUniformLocation(program, name);\n }\n /**\n * ```\n * gl.enableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n enableVertexAttribArray(index) {\n const { gl } = this;\n gl.enableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.disableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n disableVertexAttribArray(index) {\n const { gl } = this;\n gl.disableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.createShader(type);\n * ```\n *\n * @param type\n * @returns\n */\n createShader(type) {\n const { gl } = this;\n return gl.createShader(type);\n }\n /**\n * ```\n * gl.compileShader(shader);\n * ```\n *\n * @param shader\n * @returns\n */\n compileShader(shader) {\n const { gl } = this;\n gl.compileShader(shader);\n }\n /**\n * ```\n * gl.attachShader(program, shader);\n * ```\n *\n * @param program\n * @param shader\n */\n attachShader(program, shader) {\n const { gl } = this;\n gl.attachShader(program, shader);\n }\n /**\n * ```\n * gl.linkProgram(program);\n * ```\n *\n * @param program\n */\n linkProgram(program) {\n const { gl } = this;\n gl.linkProgram(program);\n }\n /**\n * ```\n * gl.deleteProgram(shader);\n * ```\n *\n * @param shader\n */\n deleteProgram(shader) {\n const { gl } = this;\n gl.deleteProgram(shader);\n }\n /**\n * ```\n * gl.getShaderParameter(shader, pname);\n * ```\n *\n * @param shader\n * @param pname\n */\n getShaderParameter(shader, pname) {\n const { gl } = this;\n return gl.getShaderParameter(shader, pname);\n }\n /**\n * ```\n * gl.getShaderInfoLog(shader);\n * ```\n *\n * @param shader\n */\n getShaderInfoLog(shader) {\n const { gl } = this;\n return gl.getShaderInfoLog(shader);\n }\n /**\n * ```\n * gl.createProgram();\n * ```\n *\n * @returns\n */\n createProgram() {\n const { gl } = this;\n return gl.createProgram();\n }\n /**\n * ```\n * gl.getProgramParameter(program, pname);\n * ```\n *\n * @param program\n * @param pname\n * @returns\n */\n getProgramParameter(program, pname) {\n const { gl } = this;\n return gl.getProgramParameter(program, pname);\n }\n /**\n * ```\n * gl.getProgramInfoLog(program);\n * ```\n *\n * @param program\n * @returns\n */\n getProgramInfoLog(program) {\n const { gl } = this;\n return gl.getProgramInfoLog(program);\n }\n /**\n * ```\n * gl.shaderSource(shader, source);\n * ```\n *\n * @param shader\n * @param source\n */\n shaderSource(shader, source) {\n const { gl } = this;\n gl.shaderSource(shader, source);\n }\n /**\n * ```\n * gl.deleteShader(shader);\n * ```\n *\n * @param shader\n */\n deleteShader(shader) {\n const { gl } = this;\n gl.deleteShader(shader);\n }\n}\n/**\n * Compare two arrays for equality.\n *\n * @remarks\n * This function will not try to compare nested arrays or Float32Arrays and\n * instead will always return false when they are encountered.\n *\n * @param a\n * @param b\n * @returns\n */\nexport function compareArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((v, i) => {\n // Don't bother to compare nested arrays or Float32Arrays\n if (Array.isArray(v) || v instanceof Float32Array) {\n return false;\n }\n else {\n return v === b[i];\n }\n });\n}\n//# sourceMappingURL=WebGlContextWrapper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nexport class RenderTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = RenderTexture.resolveDefaults(props || {});\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n }\n async getTextureData() {\n return {\n data: null,\n premultiplyAlpha: null,\n };\n }\n static resolveDefaults(props) {\n return {\n width: props.width || 256,\n height: props.height || 256,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=RenderTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2024 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxRenderTexture extends WebGlCoreCtxTexture {\n framebuffer;\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n // Create Framebuffer object\n const framebuffer = glw.createFramebuffer();\n assertTruthy(framebuffer, 'Unable to create framebuffer');\n this.framebuffer = framebuffer;\n }\n async onLoadRequest() {\n const { glw, memManager } = this;\n const nativeTexture = (this._nativeCtxTexture =\n this.createNativeCtxTexture());\n const { width, height } = this.textureSource;\n // Set the dimensions of the render texture\n glw.texImage2D(0, glw.RGBA, width, height, 0, glw.RGBA, glw.UNSIGNED_BYTE, null);\n // Update the texture memory manager\n memManager.setTextureMemUse(this, width * height * 4);\n // Bind the framebuffer\n glw.bindFramebuffer(this.framebuffer);\n // Attach the texture to the framebuffer\n glw.framebufferTexture2D(glw.COLOR_ATTACHMENT0, nativeTexture, 0);\n // Unbind the framebuffer\n glw.bindFramebuffer(null);\n return {\n width,\n height,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxRenderTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, createWebGLContext, hasOwn, mergeColorAlphaPremultiplied, } from '../../../utils.js';\nimport { CoreRenderer } from '../CoreRenderer.js';\nimport { WebGlCoreRenderOp } from './WebGlCoreRenderOp.js';\nimport { createIndexBuffer, getWebGlParameters, getWebGlExtensions, } from './internal/RendererUtils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nimport { Texture } from '../../textures/Texture.js';\nimport { ColorTexture } from '../../textures/ColorTexture.js';\nimport { SubTexture } from '../../textures/SubTexture.js';\nimport { WebGlCoreCtxSubTexture } from './WebGlCoreCtxSubTexture.js';\nimport { CoreShaderManager } from '../../CoreShaderManager.js';\nimport { BufferCollection } from './internal/BufferCollection.js';\nimport { compareRect, getNormalizedRgbaComponents, } from '../../lib/utils.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nimport { RoundedRectangle } from './shaders/RoundedRectangle.js';\nimport { ContextSpy } from '../../lib/ContextSpy.js';\nimport { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';\nimport { RenderTexture } from '../../textures/RenderTexture.js';\nimport { WebGlCoreCtxRenderTexture } from './WebGlCoreCtxRenderTexture.js';\nconst WORDS_PER_QUAD = 24;\nconst BYTES_PER_QUAD = WORDS_PER_QUAD * 4;\nexport class WebGlCoreRenderer extends CoreRenderer {\n //// WebGL Native Context and Data\n glw;\n system;\n //// Core Managers\n txManager;\n txMemManager;\n shManager;\n //// Options\n options;\n //// Persistent data\n quadBuffer = new ArrayBuffer(1024 * 1024 * 4);\n fQuadBuffer = new Float32Array(this.quadBuffer);\n uiQuadBuffer = new Uint32Array(this.quadBuffer);\n renderOps = [];\n //// Render Op / Buffer Filling State\n curBufferIdx = 0;\n curRenderOp = null;\n rttNodes = [];\n activeRttNode = null;\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\n /**\n * Whether the renderer is currently rendering to a texture.\n */\n renderToTextureActive = false;\n constructor(options) {\n super(options.stage);\n const { canvas, clearColor, bufferMemory } = options;\n this.options = options;\n this.txManager = options.txManager;\n this.txMemManager = options.txMemManager;\n this.shManager = options.shManager;\n this.defaultTexture = new ColorTexture(this.txManager);\n // When the default texture is loaded, request a render in case the\n // RAF is paused. Fixes: https://github.com/lightning-js/renderer/issues/123\n this.defaultTexture.once('loaded', () => {\n this.stage.requestRender();\n });\n const gl = createWebGLContext(canvas, options.contextSpy);\n const glw = (this.glw = new WebGlContextWrapper(gl));\n const color = getNormalizedRgbaComponents(clearColor);\n glw.viewport(0, 0, canvas.width, canvas.height);\n glw.clearColor(color[0], color[1], color[2], color[3]);\n glw.setBlend(true);\n glw.blendFunc(glw.ONE, glw.ONE_MINUS_SRC_ALPHA);\n createIndexBuffer(glw, bufferMemory);\n this.system = {\n parameters: getWebGlParameters(this.glw),\n extensions: getWebGlExtensions(this.glw),\n };\n this.shManager.renderer = this;\n this.defaultShader = this.shManager.loadShader('DefaultShader').shader;\n const quadBuffer = glw.createBuffer();\n assertTruthy(quadBuffer);\n const stride = 6 * Float32Array.BYTES_PER_ELEMENT;\n this.quadBufferCollection = new BufferCollection([\n {\n buffer: quadBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_color: {\n name: 'a_color',\n size: 4,\n type: glw.UNSIGNED_BYTE,\n normalized: true,\n stride,\n offset: 4 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_textureIndex: {\n name: 'a_textureIndex',\n size: 1,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 5 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n }\n reset() {\n const { glw } = this;\n this.curBufferIdx = 0;\n this.curRenderOp = null;\n this.renderOps.length = 0;\n glw.setScissorTest(false);\n glw.clear();\n }\n getShaderManager() {\n return this.shManager;\n }\n createCtxTexture(textureSource) {\n if (textureSource instanceof SubTexture) {\n return new WebGlCoreCtxSubTexture(this.glw, this.txMemManager, textureSource);\n }\n else if (textureSource instanceof RenderTexture) {\n return new WebGlCoreCtxRenderTexture(this.glw, this.txMemManager, textureSource);\n }\n return new WebGlCoreCtxTexture(this.glw, this.txMemManager, textureSource);\n }\n /**\n * This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.\n *\n * It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix.\n * The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided.\n * It then checks if a new render operation is needed, based on the current shader and clipping rectangle.\n * If a new render operation is needed, it creates one and updates the current render operation.\n * The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.\n *\n * Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer.\n * The function updates the length and number of quads in the current render operation, and updates the current buffer index.\n */\n addQuad(params) {\n const { fQuadBuffer, uiQuadBuffer } = this;\n const { width, height, colorTl, colorTr, colorBl, colorBr, textureOptions, shader, shaderProps, alpha, clippingRect, tx, ty, ta, tb, tc, td, rtt: renderToTexture, parentHasRenderTexture, framebufferDimensions, } = params;\n let { texture } = params;\n /**\n * If the shader props contain any automatic properties, update it with the\n * current dimensions that will be used to render the quad.\n */\n if (shaderProps && hasOwn(shaderProps, '$dimensions')) {\n const dimensions = shaderProps.$dimensions;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n dimensions.width = width;\n dimensions.height = height;\n }\n texture = texture ?? this.defaultTexture;\n assertTruthy(texture instanceof Texture, 'Invalid texture type');\n let { curBufferIdx: bufferIdx, curRenderOp } = this;\n const targetDims = {\n width,\n height,\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (!this.reuseRenderOp(params)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx, renderToTexture, parentHasRenderTexture, framebufferDimensions);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n }\n const flipX = textureOptions?.flipX ?? false;\n const flipY = textureOptions?.flipY ?? false;\n let texCoordX1 = 0;\n let texCoordY1 = 0;\n let texCoordX2 = 1;\n let texCoordY2 = 1;\n if (texture instanceof SubTexture) {\n const { x: tx, y: ty, width: tw, height: th } = texture.props;\n const { width: parentW = 0, height: parentH = 0 } = texture.parentTexture\n .dimensions || { width: 0, height: 0 };\n texCoordX1 = tx / parentW;\n texCoordX2 = texCoordX1 + tw / parentW;\n texCoordY1 = ty / parentH;\n texCoordY2 = texCoordY1 + th / parentH;\n texture = texture.parentTexture;\n }\n // Flip texture coordinates if dictated by texture options\n if (flipX) {\n [texCoordX1, texCoordX2] = [texCoordX2, texCoordX1];\n }\n if (flipY) {\n [texCoordY1, texCoordY2] = [texCoordY2, texCoordY1];\n }\n const { txManager } = this.stage;\n const ctxTexture = txManager.getCtxTexture(texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxTexture);\n const textureIdx = this.addTexture(ctxTexture, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n // render quad advanced\n if (tb !== 0 || tc !== 0) {\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta;\n fQuadBuffer[bufferIdx++] = ty + width * tc;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx + height * tb;\n fQuadBuffer[bufferIdx++] = ty + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta + height * tb;\n fQuadBuffer[bufferIdx++] = ty + width * tc + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n else {\n // Calculate the right corner of the quad\n // multiplied by the scale\n const rightCornerX = tx + width * ta;\n const rightCornerY = ty + height * td;\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = ty;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n // Update the length of the current render op\n curRenderOp.length += WORDS_PER_QUAD;\n curRenderOp.numQuads++;\n this.curBufferIdx = bufferIdx;\n }\n /**\n * Replace the existing RenderOp with a new one that uses the specified Shader\n * and starts at the specified buffer index.\n *\n * @param shader\n * @param bufferIdx\n */\n newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx, renderToTexture, parentHasRenderTexture, framebufferDimensions) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0, // Z-Index is only used for explictly added Render Ops\n renderToTexture, parentHasRenderTexture, framebufferDimensions);\n this.curRenderOp = curRenderOp;\n this.renderOps.push(curRenderOp);\n }\n /**\n * Add a texture to the current RenderOp. If the texture cannot be added to the\n * current RenderOp, a new RenderOp will be created and the texture will be added\n * to that one.\n *\n * If the texture cannot be added to the new RenderOp, an error will be thrown.\n *\n * @param texture\n * @param bufferIdx\n * @param recursive\n * @returns Assigned Texture Index of the texture in the render op\n */\n addTexture(texture, bufferIdx, recursive) {\n const { curRenderOp } = this;\n assertTruthy(curRenderOp);\n const textureIdx = curRenderOp.addTexture(texture);\n // TODO: Refactor to be more DRY\n if (textureIdx === 0xffffffff) {\n if (recursive) {\n throw new Error('Unable to add texture to render op');\n }\n const { shader, shaderProps, dimensions, clippingRect, alpha } = curRenderOp;\n this.newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx);\n return this.addTexture(texture, bufferIdx, true);\n }\n return textureIdx;\n }\n /**\n * Test if the current Render operation can be reused for the specified parameters.\n * @param params\n * @returns\n */\n reuseRenderOp(params) {\n const { shader, shaderProps, parentHasRenderTexture, rtt, clippingRect } = params;\n const targetShader = shader || this.defaultShader;\n // Switching shader program will require a new render operation\n if (this.curRenderOp?.shader !== targetShader) {\n return false;\n }\n // Switching clipping rect will require a new render operation\n if (!compareRect(this.curRenderOp.clippingRect, clippingRect)) {\n return false;\n }\n // Force new render operation if rendering to texture\n // @todo: This needs to be improved, render operations could also be reused\n // for rendering to texture\n if (parentHasRenderTexture || rtt) {\n return false;\n }\n // Check if the shader can batch the shader properties\n if (this.curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !this.curRenderOp.shader.canBatchShaderProps(this.curRenderOp.shaderProps, shaderProps))) {\n return false;\n }\n // Render operation can be reused\n return true;\n }\n /**\n * add RenderOp to the render pipeline\n */\n addRenderOp(renderable) {\n this.renderOps.push(renderable);\n this.curRenderOp = null;\n }\n /**\n * Render the current set of RenderOps to render to the specified surface.\n *\n * TODO: 'screen' is the only supported surface at the moment.\n *\n * @param surface\n */\n render(surface = 'screen') {\n const { glw, quadBuffer } = this;\n const arr = new Float32Array(quadBuffer, 0, this.curBufferIdx);\n const buffer = this.quadBufferCollection.getBuffer('a_position') ?? null;\n glw.arrayBufferData(buffer, arr, glw.STATIC_DRAW);\n const doLog = false; // idx++ % 100 === 0;\n if (doLog) {\n console.log('renderOps', this.renderOps.length);\n }\n this.renderOps.forEach((renderOp, i) => {\n if (doLog) {\n console.log('Quads per operation', renderOp.numQuads);\n }\n renderOp.draw();\n });\n }\n renderToTexture(node) {\n for (let i = 0; i < this.rttNodes.length; i++) {\n if (this.rttNodes[i] === node) {\n return;\n }\n }\n // @todo: Better bottom up rendering order\n this.rttNodes.unshift(node);\n }\n renderRTTNodes() {\n const { glw } = this;\n const { txManager } = this.stage;\n // Render all associated RTT nodes to their textures\n for (let i = 0; i < this.rttNodes.length; i++) {\n const node = this.rttNodes[i];\n // Skip nodes that don't have RTT updates\n if (!node || !node.hasRTTupdates) {\n continue;\n }\n // Set the active RTT node to the current node\n // So we can prevent rendering children of nested RTT nodes\n this.activeRttNode = node;\n assertTruthy(node.texture, 'RTT node missing texture');\n const ctxTexture = txManager.getCtxTexture(node.texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxRenderTexture);\n this.renderToTextureActive = true;\n // Bind the the texture's framebuffer\n glw.bindFramebuffer(ctxTexture.framebuffer);\n glw.viewport(0, 0, ctxTexture.w, ctxTexture.h);\n glw.clear();\n // Render all associated quads to the texture\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n child.update(this.stage.deltaTime, {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n });\n this.stage.addQuads(child);\n child.hasRTTupdates = false;\n }\n // Render all associated quads to the texture\n this.render();\n // Reset render operations\n this.renderOps.length = 0;\n node.hasRTTupdates = false;\n }\n // Bind the default framebuffer\n glw.bindFramebuffer(null);\n glw.viewport(0, 0, this.glw.canvas.width, this.glw.canvas.height);\n this.renderToTextureActive = false;\n }\n}\n//# sourceMappingURL=WebGlCoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const SpecialCodepoints = {\n LINE_FEED: 0x0a,\n CARRIAGE_RETURN: 0x0d,\n SPACE: 0x20,\n TAB: 0x09,\n ZERO_WIDTH_SPACE: 0x200b,\n ZERO_WIDTH_NON_JOINER: 0x200c,\n ZERO_WIDTH_JOINER: 0x200d,\n LEFT_TO_RIGHT_MARK: 0x200e,\n RIGHT_TO_LEFT_MARK: 0x200f,\n LEFT_TO_RIGHT_EMBEDDING: 0x202a,\n RIGHT_TO_LEFT_EMBEDDING: 0x202b,\n POP_DIRECTIONAL_FORMATTING: 0x202c,\n LEFT_TO_RIGHT_OVERRIDE: 0x202d,\n RIGHT_TO_LEFT_OVERRIDE: 0x202e,\n LINE_SEPARATOR: 0x2028,\n PARAGRAPH_SEPARATOR: 0x2029,\n OBJECT_REPLACEMENT_CHARACTER: 0xfffc,\n REPLACEMENT_CHARACTER: 0xfffd,\n ZERO_WIDTH_NO_BREAK_SPACE: 0xfeff,\n LEFT_TO_RIGHT_ISOLATE: 0x2066,\n RIGHT_TO_LEFT_ISOLATE: 0x2067,\n FIRST_STRONG_ISOLATE: 0x2068,\n POP_DIRECTIONAL_ISOLATE: 0x2069,\n INHIBIT_SYMMETRIC_SWAPPING: 0x206a,\n ACTIVATE_SYMMETRIC_SWAPPING: 0x206b,\n INHIBIT_ARABIC_FORM_SHAPING: 0x206c,\n ACTIVATE_ARABIC_FORM_SHAPING: 0x206d,\n NATIONAL_DIGIT_SHAPES: 0x206e,\n NOMINAL_DIGIT_SHAPES: 0x206f,\n LEFT_TO_RIGHT_BOUNDARY: 0x200e,\n RIGHT_TO_LEFT_BOUNDARY: 0x200f,\n};\n//# sourceMappingURL=SpecialCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FontShaper {\n}\n//# sourceMappingURL=FontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SpecialCodepoints } from '../../../renderers/SdfTextRenderer/internal/SpecialCodepoints.js';\nimport { FontShaper, } from './FontShaper.js';\nexport class SdfFontShaper extends FontShaper {\n data;\n glyphMap;\n kernings;\n constructor(data, glyphMap) {\n super();\n this.data = data;\n this.glyphMap = glyphMap;\n const kernings = (this.kernings = {});\n data.kernings.forEach((kerning) => {\n const second = kerning.second;\n const firsts = (kernings[second] = kernings[second] || {});\n firsts[kerning.first] = kerning.amount;\n });\n this.kernings = kernings;\n }\n *shapeText(props, codepoints) {\n let codepointResult;\n let lastGlyphId = undefined;\n while ((codepointResult = codepoints.peek()) && !codepointResult.done) {\n const codepoint = codepointResult.value;\n const glyph = this.glyphMap.get(codepoint);\n codepoints.next();\n if (glyph !== undefined) {\n // We found a glyph for this codepoint\n // Yield the mapped glyph info\n /**\n * Kerning includes any possible additional letter spacing\n */\n const kerning = lastGlyphId !== undefined\n ? (this.kernings[glyph.id]?.[lastGlyphId] || 0) +\n props.letterSpacing\n : 0;\n lastGlyphId = glyph.id;\n yield {\n mapped: true,\n glyphId: glyph.id,\n codepoint,\n cluster: codepoints.lastIndex,\n xAdvance: glyph.xadvance + kerning,\n yAdvance: 0,\n xOffset: glyph.xoffset + kerning,\n yOffset: glyph.yoffset,\n xBearing: 0,\n yBearing: 0,\n width: glyph.width,\n height: glyph.height,\n };\n }\n else {\n // We didn't find a glyph for this codepoint\n // Yield the unmapped codepoint info\n // If this codepoint is a linebreak, we should reset the last glyph id\n // so that the next glyph will not be kerned with the last glyph of the\n // previous line.\n if (codepoint === SpecialCodepoints.LINE_FEED) {\n lastGlyphId = undefined;\n }\n yield {\n mapped: false,\n codepoint,\n cluster: codepoints.lastIndex,\n };\n }\n }\n }\n}\n//# sourceMappingURL=SdfFontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// import type { Renderer } from '../../../Renderer';\nimport { assertTruthy } from '../../../../utils.js';\nimport { WebGlCoreRenderer } from '../../../renderers/webgl/WebGlCoreRenderer.js';\nimport { ImageTexture } from '../../../textures/ImageTexture.js';\nimport { TrFontFace } from '../TrFontFace.js';\nimport { SdfFontShaper } from './internal/SdfFontShaper.js';\nexport class SdfTrFontFace extends TrFontFace {\n type;\n texture;\n /**\n * Height of the tallest character in the font including the whitespace above it\n */\n maxCharHeight = 0;\n data;\n shaper;\n glyphMap = new Map();\n constructor(fontFamily, descriptors, type, stage, atlasUrl, atlasDataUrl) {\n super(fontFamily, descriptors);\n this.type = type;\n const renderer = stage.renderer;\n assertTruthy(renderer instanceof WebGlCoreRenderer, 'SDF Font Faces can only be used with the WebGL Renderer');\n this.texture = stage.txManager.loadTexture('ImageTexture', {\n src: atlasUrl,\n // IMPORTANT: The SDF shader requires the alpha channel to NOT be\n // premultiplied on the atlas texture. If it is premultiplied, the\n // rendering of SDF glyphs (especially single-channel SDF fonts) will\n // be very jagged.\n premultiplyAlpha: false,\n }, {\n preload: true,\n });\n this.texture.on('loaded', () => {\n this.checkLoaded();\n });\n // Set this.data to the fetched data from dataUrl\n fetch(atlasDataUrl)\n .then(async (response) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.data = await response.json();\n // Add all the glyphs to the glyph map\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let maxCharHeight = 0;\n this.data.chars.forEach((glyph) => {\n this.glyphMap.set(glyph.id, glyph);\n const charHeight = glyph.yoffset + glyph.height;\n if (charHeight > maxCharHeight) {\n maxCharHeight = charHeight;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.maxCharHeight = maxCharHeight;\n // We know `data` is defined here, because we just set it\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shaper = new SdfFontShaper(this.data, this.glyphMap);\n this.checkLoaded();\n })\n .catch(console.error);\n }\n getAtlasEntry(glyphId) {\n const glyph = this.glyphMap.get(glyphId);\n if (glyph === undefined) {\n throw new Error(`Glyph ${glyphId} not found in font ${this.fontFamily}`);\n }\n return {\n x: glyph.x,\n y: glyph.y,\n width: glyph.width,\n height: glyph.height,\n };\n }\n checkLoaded() {\n if (this.loaded)\n return;\n if (this.texture.state === 'loaded' && this.data) {\n this.loaded = true;\n this.emit('loaded');\n }\n }\n}\n//# sourceMappingURL=SdfTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Base class for Core extensions.\n *\n * @remarks\n * Core extensions are used to extend the Core Renderer with custom code such as\n * custom fonts, custom shaders, custom textures, custom animation functions,\n * and more.\n */\nexport class CoreExtension {\n}\n//# sourceMappingURL=CoreExtension.js.map"],"names":["createWebGLContext","canvas","contextSpy","config","gl","target","prop","value","assertTruthy","condition","message","isProductionEnvironment","mergeColorProgress","rgba1","rgba2","p","r1","g1","b1","a1","r2","g2","b2","a2","r","g","b","a","mergeColorAlpha","rgba","alpha","mergeColorAlphaPremultiplied","flipEndianess","newAlpha","hasOwn","obj","EventEmitter","__publicField","event","listener","listeners","index","onceListener","data","CoreShader","props","createShader","glw","type","source","shader","createProgram","vertexShader","fragmentShader","program","isWebGl2","WebGlCoreShader","options","renderer","webGl2","requiredExtensions","glVersion","extensionName","shaderSources","textureUnits","vertexSource","fragmentSource","vao","attributeName","location","buffer","uniform","attribute","loc","propsA","propsB","renderOp","parentHasRenderTexture","renderToTexture","width","height","dimensions","name","resolvedBuffer","resolvedInfo","textures","Texture","txManager","owner","renderable","state","args","loadedArgs","failedArgs","getNormalizedRgbaComponents","getNormalizedAlphaComponent","getRgbaString","color","createBound","x1","y1","x2","y2","out","intersectBound","intersection","boundsOverlap","convertBoundToRect","bound","intersectRect","x","y","copyRect","compareRect","boundInsideBound","bound1","bound2","isBoundPositive","TrFontFace","fontFamily","descriptors","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","buffers","shaderProps","clippingRect","bufferIdx","zIndex","framebufferDimensions","texture","maxTextures","existingIdx","t","newIdx","shManager","quadIdx","pixelRatio","canvasHeight","clipX","clipWidth","clipHeight","clipY","getWebGlParameters","params","key","getWebGlExtensions","extensions","createIndexBuffer","size","maxQuads","indices","j","isHTMLImageElement","memize","fn","head","tail","memoized","node","len","i","searchCache","isPowerOfTwo","getTimingBezier","c","d","xc","xb","xa","yc","yb","ya","time","cbx","cbxd","dx","it","minT","maxT","getTimingFunction","memo","str","s","parts","TRANSPARENT_TEXTURE_DATA","WebGlCoreCtxTexture","err","_a","_b","textureData","mipmaps","glInternalFormat","view","nativeTexture","_ColorTexture","pixelData32","pixelData8","resolvedProps","ColorTexture","_SubTexture","error","parentTx","SubTexture","WebGlCoreCtxSubTexture","BufferCollection","item","WebGlContextWrapper","maxTextureUnits","_","scissorBox","textureUnit","activeTextureUnit","texture2dUnits","pname","param","texture2dParams","activeTexture","textureParams","level","internalFormat","widthOrFormat","heightOrType","borderOrSource","format","pixels","internalformat","border","red","green","blue","enable","scissorEnabled","scissorX","scissorY","scissorWidth","scissorHeight","blend","blendEnabled","src","dst","blendSrcRgb","blendDstRgb","blendSrcAlpha","blendDstAlpha","framebuffer","attachment","usage","boundArrayBuffer","boundElementArrayBuffer","normalized","stride","offset","curProgram","programUniforms","uniforms","uniformArgs","compareArrays","mode","count","vertexArray","v","_RenderTexture","RenderTexture","WebGlCoreCtxRenderTexture","WORDS_PER_QUAD","WebGlCoreRenderer","clearColor","bufferMemory","quadBuffer","fQuadBuffer","uiQuadBuffer","colorTl","colorTr","colorBl","colorBr","textureOptions","tx","ty","ta","tb","tc","td","curRenderOp","targetDims","targetShader","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","tw","th","parentW","parentH","ctxTexture","textureIdx","rightCornerX","rightCornerY","recursive","rtt","surface","arr","child","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","firsts","codepoints","codepointResult","lastGlyphId","codepoint","glyph","SdfTrFontFace","atlasUrl","atlasDataUrl","response","maxCharHeight","charHeight","glyphId","CoreExtension"],"mappings":"4KAkBgB,SAAAA,GAAmBC,EAAQC,EAAY,CACnD,MAAMC,EAAS,CACX,MAAO,GACP,UAAW,GACX,MAAO,GACP,QAAS,GACT,eAAgB,GAGhB,gBAAiB,mBACjB,mBAAoB,GACpB,sBAAuB,EAAA,EAErBC,EAGLH,EAAO,WAAW,QAASE,CAAM,GAC9BF,EAAO,WAAW,qBAAsBE,CAAM,EAClD,GAAI,CAACC,EACK,MAAA,IAAI,MAAM,gCAAgC,EAEpD,OAA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AAQ,GAAG,SAAU,IAAM,CAC5B,KAAK,YAAW,CAC5B,CAAS,EAED,MAAMC,CAAY,EACb,KAAK,MAAOC,GAAa,CAE1B,KAAK,KAAO,MAAMA,EAAS,KAAI,EAG/B,IAAIC,EAAgB,EACpB,KAAK,KAAK,MAAM,QAASL,GAAU,CAC/B,KAAK,SAAS,IAAIA,EAAM,GAAIA,CAAK,EACjC,MAAMM,EAAaN,EAAM,QAAUA,EAAM,OACrCM,EAAaD,IACbA,EAAgBC,EAEpC,CAAa,EAED,KAAK,cAAgBD,EAGrB,KAAK,OAAS,IAAIf,GAAc,KAAK,KAAM,KAAK,QAAQ,EACxD,KAAK,YAAW,CAC5B,CAAS,EACI,MAAM,QAAQ,KAAK,CAC3B,CACD,cAAciB,EAAS,CACnB,MAAMP,EAAQ,KAAK,SAAS,IAAIO,CAAO,EACvC,GAAIP,IAAU,OACV,MAAM,IAAI,MAAM,SAAS,OAAAO,EAAO,uBAAsB,YAAK,WAAY,EAE3E,MAAO,CACH,EAAGP,EAAM,EACT,EAAGA,EAAM,EACT,MAAOA,EAAM,MACb,OAAQA,EAAM,MAC1B,CACK,CACD,aAAc,CACN,KAAK,QAEL,KAAK,QAAQ,QAAU,UAAY,KAAK,OACxC,KAAK,OAAS,GACd,KAAK,KAAK,QAAQ,EAEzB,CACL,CCtEO,MAAMQ,EAAc,CAC3B","x_google_ignoreList":[14]} \ No newline at end of file diff --git a/assets/CoreExtension-D6FI1p2n.js b/assets/CoreExtension-D6FI1p2n.js deleted file mode 100644 index e8ff0ed..0000000 --- a/assets/CoreExtension-D6FI1p2n.js +++ /dev/null @@ -1,2 +0,0 @@ -var le=Object.defineProperty;var de=(n,t,e)=>t in n?le(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var a=(n,t,e)=>(de(n,typeof t!="symbol"?t+"":t,e),e);function Te(n,t){const e={alpha:!0,antialias:!1,depth:!1,stencil:!0,desynchronized:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:!1},r=n.getContext("webgl",e)||n.getContext("experimental-webgl",e);if(!r)throw new Error("Unable to create WebGL context");return t?new Proxy(r,{get(s,i){const o=s[i];return typeof o=="function"?(t.increment(String(i)),o.bind(s)):o}}):r}function g(n,t){if(!Ee()&&!n)throw new Error(t||"Assertion failed")}function We(n,t,e){const r=Math.trunc(n>>>24),s=Math.trunc(n>>>16&255),i=Math.trunc(n>>>8&255),o=Math.trunc(n&255),h=Math.trunc(t>>>24),c=Math.trunc(t>>>16&255),u=Math.trunc(t>>>8&255),d=Math.trunc(t&255),l=Math.round(h*e+r*(1-e)),E=Math.round(c*e+s*(1-e)),x=Math.round(u*e+i*(1-e)),_=Math.round(d*e+o*(1-e));return(l<<24|E<<16|x<<8|_)>>>0}function He(n,t){const e=n>>>24,r=n>>>16&255,s=n>>>8&255,i=Math.trunc((n&255)*t);return(e<<24|r<<16|s<<8|i)>>>0}function Ve(n,t,e=!1){const r=(n&255)/255*t,s=Math.trunc((n>>>24)*r),i=Math.trunc((n>>>16&255)*r),o=Math.trunc((n>>>8&255)*r),h=Math.trunc(r*255);return e?(h<<24|o<<16|i<<8|s)>>>0:(s<<24|i<<16|o<<8|h)>>>0}function H(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function Ee(){return{BASE_URL:"/solid-demo-app/",MODE:"development",DEV:!0,PROD:!1,SSR:!1,LEGACY:!1}&&!1}class te{constructor(){a(this,"eventListeners",{})}on(t,e){let r=this.eventListeners[t];r||(r=[]),r.push(e),this.eventListeners[t]=r}off(t,e){const r=this.eventListeners[t];if(!r)return;if(!e){delete this.eventListeners[t];return}const s=r.indexOf(e);s>=0&&r.splice(s,1)}once(t,e){const r=(s,i)=>{this.off(t,r),e(s,i)};this.on(t,r)}emit(t,e){const r=this.eventListeners[t];r&&[...r].forEach(s=>{s(this,e)})}removeAllListeners(){this.eventListeners={}}}class _e{static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}function Q(n,t,e){const r=n.createShader(t);if(!r)throw new Error;if(n.shaderSource(r,e),n.compileShader(r),n.getShaderParameter(r,n.COMPILE_STATUS))return r;console.log(n.getShaderInfoLog(r)),n.deleteShader(r)}function xe(n,t,e){const r=n.createProgram();if(!r)throw new Error;if(n.attachShader(r,t),n.attachShader(r,e),n.linkProgram(r),n.getProgramParameter(r,n.LINK_STATUS))return r;console.log(n.getProgramInfoLog(r)),n.deleteProgram(r)}function Re(n){return self.WebGL2RenderingContext&&n instanceof self.WebGL2RenderingContext}class re extends _e{constructor(e){super();a(this,"boundBufferCollection",null);a(this,"buffersBound",!1);a(this,"program");a(this,"vao");a(this,"renderer");a(this,"glw");a(this,"attributeBuffers");a(this,"attributeLocations");a(this,"attributeNames");a(this,"uniformLocations");a(this,"uniformTypes");a(this,"supportsIndexedTextures");const r=this.renderer=e.renderer,s=this.glw=this.renderer.glw;this.supportsIndexedTextures=e.supportsIndexedTextures||!1;const i=s.isWebGl2(),o=i&&e.webgl2Extensions||!i&&e.webgl1Extensions||[],h=i?"2.0":"1.0";o.forEach(T=>{if(!s.getExtension(T))throw new Error('Shader "'.concat(this.constructor.name,'" requires extension "').concat(T,'" for WebGL ').concat(h," but wasn't found"))});const c=e.shaderSources||this.constructor.shaderSources;if(c)i&&(c!=null&&c.webGl2)&&(c.fragment=c.webGl2.fragment,c.vertex=c.webGl2.vertex,delete c.webGl2);else throw new Error('Shader "'.concat(this.constructor.name,'" is missing shaderSources.'));const u=r.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,d=c.vertex instanceof Function?c.vertex(u):c.vertex,l=c.fragment instanceof Function?c.fragment(u):c.fragment,E=Q(s,s.VERTEX_SHADER,d),x=Q(s,s.FRAGMENT_SHADER,l);if(!E||!x)throw new Error;const _=xe(s,E,x);if(!_)throw new Error;if(this.program=_,i){const T=s.createVertexArray();if(!T)throw new Error;this.vao=T,s.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...e.attributes].forEach(T=>{const R=s.getAttribLocation(this.program,T);if(R<0)throw new Error("".concat(this.constructor.name,': Vertex shader must have an attribute "').concat(T,'"!'));const A=s.createBuffer();if(!A)throw new Error("".concat(this.constructor.name,': Could not create buffer for attribute "').concat(T,'"'));this.attributeLocations[T]=R,this.attributeBuffers[T]=A,this.attributeNames.push(T)}),this.uniformLocations={},this.uniformTypes={},e.uniforms.forEach(T=>{const R=s.getUniformLocation(this.program,T.name);if(this.uniformTypes[T.name]=T.uniform,!R){console.warn('Shader "'.concat(this.constructor.name,'" could not get uniform location for "').concat(T.name,'"'));return}this.uniformLocations[T.name]=R})}bindBufferAttribute(e,r,s){const{glw:i}=this;i.enableVertexAttribArray(e),i.vertexAttribPointer(r,e,s.size,s.type,s.normalized,s.stride,s.offset)}disableAttribute(e){this.glw.disableVertexAttribArray(e)}disableAttributes(){for(const e in this.attributeLocations)this.disableAttribute(this.attributeLocations[e]);this.boundBufferCollection=null}canBatchShaderProps(e,r){return!1}bindRenderOp(e,r){this.bindBufferCollection(e.buffers),e.textures.length>0&&this.bindTextures(e.textures);const{glw:s,parentHasRenderTexture:i,renderToTexture:o}=e;if(!(o&&i)){if(i){const{width:h,height:c}=e.framebufferDimensions||{};this.setUniform("u_pixelRatio",1),this.setUniform("u_resolution",new Float32Array([h!=null?h:0,c!=null?c:0]))}else this.setUniform("u_pixelRatio",e.options.pixelRatio),this.setUniform("u_resolution",new Float32Array([s.canvas.width,s.canvas.height]));if(r){if(H(r,"$dimensions")){let h=r.$dimensions;h||(h=e.dimensions),this.setUniform("u_dimensions",[h.width,h.height])}if(H(r,"$alpha")){let h=r.$alpha;h||(h=e.alpha),this.setUniform("u_alpha",h)}this.bindProps(r)}}}setUniform(e,...r){this.glw.setUniform(this.uniformTypes[e],this.uniformLocations[e],...r)}bindBufferCollection(e){if(this.boundBufferCollection!==e){for(const r in this.attributeLocations){const s=e.getBuffer(r),i=e.getAttributeInfo(r);g(s,'Buffer for "'.concat(r,'" not found')),g(i),this.bindBufferAttribute(this.attributeLocations[r],s,i)}this.boundBufferCollection=e}}bindProps(e){}bindTextures(e){}attach(){this.glw.useProgram(this.program),this.glw.useProgram(this.program),this.glw.isWebGl2()&&this.vao&&this.glw.bindVertexArray(this.vao)}detach(){this.disableAttributes()}}a(re,"shaderSources");class O extends te{constructor(e){super();a(this,"txManager");a(this,"dimensions",null);a(this,"error",null);a(this,"state","freed");a(this,"renderableOwners",new Set);this.txManager=e}setRenderableOwner(e,r){r?this.renderableOwners.add(e):this.renderableOwners.delete(e)}get renderable(){return this.renderableOwners.size>0}setState(e,...r){if(this.state!==e){if(this.state=e,e==="loaded"){const s=r;this.dimensions=s[0]}else if(e==="failed"){const s=r;this.error=s[0]}this.emit(e,...r)}}static makeCacheKey(e){return!1}static resolveDefaults(e){return{}}}const Ae=n=>{const t=n>>>24,e=n>>>16&255,r=n>>>8&255,s=n&255;return[t/255,e/255,r/255,s/255]};function Ye(n){return(n&255)/255}function ke(n){const t=Math.floor(n[0]*255),e=Math.floor(n[1]*255),r=Math.floor(n[2]*255),s=Math.floor(n[3]*255);return"rgba(".concat(t,",").concat(e,",").concat(r,",").concat(s.toFixed(4),")")}function j(n,t,e,r,s){return s?(s.x1=n,s.y1=t,s.x2=e,s.y2=r,s):{x1:n,y1:t,x2:e,y2:r}}function $e(n,t,e){const r=j(Math.max(n.x1,t.x1),Math.max(n.y1,t.y1),Math.min(n.x2,t.x2),Math.min(n.y2,t.y2),e);return r.x1t.x1&&n.y1t.y1}function qe(n,t){return t?(t.x=n.x1,t.y=n.y1,t.width=n.x2-n.x1,t.height=n.y2-n.y1,t):{x:n.x1,y:n.y1,width:n.x2-n.x1,height:n.y2-n.y1}}function Ke(n,t,e){const r=Math.max(n.x,t.x),s=Math.max(n.y,t.y),i=Math.min(n.x+n.width,t.x+t.width)-r,o=Math.min(n.y+n.height,t.y+t.height)-s;return i>0&&o>0?e?(e.x=r,e.y=s,e.width=i,e.height=o,e):{x:r,y:s,width:i,height:o}:e?(e.x=0,e.y=0,e.width=0,e.height=0,e):{x:0,y:0,width:0,height:0}}function Ze(n,t){return t?(t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height,t):{x:n.x,y:n.y,width:n.width,height:n.height}}function ge(n,t){return n===t?!0:n===null||t===null?!1:n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Qe(n,t){return n.x1<=t.x2&&n.y1<=t.y2&&n.x2>=t.x1&&n.y2>=t.y1}function je(n){return n.x1h===e);if(i!==-1)return i;const o=r.length;return o>=s?4294967295:(this.textures.push(e),o)}draw(){const{glw:e,shader:r,shaderProps:s,options:i}=this,{shManager:o}=i;o.useShader(r),r.bindRenderOp(this,s);const h=this.bufferIdx/24*6*2;if(this.clippingRect.valid){const{x:c,y:u,width:d,height:l}=this.clippingRect,E=i.pixelRatio,x=i.canvas.height,_=Math.round(c*E),T=Math.round(d*E),R=Math.round(l*E),A=Math.round(x-R-u*E);e.setScissorTest(!0),e.scissor(_,A,T,R)}else e.setScissorTest(!1);e.drawElements(e.TRIANGLES,6*this.numQuads,e.UNSIGNED_SHORT,h)}}function Ne(n){const t={MAX_RENDERBUFFER_SIZE:0,MAX_TEXTURE_SIZE:0,MAX_VIEWPORT_DIMS:0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:0,MAX_TEXTURE_IMAGE_UNITS:0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:0,MAX_VERTEX_ATTRIBS:0,MAX_VARYING_VECTORS:0,MAX_VERTEX_UNIFORM_VECTORS:0,MAX_FRAGMENT_UNIFORM_VECTORS:0};return Object.keys(t).forEach(r=>{t[r]=n.getParameter(n[r])}),t}function be(n){const t={ANGLE_instanced_arrays:null,WEBGL_compressed_texture_s3tc:null,WEBGL_compressed_texture_astc:null,WEBGL_compressed_texture_etc:null,WEBGL_compressed_texture_etc1:null,WEBGL_compressed_texture_pvrtc:null,WEBKIT_WEBGL_compressed_texture_pvrtc:null,WEBGL_compressed_texture_s3tc_srgb:null,OES_vertex_array_object:null};return Object.keys(t).forEach(r=>{t[r]=n.getExtension(r)}),t}function we(n,t){const e=~~(t/80),r=new Uint16Array(e*6);for(let i=0,o=0;in&&!(n&n-1),m=(n,t,e,r)=>{const s=3*n,i=3*(e-n)-s,o=1-s-i,h=3*t,c=3*(r-t)-h,u=1-h-c;return function(d){if(d>=1)return 1;if(d<=0)return 0;let l=.5,E,x,_;for(let A=0;A<20;A++){if(E=l*(l*(l*o+i)+s),_=d-E,_>-1e-8&&_<1e-8)return l*(l*(l*u+c)+h);if(x=l*(l*(3*o)+2*i)+s,x>1e-10&&x<1e-10)break;l+=_/x}let T=0,R=1;for(let A=0;A<20;A++){if(l=.5*(T+R),E=l*(l*(l*o+i)+s),_=d-E,_>-1e-8&&_<1e-8)return l*(l*(l*u+c)+h);_<0?R=l:T=l}}},Je=ye(n=>{switch(n){case"linear":return function(e){return e};case"ease":return m(.25,.1,.25,1);case"ease-in":return m(.42,0,1,1);case"ease-out":return m(0,0,.58,1);case"ease-in-out":return m(.42,0,.58,1);case"ease-in-sine":return m(.12,0,.39,0);case"ease-out-sine":return m(.12,0,.39,0);case"ease-in-out-sine":return m(.37,0,.63,1);case"ease-in-cubic":return m(.32,0,.67,0);case"ease-out-cubic":return m(.33,1,.68,1);case"ease-in-out-cubic":return m(.65,0,.35,1);case"ease-in-circ":return m(.55,0,1,.45);case"ease-out-circ":return m(0,.55,.45,1);case"ease-in-out-circ":return m(.85,0,.15,1);case"ease-in-back":return m(.36,0,.66,-.56);case"ease-out-back":return m(.34,1.56,.64,1);case"ease-in-out-back":return m(.68,-.6,.32,1.6);case"step-start":return function(){return 1};case"step-end":return function(e){return e===1?1:0};default:const t="cubic-bezier(";if(n&&n.indexOf(t)===0){const e=n.substr(t.length,n.length-t.length-1).split(",");if(e.length!==4)return console.warn("Unknown timing function: "+n),function(h){return h};const r=parseFloat(e[0]||"0.42"),s=parseFloat(e[1]||"0"),i=parseFloat(e[2]||"1"),o=parseFloat(e[3]||"1");return isNaN(r)||isNaN(s)||isNaN(i)||isNaN(o)?(console.warn(" Unknown timing function: "+n),function(h){return h}):m(r,s,i,o)}else return console.warn("Unknown timing function: "+n),function(e){return e}}});Math.hypot||(Math.hypot=(...n)=>{let t=0,e=n.length;for(;e--;)t+=n[e]*n[e];return Math.sqrt(t)});const W=new Uint8Array([0,0,0,0]);class P extends pe{constructor(e,r,s){super(r,s);a(this,"glw");a(this,"_nativeCtxTexture",null);a(this,"_state","freed");a(this,"_w",0);a(this,"_h",0);this.glw=e}get ctxTexture(){return this._state==="freed"&&this.load(),g(this._nativeCtxTexture),this._nativeCtxTexture}get renderable(){return this.textureSource.renderable}get w(){return this._w}get h(){return this._h}load(){this._state==="loading"||this._state==="loaded"||(this._state="loading",this.textureSource.setState("loading"),this._nativeCtxTexture=this.createNativeCtxTexture(),this.onLoadRequest().then(({width:e,height:r})=>{this._state!=="freed"&&(this._state="loaded",this._w=e,this._h=r,this.textureSource.setState("loaded",{width:e,height:r}))}).catch(e=>{this._state="failed",this.textureSource.setState("failed",e),console.error(e)}))}async onLoadRequest(){var h,c;const{glw:e,memManager:r}=this;e.texImage2D(0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null),r.setTextureMemUse(this,W.byteLength);const s=await((h=this.textureSource)==null?void 0:h.getTextureData());if(!this._nativeCtxTexture)return g(this._state==="freed"),{width:0,height:0};let i=0,o=0;if(g(this._nativeCtxTexture),e.activeTexture(0),s.data instanceof ImageBitmap||s.data instanceof ImageData||Le(s.data)){const u=s.data;i=u.width,o=u.height,e.bindTexture(this._nativeCtxTexture),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!!s.premultiplyAlpha),e.texImage2D(0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,u),r.setTextureMemUse(this,i*o*4),(e.isWebGl2()||J(i)&&J(o))&&e.generateMipmap()}else if(s.data===null)i=0,o=0,e.bindTexture(this._nativeCtxTexture),e.texImage2D(0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,W),r.setTextureMemUse(this,W.byteLength);else if("mipmaps"in s.data&&s.data.mipmaps){const{mipmaps:u,width:d=0,height:l=0,type:E,glInternalFormat:x}=s.data,_=E==="ktx"?new DataView((c=u[0])!=null?c:new ArrayBuffer(0)):u[0];e.bindTexture(this._nativeCtxTexture),e.compressedTexImage2D(0,x,d,l,0,_),e.texParameteri(e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_MIN_FILTER,e.LINEAR),r.setTextureMemUse(this,_.byteLength)}else console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",s);return{width:i,height:o}}free(){if(this._state==="freed"||(this._state="freed",this.textureSource.setState("freed"),this._w=0,this._h=0,!this._nativeCtxTexture))return;const{glw:e,memManager:r}=this;e.deleteTexture(this._nativeCtxTexture),r.setTextureMemUse(this,0),this._nativeCtxTexture=null}createNativeCtxTexture(){const{glw:e}=this,r=e.createTexture();if(!r)throw new Error("Could not create WebGL Texture");return e.activeTexture(0),e.bindTexture(r),e.texParameteri(e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r}}const y=class y extends O{constructor(e,r){super(e);a(this,"props");this.props=y.resolveDefaults(r||{})}get color(){return this.props.color}set color(e){this.props.color=e}async getTextureData(){const e=new Uint32Array([this.color]),r=new Uint8ClampedArray(e.buffer);return{data:new ImageData(r,1,1),premultiplyAlpha:!0}}static makeCacheKey(e){const r=y.resolveDefaults(e);return"ColorTexture,".concat(r.color)}static resolveDefaults(e){return{color:e.color||4294967295}}};a(y,"z$__type__Props");let V=y;const C=class C extends O{constructor(e,r){super(e);a(this,"props");a(this,"parentTexture");a(this,"onParentTxLoaded",()=>{this.setState("loaded",{width:this.props.width,height:this.props.height})});a(this,"onParentTxFailed",(e,r)=>{this.setState("failed",r)});this.parentTexture=this.txManager.loadTexture(r.texture.txType,r.texture.props,r.texture.options),this.props=C.resolveDefaults(r||{}),queueMicrotask(()=>{const s=this.parentTexture;s.state==="loaded"?this.onParentTxLoaded(s,s.dimensions):s.state==="failed"&&this.onParentTxFailed(s,s.error),s.on("loaded",this.onParentTxLoaded),s.on("failed",this.onParentTxFailed)})}async getTextureData(){return{data:this.props}}static makeCacheKey(e){return!1}static resolveDefaults(e){return{texture:e.texture,x:e.x||0,y:e.y||0,width:e.width||0,height:e.height||0}}};a(C,"z$__type__Props");let B=C;class Ue extends P{constructor(t,e,r){super(t,e,r)}async onLoadRequest(){var e,r;const t=await this.textureSource.getTextureData();return{width:((e=t.data)==null?void 0:e.width)||0,height:((r=t.data)==null?void 0:r.height)||0}}}class Pe{constructor(t){a(this,"config");this.config=t}getBuffer(t){var e;return(e=this.config.find(r=>r.attributes[t]))==null?void 0:e.buffer}getAttributeInfo(t){var e;return(e=this.config.find(r=>r.attributes[t]))==null?void 0:e.attributes[t]}}class Be{constructor(t){a(this,"gl");a(this,"activeTextureUnit",0);a(this,"texture2dUnits");a(this,"texture2dParams",new WeakMap);a(this,"scissorEnabled");a(this,"scissorX");a(this,"scissorY");a(this,"scissorWidth");a(this,"scissorHeight");a(this,"blendEnabled");a(this,"blendSrcRgb");a(this,"blendDstRgb");a(this,"blendSrcAlpha");a(this,"blendDstAlpha");a(this,"boundArrayBuffer");a(this,"boundElementArrayBuffer");a(this,"curProgram");a(this,"programUniforms",new WeakMap);a(this,"canvas");a(this,"MAX_RENDERBUFFER_SIZE");a(this,"MAX_TEXTURE_SIZE");a(this,"MAX_VIEWPORT_DIMS");a(this,"MAX_VERTEX_TEXTURE_IMAGE_UNITS");a(this,"MAX_TEXTURE_IMAGE_UNITS");a(this,"MAX_COMBINED_TEXTURE_IMAGE_UNITS");a(this,"MAX_VERTEX_ATTRIBS");a(this,"MAX_VARYING_VECTORS");a(this,"MAX_VERTEX_UNIFORM_VECTORS");a(this,"MAX_FRAGMENT_UNIFORM_VECTORS");a(this,"TEXTURE_MAG_FILTER");a(this,"TEXTURE_MIN_FILTER");a(this,"TEXTURE_WRAP_S");a(this,"TEXTURE_WRAP_T");a(this,"LINEAR");a(this,"CLAMP_TO_EDGE");a(this,"RGBA");a(this,"UNSIGNED_BYTE");a(this,"UNPACK_PREMULTIPLY_ALPHA_WEBGL");a(this,"UNPACK_FLIP_Y_WEBGL");a(this,"FLOAT");a(this,"TRIANGLES");a(this,"UNSIGNED_SHORT");a(this,"ONE");a(this,"ONE_MINUS_SRC_ALPHA");a(this,"VERTEX_SHADER");a(this,"FRAGMENT_SHADER");a(this,"STATIC_DRAW");a(this,"COMPILE_STATUS");a(this,"LINK_STATUS");a(this,"DYNAMIC_DRAW");a(this,"COLOR_ATTACHMENT0");this.gl=t,this.activeTextureUnit=t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0;const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.texture2dUnits=new Array(e).fill(void 0).map((s,i)=>(this.activeTexture(i),t.getParameter(t.TEXTURE_BINDING_2D))),this.activeTexture(this.activeTextureUnit),this.scissorEnabled=t.isEnabled(t.SCISSOR_TEST);const r=t.getParameter(t.SCISSOR_BOX);this.scissorX=r[0],this.scissorY=r[1],this.scissorWidth=r[2],this.scissorHeight=r[3],this.blendEnabled=t.isEnabled(t.BLEND),this.blendSrcRgb=t.getParameter(t.BLEND_SRC_RGB),this.blendDstRgb=t.getParameter(t.BLEND_DST_RGB),this.blendSrcAlpha=t.getParameter(t.BLEND_SRC_ALPHA),this.blendDstAlpha=t.getParameter(t.BLEND_DST_ALPHA),this.boundArrayBuffer=t.getParameter(t.ARRAY_BUFFER_BINDING),this.boundElementArrayBuffer=t.getParameter(t.ELEMENT_ARRAY_BUFFER_BINDING),this.curProgram=t.getParameter(t.CURRENT_PROGRAM),this.canvas=t.canvas,this.MAX_RENDERBUFFER_SIZE=t.MAX_RENDERBUFFER_SIZE,this.MAX_TEXTURE_SIZE=t.MAX_TEXTURE_SIZE,this.MAX_VIEWPORT_DIMS=t.MAX_VIEWPORT_DIMS,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.MAX_TEXTURE_IMAGE_UNITS=t.MAX_TEXTURE_IMAGE_UNITS,this.MAX_COMBINED_TEXTURE_IMAGE_UNITS=t.MAX_COMBINED_TEXTURE_IMAGE_UNITS,this.MAX_VERTEX_ATTRIBS=t.MAX_VERTEX_ATTRIBS,this.MAX_VARYING_VECTORS=t.MAX_VARYING_VECTORS,this.MAX_VERTEX_UNIFORM_VECTORS=t.MAX_VERTEX_UNIFORM_VECTORS,this.MAX_FRAGMENT_UNIFORM_VECTORS=t.MAX_FRAGMENT_UNIFORM_VECTORS,this.TEXTURE_MAG_FILTER=t.TEXTURE_MAG_FILTER,this.TEXTURE_MIN_FILTER=t.TEXTURE_MIN_FILTER,this.TEXTURE_WRAP_S=t.TEXTURE_WRAP_S,this.TEXTURE_WRAP_T=t.TEXTURE_WRAP_T,this.LINEAR=t.LINEAR,this.CLAMP_TO_EDGE=t.CLAMP_TO_EDGE,this.RGBA=t.RGBA,this.UNSIGNED_BYTE=t.UNSIGNED_BYTE,this.UNPACK_PREMULTIPLY_ALPHA_WEBGL=t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.UNPACK_FLIP_Y_WEBGL=t.UNPACK_FLIP_Y_WEBGL,this.FLOAT=t.FLOAT,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.ONE=t.ONE,this.ONE_MINUS_SRC_ALPHA=t.ONE_MINUS_SRC_ALPHA,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.VERTEX_SHADER=t.VERTEX_SHADER,this.FRAGMENT_SHADER=t.FRAGMENT_SHADER,this.STATIC_DRAW=t.STATIC_DRAW,this.COMPILE_STATUS=t.COMPILE_STATUS,this.LINK_STATUS=t.LINK_STATUS,this.DYNAMIC_DRAW=t.DYNAMIC_DRAW,this.COLOR_ATTACHMENT0=t.COLOR_ATTACHMENT0}isWebGl2(){return Re(this.gl)}activeTexture(t){const{gl:e}=this;this.activeTextureUnit!==t&&(e.activeTexture(t+e.TEXTURE0),this.activeTextureUnit=t)}bindTexture(t){const{gl:e,activeTextureUnit:r,texture2dUnits:s}=this;s[r]!==t&&(s[r]=t,e.bindTexture(this.gl.TEXTURE_2D,t))}_getActiveTexture(){const{activeTextureUnit:t,texture2dUnits:e}=this;return e[t]}texParameteri(t,e){const{gl:r,texture2dParams:s}=this,i=this._getActiveTexture();if(!i)throw new Error("No active texture");let o=s.get(i);o||(o={},s.set(i,o)),o[t]!==e&&(o[t]=e,r.texParameteri(r.TEXTURE_2D,t,e))}texImage2D(t,e,r,s,i,o,h,c){const{gl:u}=this;o?u.texImage2D(u.TEXTURE_2D,t,e,r,s,i,o,h,c):u.texImage2D(u.TEXTURE_2D,t,e,r,s,i)}compressedTexImage2D(t,e,r,s,i,o){const{gl:h}=this;h.compressedTexImage2D(h.TEXTURE_2D,t,e,r,s,i,o)}pixelStorei(t,e){const{gl:r}=this;r.pixelStorei(t,e)}generateMipmap(){const{gl:t}=this;t.generateMipmap(t.TEXTURE_2D)}createTexture(){const{gl:t}=this;return t.createTexture()}deleteTexture(t){const{gl:e}=this;t&&this.texture2dParams.delete(t),e.deleteTexture(t)}viewport(t,e,r,s){const{gl:i}=this;i.viewport(t,e,r,s)}clearColor(t,e,r,s){const{gl:i}=this;i.clearColor(t,e,r,s)}setScissorTest(t){const{gl:e,scissorEnabled:r}=this;t!==r&&(t?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST),this.scissorEnabled=t)}scissor(t,e,r,s){const{gl:i,scissorX:o,scissorY:h,scissorWidth:c,scissorHeight:u}=this;(t!==o||e!==h||r!==c||s!==u)&&(i.scissor(t,e,r,s),this.scissorX=t,this.scissorY=e,this.scissorWidth=r,this.scissorHeight=s)}setBlend(t){const{gl:e,blendEnabled:r}=this;t!==r&&(t?e.enable(e.BLEND):e.disable(e.BLEND),this.blendEnabled=t)}blendFunc(t,e){const{gl:r,blendSrcRgb:s,blendDstRgb:i,blendSrcAlpha:o,blendDstAlpha:h}=this;(t!==s||e!==i||t!==o||e!==h)&&(r.blendFunc(t,e),this.blendSrcRgb=t,this.blendDstRgb=e,this.blendSrcAlpha=t,this.blendDstAlpha=e)}createBuffer(){const{gl:t}=this;return t.createBuffer()}createFramebuffer(){const{gl:t}=this;return t.createFramebuffer()}bindFramebuffer(t){const{gl:e}=this;e.bindFramebuffer(e.FRAMEBUFFER,t)}framebufferTexture2D(t,e,r){const{gl:s}=this;s.framebufferTexture2D(s.FRAMEBUFFER,t,s.TEXTURE_2D,e,r)}clear(){const{gl:t}=this;t.clear(t.COLOR_BUFFER_BIT)}arrayBufferData(t,e,r){const{gl:s,boundArrayBuffer:i}=this;i!==t&&(s.bindBuffer(s.ARRAY_BUFFER,t),this.boundArrayBuffer=t),s.bufferData(s.ARRAY_BUFFER,e,r)}elementArrayBufferData(t,e,r){const{gl:s,boundElementArrayBuffer:i}=this;i!==t&&(s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,t),this.boundElementArrayBuffer=t),s.bufferData(s.ELEMENT_ARRAY_BUFFER,e,r)}vertexAttribPointer(t,e,r,s,i,o,h){const{gl:c,boundArrayBuffer:u}=this;u!==t&&(c.bindBuffer(c.ARRAY_BUFFER,t),this.boundArrayBuffer=t),c.vertexAttribPointer(e,r,s,i,o,h)}useProgram(t){const{gl:e,curProgram:r}=this;r!==t&&(e.useProgram(t),this.curProgram=t)}setUniform(t,e,...r){const{gl:s,programUniforms:i}=this;let o=i.get(this.curProgram);o||(o=new Map,i.set(this.curProgram,o));const h=o.get(e);(!h||!Ce(h,r))&&(o.set(e,r),s[t](e,...r))}getParameter(t){const{gl:e}=this;return e.getParameter(t)}drawElements(t,e,r,s){const{gl:i}=this;i.drawElements(t,e,r,s)}getExtension(t){const{gl:e}=this;return e.getExtension(t)}createVertexArray(){const{gl:t}=this;return g(t instanceof WebGL2RenderingContext),t.createVertexArray()}bindVertexArray(t){const{gl:e}=this;g(e instanceof WebGL2RenderingContext),e.bindVertexArray(t)}getAttribLocation(t,e){const{gl:r}=this;return r.getAttribLocation(t,e)}getUniformLocation(t,e){const{gl:r}=this;return r.getUniformLocation(t,e)}enableVertexAttribArray(t){const{gl:e}=this;e.enableVertexAttribArray(t)}disableVertexAttribArray(t){const{gl:e}=this;e.disableVertexAttribArray(t)}createShader(t){const{gl:e}=this;return e.createShader(t)}compileShader(t){const{gl:e}=this;e.compileShader(t)}attachShader(t,e){const{gl:r}=this;r.attachShader(t,e)}linkProgram(t){const{gl:e}=this;e.linkProgram(t)}deleteProgram(t){const{gl:e}=this;e.deleteProgram(t)}getShaderParameter(t,e){const{gl:r}=this;return r.getShaderParameter(t,e)}getShaderInfoLog(t){const{gl:e}=this;return e.getShaderInfoLog(t)}createProgram(){const{gl:t}=this;return t.createProgram()}getProgramParameter(t,e){const{gl:r}=this;return r.getProgramParameter(t,e)}getProgramInfoLog(t){const{gl:e}=this;return e.getProgramInfoLog(t)}shaderSource(t,e){const{gl:r}=this;r.shaderSource(t,e)}deleteShader(t){const{gl:e}=this;e.deleteShader(t)}}function Ce(n,t){return n.length!==t.length?!1:n.every((e,r)=>Array.isArray(e)||e instanceof Float32Array?!1:e===t[r])}const D=class D extends O{constructor(e,r){super(e);a(this,"props");this.props=D.resolveDefaults(r||{})}get width(){return this.props.width}set width(e){this.props.width=e}get height(){return this.props.height}set height(e){this.props.height=e}async getTextureData(){return{data:null,premultiplyAlpha:null}}static resolveDefaults(e){return{width:e.width||256,height:e.height||256}}};a(D,"z$__type__Props");let Y=D;class ee extends P{constructor(e,r,s){super(e,r,s);a(this,"framebuffer");const i=e.createFramebuffer();g(i,"Unable to create framebuffer"),this.framebuffer=i}async onLoadRequest(){const{glw:e,memManager:r}=this,s=this._nativeCtxTexture=this.createNativeCtxTexture(),{width:i,height:o}=this.textureSource;return e.texImage2D(0,e.RGBA,i,o,0,e.RGBA,e.UNSIGNED_BYTE,null),r.setTextureMemUse(this,i*o*4),e.bindFramebuffer(this.framebuffer),e.framebufferTexture2D(e.COLOR_ATTACHMENT0,s,0),e.bindFramebuffer(null),{width:i,height:o}}}const De=24;class Oe extends Ie{constructor(e){super(e.stage);a(this,"glw");a(this,"system");a(this,"txManager");a(this,"txMemManager");a(this,"shManager");a(this,"options");a(this,"quadBuffer",new ArrayBuffer(1024*1024*4));a(this,"fQuadBuffer",new Float32Array(this.quadBuffer));a(this,"uiQuadBuffer",new Uint32Array(this.quadBuffer));a(this,"renderOps",[]);a(this,"curBufferIdx",0);a(this,"curRenderOp",null);a(this,"rttNodes",[]);a(this,"activeRttNode",null);a(this,"defaultShader");a(this,"quadBufferCollection");a(this,"defaultTexture");a(this,"renderToTextureActive",!1);const{canvas:r,clearColor:s,bufferMemory:i}=e;this.options=e,this.txManager=e.txManager,this.txMemManager=e.txMemManager,this.shManager=e.shManager,this.defaultTexture=new V(this.txManager),this.defaultTexture.once("loaded",()=>{this.stage.requestRender()});const o=Te(r,e.contextSpy),h=this.glw=new Be(o),c=Ae(s);h.viewport(0,0,r.width,r.height),h.clearColor(c[0],c[1],c[2],c[3]),h.setBlend(!0),h.blendFunc(h.ONE,h.ONE_MINUS_SRC_ALPHA),we(h,i),this.system={parameters:Ne(this.glw),extensions:be(this.glw)},this.shManager.renderer=this,this.defaultShader=this.shManager.loadShader("DefaultShader").shader;const u=h.createBuffer();g(u);const d=6*Float32Array.BYTES_PER_ELEMENT;this.quadBufferCollection=new Pe([{buffer:u,attributes:{a_position:{name:"a_position",size:2,type:h.FLOAT,normalized:!1,stride:d,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:h.FLOAT,normalized:!1,stride:d,offset:2*Float32Array.BYTES_PER_ELEMENT},a_color:{name:"a_color",size:4,type:h.UNSIGNED_BYTE,normalized:!0,stride:d,offset:4*Float32Array.BYTES_PER_ELEMENT},a_textureIndex:{name:"a_textureIndex",size:1,type:h.FLOAT,normalized:!1,stride:d,offset:5*Float32Array.BYTES_PER_ELEMENT}}}])}reset(){const{glw:e}=this;this.curBufferIdx=0,this.curRenderOp=null,this.renderOps.length=0,e.setScissorTest(!1),e.clear()}getShaderManager(){return this.shManager}createCtxTexture(e){return e instanceof B?new Ue(this.glw,this.txMemManager,e):e instanceof Y?new ee(this.glw,this.txMemManager,e):new P(this.glw,this.txMemManager,e)}addQuad(e){var z,q;const{fQuadBuffer:r,uiQuadBuffer:s}=this,{width:i,height:o,colorTl:h,colorTr:c,colorBl:u,colorBr:d,textureOptions:l,shader:E,shaderProps:x,alpha:_,clippingRect:T,tx:R,ty:A,ta:G,tb:X,tc:F,td:v,rtt:se,parentHasRenderTexture:ne,framebufferDimensions:ie}=e;let{texture:p}=e;if(x&&H(x,"$dimensions")){const w=x.$dimensions;w.width=i,w.height=o}p=p!=null?p:this.defaultTexture,g(p instanceof O,"Invalid texture type");let{curBufferIdx:f,curRenderOp:L}=this;const ae={width:i,height:o},k=E||this.defaultShader;g(k instanceof re),this.reuseRenderOp(e)||(this.newRenderOp(k,x,_,ae,T,f,se,ne,ie),L=this.curRenderOp,g(L));const oe=(z=l==null?void 0:l.flipX)!=null?z:!1,he=(q=l==null?void 0:l.flipY)!=null?q:!1;let I=0,S=0,N=1,b=1;if(p instanceof B){const{x:w,y:U,width:ue,height:fe}=p.props,{width:K=0,height:Z=0}=p.parentTexture.dimensions||{width:0,height:0};I=w/K,N=I+ue/K,S=U/Z,b=S+fe/Z,p=p.parentTexture}oe&&([I,N]=[N,I]),he&&([S,b]=[b,S]);const{txManager:ce}=this.stage,$=ce.getCtxTexture(p);g($ instanceof P);const M=this.addTexture($,f);if(L=this.curRenderOp,g(L),X!==0||F!==0)r[f++]=R,r[f++]=A,r[f++]=I,r[f++]=S,s[f++]=h,r[f++]=M,r[f++]=R+i*G,r[f++]=A+i*F,r[f++]=N,r[f++]=S,s[f++]=c,r[f++]=M,r[f++]=R+o*X,r[f++]=A+o*v,r[f++]=I,r[f++]=b,s[f++]=u,r[f++]=M,r[f++]=R+i*G+o*X,r[f++]=A+i*F+o*v,r[f++]=N,r[f++]=b,s[f++]=d,r[f++]=M;else{const w=R+i*G,U=A+o*v;r[f++]=R,r[f++]=A,r[f++]=I,r[f++]=S,s[f++]=h,r[f++]=M,r[f++]=w,r[f++]=A,r[f++]=N,r[f++]=S,s[f++]=c,r[f++]=M,r[f++]=R,r[f++]=U,r[f++]=I,r[f++]=b,s[f++]=u,r[f++]=M,r[f++]=w,r[f++]=U,r[f++]=N,r[f++]=b,s[f++]=d,r[f++]=M}L.length+=De,L.numQuads++,this.curBufferIdx=f}newRenderOp(e,r,s,i,o,h,c,u,d){const l=new Me(this.glw,this.options,this.quadBufferCollection,e,r,s,o,i,h,0,c,u,d);this.curRenderOp=l,this.renderOps.push(l)}addTexture(e,r,s){const{curRenderOp:i}=this;g(i);const o=i.addTexture(e);if(o===4294967295){if(s)throw new Error("Unable to add texture to render op");const{shader:h,shaderProps:c,dimensions:u,clippingRect:d,alpha:l}=i;return this.newRenderOp(h,c,l,u,d,r),this.addTexture(e,r,!0)}return o}reuseRenderOp(e){var u;const{shader:r,shaderProps:s,parentHasRenderTexture:i,rtt:o,clippingRect:h}=e,c=r||this.defaultShader;return!(((u=this.curRenderOp)==null?void 0:u.shader)!==c||!ge(this.curRenderOp.clippingRect,h)||i||o||this.curRenderOp.shader!==this.defaultShader&&(!s||!this.curRenderOp.shader.canBatchShaderProps(this.curRenderOp.shaderProps,s)))}addRenderOp(e){this.renderOps.push(e),this.curRenderOp=null}render(e="screen"){var h;const{glw:r,quadBuffer:s}=this,i=new Float32Array(s,0,this.curBufferIdx),o=(h=this.quadBufferCollection.getBuffer("a_position"))!=null?h:null;r.arrayBufferData(o,i,r.STATIC_DRAW),this.renderOps.forEach((c,u)=>{c.draw()})}renderToTexture(e){for(let r=0;r{const o=i.second,h=s[o]=s[o]||{};h[i.first]=i.amount}),this.kernings=s}*shapeText(e,r){var o;let s,i;for(;(s=r.peek())&&!s.done;){const h=s.value,c=this.glyphMap.get(h);if(r.next(),c!==void 0){const u=i!==void 0?(((o=this.kernings[c.id])==null?void 0:o[i])||0)+e.letterSpacing:0;i=c.id,yield{mapped:!0,glyphId:c.id,codepoint:h,cluster:r.lastIndex,xAdvance:c.xadvance+u,yAdvance:0,xOffset:c.xoffset+u,yOffset:c.yoffset,xBearing:0,yBearing:0,width:c.width,height:c.height}}else h===Ge.LINE_FEED&&(i=void 0),yield{mapped:!1,codepoint:h,cluster:r.lastIndex}}}}class et extends me{constructor(e,r,s,i,o,h){super(e,r);a(this,"type");a(this,"texture");a(this,"maxCharHeight",0);a(this,"data");a(this,"shaper");a(this,"glyphMap",new Map);this.type=s;const c=i.renderer;g(c instanceof Oe,"SDF Font Faces can only be used with the WebGL Renderer"),this.texture=i.txManager.loadTexture("ImageTexture",{src:o,premultiplyAlpha:!1},{preload:!0}),this.texture.on("loaded",()=>{this.checkLoaded()}),fetch(h).then(async u=>{this.data=await u.json();let d=0;this.data.chars.forEach(l=>{this.glyphMap.set(l.id,l);const E=l.yoffset+l.height;E>d&&(d=E)}),this.maxCharHeight=d,this.shaper=new Fe(this.data,this.glyphMap),this.checkLoaded()}).catch(console.error)}getAtlasEntry(e){const r=this.glyphMap.get(e);if(r===void 0)throw new Error("Glyph ".concat(e," not found in font ").concat(this.fontFamily));return{x:r.x,y:r.y,width:r.width,height:r.height}}checkLoaded(){this.loaded||this.texture.state==="loaded"&&this.data&&(this.loaded=!0,this.emit("loaded"))}}class tt{}export{Pe as B,tt as C,te as E,Y as R,et as S,me as T,re as W,g as a,Ae as b,j as c,$e as d,Ke as e,Ye as f,ke as g,ye as h,Ee as i,O as j,je as k,ze as l,Ve as m,qe as n,Ze as o,Me as p,He as q,Je as r,We as s,Qe as t,V as u,B as v,Oe as w}; -//# sourceMappingURL=CoreExtension-D6FI1p2n.js.map diff --git a/assets/CoreExtension-legacy-1r1p_2oI.js b/assets/CoreExtension-legacy-1r1p_2oI.js new file mode 100644 index 0000000..64882c8 --- /dev/null +++ b/assets/CoreExtension-legacy-1r1p_2oI.js @@ -0,0 +1,2 @@ +!function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var e,r={},i=Object.prototype,n=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",h=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(e){d=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var n=e&&e.prototype instanceof T?e:T,a=Object.create(n.prototype),o=new N(i||[]);return s(a,"_invoke",{value:S(t,r,o)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=c;var f="suspendedStart",v="suspendedYield",g="executing",p="completed",E={};function T(){}function x(){}function _(){}var m={};d(m,o,(function(){return this}));var R=Object.getPrototypeOf,A=R&&R(R(U([])));A&&A!==i&&n.call(A,o)&&(m=A);var b=_.prototype=T.prototype=Object.create(m);function y(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(i,s,a,o){var h=l(t[i],t,s);if("throw"!==h.type){var u=h.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,a,o)}),(function(t){r("throw",t,a,o)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,o)}))}o(h.arg)}var i;s(this,"_invoke",{value:function(t,n){function s(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(s,s):s()}})}function S(t,r,i){var n=f;return function(s,a){if(n===g)throw Error("Generator is already running");if(n===p){if("throw"===s)throw a;return{value:e,done:!0}}for(i.method=s,i.arg=a;;){var o=i.delegate;if(o){var h=M(o,i);if(h){if(h===E)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===f)throw n=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=g;var u=l(t,r,i);if("normal"===u.type){if(n=i.done?p:v,u.arg===E)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(n=p,i.method="throw",i.arg=u.arg)}}}function M(t,r){var i=r.method,n=t.iterator[i];if(n===e)return r.delegate=null,"throw"===i&&t.iterator.return&&(r.method="return",r.arg=e,M(t,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),E;var s=l(n,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,E;var a=s.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,E):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,E)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function U(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function r(){for(;++i=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var h=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(h&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),E}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;L(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,r,i){return this.delegate={iterator:U(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=e),E}},r}function e(t,e,r,i,n,s,a){try{var o=t[s](a),h=o.value}catch(u){return void r(u)}o.done?e(h):Promise.resolve(h).then(i,n)}function r(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var a=t.apply(r,i);function o(t){e(a,n,s,o,h,"next",t)}function h(t){e(a,n,s,o,h,"throw",t)}o(void 0)}))}}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}System.register([],(function(e,s){"use strict";return{execute:function(){function s(t,e){}function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function o(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!0}&&!0}e({a:s,c:v,d:function(t,e,r){var i=v(Math.max(t.x1,e.x1),Math.max(t.y1,e.y1),Math.min(t.x2,e.x2),Math.min(t.y2,e.y2),r);if(i.x10&&a>0)return r?(r.x=i,r.y=n,r.width=s,r.height=a,r):{x:i,y:n,width:s,height:a};if(r)return r.x=0,r.y=0,r.width=0,r.height=0,r;return{x:0,y:0,width:0,height:0}},f:function(t){return(255&t)/255},g:function(t){var e=Math.floor(255*t[0]),r=Math.floor(255*t[1]),i=Math.floor(255*t[2]),n=Math.floor(255*t[3]);return`rgba(${e},${r},${i},${n.toFixed(4)})`},h:R,i:o,k:function(t){return t.x1e.x1&&t.y1e.y1},m:function(t,e,r=!1){var i=(255&t)/255*e,n=Math.trunc((t>>>24)*i),s=Math.trunc((t>>>16&255)*i),a=Math.trunc((t>>>8&255)*i),o=Math.trunc(255*i);if(r)return(o<<24|a<<16|s<<8|n)>>>0;return(n<<24|s<<16|a<<8|o)>>>0},n:function(t,e){if(e)return e.x=t.x1,e.y=t.y1,e.width=t.x2-t.x1,e.height=t.y2-t.y1,e;return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}},o:function(t,e){if(e)return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e;return{x:t.x,y:t.y,width:t.width,height:t.height}},q:function(t,e){var r=t>>>24,i=t>>>16&255,n=t>>>8&255,s=Math.trunc((255&t)*e);return(r<<24|i<<16|n<<8|s)>>>0},s:function(t,e,r){var i=Math.trunc(t>>>24),n=Math.trunc(t>>>16&255),s=Math.trunc(t>>>8&255),a=Math.trunc(255&t),o=Math.trunc(e>>>24),h=Math.trunc(e>>>16&255),u=Math.trunc(e>>>8&255),d=Math.trunc(255&e),c=Math.round(o*r+i*(1-r)),l=Math.round(h*r+n*(1-r)),f=Math.round(u*r+s*(1-r)),v=Math.round(d*r+a*(1-r));return(c<<24|l<<16|f<<8|v)>>>0},t:function(t,e){return t.x1<=e.x2&&t.y1<=e.y2&&t.x2>=e.x1&&t.y2>=e.y1}});class h{constructor(){n(this,"eventListeners",{})}on(t,e){var r=this.eventListeners[t];r||(r=[]),r.push(e),this.eventListeners[t]=r}off(t,e){var r=this.eventListeners[t];if(r)if(e){var i=r.indexOf(e);i>=0&&r.splice(i,1)}else delete this.eventListeners[t]}once(t,e){var r=(i,n)=>{this.off(t,r),e(i,n)};this.on(t,r)}emit(t,e){var r=this.eventListeners[t];r&&[...r].forEach((t=>{t(this,e)}))}removeAllListeners(){this.eventListeners={}}}e("E",h);class u{static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}function d(t,e,r){var i=t.createShader(e);if(!i)throw new Error;if(t.shaderSource(i,r),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS))return i;console.log(t.getShaderInfoLog(i)),t.deleteShader(i)}class c extends u{constructor(t){super(),n(this,"boundBufferCollection",null),n(this,"buffersBound",!1),n(this,"program",void 0),n(this,"vao",void 0),n(this,"renderer",void 0),n(this,"glw",void 0),n(this,"attributeBuffers",void 0),n(this,"attributeLocations",void 0),n(this,"attributeNames",void 0),n(this,"uniformLocations",void 0),n(this,"uniformTypes",void 0),n(this,"supportsIndexedTextures",void 0);var e=this.renderer=t.renderer,r=this.glw=this.renderer.glw;this.supportsIndexedTextures=t.supportsIndexedTextures||!1;var i=r.isWebGl2(),s=i&&t.webgl2Extensions||!i&&t.webgl1Extensions||[],a=i?"2.0":"1.0";s.forEach((t=>{if(!r.getExtension(t))throw new Error(`Shader "${this.constructor.name}" requires extension "${t}" for WebGL ${a} but wasn't found`)}));var o=t.shaderSources||this.constructor.shaderSources;if(!o)throw new Error(`Shader "${this.constructor.name}" is missing shaderSources.`);i&&null!=o&&o.webGl2&&(o.fragment=o.webGl2.fragment,o.vertex=o.webGl2.vertex,delete o.webGl2);var h=e.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,u=o.vertex instanceof Function?o.vertex(h):o.vertex,c=o.fragment instanceof Function?o.fragment(h):o.fragment,l=d(r,r.VERTEX_SHADER,u),f=d(r,r.FRAGMENT_SHADER,c);if(!l||!f)throw new Error;var v=function(t,e,r){var i=t.createProgram();if(!i)throw new Error;if(t.attachShader(i,e),t.attachShader(i,r),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS))return i;console.log(t.getProgramInfoLog(i)),t.deleteProgram(i)}(r,l,f);if(!v)throw new Error;if(this.program=v,i){var g=r.createVertexArray();if(!g)throw new Error;this.vao=g,r.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...t.attributes].forEach((t=>{var e=r.getAttribLocation(this.program,t);if(e<0)throw new Error(`${this.constructor.name}: Vertex shader must have an attribute "${t}"!`);var i=r.createBuffer();if(!i)throw new Error(`${this.constructor.name}: Could not create buffer for attribute "${t}"`);this.attributeLocations[t]=e,this.attributeBuffers[t]=i,this.attributeNames.push(t)})),this.uniformLocations={},this.uniformTypes={},t.uniforms.forEach((t=>{var e=r.getUniformLocation(this.program,t.name);this.uniformTypes[t.name]=t.uniform,e?this.uniformLocations[t.name]=e:console.warn(`Shader "${this.constructor.name}" could not get uniform location for "${t.name}"`)}))}bindBufferAttribute(t,e,r){var i=this.glw;i.enableVertexAttribArray(t),i.vertexAttribPointer(e,t,r.size,r.type,r.normalized,r.stride,r.offset)}disableAttribute(t){this.glw.disableVertexAttribArray(t)}disableAttributes(){for(var t in this.attributeLocations)this.disableAttribute(this.attributeLocations[t]);this.boundBufferCollection=null}canBatchShaderProps(t,e){return!1}bindRenderOp(t,e){this.bindBufferCollection(t.buffers),t.textures.length>0&&this.bindTextures(t.textures);var r=t.glw,i=t.parentHasRenderTexture;if(!t.renderToTexture||!i){if(i){var n=t.framebufferDimensions||{},s=n.width,o=n.height;this.setUniform("u_pixelRatio",1),this.setUniform("u_resolution",new Float32Array([null!=s?s:0,null!=o?o:0]))}else this.setUniform("u_pixelRatio",t.options.pixelRatio),this.setUniform("u_resolution",new Float32Array([r.canvas.width,r.canvas.height]));if(e){if(a(e,"$dimensions")){var h=e.$dimensions;h||(h=t.dimensions),this.setUniform("u_dimensions",[h.width,h.height])}if(a(e,"$alpha")){var u=e.$alpha;u||(u=t.alpha),this.setUniform("u_alpha",u)}this.bindProps(e)}}}setUniform(t,...e){this.glw.setUniform(this.uniformTypes[t],this.uniformLocations[t],...e)}bindBufferCollection(t){if(this.boundBufferCollection!==t){for(var e in this.attributeLocations){var r=t.getBuffer(e),i=t.getAttributeInfo(e);this.bindBufferAttribute(this.attributeLocations[e],r,i)}this.boundBufferCollection=t}}bindProps(t){}bindTextures(t){}attach(){this.glw.useProgram(this.program),this.glw.useProgram(this.program),this.glw.isWebGl2()&&this.vao&&this.glw.bindVertexArray(this.vao)}detach(){this.disableAttributes()}}n(c,"shaderSources",void 0),e("W",c);class l extends h{constructor(t){super(),n(this,"txManager",void 0),n(this,"dimensions",null),n(this,"error",null),n(this,"state","freed"),n(this,"renderableOwners",new Set),this.txManager=t}setRenderableOwner(t,e){e?this.renderableOwners.add(t):this.renderableOwners.delete(t)}get renderable(){return this.renderableOwners.size>0}setState(t,...e){if(this.state!==t){if(this.state=t,"loaded"===t){var r=e;this.dimensions=r[0]}else if("failed"===t){var i=e;this.error=i[0]}this.emit(t,...e)}}static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}e("j",l);var f=e("b",(t=>[(t>>>24)/255,(t>>>16&255)/255,(t>>>8&255)/255,(255&t)/255]));function v(t,e,r,i,n){return n?(n.x1=t,n.y1=e,n.x2=r,n.y2=i,n):{x1:t,y1:e,x2:r,y2:i}}class g extends h{constructor(t,e){super(),n(this,"fontFamily",void 0),n(this,"descriptors",void 0),n(this,"loaded",!1),this.fontFamily=t,this.descriptors=function(t){for(var e=1;ee===t));if(-1!==i)return i;var n=e.length;return n>=r?4294967295:(this.textures.push(t),n)}draw(){var t=this.glw,e=this.shader,r=this.shaderProps,i=this.options;i.shManager.useShader(e),e.bindRenderOp(this,r);var n=this.bufferIdx/24*6*2;if(this.clippingRect.valid){var s=this.clippingRect,a=s.x,o=s.y,h=s.width,u=s.height,d=i.pixelRatio,c=i.canvas.height,l=Math.round(a*d),f=Math.round(h*d),v=Math.round(u*d),g=Math.round(c-v-o*d);t.setScissorTest(!0),t.scissor(l,g,f,v)}else t.setScissorTest(!1);t.drawElements(t.TRIANGLES,6*this.numQuads,t.UNSIGNED_SHORT,n)}}function _(t){var e={MAX_RENDERBUFFER_SIZE:0,MAX_TEXTURE_SIZE:0,MAX_VIEWPORT_DIMS:0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:0,MAX_TEXTURE_IMAGE_UNITS:0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:0,MAX_VERTEX_ATTRIBS:0,MAX_VARYING_VECTORS:0,MAX_VERTEX_UNIFORM_VECTORS:0,MAX_FRAGMENT_UNIFORM_VECTORS:0};return Object.keys(e).forEach((r=>{e[r]=t.getParameter(t[r])})),e}function m(t){var e={ANGLE_instanced_arrays:null,WEBGL_compressed_texture_s3tc:null,WEBGL_compressed_texture_astc:null,WEBGL_compressed_texture_etc:null,WEBGL_compressed_texture_etc1:null,WEBGL_compressed_texture_pvrtc:null,WEBKIT_WEBGL_compressed_texture_pvrtc:null,WEBGL_compressed_texture_s3tc_srgb:null,OES_vertex_array_object:null};return Object.keys(e).forEach((r=>{e[r]=t.getExtension(r)})),e}function R(t,e){var r,i,n=0;function s(){var s,a,o=r,h=arguments.length;t:for(;o;){if(o.args.length===arguments.length){for(a=0;at&&!(t&t-1),b=(t,e,r,i)=>{var n=3*t,s=3*(r-t)-n,a=1-n-s,o=3*e,h=3*(i-e)-o,u=1-o-h;return function(t){if(t>=1)return 1;if(t<=0)return 0;for(var e,r,i=.5,d=0;d<20;d++){if((r=t-i*(i*(i*a+s)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);if((e=i*(i*(3*a)+2*s)+n)>1e-10&&e<1e-10)break;i+=r/e}for(var c=0,l=1,f=0;f<20;f++){if((r=t-(i=.5*(c+l))*(i*(i*a+s)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);r<0?l=i:c=i}}};e("r",R((t=>{switch(t){case"linear":return function(t){return t};case"ease":return b(.25,.1,.25,1);case"ease-in":return b(.42,0,1,1);case"ease-out":return b(0,0,.58,1);case"ease-in-out":return b(.42,0,.58,1);case"ease-in-sine":case"ease-out-sine":return b(.12,0,.39,0);case"ease-in-out-sine":return b(.37,0,.63,1);case"ease-in-cubic":return b(.32,0,.67,0);case"ease-out-cubic":return b(.33,1,.68,1);case"ease-in-out-cubic":return b(.65,0,.35,1);case"ease-in-circ":return b(.55,0,1,.45);case"ease-out-circ":return b(0,.55,.45,1);case"ease-in-out-circ":return b(.85,0,.15,1);case"ease-in-back":return b(.36,0,.66,-.56);case"ease-out-back":return b(.34,1.56,.64,1);case"ease-in-out-back":return b(.68,-.6,.32,1.6);case"step-start":return function(){return 1};case"step-end":return function(t){return 1===t?1:0};default:var e="cubic-bezier(";if(t&&0===t.indexOf(e)){var r=t.substr(13,t.length-13-1).split(",");if(4!==r.length)return console.warn("Unknown timing function: "+t),function(t){return t};var i=parseFloat(r[0]||"0.42"),n=parseFloat(r[1]||"0"),s=parseFloat(r[2]||"1"),a=parseFloat(r[3]||"1");return isNaN(i)||isNaN(n)||isNaN(s)||isNaN(a)?(console.warn(" Unknown timing function: "+t),function(t){return t}):b(i,n,s,a)}return console.warn("Unknown timing function: "+t),function(t){return t}}})));Math.hypot||(Math.hypot=(...t)=>{for(var e=0,r=t.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var y=new Uint8Array([0,0,0,0]);class w extends p{constructor(t,e,r){super(e,r),n(this,"glw",void 0),n(this,"_nativeCtxTexture",null),n(this,"_state","freed"),n(this,"_w",0),n(this,"_h",0),this.glw=t}get ctxTexture(){return"freed"===this._state&&this.load(),this._nativeCtxTexture,this._nativeCtxTexture}get renderable(){return this.textureSource.renderable}get w(){return this._w}get h(){return this._h}load(){"loading"!==this._state&&"loaded"!==this._state&&(this._state="loading",this.textureSource.setState("loading"),this._nativeCtxTexture=this.createNativeCtxTexture(),this.onLoadRequest().then((({width:t,height:e})=>{"freed"!==this._state&&(this._state="loaded",this._w=t,this._h=e,this.textureSource.setState("loaded",{width:t,height:e}))})).catch((t=>{this._state="failed",this.textureSource.setState("failed",t),console.error(t)})))}onLoadRequest(){var e=this;return r(t().mark((function r(){var i,n,s,a,o,h,u,d,c,l,f,v,g,p,E,T,x;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.glw,s=e.memManager,n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,null),s.setTextureMemUse(e,y.byteLength),t.next=5,null===(i=e.textureSource)||void 0===i?void 0:i.getTextureData();case 5:if(a=t.sent,e._nativeCtxTexture){t.next=9;break}return e._state,t.abrupt("return",{width:0,height:0});case 9:return o=0,h=0,e._nativeCtxTexture,n.activeTexture(0),a.data instanceof ImageBitmap||a.data instanceof ImageData||null!==(r=a.data)&&"object"==typeof r&&r.constructor&&"HTMLImageElement"===r.constructor.name?(u=a.data,o=u.width,h=u.height,n.bindTexture(e._nativeCtxTexture),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!!a.premultiplyAlpha),n.texImage2D(0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u),s.setTextureMemUse(e,o*h*4),(n.isWebGl2()||A(o)&&A(h))&&n.generateMipmap()):null===a.data?(o=0,h=0,n.bindTexture(e._nativeCtxTexture),n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,y),s.setTextureMemUse(e,y.byteLength)):"mipmaps"in a.data&&a.data.mipmaps?(c=a.data,l=c.mipmaps,f=c.width,v=void 0===f?0:f,g=c.height,p=void 0===g?0:g,E=c.type,T=c.glInternalFormat,x="ktx"===E?new DataView(null!==(d=l[0])&&void 0!==d?d:new ArrayBuffer(0)):l[0],n.bindTexture(e._nativeCtxTexture),n.compressedTexImage2D(0,T,v,p,0,x),n.texParameteri(n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_MIN_FILTER,n.LINEAR),s.setTextureMemUse(e,x.byteLength)):console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",a),t.abrupt("return",{width:o,height:h});case 15:case"end":return t.stop()}var r}),r)})))()}free(){if("freed"!==this._state&&(this._state="freed",this.textureSource.setState("freed"),this._w=0,this._h=0,this._nativeCtxTexture)){var t=this.glw,e=this.memManager;t.deleteTexture(this._nativeCtxTexture),e.setTextureMemUse(this,0),this._nativeCtxTexture=null}}createNativeCtxTexture(){var t=this.glw,e=t.createTexture();if(!e)throw new Error("Could not create WebGL Texture");return t.activeTexture(0),t.bindTexture(e),t.texParameteri(t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}}class S extends l{constructor(t,e){super(t),n(this,"props",void 0),this.props=S.resolveDefaults(e||{})}get color(){return this.props.color}set color(t){this.props.color=t}getTextureData(){var e=this;return r(t().mark((function r(){var i,n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new Uint32Array([e.color]),n=new Uint8ClampedArray(i.buffer),t.abrupt("return",{data:new ImageData(n,1,1),premultiplyAlpha:!0});case 3:case"end":return t.stop()}}),r)})))()}static makeCacheKey(t){return`ColorTexture,${S.resolveDefaults(t).color}`}static resolveDefaults(t){return{color:t.color||4294967295}}}n(S,"z$__type__Props",void 0),e("u",S);class M extends l{constructor(t,e){super(t),n(this,"props",void 0),n(this,"parentTexture",void 0),n(this,"onParentTxLoaded",(()=>{this.setState("loaded",{width:this.props.width,height:this.props.height})})),n(this,"onParentTxFailed",((t,e)=>{this.setState("failed",e)})),this.parentTexture=this.txManager.loadTexture(e.texture.txType,e.texture.props,e.texture.options),this.props=M.resolveDefaults(e||{}),queueMicrotask((()=>{var t=this.parentTexture;"loaded"===t.state?this.onParentTxLoaded(t,t.dimensions):"failed"===t.state&&this.onParentTxFailed(t,t.error),t.on("loaded",this.onParentTxLoaded),t.on("failed",this.onParentTxFailed)}))}getTextureData(){var e=this;return r(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:e.props});case 1:case"end":return t.stop()}}),r)})))()}static makeCacheKey(t){return!1}static resolveDefaults(t){return{texture:t.texture,x:t.x||0,y:t.y||0,width:t.width||0,height:t.height||0}}}n(M,"z$__type__Props",void 0),e("v",M);class I extends w{constructor(t,e,r){super(t,e,r)}onLoadRequest(){var e=this;return r(t().mark((function r(){var i,n,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.textureSource.getTextureData();case 2:return s=t.sent,t.abrupt("return",{width:(null===(i=s.data)||void 0===i?void 0:i.width)||0,height:(null===(n=s.data)||void 0===n?void 0:n.height)||0});case 4:case"end":return t.stop()}}),r)})))()}}class L{constructor(t){n(this,"config",void 0),this.config=t}getBuffer(t){var e;return null===(e=this.config.find((e=>e.attributes[t])))||void 0===e?void 0:e.buffer}getAttributeInfo(t){var e;return null===(e=this.config.find((e=>e.attributes[t])))||void 0===e?void 0:e.attributes[t]}}e("B",L);class N{constructor(t){n(this,"gl",void 0),n(this,"activeTextureUnit",0),n(this,"texture2dUnits",void 0),n(this,"texture2dParams",new WeakMap),n(this,"scissorEnabled",void 0),n(this,"scissorX",void 0),n(this,"scissorY",void 0),n(this,"scissorWidth",void 0),n(this,"scissorHeight",void 0),n(this,"blendEnabled",void 0),n(this,"blendSrcRgb",void 0),n(this,"blendDstRgb",void 0),n(this,"blendSrcAlpha",void 0),n(this,"blendDstAlpha",void 0),n(this,"boundArrayBuffer",void 0),n(this,"boundElementArrayBuffer",void 0),n(this,"curProgram",void 0),n(this,"programUniforms",new WeakMap),n(this,"canvas",void 0),n(this,"MAX_RENDERBUFFER_SIZE",void 0),n(this,"MAX_TEXTURE_SIZE",void 0),n(this,"MAX_VIEWPORT_DIMS",void 0),n(this,"MAX_VERTEX_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_COMBINED_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_VERTEX_ATTRIBS",void 0),n(this,"MAX_VARYING_VECTORS",void 0),n(this,"MAX_VERTEX_UNIFORM_VECTORS",void 0),n(this,"MAX_FRAGMENT_UNIFORM_VECTORS",void 0),n(this,"TEXTURE_MAG_FILTER",void 0),n(this,"TEXTURE_MIN_FILTER",void 0),n(this,"TEXTURE_WRAP_S",void 0),n(this,"TEXTURE_WRAP_T",void 0),n(this,"LINEAR",void 0),n(this,"CLAMP_TO_EDGE",void 0),n(this,"RGBA",void 0),n(this,"UNSIGNED_BYTE",void 0),n(this,"UNPACK_PREMULTIPLY_ALPHA_WEBGL",void 0),n(this,"UNPACK_FLIP_Y_WEBGL",void 0),n(this,"FLOAT",void 0),n(this,"TRIANGLES",void 0),n(this,"UNSIGNED_SHORT",void 0),n(this,"ONE",void 0),n(this,"ONE_MINUS_SRC_ALPHA",void 0),n(this,"VERTEX_SHADER",void 0),n(this,"FRAGMENT_SHADER",void 0),n(this,"STATIC_DRAW",void 0),n(this,"COMPILE_STATUS",void 0),n(this,"LINK_STATUS",void 0),n(this,"DYNAMIC_DRAW",void 0),n(this,"COLOR_ATTACHMENT0",void 0),this.gl=t,this.activeTextureUnit=t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.texture2dUnits=new Array(e).fill(void 0).map(((e,r)=>(this.activeTexture(r),t.getParameter(t.TEXTURE_BINDING_2D)))),this.activeTexture(this.activeTextureUnit),this.scissorEnabled=t.isEnabled(t.SCISSOR_TEST);var r=t.getParameter(t.SCISSOR_BOX);this.scissorX=r[0],this.scissorY=r[1],this.scissorWidth=r[2],this.scissorHeight=r[3],this.blendEnabled=t.isEnabled(t.BLEND),this.blendSrcRgb=t.getParameter(t.BLEND_SRC_RGB),this.blendDstRgb=t.getParameter(t.BLEND_DST_RGB),this.blendSrcAlpha=t.getParameter(t.BLEND_SRC_ALPHA),this.blendDstAlpha=t.getParameter(t.BLEND_DST_ALPHA),this.boundArrayBuffer=t.getParameter(t.ARRAY_BUFFER_BINDING),this.boundElementArrayBuffer=t.getParameter(t.ELEMENT_ARRAY_BUFFER_BINDING),this.curProgram=t.getParameter(t.CURRENT_PROGRAM),this.canvas=t.canvas,this.MAX_RENDERBUFFER_SIZE=t.MAX_RENDERBUFFER_SIZE,this.MAX_TEXTURE_SIZE=t.MAX_TEXTURE_SIZE,this.MAX_VIEWPORT_DIMS=t.MAX_VIEWPORT_DIMS,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.MAX_TEXTURE_IMAGE_UNITS=t.MAX_TEXTURE_IMAGE_UNITS,this.MAX_COMBINED_TEXTURE_IMAGE_UNITS=t.MAX_COMBINED_TEXTURE_IMAGE_UNITS,this.MAX_VERTEX_ATTRIBS=t.MAX_VERTEX_ATTRIBS,this.MAX_VARYING_VECTORS=t.MAX_VARYING_VECTORS,this.MAX_VERTEX_UNIFORM_VECTORS=t.MAX_VERTEX_UNIFORM_VECTORS,this.MAX_FRAGMENT_UNIFORM_VECTORS=t.MAX_FRAGMENT_UNIFORM_VECTORS,this.TEXTURE_MAG_FILTER=t.TEXTURE_MAG_FILTER,this.TEXTURE_MIN_FILTER=t.TEXTURE_MIN_FILTER,this.TEXTURE_WRAP_S=t.TEXTURE_WRAP_S,this.TEXTURE_WRAP_T=t.TEXTURE_WRAP_T,this.LINEAR=t.LINEAR,this.CLAMP_TO_EDGE=t.CLAMP_TO_EDGE,this.RGBA=t.RGBA,this.UNSIGNED_BYTE=t.UNSIGNED_BYTE,this.UNPACK_PREMULTIPLY_ALPHA_WEBGL=t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.UNPACK_FLIP_Y_WEBGL=t.UNPACK_FLIP_Y_WEBGL,this.FLOAT=t.FLOAT,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.ONE=t.ONE,this.ONE_MINUS_SRC_ALPHA=t.ONE_MINUS_SRC_ALPHA,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.VERTEX_SHADER=t.VERTEX_SHADER,this.FRAGMENT_SHADER=t.FRAGMENT_SHADER,this.STATIC_DRAW=t.STATIC_DRAW,this.COMPILE_STATUS=t.COMPILE_STATUS,this.LINK_STATUS=t.LINK_STATUS,this.DYNAMIC_DRAW=t.DYNAMIC_DRAW,this.COLOR_ATTACHMENT0=t.COLOR_ATTACHMENT0}isWebGl2(){return t=this.gl,self.WebGL2RenderingContext&&t instanceof self.WebGL2RenderingContext;var t}activeTexture(t){var e=this.gl;this.activeTextureUnit!==t&&(e.activeTexture(t+e.TEXTURE0),this.activeTextureUnit=t)}bindTexture(t){var e=this.gl,r=this.activeTextureUnit,i=this.texture2dUnits;i[r]!==t&&(i[r]=t,e.bindTexture(this.gl.TEXTURE_2D,t))}_getActiveTexture(){var t=this.activeTextureUnit;return this.texture2dUnits[t]}texParameteri(t,e){var r=this.gl,i=this.texture2dParams,n=this._getActiveTexture();if(!n)throw new Error("No active texture");var s=i.get(n);s||(s={},i.set(n,s)),s[t]!==e&&(s[t]=e,r.texParameteri(r.TEXTURE_2D,t,e))}texImage2D(t,e,r,i,n,s,a,o){var h=this.gl;s?h.texImage2D(h.TEXTURE_2D,t,e,r,i,n,s,a,o):h.texImage2D(h.TEXTURE_2D,t,e,r,i,n)}compressedTexImage2D(t,e,r,i,n,s){var a=this.gl;a.compressedTexImage2D(a.TEXTURE_2D,t,e,r,i,n,s)}pixelStorei(t,e){this.gl.pixelStorei(t,e)}generateMipmap(){var t=this.gl;t.generateMipmap(t.TEXTURE_2D)}createTexture(){return this.gl.createTexture()}deleteTexture(t){var e=this.gl;t&&this.texture2dParams.delete(t),e.deleteTexture(t)}viewport(t,e,r,i){this.gl.viewport(t,e,r,i)}clearColor(t,e,r,i){this.gl.clearColor(t,e,r,i)}setScissorTest(t){var e=this.gl;t!==this.scissorEnabled&&(t?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST),this.scissorEnabled=t)}scissor(t,e,r,i){var n=this.gl,s=this.scissorX,a=this.scissorY,o=this.scissorWidth,h=this.scissorHeight;t===s&&e===a&&r===o&&i===h||(n.scissor(t,e,r,i),this.scissorX=t,this.scissorY=e,this.scissorWidth=r,this.scissorHeight=i)}setBlend(t){var e=this.gl;t!==this.blendEnabled&&(t?e.enable(e.BLEND):e.disable(e.BLEND),this.blendEnabled=t)}blendFunc(t,e){var r=this.gl,i=this.blendSrcRgb,n=this.blendDstRgb,s=this.blendSrcAlpha,a=this.blendDstAlpha;t===i&&e===n&&t===s&&e===a||(r.blendFunc(t,e),this.blendSrcRgb=t,this.blendDstRgb=e,this.blendSrcAlpha=t,this.blendDstAlpha=e)}createBuffer(){return this.gl.createBuffer()}createFramebuffer(){return this.gl.createFramebuffer()}bindFramebuffer(t){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t)}framebufferTexture2D(t,e,r){var i=this.gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,i.TEXTURE_2D,e,r)}clear(){var t=this.gl;t.clear(t.COLOR_BUFFER_BIT)}arrayBufferData(t,e,r){var i=this.gl;this.boundArrayBuffer!==t&&(i.bindBuffer(i.ARRAY_BUFFER,t),this.boundArrayBuffer=t),i.bufferData(i.ARRAY_BUFFER,e,r)}elementArrayBufferData(t,e,r){var i=this.gl;this.boundElementArrayBuffer!==t&&(i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t),this.boundElementArrayBuffer=t),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e,r)}vertexAttribPointer(t,e,r,i,n,s,a){var o=this.gl;this.boundArrayBuffer!==t&&(o.bindBuffer(o.ARRAY_BUFFER,t),this.boundArrayBuffer=t),o.vertexAttribPointer(e,r,i,n,s,a)}useProgram(t){var e=this.gl;this.curProgram!==t&&(e.useProgram(t),this.curProgram=t)}setUniform(t,e,...r){var i=this.gl,n=this.programUniforms,s=n.get(this.curProgram);s||(s=new Map,n.set(this.curProgram,s));var a=s.get(e);a&&function(t,e){if(t.length!==e.length)return!1;return t.every(((t,r)=>!(Array.isArray(t)||t instanceof Float32Array)&&t===e[r]))}(a,r)||(s.set(e,r),i[t](e,...r))}getParameter(t){return this.gl.getParameter(t)}drawElements(t,e,r,i){this.gl.drawElements(t,e,r,i)}getExtension(t){return this.gl.getExtension(t)}createVertexArray(){var t=this.gl;return WebGL2RenderingContext,t.createVertexArray()}bindVertexArray(t){var e=this.gl;WebGL2RenderingContext,e.bindVertexArray(t)}getAttribLocation(t,e){return this.gl.getAttribLocation(t,e)}getUniformLocation(t,e){return this.gl.getUniformLocation(t,e)}enableVertexAttribArray(t){this.gl.enableVertexAttribArray(t)}disableVertexAttribArray(t){this.gl.disableVertexAttribArray(t)}createShader(t){return this.gl.createShader(t)}compileShader(t){this.gl.compileShader(t)}attachShader(t,e){this.gl.attachShader(t,e)}linkProgram(t){this.gl.linkProgram(t)}deleteProgram(t){this.gl.deleteProgram(t)}getShaderParameter(t,e){return this.gl.getShaderParameter(t,e)}getShaderInfoLog(t){return this.gl.getShaderInfoLog(t)}createProgram(){return this.gl.createProgram()}getProgramParameter(t,e){return this.gl.getProgramParameter(t,e)}getProgramInfoLog(t){return this.gl.getProgramInfoLog(t)}shaderSource(t,e){this.gl.shaderSource(t,e)}deleteShader(t){this.gl.deleteShader(t)}}class U extends l{constructor(t,e){super(t),n(this,"props",void 0),this.props=U.resolveDefaults(e||{})}get width(){return this.props.width}set width(t){this.props.width=t}get height(){return this.props.height}set height(t){this.props.height=t}getTextureData(){return r(t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:null,premultiplyAlpha:null});case 1:case"end":return t.stop()}}),e)})))()}static resolveDefaults(t){return{width:t.width||256,height:t.height||256}}}n(U,"z$__type__Props",void 0),e("R",U);class P extends w{constructor(t,e,r){super(t,e,r),n(this,"framebuffer",void 0);var i=t.createFramebuffer();this.framebuffer=i}onLoadRequest(){var e=this;return r(t().mark((function r(){var i,n,s,a,o,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.glw,n=e.memManager,s=e._nativeCtxTexture=e.createNativeCtxTexture(),a=e.textureSource,o=a.width,h=a.height,i.texImage2D(0,i.RGBA,o,h,0,i.RGBA,i.UNSIGNED_BYTE,null),n.setTextureMemUse(e,o*h*4),i.bindFramebuffer(e.framebuffer),i.framebufferTexture2D(i.COLOR_ATTACHMENT0,s,0),i.bindFramebuffer(null),t.abrupt("return",{width:o,height:h});case 9:case"end":return t.stop()}}),r)})))()}}class O extends E{constructor(t){super(t.stage),n(this,"glw",void 0),n(this,"system",void 0),n(this,"txManager",void 0),n(this,"txMemManager",void 0),n(this,"shManager",void 0),n(this,"options",void 0),n(this,"quadBuffer",new ArrayBuffer(4194304)),n(this,"fQuadBuffer",new Float32Array(this.quadBuffer)),n(this,"uiQuadBuffer",new Uint32Array(this.quadBuffer)),n(this,"renderOps",[]),n(this,"curBufferIdx",0),n(this,"curRenderOp",null),n(this,"rttNodes",[]),n(this,"activeRttNode",null),n(this,"defaultShader",void 0),n(this,"quadBufferCollection",void 0),n(this,"defaultTexture",void 0),n(this,"renderToTextureActive",!1);var e=t.canvas,r=t.clearColor,i=t.bufferMemory;this.options=t,this.txManager=t.txManager,this.txMemManager=t.txMemManager,this.shManager=t.shManager,this.defaultTexture=new S(this.txManager),this.defaultTexture.once("loaded",(()=>{this.stage.requestRender()}));var s=function(t,e){var r={alpha:!0,antialias:!1,depth:!1,stencil:!0,desynchronized:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:!1},i=t.getContext("webgl",r)||t.getContext("experimental-webgl",r);if(!i)throw new Error("Unable to create WebGL context");return e?new Proxy(i,{get(t,r){var i=t[r];return"function"==typeof i?(e.increment(String(r)),i.bind(t)):i}}):i}(e,t.contextSpy),a=this.glw=new N(s),o=f(r);a.viewport(0,0,e.width,e.height),a.clearColor(o[0],o[1],o[2],o[3]),a.setBlend(!0),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),function(t,e){for(var r=~~(e/80),i=new Uint16Array(6*r),n=0,s=0;n{t.draw()}))}renderToTexture(t){for(var e=0;e{var e=t.second;(r[e]=r[e]||{})[t.first]=t.amount})),this.kernings=r}shapeText(e,r){var i=this;return t().mark((function n(){var s,a,o,h,u,d;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=void 0;case 1:if(!(s=r.peek())||s.done){t.next=17;break}if(o=s.value,h=i.glyphMap.get(o),r.next(),void 0===h){t.next=12;break}return d=void 0!==a?((null===(u=i.kernings[h.id])||void 0===u?void 0:u[a])||0)+e.letterSpacing:0,a=h.id,t.next=10,{mapped:!0,glyphId:h.id,codepoint:o,cluster:r.lastIndex,xAdvance:h.xadvance+d,yAdvance:0,xOffset:h.xoffset+d,yOffset:h.yoffset,xBearing:0,yBearing:0,width:h.width,height:h.height};case 10:t.next=15;break;case 12:return o===B&&(a=void 0),t.next=15,{mapped:!1,codepoint:o,cluster:r.lastIndex};case 15:t.next=1;break;case 17:case"end":return t.stop()}}),n)}))()}}e("S",class extends g{constructor(e,i,s,a,o,h){var u;super(e,i),u=this,n(this,"type",void 0),n(this,"texture",void 0),n(this,"maxCharHeight",0),n(this,"data",void 0),n(this,"shaper",void 0),n(this,"glyphMap",new Map),this.type=s;a.renderer;this.texture=a.txManager.loadTexture("ImageTexture",{src:o,premultiplyAlpha:!1},{preload:!0}),this.texture.on("loaded",(()=>{this.checkLoaded()})),fetch(h).then(function(){var e=r(t().mark((function e(r){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.json();case 2:u.data=t.sent,i=0,u.data.chars.forEach((t=>{u.glyphMap.set(t.id,t);var e=t.yoffset+t.height;e>i&&(i=e)})),u.maxCharHeight=i,u.shaper=new X(u.data,u.glyphMap),u.checkLoaded();case 8:case"end":return t.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch(console.error)}getAtlasEntry(t){var e=this.glyphMap.get(t);if(void 0===e)throw new Error(`Glyph ${t} not found in font ${this.fontFamily}`);return{x:e.x,y:e.y,width:e.width,height:e.height}}checkLoaded(){this.loaded||"loaded"===this.texture.state&&this.data&&(this.loaded=!0,this.emit("loaded"))}});e("C",class{})}}}))}(); +//# sourceMappingURL=CoreExtension-legacy-1r1p_2oI.js.map diff --git a/assets/CoreExtension-legacy-SS_VGrQO.js.map b/assets/CoreExtension-legacy-1r1p_2oI.js.map similarity index 76% rename from assets/CoreExtension-legacy-SS_VGrQO.js.map rename to assets/CoreExtension-legacy-1r1p_2oI.js.map index c330a93..acc912c 100644 --- a/assets/CoreExtension-legacy-SS_VGrQO.js.map +++ b/assets/CoreExtension-legacy-1r1p_2oI.js.map @@ -1 +1 @@ -{"version":3,"file":"CoreExtension-legacy-SS_VGrQO.js","sources":["../../../../../renderer/dist/src/utils.js","../../../../../renderer/dist/src/core/lib/utils.js","../../../../../renderer/dist/src/common/EventEmitter.js","../../../../../renderer/dist/src/core/renderers/CoreShader.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/ShaderUtils.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreShader.js","../../../../../renderer/dist/src/core/textures/Texture.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/TrFontFace.js","../../../../../renderer/dist/src/core/renderers/CoreContextTexture.js","../../../../../renderer/dist/src/core/renderers/CoreRenderer.js","../../../../../renderer/dist/src/core/renderers/CoreRenderOp.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreRenderOp.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/RendererUtils.js","../../../../../renderer/node_modules/.pnpm/memize@2.1.0/node_modules/memize/dist/index.js","../../../../../renderer/dist/src/core/utils.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js","../../../../../renderer/dist/src/core/textures/ColorTexture.js","../../../../../renderer/dist/src/core/textures/SubTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxSubTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/BufferCollection.js","../../../../../renderer/dist/src/core/lib/WebGlContextWrapper.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/WebGlUtils.js","../../../../../renderer/dist/src/core/textures/RenderTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxRenderTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/SpecialCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/FontShaper.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/SdfFontShaper.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js","../../../../../renderer/dist/src/core/CoreExtension.js"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createWebGLContext(canvas, contextSpy) {\n const config = {\n alpha: true,\n antialias: false,\n depth: false,\n stencil: true,\n desynchronized: false,\n // Disabled because it prevents Visual Regression Tests from working\n // failIfMajorPerformanceCaveat: true,\n powerPreference: 'high-performance',\n premultipliedAlpha: true,\n preserveDrawingBuffer: false,\n };\n const gl = \n // TODO: Remove this assertion once this issue is fixed in TypeScript\n // https://github.com/microsoft/TypeScript/issues/53614\n (canvas.getContext('webgl', config) ||\n canvas.getContext('experimental-webgl', config));\n if (!gl) {\n throw new Error('Unable to create WebGL context');\n }\n if (contextSpy) {\n // Proxy the GL context to log all GL calls\n return new Proxy(gl, {\n get(target, prop) {\n const value = target[prop];\n if (typeof value === 'function') {\n contextSpy.increment(String(prop));\n return value.bind(target);\n }\n return value;\n },\n });\n }\n return gl;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (isProductionEnvironment())\n return;\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n/**\n * Merges two colors based on a given progress value.\n *\n * This function takes two colors (c1 and c2) represented as 32-bit integers\n * in RGBA format and blends them based on the provided progress value (p).\n * The result is a new color that is a weighted combination of the input colors,\n * where the weight is determined by the progress value.\n *\n * @param {number} c1 - The first color in RGBA format (32-bit integer).\n * @param {number} c2 - The second color in RGBA format (32-bit integer).\n * @param {number} p - The progress value between 0 and 1.\n * @returns {number} The merged color as a 32-bit integer in RGBA format.\n */\nexport function mergeColorProgress(rgba1, rgba2, p) {\n const r1 = Math.trunc(rgba1 >>> 24);\n const g1 = Math.trunc((rgba1 >>> 16) & 0xff);\n const b1 = Math.trunc((rgba1 >>> 8) & 0xff);\n const a1 = Math.trunc(rgba1 & 0xff);\n const r2 = Math.trunc(rgba2 >>> 24);\n const g2 = Math.trunc((rgba2 >>> 16) & 0xff);\n const b2 = Math.trunc((rgba2 >>> 8) & 0xff);\n const a2 = Math.trunc(rgba2 & 0xff);\n const r = Math.round(r2 * p + r1 * (1 - p));\n const g = Math.round(g2 * p + g1 * (1 - p));\n const b = Math.round(b2 * p + b1 * (1 - p));\n const a = Math.round(a2 * p + a1 * (1 - p));\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter.\n *\n * @internalRemarks\n * This method does NOT premultiply the alpha into the color channels. If that\n * is required (for internal use only) use {@link mergeColorAlphaPremultiplied}\n * instead.\n *\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @returns\n */\nexport function mergeColorAlpha(rgba, alpha) {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = Math.trunc((rgba & 0xff) * alpha);\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter. Before returning, the\n * final alpha value is multiplied into the color channels.\n *\n * @remarks\n * If `flipEndianess` is set to true, the function will returned an ABGR encoded number\n * which is useful when the color value needs to be passed into a shader attribute.\n *\n * NOTE: This method returns a PREMULTIPLIED alpha color which is generally only useful\n * in the context of the internal rendering process. Use {@link mergeColorAlpha} if you\n * need to blend an alpha value into a color in the context of the Renderer's\n * main API.\n *\n * @internalRemarks\n * Do not expose this method in the main API because Renderer users should instead use\n * {@link mergeColorAlpha} to manipulate the alpha value of a color.\n *\n * @internal\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @param flipEndianess Flip the endianess. RGBA becomes encoded as ABGR (for inserting colors into shader attributes)\n * @returns\n */\nexport function mergeColorAlphaPremultiplied(rgba, alpha, flipEndianess = false) {\n const newAlpha = ((rgba & 0xff) / 255) * alpha;\n const r = Math.trunc((rgba >>> 24) * newAlpha);\n const g = Math.trunc(((rgba >>> 16) & 0xff) * newAlpha);\n const b = Math.trunc(((rgba >>> 8) & 0xff) * newAlpha);\n const a = Math.trunc(newAlpha * 255);\n if (flipEndianess) {\n return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0;\n }\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Returns true if the given object has the given \"own\" property.\n *\n * @param obj\n * @param prop\n * @returns\n */\nexport function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n/**\n * Converts degrees to radians\n *\n * @param degrees\n * @returns\n */\nexport function deg2Rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * Returns image aspect ratio\n *\n * @param width\n * @param height\n * @returns\n */\nexport function getImageAspectRatio(width, height) {\n return width / height;\n}\n/**\n * Checks import.meta if env is production\n *\n * @returns\n */\nexport function isProductionEnvironment() {\n return import.meta.env && import.meta.env.PROD;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNormalizedRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r / 255, g / 255, b / 255, a / 255];\n};\nexport const getRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r, g, b, a];\n};\nexport const norm = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n const rgbaArr = [r / 255, g / 255, b / 255, a / 255];\n rgbaArr[0] = Math.max(0, Math.min(255, rgbaArr[0]));\n rgbaArr[1] = Math.max(0, Math.min(255, rgbaArr[1]));\n rgbaArr[2] = Math.max(0, Math.min(255, rgbaArr[2]));\n rgbaArr[3] = Math.max(0, Math.min(255, rgbaArr[3]));\n let v = ((rgbaArr[3] | 0) << 24) +\n ((rgbaArr[0] | 0) << 16) +\n ((rgbaArr[1] | 0) << 8) +\n (rgbaArr[2] | 0);\n if (v < 0) {\n v = 0xffffffff + v + 1;\n }\n return v;\n};\nexport function getNormalizedAlphaComponent(rgba) {\n return (rgba & 0xff) / 255.0;\n}\n/**\n * Get a CSS color string from a RGBA color\n *\n * @param color\n * @returns\n */\nexport function getRgbaString(color) {\n const r = Math.floor(color[0] * 255.0);\n const g = Math.floor(color[1] * 255.0);\n const b = Math.floor(color[2] * 255.0);\n const a = Math.floor(color[3] * 255.0);\n return `rgba(${r},${g},${b},${a.toFixed(4)})`;\n}\nexport function createBound(x1, y1, x2, y2, out) {\n if (out) {\n out.x1 = x1;\n out.y1 = y1;\n out.x2 = x2;\n out.y2 = y2;\n return out;\n }\n return {\n x1,\n y1,\n x2,\n y2,\n };\n}\nexport function intersectBound(a, b, out) {\n const intersection = createBound(Math.max(a.x1, b.x1), Math.max(a.y1, b.y1), Math.min(a.x2, b.x2), Math.min(a.y2, b.y2), out);\n if (intersection.x1 < intersection.x2 && intersection.y1 < intersection.y2) {\n return intersection;\n }\n return createBound(0, 0, 0, 0, intersection);\n}\nexport function boundsOverlap(a, b) {\n return a.x1 < b.x2 && a.x2 > b.x1 && a.y1 < b.y2 && a.y2 > b.y1;\n}\nexport function convertBoundToRect(bound, out) {\n if (out) {\n out.x = bound.x1;\n out.y = bound.y1;\n out.width = bound.x2 - bound.x1;\n out.height = bound.y2 - bound.y1;\n return out;\n }\n return {\n x: bound.x1,\n y: bound.y1,\n width: bound.x2 - bound.x1,\n height: bound.y2 - bound.y1,\n };\n}\nexport function intersectRect(a, b, out) {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const width = Math.min(a.x + a.width, b.x + b.width) - x;\n const height = Math.min(a.y + a.height, b.y + b.height) - y;\n if (width > 0 && height > 0) {\n if (out) {\n out.x = x;\n out.y = y;\n out.width = width;\n out.height = height;\n return out;\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n if (out) {\n out.x = 0;\n out.y = 0;\n out.width = 0;\n out.height = 0;\n return out;\n }\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n}\nexport function copyRect(a, out) {\n if (out) {\n out.x = a.x;\n out.y = a.y;\n out.width = a.width;\n out.height = a.height;\n return out;\n }\n return {\n x: a.x,\n y: a.y,\n width: a.width,\n height: a.height,\n };\n}\nexport function compareRect(a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n return (a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height);\n}\nexport function boundInsideBound(bound1, bound2) {\n return (bound1.x1 <= bound2.x2 &&\n bound1.y1 <= bound2.y2 &&\n bound1.x2 >= bound2.x1 &&\n bound1.y2 >= bound2.y1);\n}\nexport function isBoundPositive(bound) {\n return bound.x1 < bound.x2 && bound.y1 < bound.y2;\n}\nexport function isRectPositive(rect) {\n return rect.width > 0 && rect.height > 0;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * EventEmitter base class\n */\nexport class EventEmitter {\n eventListeners = {};\n on(event, listener) {\n let listeners = this.eventListeners[event];\n if (!listeners) {\n listeners = [];\n }\n listeners.push(listener);\n this.eventListeners[event] = listeners;\n }\n off(event, listener) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n if (!listener) {\n delete this.eventListeners[event];\n return;\n }\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n once(event, listener) {\n const onceListener = (target, data) => {\n this.off(event, onceListener);\n listener(target, data);\n };\n this.on(event, onceListener);\n }\n emit(event, data) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n [...listeners].forEach((listener) => {\n listener(this, data);\n });\n }\n removeAllListeners() {\n this.eventListeners = {};\n }\n}\n//# sourceMappingURL=EventEmitter.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreShader {\n // abstract draw(): void;\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {};\n }\n}\n//# sourceMappingURL=CoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion Types\nexport function createShader(glw, type, source) {\n const shader = glw.createShader(type);\n if (!shader) {\n throw new Error();\n }\n glw.shaderSource(shader, source);\n glw.compileShader(shader);\n const success = glw.getShaderParameter(shader, glw.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.log(glw.getShaderInfoLog(shader));\n glw.deleteShader(shader);\n}\nexport function createProgram(glw, vertexShader, fragmentShader) {\n const program = glw.createProgram();\n if (!program) {\n throw new Error();\n }\n glw.attachShader(program, vertexShader);\n glw.attachShader(program, fragmentShader);\n glw.linkProgram(program);\n const success = glw.getProgramParameter(program, glw.LINK_STATUS);\n if (success) {\n return program;\n }\n console.log(glw.getProgramInfoLog(program));\n glw.deleteProgram(program);\n return undefined;\n}\n//# sourceMappingURL=ShaderUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, hasOwn } from '../../../utils.js';\nimport { CoreShader } from '../CoreShader.js';\nimport { createProgram, createShader, } from './internal/ShaderUtils.js';\nimport { isWebGl2 } from './internal/WebGlUtils.js';\nexport class WebGlCoreShader extends CoreShader {\n boundBufferCollection = null;\n buffersBound = false;\n program;\n /**\n * Vertex Array Object\n *\n * @remarks\n * Used by WebGL2 Only\n */\n vao;\n renderer;\n glw;\n attributeBuffers;\n attributeLocations;\n attributeNames;\n uniformLocations;\n uniformTypes;\n supportsIndexedTextures;\n constructor(options) {\n super();\n const renderer = (this.renderer = options.renderer);\n const glw = (this.glw = this.renderer.glw);\n this.supportsIndexedTextures = options.supportsIndexedTextures || false;\n // Check that extensions are supported\n const webGl2 = glw.isWebGl2();\n const requiredExtensions = (webGl2 && options.webgl2Extensions) ||\n (!webGl2 && options.webgl1Extensions) ||\n [];\n const glVersion = webGl2 ? '2.0' : '1.0';\n requiredExtensions.forEach((extensionName) => {\n if (!glw.getExtension(extensionName)) {\n throw new Error(`Shader \"${this.constructor.name}\" requires extension \"${extensionName}\" for WebGL ${glVersion} but wasn't found`);\n }\n });\n // Gather shader sources\n // - If WebGL 2 and special WebGL 2 sources are provided, we copy those sources and delete\n // the extra copy of them to save memory.\n // TODO: This could be further made optimal by just caching the compiled shaders and completely deleting\n // the source code\n const shaderSources = options.shaderSources ||\n this.constructor.shaderSources;\n if (!shaderSources) {\n throw new Error(`Shader \"${this.constructor.name}\" is missing shaderSources.`);\n }\n else if (webGl2 && shaderSources?.webGl2) {\n shaderSources.fragment = shaderSources.webGl2.fragment;\n shaderSources.vertex = shaderSources.webGl2.vertex;\n delete shaderSources.webGl2;\n }\n const textureUnits = renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n const vertexSource = shaderSources.vertex instanceof Function\n ? shaderSources.vertex(textureUnits)\n : shaderSources.vertex;\n const fragmentSource = shaderSources.fragment instanceof Function\n ? shaderSources.fragment(textureUnits)\n : shaderSources.fragment;\n const vertexShader = createShader(glw, glw.VERTEX_SHADER, vertexSource);\n const fragmentShader = createShader(glw, glw.FRAGMENT_SHADER, fragmentSource);\n if (!vertexShader || !fragmentShader) {\n throw new Error();\n }\n const program = createProgram(glw, vertexShader, fragmentShader);\n if (!program) {\n throw new Error();\n }\n this.program = program;\n if (webGl2) {\n const vao = glw.createVertexArray();\n if (!vao) {\n throw new Error();\n }\n this.vao = vao;\n glw.bindVertexArray(this.vao);\n }\n this.attributeLocations = {};\n this.attributeBuffers = {};\n this.attributeNames = [];\n [...options.attributes].forEach((attributeName) => {\n const location = glw.getAttribLocation(this.program, attributeName);\n if (location < 0) {\n throw new Error(`${this.constructor.name}: Vertex shader must have an attribute \"${attributeName}\"!`);\n }\n const buffer = glw.createBuffer();\n if (!buffer) {\n throw new Error(`${this.constructor.name}: Could not create buffer for attribute \"${attributeName}\"`);\n }\n this.attributeLocations[attributeName] = location;\n this.attributeBuffers[attributeName] = buffer;\n this.attributeNames.push(attributeName);\n });\n this.uniformLocations = {};\n this.uniformTypes = {};\n options.uniforms.forEach((uniform) => {\n const location = glw.getUniformLocation(this.program, uniform.name);\n this.uniformTypes[uniform.name] = uniform.uniform;\n if (!location) {\n console.warn(`Shader \"${this.constructor.name}\" could not get uniform location for \"${uniform.name}\"`);\n return;\n }\n this.uniformLocations[uniform.name] = location;\n });\n }\n bindBufferAttribute(location, buffer, attribute) {\n const { glw } = this;\n glw.enableVertexAttribArray(location);\n glw.vertexAttribPointer(buffer, location, attribute.size, attribute.type, attribute.normalized, attribute.stride, attribute.offset);\n }\n disableAttribute(location) {\n this.glw.disableVertexAttribArray(location);\n }\n disableAttributes() {\n for (const loc in this.attributeLocations) {\n this.disableAttribute(this.attributeLocations[loc]);\n }\n this.boundBufferCollection = null;\n }\n /**\n * Given two sets of Shader props destined for this Shader, determine if they can be batched together\n * to reduce the number of draw calls.\n *\n * @remarks\n * This is used by the {@link WebGlCoreRenderer} to determine if it can batch multiple consecutive draw\n * calls into a single draw call.\n *\n * By default, this returns false (meaning no batching is allowed), but can be\n * overridden by child classes to provide more efficient batching.\n *\n * @param propsA\n * @param propsB\n * @returns\n */\n canBatchShaderProps(propsA, propsB) {\n return false;\n }\n bindRenderOp(renderOp, props) {\n this.bindBufferCollection(renderOp.buffers);\n if (renderOp.textures.length > 0) {\n this.bindTextures(renderOp.textures);\n }\n const { glw, parentHasRenderTexture, renderToTexture } = renderOp;\n // Skip if the parent and current operation both have render textures\n if (renderToTexture && parentHasRenderTexture) {\n return;\n }\n // Bind render texture framebuffer dimensions as resolution\n // if the parent has a render texture\n if (parentHasRenderTexture) {\n const { width, height } = renderOp.framebufferDimensions || {};\n // Force pixel ratio to 1.0 for render textures since they are always 1:1\n // the final render texture will be rendered to the screen with the correct pixel ratio\n this.setUniform('u_pixelRatio', 1.0);\n // Set resolution to the framebuffer dimensions\n this.setUniform('u_resolution', new Float32Array([width ?? 0, height ?? 0]));\n }\n else {\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\n this.setUniform('u_resolution', new Float32Array([glw.canvas.width, glw.canvas.height]));\n }\n if (props) {\n // Bind optional automatic uniforms\n // These are only bound if their keys are present in the props.\n if (hasOwn(props, '$dimensions')) {\n let dimensions = props.$dimensions;\n if (!dimensions) {\n dimensions = renderOp.dimensions;\n }\n this.setUniform('u_dimensions', [dimensions.width, dimensions.height]);\n }\n if (hasOwn(props, '$alpha')) {\n let alpha = props.$alpha;\n if (!alpha) {\n alpha = renderOp.alpha;\n }\n this.setUniform('u_alpha', alpha);\n }\n this.bindProps(props);\n }\n }\n setUniform(name, ...value) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-argument\n this.glw.setUniform(this.uniformTypes[name], this.uniformLocations[name], ...value);\n }\n bindBufferCollection(buffer) {\n if (this.boundBufferCollection === buffer) {\n return;\n }\n for (const attributeName in this.attributeLocations) {\n const resolvedBuffer = buffer.getBuffer(attributeName);\n const resolvedInfo = buffer.getAttributeInfo(attributeName);\n assertTruthy(resolvedBuffer, `Buffer for \"${attributeName}\" not found`);\n assertTruthy(resolvedInfo);\n this.bindBufferAttribute(this.attributeLocations[attributeName], resolvedBuffer, resolvedInfo);\n }\n this.boundBufferCollection = buffer;\n }\n bindProps(props) {\n // Implement in child class\n }\n bindTextures(textures) {\n // no defaults\n }\n attach() {\n this.glw.useProgram(this.program);\n this.glw.useProgram(this.program);\n if (this.glw.isWebGl2() && this.vao) {\n this.glw.bindVertexArray(this.vao);\n }\n }\n detach() {\n this.disableAttributes();\n }\n static shaderSources;\n}\n//# sourceMappingURL=WebGlCoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../common/EventEmitter.js';\n/**\n * Represents a source of texture data for a CoreContextTexture.\n *\n * @remarks\n * Texture sources are used to populate a CoreContextTexture when that texture\n * is loaded. Texture data retrieved by the CoreContextTexture by the\n * `getTextureData` method. It's the responsibility of the concerete `Texture`\n * subclass to implement this method appropriately.\n */\nexport class Texture extends EventEmitter {\n txManager;\n /**\n * The dimensions of the texture\n *\n * @remarks\n * Until the texture data is loaded for the first time the value will be\n * `null`.\n */\n dimensions = null;\n error = null;\n state = 'freed';\n renderableOwners = new Set();\n constructor(txManager) {\n super();\n this.txManager = txManager;\n }\n /**\n * Add/remove an owner to/from the Texture based on its renderability.\n *\n * @remarks\n * Any object can own a texture, be it a CoreNode or even the state object\n * from a Text Renderer.\n *\n * When the reference to the texture that an owner object holds is replaced\n * or cleared it must call this with `renderable=false` to release the owner\n * association.\n *\n * @param owner\n * @param renderable\n */\n setRenderableOwner(owner, renderable) {\n if (renderable) {\n this.renderableOwners.add(owner);\n }\n else {\n this.renderableOwners.delete(owner);\n }\n }\n /**\n * Returns true if the texture is assigned to any Nodes that are renderable.\n */\n get renderable() {\n return this.renderableOwners.size > 0;\n }\n /**\n * Set the state of the texture\n *\n * @remark\n * Intended for internal-use only but declared public so that it can be set\n * by it's associated {@link CoreContextTexture}\n *\n * @param state\n * @param args\n */\n setState(state, ...args) {\n if (this.state !== state) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.state = state;\n if (state === 'loaded') {\n const loadedArgs = args;\n this.dimensions = loadedArgs[0];\n }\n else if (state === 'failed') {\n const failedArgs = args;\n this.error = failedArgs[0];\n }\n this.emit(state, ...args);\n }\n }\n /**\n * Make a cache key for this texture.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide an\n * appropriate cache key for the texture type including the texture's\n * properties that uniquely identify a copy of the texture. If the texture\n * type does not support caching, then this method should return `false`.\n *\n * @param props\n * @returns\n * A cache key for this texture or `false` if the texture type does not\n * support caching.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n /**\n * Resolve the default values for the texture's properties.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide\n * default values for the texture's optional properties.\n *\n * @param props\n * @returns\n * The default values for the texture's properties.\n */\n static resolveDefaults(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props) {\n return {};\n }\n}\n//# sourceMappingURL=Texture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nexport class TrFontFace extends EventEmitter {\n fontFamily;\n descriptors;\n loaded = false;\n constructor(fontFamily, descriptors) {\n super();\n this.fontFamily = fontFamily;\n this.descriptors = {\n style: 'normal',\n weight: 'normal',\n stretch: 'normal',\n ...descriptors,\n };\n }\n /**\n * Convert a TrFontFaceDescriptors to a FontFaceDescriptors which differ slightly\n *\n * @param descriptors\n * @returns\n */\n static convertToCssFontFaceDescriptors(descriptors) {\n return {\n style: descriptors.style,\n weight: typeof descriptors.weight === 'number'\n ? `${descriptors.weight}`\n : descriptors.weight,\n stretch: descriptors.stretch,\n unicodeRange: descriptors.unicodeRange,\n variant: descriptors.variant,\n featureSettings: descriptors.featureSettings,\n display: descriptors.display,\n };\n }\n}\n//# sourceMappingURL=TrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreContextTexture {\n memManager;\n textureSource;\n constructor(memManager, textureSource) {\n this.memManager = memManager;\n this.textureSource = textureSource;\n }\n}\n//# sourceMappingURL=CoreContextTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreContextTexture } from './CoreContextTexture.js';\nexport class CoreRenderer {\n stage;\n constructor(stage) {\n this.stage = stage;\n }\n}\n//# sourceMappingURL=CoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreRenderOp {\n}\n//# sourceMappingURL=CoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreRenderOp } from '../CoreRenderOp.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nconst MAX_TEXTURES = 8; // TODO: get from gl\n/**\n * Can render multiple quads with multiple textures (up to vertex shader texture limit)\n *\n */\nexport class WebGlCoreRenderOp extends CoreRenderOp {\n glw;\n options;\n buffers;\n shader;\n shaderProps;\n alpha;\n clippingRect;\n dimensions;\n bufferIdx;\n zIndex;\n renderToTexture;\n parentHasRenderTexture;\n framebufferDimensions;\n length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex, renderToTexture, parentHasRenderTexture, framebufferDimensions) {\n super();\n this.glw = glw;\n this.options = options;\n this.buffers = buffers;\n this.shader = shader;\n this.shaderProps = shaderProps;\n this.alpha = alpha;\n this.clippingRect = clippingRect;\n this.dimensions = dimensions;\n this.bufferIdx = bufferIdx;\n this.zIndex = zIndex;\n this.renderToTexture = renderToTexture;\n this.parentHasRenderTexture = parentHasRenderTexture;\n this.framebufferDimensions = framebufferDimensions;\n this.maxTextures = shader.supportsIndexedTextures\n ? glw.getParameter(glw.MAX_VERTEX_TEXTURE_IMAGE_UNITS)\n : 1;\n }\n addTexture(texture) {\n const { textures, maxTextures } = this;\n const existingIdx = textures.findIndex((t) => t === texture);\n if (existingIdx !== -1) {\n return existingIdx;\n }\n const newIdx = textures.length;\n if (newIdx >= maxTextures) {\n return 0xffffffff;\n }\n this.textures.push(texture);\n return newIdx;\n }\n draw() {\n const { glw, shader, shaderProps, options } = this;\n const { shManager } = options;\n shManager.useShader(shader);\n shader.bindRenderOp(this, shaderProps);\n // TODO: Reduce calculations required\n const quadIdx = (this.bufferIdx / 24) * 6 * 2;\n // Clipping\n if (this.clippingRect.valid) {\n const { x, y, width, height } = this.clippingRect;\n const pixelRatio = options.pixelRatio;\n const canvasHeight = options.canvas.height;\n const clipX = Math.round(x * pixelRatio);\n const clipWidth = Math.round(width * pixelRatio);\n const clipHeight = Math.round(height * pixelRatio);\n const clipY = Math.round(canvasHeight - clipHeight - y * pixelRatio);\n glw.setScissorTest(true);\n glw.scissor(clipX, clipY, clipWidth, clipHeight);\n }\n else {\n glw.setScissorTest(false);\n }\n glw.drawElements(glw.TRIANGLES, 6 * this.numQuads, glw.UNSIGNED_SHORT, quadIdx);\n }\n}\n//# sourceMappingURL=WebGlCoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Get device specific webgl parameters\n * @param glw\n */\nexport function getWebGlParameters(glw) {\n const params = {\n MAX_RENDERBUFFER_SIZE: 0,\n MAX_TEXTURE_SIZE: 0,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n MAX_VIEWPORT_DIMS: 0,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0,\n MAX_TEXTURE_IMAGE_UNITS: 0,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0,\n MAX_VERTEX_ATTRIBS: 0,\n MAX_VARYING_VECTORS: 0,\n MAX_VERTEX_UNIFORM_VECTORS: 0,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0,\n };\n // Map over all parameters and get them\n const keys = Object.keys(params);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params[key] = glw.getParameter(glw[key]);\n });\n return params;\n}\n/**\n * Get device webgl extensions\n * @param glw\n */\nexport function getWebGlExtensions(glw) {\n const extensions = {\n ANGLE_instanced_arrays: null,\n WEBGL_compressed_texture_s3tc: null,\n WEBGL_compressed_texture_astc: null,\n WEBGL_compressed_texture_etc: null,\n WEBGL_compressed_texture_etc1: null,\n WEBGL_compressed_texture_pvrtc: null,\n WEBKIT_WEBGL_compressed_texture_pvrtc: null,\n WEBGL_compressed_texture_s3tc_srgb: null,\n OES_vertex_array_object: null,\n };\n // Map over all extensions and get them\n const keys = Object.keys(extensions);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n extensions[key] = glw.getExtension(key);\n });\n return extensions;\n}\n/**\n * Allocate big memory chunk that we\n * can re-use to draw quads\n *\n * @param glw\n * @param size\n */\nexport function createIndexBuffer(glw, size) {\n const maxQuads = ~~(size / 80);\n const indices = new Uint16Array(maxQuads * 6);\n for (let i = 0, j = 0; i < maxQuads; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 2;\n indices[i + 4] = j + 1;\n indices[i + 5] = j + 3;\n }\n const buffer = glw.createBuffer();\n glw.elementArrayBufferData(buffer, indices, glw.STATIC_DRAW);\n}\n/**\n * Checks if an object is of type HTMLImageElement.\n * This is used because we cant check for HTMLImageElement directly when the\n * renderer is running in a seperate web worker context.\n *\n * @param obj\n * @returns\n */\nexport function isHTMLImageElement(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n obj.constructor &&\n obj.constructor.name === 'HTMLImageElement');\n}\n//# sourceMappingURL=RendererUtils.js.map","/**\n * Memize options object.\n *\n * @typedef MemizeOptions\n *\n * @property {number} [maxSize] Maximum size of the cache.\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef MemizeCacheNode\n *\n * @property {?MemizeCacheNode|undefined} [prev] Previous node.\n * @property {?MemizeCacheNode|undefined} [next] Next node.\n * @property {Array<*>} args Function arguments for cache\n * entry.\n * @property {*} val Function result.\n */\n\n/**\n * Properties of the enhanced function for controlling cache.\n *\n * @typedef MemizeMemoizedFunction\n *\n * @property {()=>void} clear Clear the cache.\n */\n\n/**\n * Accepts a function to be memoized, and returns a new memoized function, with\n * optional options.\n *\n * @template {(...args: any[]) => any} F\n *\n * @param {F} fn Function to memoize.\n * @param {MemizeOptions} [options] Options object.\n *\n * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function.\n */\nfunction memize(fn, options) {\n\tvar size = 0;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar head;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar tail;\n\n\toptions = options || {};\n\n\tfunction memoized(/* ...args */) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs,\n\t\t\ti;\n\n\t\tsearchCache: while (node) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif (node.args.length !== arguments.length) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (node.args[i] !== arguments[i]) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== head) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif (node === tail) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\t/** @type {MemizeCacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {MemizeCacheNode} */ (head).prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply(null, args),\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (head) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif (size === /** @type {MemizeOptions} */ (options).maxSize) {\n\t\t\ttail = /** @type {MemizeCacheNode} */ (tail).prev;\n\t\t\t/** @type {MemizeCacheNode} */ (tail).next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function () {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\t// Ignore reason: There's not a clear solution to create an intersection of\n\t// the function with additional properties, where the goal is to retain the\n\t// function signature of the incoming argument and add control properties\n\t// on the return value.\n\n\t// @ts-ignore\n\treturn memoized;\n}\n\nexport { memize as default };\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Core Utility Functions\n *\n * @module\n */\nimport memo from 'memize';\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\nconst degree = Math.PI / 180;\nexport const setMatrixArrayType = (type) => {\n ARRAY_TYPE = type;\n};\nexport const toRadian = (a) => {\n return a * degree;\n};\nexport const equals = (a, b) => {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n};\nexport const rand = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\nexport const isPowerOfTwo = (value) => {\n return value && !(value & (value - 1));\n};\nconst getTimingBezier = (a, b, c, d) => {\n const xc = 3.0 * a;\n const xb = 3.0 * (c - a) - xc;\n const xa = 1.0 - xc - xb;\n const yc = 3.0 * b;\n const yb = 3.0 * (d - b) - yc;\n const ya = 1.0 - yc - yb;\n return function (time) {\n if (time >= 1.0) {\n return 1;\n }\n if (time <= 0) {\n return 0;\n }\n let t = 0.5, cbx, cbxd, dx;\n for (let it = 0; it < 20; it++) {\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n return t * (t * (t * ya + yb) + yc);\n }\n // Cubic bezier derivative.\n cbxd = t * (t * (3 * xa) + 2 * xb) + xc;\n if (cbxd > 1e-10 && cbxd < 1e-10) {\n // Problematic. Fall back to binary search method.\n break;\n }\n t += dx / cbxd;\n }\n // Fallback: binary search method. This is more reliable when there are near-0 slopes.\n let minT = 0;\n let maxT = 1;\n for (let it = 0; it < 20; it++) {\n t = 0.5 * (minT + maxT);\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n // Solution found!\n return t * (t * (t * ya + yb) + yc);\n }\n if (dx < 0) {\n maxT = t;\n }\n else {\n minT = t;\n }\n }\n };\n};\nexport const getTimingFunction = memo((str) => {\n switch (str) {\n case 'linear':\n return function (time) {\n return time;\n };\n case 'ease':\n return getTimingBezier(0.25, 0.1, 0.25, 1.0);\n case 'ease-in':\n return getTimingBezier(0.42, 0, 1.0, 1.0);\n case 'ease-out':\n return getTimingBezier(0, 0, 0.58, 1.0);\n case 'ease-in-out':\n return getTimingBezier(0.42, 0, 0.58, 1.0);\n case 'ease-in-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-out-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-in-out-sine':\n return getTimingBezier(0.37, 0, 0.63, 1);\n case 'ease-in-cubic':\n return getTimingBezier(0.32, 0, 0.67, 0);\n case 'ease-out-cubic':\n return getTimingBezier(0.33, 1, 0.68, 1);\n case 'ease-in-out-cubic':\n return getTimingBezier(0.65, 0, 0.35, 1);\n case 'ease-in-circ':\n return getTimingBezier(0.55, 0, 1, 0.45);\n case 'ease-out-circ':\n return getTimingBezier(0, 0.55, 0.45, 1);\n case 'ease-in-out-circ':\n return getTimingBezier(0.85, 0, 0.15, 1);\n case 'ease-in-back':\n return getTimingBezier(0.36, 0, 0.66, -0.56);\n case 'ease-out-back':\n return getTimingBezier(0.34, 1.56, 0.64, 1);\n case 'ease-in-out-back':\n return getTimingBezier(0.68, -0.6, 0.32, 1.6);\n case 'step-start':\n return function () {\n return 1;\n };\n case 'step-end':\n return function (time) {\n return time === 1 ? 1 : 0;\n };\n default:\n // eslint-disable-next-line no-case-declarations\n const s = 'cubic-bezier(';\n if (str && str.indexOf(s) === 0) {\n const parts = str\n .substr(s.length, str.length - s.length - 1)\n .split(',');\n if (parts.length !== 4) {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n const a = parseFloat(parts[0] || '0.42');\n const b = parseFloat(parts[1] || '0');\n const c = parseFloat(parts[2] || '1');\n const d = parseFloat(parts[3] || '1');\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\n console.warn(' Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n return getTimingBezier(a, b, c, d);\n }\n else {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n }\n});\nif (!Math.hypot)\n Math.hypot = (...args) => {\n let y = 0, i = args.length;\n while (i--) {\n y += args[i] * args[i];\n }\n return Math.sqrt(y);\n };\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { isPowerOfTwo } from '../../utils.js';\nimport { CoreContextTexture } from '../CoreContextTexture.js';\nimport { isHTMLImageElement } from './internal/RendererUtils.js';\nconst TRANSPARENT_TEXTURE_DATA = new Uint8Array([0, 0, 0, 0]);\n/**\n * A wrapper around a WebGLTexture that handles loading the texture data\n * from a Texture source and uploading it to the GPU as well as freeing\n * the uploaded texture.\n *\n * @remarks\n * When accessing the ctxTexture property, the texture will be loaded if\n * it hasn't been already. ctxTexture will always return a valid WebGLTexture\n * and trigger the loading/uploading of the texture's data if it hasn't been\n * loaded yet.\n */\nexport class WebGlCoreCtxTexture extends CoreContextTexture {\n glw;\n _nativeCtxTexture = null;\n _state = 'freed';\n _w = 0;\n _h = 0;\n constructor(glw, memManager, textureSource) {\n super(memManager, textureSource);\n this.glw = glw;\n }\n get ctxTexture() {\n if (this._state === 'freed') {\n this.load();\n }\n assertTruthy(this._nativeCtxTexture);\n return this._nativeCtxTexture;\n }\n get renderable() {\n return this.textureSource.renderable;\n }\n get w() {\n return this._w;\n }\n get h() {\n return this._h;\n }\n /**\n * Load the texture data from the Texture source and upload it to the GPU\n *\n * @remarks\n * This method is called automatically when accessing the ctxTexture property\n * if the texture hasn't been loaded yet. But it can also be called manually\n * to force the texture to be pre-loaded prior to accessing the ctxTexture\n * property.\n */\n load() {\n // If the texture is already loading or loaded, don't load it again.\n if (this._state === 'loading' || this._state === 'loaded') {\n return;\n }\n this._state = 'loading';\n this.textureSource.setState('loading');\n this._nativeCtxTexture = this.createNativeCtxTexture();\n this.onLoadRequest()\n .then(({ width, height }) => {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'loaded';\n this._w = width;\n this._h = height;\n // Update the texture source's width and height so that it can be used\n // for rendering.\n this.textureSource.setState('loaded', { width, height });\n })\n .catch((err) => {\n this._state = 'failed';\n this.textureSource.setState('failed', err);\n console.error(err);\n });\n }\n /**\n * Called when the texture data needs to be loaded and uploaded to a texture\n */\n async onLoadRequest() {\n const { glw, memManager } = this;\n // Set to a 1x1 transparent texture\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, null);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n const textureData = await this.textureSource?.getTextureData();\n // If the texture has been freed while loading, return early.\n if (!this._nativeCtxTexture) {\n assertTruthy(this._state === 'freed');\n return { width: 0, height: 0 };\n }\n let width = 0;\n let height = 0;\n assertTruthy(this._nativeCtxTexture);\n glw.activeTexture(0);\n // If textureData is null, the texture is empty (0, 0) and we don't need to\n // upload any data to the GPU.\n if (textureData.data instanceof ImageBitmap ||\n textureData.data instanceof ImageData ||\n // not using typeof HTMLImageElement due to web worker\n isHTMLImageElement(textureData.data)) {\n const data = textureData.data;\n width = data.width;\n height = data.height;\n glw.bindTexture(this._nativeCtxTexture);\n glw.pixelStorei(glw.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !!textureData.premultiplyAlpha);\n glw.texImage2D(0, glw.RGBA, glw.RGBA, glw.UNSIGNED_BYTE, data);\n memManager.setTextureMemUse(this, width * height * 4);\n // generate mipmaps for power-of-2 textures or in WebGL2RenderingContext\n if (glw.isWebGl2() || (isPowerOfTwo(width) && isPowerOfTwo(height))) {\n glw.generateMipmap();\n }\n }\n else if (textureData.data === null) {\n width = 0;\n height = 0;\n // Reset to a 1x1 transparent texture\n glw.bindTexture(this._nativeCtxTexture);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n }\n else if ('mipmaps' in textureData.data && textureData.data.mipmaps) {\n const { mipmaps, width = 0, height = 0, type, glInternalFormat, } = textureData.data;\n const view = type === 'ktx'\n ? new DataView(mipmaps[0] ?? new ArrayBuffer(0))\n : mipmaps[0];\n glw.bindTexture(this._nativeCtxTexture);\n glw.compressedTexImage2D(0, glInternalFormat, width, height, 0, view);\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n memManager.setTextureMemUse(this, view.byteLength);\n }\n else {\n console.error(`WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned`, textureData);\n }\n return {\n width,\n height,\n };\n }\n /**\n * Free the WebGLTexture from the GPU\n *\n * @returns\n */\n free() {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'freed';\n this.textureSource.setState('freed');\n this._w = 0;\n this._h = 0;\n if (!this._nativeCtxTexture) {\n return;\n }\n const { glw, memManager } = this;\n glw.deleteTexture(this._nativeCtxTexture);\n memManager.setTextureMemUse(this, 0);\n this._nativeCtxTexture = null;\n }\n /**\n * Create native context texture\n *\n * @remarks\n * When this method returns the returned texture will be bound to the GL context state.\n *\n * @param width\n * @param height\n * @returns\n */\n createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\n // On initial load request, create a 1x1 transparent texture to use until\n // the texture data is finally loaded.\n glw.activeTexture(0);\n glw.bindTexture(nativeTexture);\n // linear texture filtering\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n // texture wrapping method\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n return nativeTexture;\n }\n}\n//# sourceMappingURL=WebGlCoreCtxTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of only a 1x1 color pixel\n *\n * @remarks\n * The pixel color is set with the {@link ColorTextureProps.color} prop.\n *\n * This is the default texture used for a Node if it's\n * {@link INodeWritableProps.texture} prop is set to `null` (the default)\n *\n * Generally the 1x1 color pixel is stretched to whatever the set dimensions of\n * a Node are.\n */\nexport class ColorTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ColorTexture.resolveDefaults(props || {});\n }\n get color() {\n return this.props.color;\n }\n set color(color) {\n this.props.color = color;\n }\n async getTextureData() {\n const pixelData32 = new Uint32Array([this.color]);\n const pixelData8 = new Uint8ClampedArray(pixelData32.buffer);\n return {\n data: new ImageData(pixelData8, 1, 1),\n premultiplyAlpha: true,\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = ColorTexture.resolveDefaults(props);\n return `ColorTexture,${resolvedProps.color}`;\n }\n static resolveDefaults(props) {\n return {\n color: props.color || 0xffffffff,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ColorTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture, } from './Texture.js';\n/**\n * A Texture that is a sub-region of another Texture.\n *\n * @remarks\n * The parent texture can be a Sprite Sheet/Texture Atlas and set using the\n * {@link SubTextureProps.texture} prop. The sub-region relative to the parent\n * texture is defined with the {@link SubTextureProps.x},\n * {@link SubTextureProps.y}, {@link SubTextureProps.width}, and\n * {@link SubTextureProps.height} pixel values.\n */\nexport class SubTexture extends Texture {\n props;\n parentTexture;\n constructor(txManager, props) {\n super(txManager);\n this.parentTexture = this.txManager.loadTexture(props.texture.txType, props.texture.props, props.texture.options);\n this.props = SubTexture.resolveDefaults(props || {});\n // If parent texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n const parentTx = this.parentTexture;\n if (parentTx.state === 'loaded') {\n this.onParentTxLoaded(parentTx, parentTx.dimensions);\n }\n else if (parentTx.state === 'failed') {\n this.onParentTxFailed(parentTx, parentTx.error);\n }\n parentTx.on('loaded', this.onParentTxLoaded);\n parentTx.on('failed', this.onParentTxFailed);\n });\n }\n onParentTxLoaded = () => {\n // We ignore the parent's passed dimensions, and simply use the SubTexture's\n // configured dimensions (because that's all that matters here)\n this.setState('loaded', {\n width: this.props.width,\n height: this.props.height,\n });\n };\n onParentTxFailed = (target, error) => {\n this.setState('failed', error);\n };\n async getTextureData() {\n return {\n data: this.props,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {\n texture: props.texture,\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 0,\n height: props.height || 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=SubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxSubTexture extends WebGlCoreCtxTexture {\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n }\n async onLoadRequest() {\n const props = await this.textureSource.getTextureData();\n return {\n width: props.data?.width || 0,\n height: props.data?.height || 0,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxSubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a collection of WebGL Buffers along with their associated\n * vertex attribute formats.\n */\nexport class BufferCollection {\n config;\n constructor(config) {\n this.config = config;\n }\n /**\n * Get the WebGLBuffer associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getBuffer(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])?.buffer;\n }\n /**\n * Get the AttributeInfo associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getAttributeInfo(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])\n ?.attributes[attributeName];\n }\n}\n//# sourceMappingURL=BufferCollection.js.map","/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport { assertTruthy } from '../../utils.js';\nimport { isWebGl2 } from '../renderers/webgl/internal/WebGlUtils.js';\n/**\n * Optimized WebGL Context Wrapper\n *\n * @remarks\n * This class contains the subset of the WebGLRenderingContext & WebGL2RenderingContext\n * API that is used by the renderer. Select high volume WebGL methods include\n * caching optimizations to avoid making WebGL calls if the state is already set\n * to the desired value.\n *\n * While most methods contained are direct passthroughs to the WebGL context,\n * some methods combine multiple WebGL calls into one for convenience, modify\n * arguments to be more convenient, or are replaced by more specific methods.\n *\n * Not all methods are optimized. Only methods that are called frequently\n * and/or have a high cost are optimized.\n *\n * A subset of GLenum constants are also exposed as properties on this class\n * for convenience.\n */\nexport class WebGlContextWrapper {\n gl;\n //#region Cached WebGL State\n activeTextureUnit = 0;\n texture2dUnits;\n texture2dParams = new WeakMap();\n scissorEnabled;\n scissorX;\n scissorY;\n scissorWidth;\n scissorHeight;\n blendEnabled;\n blendSrcRgb;\n blendDstRgb;\n blendSrcAlpha;\n blendDstAlpha;\n boundArrayBuffer;\n boundElementArrayBuffer;\n curProgram;\n programUniforms = new WeakMap();\n //#endregion Cached WebGL State\n //#region Canvas\n canvas;\n //#endregion Canvas\n //#region WebGL Enums\n MAX_RENDERBUFFER_SIZE;\n MAX_TEXTURE_SIZE;\n MAX_VIEWPORT_DIMS;\n MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n MAX_TEXTURE_IMAGE_UNITS;\n MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n MAX_VERTEX_ATTRIBS;\n MAX_VARYING_VECTORS;\n MAX_VERTEX_UNIFORM_VECTORS;\n MAX_FRAGMENT_UNIFORM_VECTORS;\n TEXTURE_MAG_FILTER;\n TEXTURE_MIN_FILTER;\n TEXTURE_WRAP_S;\n TEXTURE_WRAP_T;\n LINEAR;\n CLAMP_TO_EDGE;\n RGBA;\n UNSIGNED_BYTE;\n UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n UNPACK_FLIP_Y_WEBGL;\n FLOAT;\n TRIANGLES;\n UNSIGNED_SHORT;\n ONE;\n ONE_MINUS_SRC_ALPHA;\n VERTEX_SHADER;\n FRAGMENT_SHADER;\n STATIC_DRAW;\n COMPILE_STATUS;\n LINK_STATUS;\n DYNAMIC_DRAW;\n COLOR_ATTACHMENT0;\n //#endregion WebGL Enums\n constructor(gl) {\n this.gl = gl;\n // The following code extracts the current state of the WebGL context\n // to our local JavaScript cached version of it. This is so we can\n // avoid making WebGL calls if we don't need to.\n // We could assume that the WebGL context is in a default state, but\n // in the future we may want to support restoring a broken WebGL context\n // and this will help with that.\n this.activeTextureUnit =\n gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0;\n const maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // save current texture units\n this.texture2dUnits = new Array(maxTextureUnits)\n .fill(undefined)\n .map((_, i) => {\n this.activeTexture(i);\n return gl.getParameter(gl.TEXTURE_BINDING_2D);\n });\n // restore active texture unit\n this.activeTexture(this.activeTextureUnit);\n this.scissorEnabled = gl.isEnabled(gl.SCISSOR_TEST);\n const scissorBox = gl.getParameter(gl.SCISSOR_BOX);\n this.scissorX = scissorBox[0];\n this.scissorY = scissorBox[1];\n this.scissorWidth = scissorBox[2];\n this.scissorHeight = scissorBox[3];\n this.blendEnabled = gl.isEnabled(gl.BLEND);\n this.blendSrcRgb = gl.getParameter(gl.BLEND_SRC_RGB);\n this.blendDstRgb = gl.getParameter(gl.BLEND_DST_RGB);\n this.blendSrcAlpha = gl.getParameter(gl.BLEND_SRC_ALPHA);\n this.blendDstAlpha = gl.getParameter(gl.BLEND_DST_ALPHA);\n this.boundArrayBuffer = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n this.boundElementArrayBuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);\n this.curProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n this.canvas = gl.canvas;\n // Extract GLenums\n this.MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE;\n this.MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE;\n this.MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS;\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n this.MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS;\n this.MAX_VARYING_VECTORS = gl.MAX_VARYING_VECTORS;\n this.MAX_VERTEX_UNIFORM_VECTORS = gl.MAX_VERTEX_UNIFORM_VECTORS;\n this.MAX_FRAGMENT_UNIFORM_VECTORS = gl.MAX_FRAGMENT_UNIFORM_VECTORS;\n this.TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T;\n this.LINEAR = gl.LINEAR;\n this.CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE;\n this.RGBA = gl.RGBA;\n this.UNSIGNED_BYTE = gl.UNSIGNED_BYTE;\n this.UNPACK_PREMULTIPLY_ALPHA_WEBGL = gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n this.UNPACK_FLIP_Y_WEBGL = gl.UNPACK_FLIP_Y_WEBGL;\n this.FLOAT = gl.FLOAT;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.ONE = gl.ONE;\n this.ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.VERTEX_SHADER = gl.VERTEX_SHADER;\n this.FRAGMENT_SHADER = gl.FRAGMENT_SHADER;\n this.STATIC_DRAW = gl.STATIC_DRAW;\n this.COMPILE_STATUS = gl.COMPILE_STATUS;\n this.LINK_STATUS = gl.LINK_STATUS;\n this.DYNAMIC_DRAW = gl.DYNAMIC_DRAW;\n this.COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0;\n }\n /**\n * Returns true if the WebGL context is WebGL2\n *\n * @returns\n */\n isWebGl2() {\n return isWebGl2(this.gl);\n }\n /**\n * ```\n * gl.activeTexture(textureUnit + gl.TEXTURE0);\n * ```\n *\n * @remarks\n * **WebGL Difference**: `textureUnit` is based from 0, not `gl.TEXTURE0`.\n *\n * @param textureUnit\n */\n activeTexture(textureUnit) {\n const { gl } = this;\n if (this.activeTextureUnit !== textureUnit) {\n gl.activeTexture(textureUnit + gl.TEXTURE0);\n this.activeTextureUnit = textureUnit;\n }\n }\n /**\n * ```\n * gl.bindTexture(gl.TEXTURE_2D, texture);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param texture\n */\n bindTexture(texture) {\n const { gl, activeTextureUnit, texture2dUnits } = this;\n if (texture2dUnits[activeTextureUnit] === texture) {\n return;\n }\n texture2dUnits[activeTextureUnit] = texture;\n gl.bindTexture(this.gl.TEXTURE_2D, texture);\n }\n _getActiveTexture() {\n const { activeTextureUnit, texture2dUnits } = this;\n return texture2dUnits[activeTextureUnit];\n }\n /**\n * ```\n * gl.texParameteri(gl.TEXTURE_2D, pname, param);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param pname\n * @param param\n * @returns\n */\n texParameteri(pname, param) {\n const { gl, texture2dParams } = this;\n const activeTexture = this._getActiveTexture();\n if (!activeTexture) {\n throw new Error('No active texture');\n }\n let textureParams = texture2dParams.get(activeTexture);\n if (!textureParams) {\n textureParams = {};\n texture2dParams.set(activeTexture, textureParams);\n }\n if (textureParams[pname] === param) {\n return;\n }\n textureParams[pname] = param;\n gl.texParameteri(gl.TEXTURE_2D, pname, param);\n }\n texImage2D(level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels) {\n const { gl } = this;\n if (format) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource);\n }\n }\n /**\n * ```\n * gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, data);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n compressedTexImage2D(level, internalformat, width, height, border, data) {\n const { gl } = this;\n gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalformat, width, height, border, data);\n }\n /**\n * ```\n * gl.pixelStorei(pname, param);\n * ```\n *\n * @param pname\n * @param param\n */\n pixelStorei(pname, param) {\n const { gl } = this;\n gl.pixelStorei(pname, param);\n }\n /**\n * ```\n * gl.generateMipmap(gl.TEXTURE_2D);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n generateMipmap() {\n const { gl } = this;\n gl.generateMipmap(gl.TEXTURE_2D);\n }\n /**\n * ```\n * gl.createTexture();\n * ```\n *\n * @returns\n */\n createTexture() {\n const { gl } = this;\n return gl.createTexture();\n }\n /**\n * ```\n * gl.deleteTexture(texture);\n * ```\n *\n * @param texture\n */\n deleteTexture(texture) {\n const { gl } = this;\n if (texture) {\n this.texture2dParams.delete(texture);\n }\n gl.deleteTexture(texture);\n }\n /**\n * ```\n * gl.viewport(x, y, width, height);\n * ```\n */\n viewport(x, y, width, height) {\n const { gl } = this;\n gl.viewport(x, y, width, height);\n }\n /**\n * ```\n * gl.clearColor(red, green, blue, alpha);\n * ```\n *\n * @param red\n * @param green\n * @param blue\n * @param alpha\n */\n clearColor(red, green, blue, alpha) {\n const { gl } = this;\n gl.clearColor(red, green, blue, alpha);\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.SCISSOR_TEST);\n * ```\n * @param enable\n */\n setScissorTest(enable) {\n const { gl, scissorEnabled } = this;\n if (enable === scissorEnabled) {\n return;\n }\n if (enable) {\n gl.enable(gl.SCISSOR_TEST);\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n this.scissorEnabled = enable;\n }\n /**\n * ```\n * gl.scissor(x, y, width, height);\n * ```\n *\n * @param x\n * @param y\n * @param width\n * @param height\n */\n scissor(x, y, width, height) {\n const { gl, scissorX, scissorY, scissorWidth, scissorHeight } = this;\n if (x !== scissorX ||\n y !== scissorY ||\n width !== scissorWidth ||\n height !== scissorHeight) {\n gl.scissor(x, y, width, height);\n this.scissorX = x;\n this.scissorY = y;\n this.scissorWidth = width;\n this.scissorHeight = height;\n }\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.BLEND);\n * ```\n *\n * @param blend\n * @returns\n */\n setBlend(blend) {\n const { gl, blendEnabled } = this;\n if (blend === blendEnabled) {\n return;\n }\n if (blend) {\n gl.enable(gl.BLEND);\n }\n else {\n gl.disable(gl.BLEND);\n }\n this.blendEnabled = blend;\n }\n /**\n * ```\n * gl.blendFunc(src, dst);\n * ```\n *\n * @param src\n * @param dst\n */\n blendFunc(src, dst) {\n const { gl, blendSrcRgb, blendDstRgb, blendSrcAlpha, blendDstAlpha } = this;\n if (src !== blendSrcRgb ||\n dst !== blendDstRgb ||\n src !== blendSrcAlpha ||\n dst !== blendDstAlpha) {\n gl.blendFunc(src, dst);\n this.blendSrcRgb = src;\n this.blendDstRgb = dst;\n this.blendSrcAlpha = src;\n this.blendDstAlpha = dst;\n }\n }\n /**\n * ```\n * gl.createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\n }\n /**\n * ```\n * gl.createFramebuffer();\n * ```\n * @returns\n */\n createFramebuffer() {\n const { gl } = this;\n return gl.createFramebuffer();\n }\n /**\n * ```\n * gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n * ```\n *\n * @param framebuffer\n */\n bindFramebuffer(framebuffer) {\n const { gl } = this;\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n }\n /**\n * ```\n * gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.FRAMEBUFFER` and textarget is always `gl.TEXTURE_2D`\n */\n framebufferTexture2D(attachment, texture, level) {\n const { gl } = this;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, texture, level);\n }\n /**\n * ```\n * gl.clear(gl.COLOR_BUFFER_BIT);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Clear mask is always `gl.COLOR_BUFFER_BIT`\n */\n clear() {\n const { gl } = this;\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n arrayBufferData(buffer, data, usage) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n * ```\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n elementArrayBufferData(buffer, data, usage) {\n const { gl, boundElementArrayBuffer } = this;\n if (boundElementArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n this.boundElementArrayBuffer = buffer;\n }\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.vertexAttribPointer` are combined into one function.\n *\n * @param buffer\n * @param index\n * @param size\n * @param type\n * @param normalized\n * @param stride\n * @param offset\n */\n vertexAttribPointer(buffer, index, size, type, normalized, stride, offset) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n }\n /**\n * ```\n * gl.useProgram(program);\n * ```\n *\n * @param program\n * @returns\n */\n useProgram(program) {\n const { gl, curProgram } = this;\n if (curProgram === program) {\n return;\n }\n gl.useProgram(program);\n this.curProgram = program;\n }\n setUniform(type, location, ...args) {\n const { gl, programUniforms } = this;\n let uniforms = programUniforms.get(this.curProgram);\n if (!uniforms) {\n uniforms = new Map();\n programUniforms.set(this.curProgram, uniforms);\n }\n const uniformArgs = uniforms.get(location);\n if (!uniformArgs || !compareArrays(uniformArgs, args)) {\n uniforms.set(location, args);\n gl[type](location, ...args);\n }\n }\n /**\n * ```\n * gl.getParameter(pname);\n * ```\n *\n * @param pname\n * @returns\n */\n getParameter(pname) {\n const { gl } = this;\n return gl.getParameter(pname);\n }\n /**\n * ```\n * gl.drawElements(mode, count, type, offset);\n * ```\n *\n * @param mode\n * @param count\n * @param type\n * @param offset\n */\n drawElements(mode, count, type, offset) {\n const { gl } = this;\n gl.drawElements(mode, count, type, offset);\n }\n /**\n * ```\n * gl.drawArrays(mode, first, count);\n * ```\n *\n * @param name\n * @returns\n */\n getExtension(name) {\n const { gl } = this;\n return gl.getExtension(name);\n }\n /**\n * ```\n * gl.createVertexArray();\n * ```\n *\n * @returns\n */\n createVertexArray() {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n return gl.createVertexArray();\n }\n /**\n * ```\n * gl.bindVertexArray(vertexArray);\n * ```\n *\n * @param vertexArray\n */\n bindVertexArray(vertexArray) {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n gl.bindVertexArray(vertexArray);\n }\n /**\n * ```\n * gl.getAttribLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getAttribLocation(program, name) {\n const { gl } = this;\n return gl.getAttribLocation(program, name);\n }\n /**\n * ```\n * gl.getUniformLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getUniformLocation(program, name) {\n const { gl } = this;\n return gl.getUniformLocation(program, name);\n }\n /**\n * ```\n * gl.enableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n enableVertexAttribArray(index) {\n const { gl } = this;\n gl.enableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.disableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n disableVertexAttribArray(index) {\n const { gl } = this;\n gl.disableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.createShader(type);\n * ```\n *\n * @param type\n * @returns\n */\n createShader(type) {\n const { gl } = this;\n return gl.createShader(type);\n }\n /**\n * ```\n * gl.compileShader(shader);\n * ```\n *\n * @param shader\n * @returns\n */\n compileShader(shader) {\n const { gl } = this;\n gl.compileShader(shader);\n }\n /**\n * ```\n * gl.attachShader(program, shader);\n * ```\n *\n * @param program\n * @param shader\n */\n attachShader(program, shader) {\n const { gl } = this;\n gl.attachShader(program, shader);\n }\n /**\n * ```\n * gl.linkProgram(program);\n * ```\n *\n * @param program\n */\n linkProgram(program) {\n const { gl } = this;\n gl.linkProgram(program);\n }\n /**\n * ```\n * gl.deleteProgram(shader);\n * ```\n *\n * @param shader\n */\n deleteProgram(shader) {\n const { gl } = this;\n gl.deleteProgram(shader);\n }\n /**\n * ```\n * gl.getShaderParameter(shader, pname);\n * ```\n *\n * @param shader\n * @param pname\n */\n getShaderParameter(shader, pname) {\n const { gl } = this;\n return gl.getShaderParameter(shader, pname);\n }\n /**\n * ```\n * gl.getShaderInfoLog(shader);\n * ```\n *\n * @param shader\n */\n getShaderInfoLog(shader) {\n const { gl } = this;\n return gl.getShaderInfoLog(shader);\n }\n /**\n * ```\n * gl.createProgram();\n * ```\n *\n * @returns\n */\n createProgram() {\n const { gl } = this;\n return gl.createProgram();\n }\n /**\n * ```\n * gl.getProgramParameter(program, pname);\n * ```\n *\n * @param program\n * @param pname\n * @returns\n */\n getProgramParameter(program, pname) {\n const { gl } = this;\n return gl.getProgramParameter(program, pname);\n }\n /**\n * ```\n * gl.getProgramInfoLog(program);\n * ```\n *\n * @param program\n * @returns\n */\n getProgramInfoLog(program) {\n const { gl } = this;\n return gl.getProgramInfoLog(program);\n }\n /**\n * ```\n * gl.shaderSource(shader, source);\n * ```\n *\n * @param shader\n * @param source\n */\n shaderSource(shader, source) {\n const { gl } = this;\n gl.shaderSource(shader, source);\n }\n /**\n * ```\n * gl.deleteShader(shader);\n * ```\n *\n * @param shader\n */\n deleteShader(shader) {\n const { gl } = this;\n gl.deleteShader(shader);\n }\n}\n/**\n * Compare two arrays for equality.\n *\n * @remarks\n * This function will not try to compare nested arrays or Float32Arrays and\n * instead will always return false when they are encountered.\n *\n * @param a\n * @param b\n * @returns\n */\nexport function compareArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((v, i) => {\n // Don't bother to compare nested arrays or Float32Arrays\n if (Array.isArray(v) || v instanceof Float32Array) {\n return false;\n }\n else {\n return v === b[i];\n }\n });\n}\n//# sourceMappingURL=WebGlContextWrapper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generic WebGL Utility Functions\n *\n * @remarks\n * Nothing here should be coupled to Renderer logic / types.\n *\n * @param gl\n * @returns\n */\nexport function isWebGl2(gl) {\n return (self.WebGL2RenderingContext && gl instanceof self.WebGL2RenderingContext);\n}\n//# sourceMappingURL=WebGlUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nexport class RenderTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = RenderTexture.resolveDefaults(props || {});\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n }\n async getTextureData() {\n return {\n data: null,\n premultiplyAlpha: null,\n };\n }\n static resolveDefaults(props) {\n return {\n width: props.width || 256,\n height: props.height || 256,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=RenderTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2024 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxRenderTexture extends WebGlCoreCtxTexture {\n framebuffer;\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n // Create Framebuffer object\n const framebuffer = glw.createFramebuffer();\n assertTruthy(framebuffer, 'Unable to create framebuffer');\n this.framebuffer = framebuffer;\n }\n async onLoadRequest() {\n const { glw, memManager } = this;\n const nativeTexture = (this._nativeCtxTexture =\n this.createNativeCtxTexture());\n const { width, height } = this.textureSource;\n // Set the dimensions of the render texture\n glw.texImage2D(0, glw.RGBA, width, height, 0, glw.RGBA, glw.UNSIGNED_BYTE, null);\n // Update the texture memory manager\n memManager.setTextureMemUse(this, width * height * 4);\n // Bind the framebuffer\n glw.bindFramebuffer(this.framebuffer);\n // Attach the texture to the framebuffer\n glw.framebufferTexture2D(glw.COLOR_ATTACHMENT0, nativeTexture, 0);\n // Unbind the framebuffer\n glw.bindFramebuffer(null);\n return {\n width,\n height,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxRenderTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, createWebGLContext, hasOwn, mergeColorAlphaPremultiplied, } from '../../../utils.js';\nimport { CoreRenderer } from '../CoreRenderer.js';\nimport { WebGlCoreRenderOp } from './WebGlCoreRenderOp.js';\nimport { createIndexBuffer, getWebGlParameters, getWebGlExtensions, } from './internal/RendererUtils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nimport { Texture } from '../../textures/Texture.js';\nimport { ColorTexture } from '../../textures/ColorTexture.js';\nimport { SubTexture } from '../../textures/SubTexture.js';\nimport { WebGlCoreCtxSubTexture } from './WebGlCoreCtxSubTexture.js';\nimport { CoreShaderManager } from '../../CoreShaderManager.js';\nimport { BufferCollection } from './internal/BufferCollection.js';\nimport { compareRect, getNormalizedRgbaComponents, } from '../../lib/utils.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nimport { RoundedRectangle } from './shaders/RoundedRectangle.js';\nimport { ContextSpy } from '../../lib/ContextSpy.js';\nimport { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';\nimport { RenderTexture } from '../../textures/RenderTexture.js';\nimport { WebGlCoreCtxRenderTexture } from './WebGlCoreCtxRenderTexture.js';\nconst WORDS_PER_QUAD = 24;\nconst BYTES_PER_QUAD = WORDS_PER_QUAD * 4;\nexport class WebGlCoreRenderer extends CoreRenderer {\n //// WebGL Native Context and Data\n glw;\n system;\n //// Core Managers\n txManager;\n txMemManager;\n shManager;\n //// Options\n options;\n //// Persistent data\n quadBuffer = new ArrayBuffer(1024 * 1024 * 4);\n fQuadBuffer = new Float32Array(this.quadBuffer);\n uiQuadBuffer = new Uint32Array(this.quadBuffer);\n renderOps = [];\n //// Render Op / Buffer Filling State\n curBufferIdx = 0;\n curRenderOp = null;\n rttNodes = [];\n activeRttNode = null;\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\n /**\n * Whether the renderer is currently rendering to a texture.\n */\n renderToTextureActive = false;\n constructor(options) {\n super(options.stage);\n const { canvas, clearColor, bufferMemory } = options;\n this.options = options;\n this.txManager = options.txManager;\n this.txMemManager = options.txMemManager;\n this.shManager = options.shManager;\n this.defaultTexture = new ColorTexture(this.txManager);\n // When the default texture is loaded, request a render in case the\n // RAF is paused. Fixes: https://github.com/lightning-js/renderer/issues/123\n this.defaultTexture.once('loaded', () => {\n this.stage.requestRender();\n });\n const gl = createWebGLContext(canvas, options.contextSpy);\n const glw = (this.glw = new WebGlContextWrapper(gl));\n const color = getNormalizedRgbaComponents(clearColor);\n glw.viewport(0, 0, canvas.width, canvas.height);\n glw.clearColor(color[0], color[1], color[2], color[3]);\n glw.setBlend(true);\n glw.blendFunc(glw.ONE, glw.ONE_MINUS_SRC_ALPHA);\n createIndexBuffer(glw, bufferMemory);\n this.system = {\n parameters: getWebGlParameters(this.glw),\n extensions: getWebGlExtensions(this.glw),\n };\n this.shManager.renderer = this;\n this.defaultShader = this.shManager.loadShader('DefaultShader').shader;\n const quadBuffer = glw.createBuffer();\n assertTruthy(quadBuffer);\n const stride = 6 * Float32Array.BYTES_PER_ELEMENT;\n this.quadBufferCollection = new BufferCollection([\n {\n buffer: quadBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_color: {\n name: 'a_color',\n size: 4,\n type: glw.UNSIGNED_BYTE,\n normalized: true,\n stride,\n offset: 4 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_textureIndex: {\n name: 'a_textureIndex',\n size: 1,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 5 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n }\n reset() {\n const { glw } = this;\n this.curBufferIdx = 0;\n this.curRenderOp = null;\n this.renderOps.length = 0;\n glw.setScissorTest(false);\n glw.clear();\n }\n getShaderManager() {\n return this.shManager;\n }\n createCtxTexture(textureSource) {\n if (textureSource instanceof SubTexture) {\n return new WebGlCoreCtxSubTexture(this.glw, this.txMemManager, textureSource);\n }\n else if (textureSource instanceof RenderTexture) {\n return new WebGlCoreCtxRenderTexture(this.glw, this.txMemManager, textureSource);\n }\n return new WebGlCoreCtxTexture(this.glw, this.txMemManager, textureSource);\n }\n /**\n * This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.\n *\n * It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix.\n * The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided.\n * It then checks if a new render operation is needed, based on the current shader and clipping rectangle.\n * If a new render operation is needed, it creates one and updates the current render operation.\n * The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.\n *\n * Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer.\n * The function updates the length and number of quads in the current render operation, and updates the current buffer index.\n */\n addQuad(params) {\n const { fQuadBuffer, uiQuadBuffer } = this;\n const { width, height, colorTl, colorTr, colorBl, colorBr, textureOptions, shader, shaderProps, alpha, clippingRect, tx, ty, ta, tb, tc, td, rtt: renderToTexture, parentHasRenderTexture, framebufferDimensions, } = params;\n let { texture } = params;\n /**\n * If the shader props contain any automatic properties, update it with the\n * current dimensions that will be used to render the quad.\n */\n if (shaderProps && hasOwn(shaderProps, '$dimensions')) {\n const dimensions = shaderProps.$dimensions;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n dimensions.width = width;\n dimensions.height = height;\n }\n texture = texture ?? this.defaultTexture;\n assertTruthy(texture instanceof Texture, 'Invalid texture type');\n let { curBufferIdx: bufferIdx, curRenderOp } = this;\n const targetDims = {\n width,\n height,\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (!this.reuseRenderOp(params)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx, renderToTexture, parentHasRenderTexture, framebufferDimensions);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n }\n const flipX = textureOptions?.flipX ?? false;\n const flipY = textureOptions?.flipY ?? false;\n let texCoordX1 = 0;\n let texCoordY1 = 0;\n let texCoordX2 = 1;\n let texCoordY2 = 1;\n if (texture instanceof SubTexture) {\n const { x: tx, y: ty, width: tw, height: th } = texture.props;\n const { width: parentW = 0, height: parentH = 0 } = texture.parentTexture\n .dimensions || { width: 0, height: 0 };\n texCoordX1 = tx / parentW;\n texCoordX2 = texCoordX1 + tw / parentW;\n texCoordY1 = ty / parentH;\n texCoordY2 = texCoordY1 + th / parentH;\n texture = texture.parentTexture;\n }\n // Flip texture coordinates if dictated by texture options\n if (flipX) {\n [texCoordX1, texCoordX2] = [texCoordX2, texCoordX1];\n }\n if (flipY) {\n [texCoordY1, texCoordY2] = [texCoordY2, texCoordY1];\n }\n const { txManager } = this.stage;\n const ctxTexture = txManager.getCtxTexture(texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxTexture);\n const textureIdx = this.addTexture(ctxTexture, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n // render quad advanced\n if (tb !== 0 || tc !== 0) {\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta;\n fQuadBuffer[bufferIdx++] = ty + width * tc;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx + height * tb;\n fQuadBuffer[bufferIdx++] = ty + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta + height * tb;\n fQuadBuffer[bufferIdx++] = ty + width * tc + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n else {\n // Calculate the right corner of the quad\n // multiplied by the scale\n const rightCornerX = tx + width * ta;\n const rightCornerY = ty + height * td;\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = ty;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n // Update the length of the current render op\n curRenderOp.length += WORDS_PER_QUAD;\n curRenderOp.numQuads++;\n this.curBufferIdx = bufferIdx;\n }\n /**\n * Replace the existing RenderOp with a new one that uses the specified Shader\n * and starts at the specified buffer index.\n *\n * @param shader\n * @param bufferIdx\n */\n newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx, renderToTexture, parentHasRenderTexture, framebufferDimensions) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0, // Z-Index is only used for explictly added Render Ops\n renderToTexture, parentHasRenderTexture, framebufferDimensions);\n this.curRenderOp = curRenderOp;\n this.renderOps.push(curRenderOp);\n }\n /**\n * Add a texture to the current RenderOp. If the texture cannot be added to the\n * current RenderOp, a new RenderOp will be created and the texture will be added\n * to that one.\n *\n * If the texture cannot be added to the new RenderOp, an error will be thrown.\n *\n * @param texture\n * @param bufferIdx\n * @param recursive\n * @returns Assigned Texture Index of the texture in the render op\n */\n addTexture(texture, bufferIdx, recursive) {\n const { curRenderOp } = this;\n assertTruthy(curRenderOp);\n const textureIdx = curRenderOp.addTexture(texture);\n // TODO: Refactor to be more DRY\n if (textureIdx === 0xffffffff) {\n if (recursive) {\n throw new Error('Unable to add texture to render op');\n }\n const { shader, shaderProps, dimensions, clippingRect, alpha } = curRenderOp;\n this.newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx);\n return this.addTexture(texture, bufferIdx, true);\n }\n return textureIdx;\n }\n /**\n * Test if the current Render operation can be reused for the specified parameters.\n * @param params\n * @returns\n */\n reuseRenderOp(params) {\n const { shader, shaderProps, parentHasRenderTexture, rtt, clippingRect } = params;\n const targetShader = shader || this.defaultShader;\n // Switching shader program will require a new render operation\n if (this.curRenderOp?.shader !== targetShader) {\n return false;\n }\n // Switching clipping rect will require a new render operation\n if (!compareRect(this.curRenderOp.clippingRect, clippingRect)) {\n return false;\n }\n // Force new render operation if rendering to texture\n // @todo: This needs to be improved, render operations could also be reused\n // for rendering to texture\n if (parentHasRenderTexture || rtt) {\n return false;\n }\n // Check if the shader can batch the shader properties\n if (this.curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !this.curRenderOp.shader.canBatchShaderProps(this.curRenderOp.shaderProps, shaderProps))) {\n return false;\n }\n // Render operation can be reused\n return true;\n }\n /**\n * add RenderOp to the render pipeline\n */\n addRenderOp(renderable) {\n this.renderOps.push(renderable);\n this.curRenderOp = null;\n }\n /**\n * Render the current set of RenderOps to render to the specified surface.\n *\n * TODO: 'screen' is the only supported surface at the moment.\n *\n * @param surface\n */\n render(surface = 'screen') {\n const { glw, quadBuffer } = this;\n const arr = new Float32Array(quadBuffer, 0, this.curBufferIdx);\n const buffer = this.quadBufferCollection.getBuffer('a_position') ?? null;\n glw.arrayBufferData(buffer, arr, glw.STATIC_DRAW);\n const doLog = false; // idx++ % 100 === 0;\n if (doLog) {\n console.log('renderOps', this.renderOps.length);\n }\n this.renderOps.forEach((renderOp, i) => {\n if (doLog) {\n console.log('Quads per operation', renderOp.numQuads);\n }\n renderOp.draw();\n });\n }\n renderToTexture(node) {\n for (let i = 0; i < this.rttNodes.length; i++) {\n if (this.rttNodes[i] === node) {\n return;\n }\n }\n // @todo: Better bottom up rendering order\n this.rttNodes.unshift(node);\n }\n renderRTTNodes() {\n const { glw } = this;\n const { txManager } = this.stage;\n // Render all associated RTT nodes to their textures\n for (let i = 0; i < this.rttNodes.length; i++) {\n const node = this.rttNodes[i];\n // Skip nodes that don't have RTT updates\n if (!node || !node.hasRTTupdates) {\n continue;\n }\n // Set the active RTT node to the current node\n // So we can prevent rendering children of nested RTT nodes\n this.activeRttNode = node;\n assertTruthy(node.texture, 'RTT node missing texture');\n const ctxTexture = txManager.getCtxTexture(node.texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxRenderTexture);\n this.renderToTextureActive = true;\n // Bind the the texture's framebuffer\n glw.bindFramebuffer(ctxTexture.framebuffer);\n glw.viewport(0, 0, ctxTexture.w, ctxTexture.h);\n glw.clear();\n // Render all associated quads to the texture\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n child.update(this.stage.deltaTime, {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n });\n this.stage.addQuads(child);\n child.hasRTTupdates = false;\n }\n // Render all associated quads to the texture\n this.render();\n // Reset render operations\n this.renderOps.length = 0;\n node.hasRTTupdates = false;\n }\n // Bind the default framebuffer\n glw.bindFramebuffer(null);\n glw.viewport(0, 0, this.glw.canvas.width, this.glw.canvas.height);\n this.renderToTextureActive = false;\n }\n}\n//# sourceMappingURL=WebGlCoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const SpecialCodepoints = {\n LINE_FEED: 0x0a,\n CARRIAGE_RETURN: 0x0d,\n SPACE: 0x20,\n TAB: 0x09,\n ZERO_WIDTH_SPACE: 0x200b,\n ZERO_WIDTH_NON_JOINER: 0x200c,\n ZERO_WIDTH_JOINER: 0x200d,\n LEFT_TO_RIGHT_MARK: 0x200e,\n RIGHT_TO_LEFT_MARK: 0x200f,\n LEFT_TO_RIGHT_EMBEDDING: 0x202a,\n RIGHT_TO_LEFT_EMBEDDING: 0x202b,\n POP_DIRECTIONAL_FORMATTING: 0x202c,\n LEFT_TO_RIGHT_OVERRIDE: 0x202d,\n RIGHT_TO_LEFT_OVERRIDE: 0x202e,\n LINE_SEPARATOR: 0x2028,\n PARAGRAPH_SEPARATOR: 0x2029,\n OBJECT_REPLACEMENT_CHARACTER: 0xfffc,\n REPLACEMENT_CHARACTER: 0xfffd,\n ZERO_WIDTH_NO_BREAK_SPACE: 0xfeff,\n LEFT_TO_RIGHT_ISOLATE: 0x2066,\n RIGHT_TO_LEFT_ISOLATE: 0x2067,\n FIRST_STRONG_ISOLATE: 0x2068,\n POP_DIRECTIONAL_ISOLATE: 0x2069,\n INHIBIT_SYMMETRIC_SWAPPING: 0x206a,\n ACTIVATE_SYMMETRIC_SWAPPING: 0x206b,\n INHIBIT_ARABIC_FORM_SHAPING: 0x206c,\n ACTIVATE_ARABIC_FORM_SHAPING: 0x206d,\n NATIONAL_DIGIT_SHAPES: 0x206e,\n NOMINAL_DIGIT_SHAPES: 0x206f,\n LEFT_TO_RIGHT_BOUNDARY: 0x200e,\n RIGHT_TO_LEFT_BOUNDARY: 0x200f,\n};\n//# sourceMappingURL=SpecialCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FontShaper {\n}\n//# sourceMappingURL=FontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SpecialCodepoints } from '../../../renderers/SdfTextRenderer/internal/SpecialCodepoints.js';\nimport { FontShaper, } from './FontShaper.js';\nexport class SdfFontShaper extends FontShaper {\n data;\n glyphMap;\n kernings;\n constructor(data, glyphMap) {\n super();\n this.data = data;\n this.glyphMap = glyphMap;\n const kernings = (this.kernings = {});\n data.kernings.forEach((kerning) => {\n const second = kerning.second;\n const firsts = (kernings[second] = kernings[second] || {});\n firsts[kerning.first] = kerning.amount;\n });\n this.kernings = kernings;\n }\n *shapeText(props, codepoints) {\n let codepointResult;\n let lastGlyphId = undefined;\n while ((codepointResult = codepoints.peek()) && !codepointResult.done) {\n const codepoint = codepointResult.value;\n const glyph = this.glyphMap.get(codepoint);\n codepoints.next();\n if (glyph !== undefined) {\n // We found a glyph for this codepoint\n // Yield the mapped glyph info\n /**\n * Kerning includes any possible additional letter spacing\n */\n const kerning = lastGlyphId !== undefined\n ? (this.kernings[glyph.id]?.[lastGlyphId] || 0) +\n props.letterSpacing\n : 0;\n lastGlyphId = glyph.id;\n yield {\n mapped: true,\n glyphId: glyph.id,\n codepoint,\n cluster: codepoints.lastIndex,\n xAdvance: glyph.xadvance + kerning,\n yAdvance: 0,\n xOffset: glyph.xoffset + kerning,\n yOffset: glyph.yoffset,\n xBearing: 0,\n yBearing: 0,\n width: glyph.width,\n height: glyph.height,\n };\n }\n else {\n // We didn't find a glyph for this codepoint\n // Yield the unmapped codepoint info\n // If this codepoint is a linebreak, we should reset the last glyph id\n // so that the next glyph will not be kerned with the last glyph of the\n // previous line.\n if (codepoint === SpecialCodepoints.LINE_FEED) {\n lastGlyphId = undefined;\n }\n yield {\n mapped: false,\n codepoint,\n cluster: codepoints.lastIndex,\n };\n }\n }\n }\n}\n//# sourceMappingURL=SdfFontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// import type { Renderer } from '../../../Renderer';\nimport { assertTruthy } from '../../../../utils.js';\nimport { WebGlCoreRenderer } from '../../../renderers/webgl/WebGlCoreRenderer.js';\nimport { ImageTexture } from '../../../textures/ImageTexture.js';\nimport { TrFontFace } from '../TrFontFace.js';\nimport { SdfFontShaper } from './internal/SdfFontShaper.js';\nexport class SdfTrFontFace extends TrFontFace {\n type;\n texture;\n /**\n * Height of the tallest character in the font including the whitespace above it\n */\n maxCharHeight = 0;\n data;\n shaper;\n glyphMap = new Map();\n constructor(fontFamily, descriptors, type, stage, atlasUrl, atlasDataUrl) {\n super(fontFamily, descriptors);\n this.type = type;\n const renderer = stage.renderer;\n assertTruthy(renderer instanceof WebGlCoreRenderer, 'SDF Font Faces can only be used with the WebGL Renderer');\n this.texture = stage.txManager.loadTexture('ImageTexture', {\n src: atlasUrl,\n // IMPORTANT: The SDF shader requires the alpha channel to NOT be\n // premultiplied on the atlas texture. If it is premultiplied, the\n // rendering of SDF glyphs (especially single-channel SDF fonts) will\n // be very jagged.\n premultiplyAlpha: false,\n }, {\n preload: true,\n });\n this.texture.on('loaded', () => {\n this.checkLoaded();\n });\n // Set this.data to the fetched data from dataUrl\n fetch(atlasDataUrl)\n .then(async (response) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.data = await response.json();\n // Add all the glyphs to the glyph map\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let maxCharHeight = 0;\n this.data.chars.forEach((glyph) => {\n this.glyphMap.set(glyph.id, glyph);\n const charHeight = glyph.yoffset + glyph.height;\n if (charHeight > maxCharHeight) {\n maxCharHeight = charHeight;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.maxCharHeight = maxCharHeight;\n // We know `data` is defined here, because we just set it\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shaper = new SdfFontShaper(this.data, this.glyphMap);\n this.checkLoaded();\n })\n .catch(console.error);\n }\n getAtlasEntry(glyphId) {\n const glyph = this.glyphMap.get(glyphId);\n if (glyph === undefined) {\n throw new Error(`Glyph ${glyphId} not found in font ${this.fontFamily}`);\n }\n return {\n x: glyph.x,\n y: glyph.y,\n width: glyph.width,\n height: glyph.height,\n };\n }\n checkLoaded() {\n if (this.loaded)\n return;\n if (this.texture.state === 'loaded' && this.data) {\n this.loaded = true;\n this.emit('loaded');\n }\n }\n}\n//# sourceMappingURL=SdfTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Base class for Core extensions.\n *\n * @remarks\n * Core extensions are used to extend the Core Renderer with custom code such as\n * custom fonts, custom shaders, custom textures, custom animation functions,\n * and more.\n */\nexport class CoreExtension {\n}\n//# sourceMappingURL=CoreExtension.js.map"],"names":["assertTruthy","condition","message","Error","hasOwn","obj","prop","Object","prototype","hasOwnProperty","call","isProductionEnvironment","BASE_URL","MODE","DEV","PROD","SSR","LEGACY","a","b","out","intersection","createBound","Math","max","x1","y1","min","x2","y2","x","y","width","height","rgba","color","r","floor","g","toFixed","bound","alpha","flipEndianess","newAlpha","trunc","rgba1","rgba2","p","r1","g1","b1","a1","r2","g2","b2","a2","round","bound1","bound2","EventEmitter","constructor","_defineProperty","this","on","event","listener","listeners","eventListeners","push","off","index","indexOf","splice","once","onceListener","target","data","emit","forEach","removeAllListeners","exports","CoreShader","makeCacheKey","props","resolveDefaults","createShader","glw","type","source","shader","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","log","getShaderInfoLog","deleteShader","WebGlCoreShader","options","super","renderer","supportsIndexedTextures","webGl2","isWebGl2","requiredExtensions","webgl2Extensions","webgl1Extensions","glVersion","extensionName","getExtension","name","shaderSources","fragment","vertex","textureUnits","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","vertexSource","Function","fragmentSource","vertexShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","program","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","deleteProgram","vao","createVertexArray","bindVertexArray","attributeLocations","attributeBuffers","attributeNames","attributes","attributeName","location","getAttribLocation","buffer","createBuffer","uniformLocations","uniformTypes","uniforms","uniform","getUniformLocation","warn","bindBufferAttribute","attribute","enableVertexAttribArray","vertexAttribPointer","size","normalized","stride","offset","disableAttribute","disableVertexAttribArray","disableAttributes","loc","boundBufferCollection","canBatchShaderProps","propsA","propsB","bindRenderOp","renderOp","bindBufferCollection","buffers","textures","length","bindTextures","parentHasRenderTexture","renderToTexture","_ref","framebufferDimensions","setUniform","Float32Array","pixelRatio","canvas","dimensions","$dimensions","$alpha","bindProps","value","resolvedBuffer","getBuffer","resolvedInfo","getAttributeInfo","attach","useProgram","detach","Texture","txManager","Set","setRenderableOwner","owner","renderable","renderableOwners","add","delete","setState","state","args","loadedArgs","failedArgs","error","getNormalizedRgbaComponents","TrFontFace","fontFamily","descriptors","_objectSpread","style","weight","stretch","convertToCssFontFaceDescriptors","unicodeRange","variant","featureSettings","display","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","shaderProps","clippingRect","bufferIdx","zIndex","maxTextures","getParameter","addTexture","texture","existingIdx","findIndex","t","newIdx","draw","shManager","useShader","quadIdx","valid","_this$clippingRect","canvasHeight","clipX","clipWidth","clipHeight","clipY","setScissorTest","scissor","drawElements","TRIANGLES","numQuads","UNSIGNED_SHORT","getWebGlParameters","params","MAX_RENDERBUFFER_SIZE","MAX_TEXTURE_SIZE","MAX_VIEWPORT_DIMS","MAX_TEXTURE_IMAGE_UNITS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_VERTEX_ATTRIBS","MAX_VARYING_VECTORS","MAX_VERTEX_UNIFORM_VECTORS","MAX_FRAGMENT_UNIFORM_VECTORS","keys","key","getWebGlExtensions","extensions","ANGLE_instanced_arrays","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc_srgb","OES_vertex_array_object","memize","fn","head","tail","memoized","i","node","len","arguments","searchCache","next","prev","val","Array","apply","maxSize","clear","isPowerOfTwo","getTimingBezier","c","d","xc","xb","xa","yc","yb","ya","time","cbxd","dx","it","minT","maxT","memo","str","s","parts","substr","split","parseFloat","isNaN","hypot","sqrt","TRANSPARENT_TEXTURE_DATA","Uint8Array","WebGlCoreCtxTexture","ctxTexture","_state","load","_nativeCtxTexture","w","_w","h","_h","createNativeCtxTexture","onLoadRequest","then","catch","err","_this","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this$textureSource","textureData","_mipmaps$","_textureData$data","mipmaps","_textureData$data$wid","_width","_textureData$data$hei","_height","glInternalFormat","view","wrap","_callee$","_context","texImage2D","RGBA","UNSIGNED_BYTE","setTextureMemUse","byteLength","getTextureData","sent","abrupt","activeTexture","ImageBitmap","ImageData","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","premultiplyAlpha","generateMipmap","DataView","ArrayBuffer","compressedTexImage2D","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","stop","free","deleteTexture","nativeTexture","createTexture","ColorTexture","_this2","_callee2","pixelData32","pixelData8","_context2","Uint32Array","Uint8ClampedArray","SubTexture","parentTexture","loadTexture","txType","queueMicrotask","parentTx","onParentTxLoaded","onParentTxFailed","_this3","_callee3","_context3","WebGlCoreCtxSubTexture","_this4","_callee4","_props$data","_props$data2","_context4","BufferCollection","config","_this$config$find","find","item","_this$config$find2","WebGlContextWrapper","gl","WeakMap","activeTextureUnit","ACTIVE_TEXTURE","TEXTURE0","maxTextureUnits","texture2dUnits","fill","undefined","map","_","TEXTURE_BINDING_2D","scissorEnabled","isEnabled","SCISSOR_TEST","scissorBox","SCISSOR_BOX","scissorX","scissorY","scissorWidth","scissorHeight","blendEnabled","BLEND","blendSrcRgb","BLEND_SRC_RGB","blendDstRgb","BLEND_DST_RGB","blendSrcAlpha","BLEND_SRC_ALPHA","blendDstAlpha","BLEND_DST_ALPHA","boundArrayBuffer","ARRAY_BUFFER_BINDING","boundElementArrayBuffer","ELEMENT_ARRAY_BUFFER_BINDING","curProgram","CURRENT_PROGRAM","UNPACK_FLIP_Y_WEBGL","FLOAT","ONE","ONE_MINUS_SRC_ALPHA","STATIC_DRAW","DYNAMIC_DRAW","COLOR_ATTACHMENT0","self","WebGL2RenderingContext","textureUnit","TEXTURE_2D","_getActiveTexture","pname","param","texture2dParams","textureParams","get","set","level","internalFormat","widthOrFormat","heightOrType","borderOrSource","format","pixels","internalformat","border","viewport","clearColor","red","green","blue","enable","disable","setBlend","blend","blendFunc","src","dst","createFramebuffer","bindFramebuffer","framebuffer","FRAMEBUFFER","framebufferTexture2D","attachment","COLOR_BUFFER_BIT","arrayBufferData","usage","bindBuffer","ARRAY_BUFFER","bufferData","elementArrayBufferData","ELEMENT_ARRAY_BUFFER","programUniforms","Map","uniformArgs","every","v","isArray","compareArrays","mode","count","vertexArray","RenderTexture","_callee5","_context5","WebGlCoreCtxRenderTexture","_this5","_callee6","_this5$textureSource","_callee6$","_context6","WebGlCoreRenderer","quadBuffer","bufferMemory","txMemManager","defaultTexture","requestRender","contextSpy","antialias","depth","stencil","desynchronized","powerPreference","premultipliedAlpha","preserveDrawingBuffer","getContext","Proxy","increment","String","bind","createWebGLContext","maxQuads","indices","Uint16Array","j","createIndexBuffer","defaultShader","loadShader","BYTES_PER_ELEMENT","quadBufferCollection","a_position","a_textureCoordinate","a_color","a_textureIndex","reset","curBufferIdx","curRenderOp","renderOps","getShaderManager","createCtxTexture","addQuad","_texture","_textureOptions$flipX","_textureOptions$flipY","fQuadBuffer","uiQuadBuffer","colorTl","colorTr","colorBl","colorBr","textureOptions","tx","ty","ta","tb","tc","td","rtt","targetDims","targetShader","reuseRenderOp","newRenderOp","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","_texture$props","tw","th","_ref2","_ref2$width","parentW","_ref2$height","parentH","_ref3","_ref4","getCtxTexture","textureIdx","rightCornerX","rightCornerY","recursive","_this$curRenderOp","addRenderOp","render","surface","_this$quadBufferColle","arr","rttNodes","unshift","renderRTTNodes","hasRTTupdates","activeRttNode","renderToTextureActive","children","child","update","deltaTime","addQuads","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","first","amount","shapeText","codepoints","_this6","_callee7","codepointResult","lastGlyphId","codepoint","glyph","_this6$kernings$glyph","_context7","peek","done","id","letterSpacing","mapped","glyphId","cluster","lastIndex","xAdvance","xadvance","yAdvance","xOffset","xoffset","yOffset","yoffset","xBearing","yBearing","atlasUrl","atlasDataUrl","_this7","preload","checkLoaded","fetch","_ref5","_callee8","response","maxCharHeight","_context8","json","chars","charHeight","shaper","_x","getAtlasEntry","loaded"],"mappings":"8hPAkEgB,SAAAA,EAAaC,EAAWC,GAGpC,IAAKD,EACK,MAAA,IAAIE,MAAMD,GAAW,mBAEnC,CA2FgB,SAAAE,EAAOC,EAAKC,GACxB,OAAOC,OAAOC,UAAUC,eAAeC,KAAKL,EAAKC,EACrD,CAyBO,SAASK,IACZ,MAAO,CAAmBC,SAAA,mBAAAC,KAAA,cAAAC,KAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,QAAA,KAAA,CAC9B,cC9GO,SAAwBC,EAAGC,EAAGC,GACjC,IAAMC,EAAeC,EAAYC,KAAKC,IAAIN,EAAEO,GAAIN,EAAEM,IAAKF,KAAKC,IAAIN,EAAEQ,GAAIP,EAAEO,IAAKH,KAAKI,IAAIT,EAAEU,GAAIT,EAAES,IAAKL,KAAKI,IAAIT,EAAEW,GAAIV,EAAEU,IAAKT,GACzH,GAAIC,EAAaI,GAAKJ,EAAaO,IAAMP,EAAaK,GAAKL,EAAaQ,GACpE,OAAOR,EAEX,OAAOC,EAAY,EAAG,EAAG,EAAG,EAAGD,EACnC,IAmBO,SAAuBH,EAAGC,EAAGC,GAChC,IAAMU,EAAIP,KAAKC,IAAIN,EAAEY,EAAGX,EAAEW,GACpBC,EAAIR,KAAKC,IAAIN,EAAEa,EAAGZ,EAAEY,GACpBC,EAAQ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AAKE,cAAc,KAAA,EAAA,IAAA,MAAA,OAAAM,EAAAnS,OAAAgS,GAAAA,EACtB,KAAA,OAAA,SAAAQ,GAAAT,OAAAA,EAAAzX,MAAA3O,KAAAqO,UAAC,CAAA,KACGiD,MAAMtP,QAAQmH,MACtB,CACD2d,aAAAA,CAAc5B,GACV,IAAMR,EAAQ1kB,KAAK6jB,SAAS9J,IAAImL,GAChC,QAAchO,IAAVwN,EACA,MAAU,IAAAroB,MAAO,SAAQ6oB,uBAA6BllB,KAAKsJ,cAE/D,MAAO,CACHtL,EAAG0mB,EAAM1mB,EACTC,EAAGymB,EAAMzmB,EACTC,MAAOwmB,EAAMxmB,MACbC,OAAQumB,EAAMvmB,OAErB,CACD+nB,WAAAA,GACQlmB,KAAK+mB,QAEkB,WAAvB/mB,KAAK+K,QAAQhC,OAAsB/I,KAAKc,OACxCd,KAAK+mB,QAAS,EACd/mB,KAAKe,KAAK,UAEjB,ICpELG,EAAA,IADO","x_google_ignoreList":[13]} \ No newline at end of file +{"version":3,"file":"CoreExtension-legacy-1r1p_2oI.js","sources":["../../../../../renderer/dist/src/utils.js","../../../../../renderer/dist/src/core/lib/utils.js","../../../../../renderer/dist/src/common/EventEmitter.js","../../../../../renderer/dist/src/core/renderers/CoreShader.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/ShaderUtils.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreShader.js","../../../../../renderer/dist/src/core/textures/Texture.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/TrFontFace.js","../../../../../renderer/dist/src/core/renderers/CoreContextTexture.js","../../../../../renderer/dist/src/core/renderers/CoreRenderer.js","../../../../../renderer/dist/src/core/renderers/CoreRenderOp.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreRenderOp.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/RendererUtils.js","../../../../../renderer/node_modules/.pnpm/memize@2.1.0/node_modules/memize/dist/index.js","../../../../../renderer/dist/src/core/utils.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js","../../../../../renderer/dist/src/core/textures/ColorTexture.js","../../../../../renderer/dist/src/core/textures/SubTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxSubTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/BufferCollection.js","../../../../../renderer/dist/src/core/lib/WebGlContextWrapper.js","../../../../../renderer/dist/src/core/renderers/webgl/internal/WebGlUtils.js","../../../../../renderer/dist/src/core/textures/RenderTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreCtxRenderTexture.js","../../../../../renderer/dist/src/core/renderers/webgl/WebGlCoreRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/SpecialCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/FontShaper.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/SdfFontShaper.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js","../../../../../renderer/dist/src/core/CoreExtension.js"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createWebGLContext(canvas, contextSpy) {\n const config = {\n alpha: true,\n antialias: false,\n depth: false,\n stencil: true,\n desynchronized: false,\n // Disabled because it prevents Visual Regression Tests from working\n // failIfMajorPerformanceCaveat: true,\n powerPreference: 'high-performance',\n premultipliedAlpha: true,\n preserveDrawingBuffer: false,\n };\n const gl = \n // TODO: Remove this assertion once this issue is fixed in TypeScript\n // https://github.com/microsoft/TypeScript/issues/53614\n (canvas.getContext('webgl', config) ||\n canvas.getContext('experimental-webgl', config));\n if (!gl) {\n throw new Error('Unable to create WebGL context');\n }\n if (contextSpy) {\n // Proxy the GL context to log all GL calls\n return new Proxy(gl, {\n get(target, prop) {\n const value = target[prop];\n if (typeof value === 'function') {\n contextSpy.increment(String(prop));\n return value.bind(target);\n }\n return value;\n },\n });\n }\n return gl;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (isProductionEnvironment())\n return;\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n/**\n * Merges two colors based on a given progress value.\n *\n * This function takes two colors (c1 and c2) represented as 32-bit integers\n * in RGBA format and blends them based on the provided progress value (p).\n * The result is a new color that is a weighted combination of the input colors,\n * where the weight is determined by the progress value.\n *\n * @param {number} c1 - The first color in RGBA format (32-bit integer).\n * @param {number} c2 - The second color in RGBA format (32-bit integer).\n * @param {number} p - The progress value between 0 and 1.\n * @returns {number} The merged color as a 32-bit integer in RGBA format.\n */\nexport function mergeColorProgress(rgba1, rgba2, p) {\n const r1 = Math.trunc(rgba1 >>> 24);\n const g1 = Math.trunc((rgba1 >>> 16) & 0xff);\n const b1 = Math.trunc((rgba1 >>> 8) & 0xff);\n const a1 = Math.trunc(rgba1 & 0xff);\n const r2 = Math.trunc(rgba2 >>> 24);\n const g2 = Math.trunc((rgba2 >>> 16) & 0xff);\n const b2 = Math.trunc((rgba2 >>> 8) & 0xff);\n const a2 = Math.trunc(rgba2 & 0xff);\n const r = Math.round(r2 * p + r1 * (1 - p));\n const g = Math.round(g2 * p + g1 * (1 - p));\n const b = Math.round(b2 * p + b1 * (1 - p));\n const a = Math.round(a2 * p + a1 * (1 - p));\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter.\n *\n * @internalRemarks\n * This method does NOT premultiply the alpha into the color channels. If that\n * is required (for internal use only) use {@link mergeColorAlphaPremultiplied}\n * instead.\n *\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @returns\n */\nexport function mergeColorAlpha(rgba, alpha) {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = Math.trunc((rgba & 0xff) * alpha);\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter. Before returning, the\n * final alpha value is multiplied into the color channels.\n *\n * @remarks\n * If `flipEndianess` is set to true, the function will returned an ABGR encoded number\n * which is useful when the color value needs to be passed into a shader attribute.\n *\n * NOTE: This method returns a PREMULTIPLIED alpha color which is generally only useful\n * in the context of the internal rendering process. Use {@link mergeColorAlpha} if you\n * need to blend an alpha value into a color in the context of the Renderer's\n * main API.\n *\n * @internalRemarks\n * Do not expose this method in the main API because Renderer users should instead use\n * {@link mergeColorAlpha} to manipulate the alpha value of a color.\n *\n * @internal\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @param flipEndianess Flip the endianess. RGBA becomes encoded as ABGR (for inserting colors into shader attributes)\n * @returns\n */\nexport function mergeColorAlphaPremultiplied(rgba, alpha, flipEndianess = false) {\n const newAlpha = ((rgba & 0xff) / 255) * alpha;\n const r = Math.trunc((rgba >>> 24) * newAlpha);\n const g = Math.trunc(((rgba >>> 16) & 0xff) * newAlpha);\n const b = Math.trunc(((rgba >>> 8) & 0xff) * newAlpha);\n const a = Math.trunc(newAlpha * 255);\n if (flipEndianess) {\n return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0;\n }\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Returns true if the given object has the given \"own\" property.\n *\n * @param obj\n * @param prop\n * @returns\n */\nexport function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n/**\n * Converts degrees to radians\n *\n * @param degrees\n * @returns\n */\nexport function deg2Rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * Returns image aspect ratio\n *\n * @param width\n * @param height\n * @returns\n */\nexport function getImageAspectRatio(width, height) {\n return width / height;\n}\n/**\n * Checks import.meta if env is production\n *\n * @returns\n */\nexport function isProductionEnvironment() {\n return import.meta.env && import.meta.env.PROD;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNormalizedRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r / 255, g / 255, b / 255, a / 255];\n};\nexport const getRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r, g, b, a];\n};\nexport const norm = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n const rgbaArr = [r / 255, g / 255, b / 255, a / 255];\n rgbaArr[0] = Math.max(0, Math.min(255, rgbaArr[0]));\n rgbaArr[1] = Math.max(0, Math.min(255, rgbaArr[1]));\n rgbaArr[2] = Math.max(0, Math.min(255, rgbaArr[2]));\n rgbaArr[3] = Math.max(0, Math.min(255, rgbaArr[3]));\n let v = ((rgbaArr[3] | 0) << 24) +\n ((rgbaArr[0] | 0) << 16) +\n ((rgbaArr[1] | 0) << 8) +\n (rgbaArr[2] | 0);\n if (v < 0) {\n v = 0xffffffff + v + 1;\n }\n return v;\n};\nexport function getNormalizedAlphaComponent(rgba) {\n return (rgba & 0xff) / 255.0;\n}\n/**\n * Get a CSS color string from a RGBA color\n *\n * @param color\n * @returns\n */\nexport function getRgbaString(color) {\n const r = Math.floor(color[0] * 255.0);\n const g = Math.floor(color[1] * 255.0);\n const b = Math.floor(color[2] * 255.0);\n const a = Math.floor(color[3] * 255.0);\n return `rgba(${r},${g},${b},${a.toFixed(4)})`;\n}\nexport function createBound(x1, y1, x2, y2, out) {\n if (out) {\n out.x1 = x1;\n out.y1 = y1;\n out.x2 = x2;\n out.y2 = y2;\n return out;\n }\n return {\n x1,\n y1,\n x2,\n y2,\n };\n}\nexport function intersectBound(a, b, out) {\n const intersection = createBound(Math.max(a.x1, b.x1), Math.max(a.y1, b.y1), Math.min(a.x2, b.x2), Math.min(a.y2, b.y2), out);\n if (intersection.x1 < intersection.x2 && intersection.y1 < intersection.y2) {\n return intersection;\n }\n return createBound(0, 0, 0, 0, intersection);\n}\nexport function boundsOverlap(a, b) {\n return a.x1 < b.x2 && a.x2 > b.x1 && a.y1 < b.y2 && a.y2 > b.y1;\n}\nexport function convertBoundToRect(bound, out) {\n if (out) {\n out.x = bound.x1;\n out.y = bound.y1;\n out.width = bound.x2 - bound.x1;\n out.height = bound.y2 - bound.y1;\n return out;\n }\n return {\n x: bound.x1,\n y: bound.y1,\n width: bound.x2 - bound.x1,\n height: bound.y2 - bound.y1,\n };\n}\nexport function intersectRect(a, b, out) {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const width = Math.min(a.x + a.width, b.x + b.width) - x;\n const height = Math.min(a.y + a.height, b.y + b.height) - y;\n if (width > 0 && height > 0) {\n if (out) {\n out.x = x;\n out.y = y;\n out.width = width;\n out.height = height;\n return out;\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n if (out) {\n out.x = 0;\n out.y = 0;\n out.width = 0;\n out.height = 0;\n return out;\n }\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n}\nexport function copyRect(a, out) {\n if (out) {\n out.x = a.x;\n out.y = a.y;\n out.width = a.width;\n out.height = a.height;\n return out;\n }\n return {\n x: a.x,\n y: a.y,\n width: a.width,\n height: a.height,\n };\n}\nexport function compareRect(a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n return (a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height);\n}\nexport function boundInsideBound(bound1, bound2) {\n return (bound1.x1 <= bound2.x2 &&\n bound1.y1 <= bound2.y2 &&\n bound1.x2 >= bound2.x1 &&\n bound1.y2 >= bound2.y1);\n}\nexport function isBoundPositive(bound) {\n return bound.x1 < bound.x2 && bound.y1 < bound.y2;\n}\nexport function isRectPositive(rect) {\n return rect.width > 0 && rect.height > 0;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * EventEmitter base class\n */\nexport class EventEmitter {\n eventListeners = {};\n on(event, listener) {\n let listeners = this.eventListeners[event];\n if (!listeners) {\n listeners = [];\n }\n listeners.push(listener);\n this.eventListeners[event] = listeners;\n }\n off(event, listener) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n if (!listener) {\n delete this.eventListeners[event];\n return;\n }\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n once(event, listener) {\n const onceListener = (target, data) => {\n this.off(event, onceListener);\n listener(target, data);\n };\n this.on(event, onceListener);\n }\n emit(event, data) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n [...listeners].forEach((listener) => {\n listener(this, data);\n });\n }\n removeAllListeners() {\n this.eventListeners = {};\n }\n}\n//# sourceMappingURL=EventEmitter.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreShader {\n // abstract draw(): void;\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {};\n }\n}\n//# sourceMappingURL=CoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion Types\nexport function createShader(glw, type, source) {\n const shader = glw.createShader(type);\n if (!shader) {\n throw new Error();\n }\n glw.shaderSource(shader, source);\n glw.compileShader(shader);\n const success = glw.getShaderParameter(shader, glw.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.log(glw.getShaderInfoLog(shader));\n glw.deleteShader(shader);\n}\nexport function createProgram(glw, vertexShader, fragmentShader) {\n const program = glw.createProgram();\n if (!program) {\n throw new Error();\n }\n glw.attachShader(program, vertexShader);\n glw.attachShader(program, fragmentShader);\n glw.linkProgram(program);\n const success = glw.getProgramParameter(program, glw.LINK_STATUS);\n if (success) {\n return program;\n }\n console.log(glw.getProgramInfoLog(program));\n glw.deleteProgram(program);\n return undefined;\n}\n//# sourceMappingURL=ShaderUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, hasOwn } from '../../../utils.js';\nimport { CoreShader } from '../CoreShader.js';\nimport { createProgram, createShader, } from './internal/ShaderUtils.js';\nimport { isWebGl2 } from './internal/WebGlUtils.js';\nexport class WebGlCoreShader extends CoreShader {\n boundBufferCollection = null;\n buffersBound = false;\n program;\n /**\n * Vertex Array Object\n *\n * @remarks\n * Used by WebGL2 Only\n */\n vao;\n renderer;\n glw;\n attributeBuffers;\n attributeLocations;\n attributeNames;\n uniformLocations;\n uniformTypes;\n supportsIndexedTextures;\n constructor(options) {\n super();\n const renderer = (this.renderer = options.renderer);\n const glw = (this.glw = this.renderer.glw);\n this.supportsIndexedTextures = options.supportsIndexedTextures || false;\n // Check that extensions are supported\n const webGl2 = glw.isWebGl2();\n const requiredExtensions = (webGl2 && options.webgl2Extensions) ||\n (!webGl2 && options.webgl1Extensions) ||\n [];\n const glVersion = webGl2 ? '2.0' : '1.0';\n requiredExtensions.forEach((extensionName) => {\n if (!glw.getExtension(extensionName)) {\n throw new Error(`Shader \"${this.constructor.name}\" requires extension \"${extensionName}\" for WebGL ${glVersion} but wasn't found`);\n }\n });\n // Gather shader sources\n // - If WebGL 2 and special WebGL 2 sources are provided, we copy those sources and delete\n // the extra copy of them to save memory.\n // TODO: This could be further made optimal by just caching the compiled shaders and completely deleting\n // the source code\n const shaderSources = options.shaderSources ||\n this.constructor.shaderSources;\n if (!shaderSources) {\n throw new Error(`Shader \"${this.constructor.name}\" is missing shaderSources.`);\n }\n else if (webGl2 && shaderSources?.webGl2) {\n shaderSources.fragment = shaderSources.webGl2.fragment;\n shaderSources.vertex = shaderSources.webGl2.vertex;\n delete shaderSources.webGl2;\n }\n const textureUnits = renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n const vertexSource = shaderSources.vertex instanceof Function\n ? shaderSources.vertex(textureUnits)\n : shaderSources.vertex;\n const fragmentSource = shaderSources.fragment instanceof Function\n ? shaderSources.fragment(textureUnits)\n : shaderSources.fragment;\n const vertexShader = createShader(glw, glw.VERTEX_SHADER, vertexSource);\n const fragmentShader = createShader(glw, glw.FRAGMENT_SHADER, fragmentSource);\n if (!vertexShader || !fragmentShader) {\n throw new Error();\n }\n const program = createProgram(glw, vertexShader, fragmentShader);\n if (!program) {\n throw new Error();\n }\n this.program = program;\n if (webGl2) {\n const vao = glw.createVertexArray();\n if (!vao) {\n throw new Error();\n }\n this.vao = vao;\n glw.bindVertexArray(this.vao);\n }\n this.attributeLocations = {};\n this.attributeBuffers = {};\n this.attributeNames = [];\n [...options.attributes].forEach((attributeName) => {\n const location = glw.getAttribLocation(this.program, attributeName);\n if (location < 0) {\n throw new Error(`${this.constructor.name}: Vertex shader must have an attribute \"${attributeName}\"!`);\n }\n const buffer = glw.createBuffer();\n if (!buffer) {\n throw new Error(`${this.constructor.name}: Could not create buffer for attribute \"${attributeName}\"`);\n }\n this.attributeLocations[attributeName] = location;\n this.attributeBuffers[attributeName] = buffer;\n this.attributeNames.push(attributeName);\n });\n this.uniformLocations = {};\n this.uniformTypes = {};\n options.uniforms.forEach((uniform) => {\n const location = glw.getUniformLocation(this.program, uniform.name);\n this.uniformTypes[uniform.name] = uniform.uniform;\n if (!location) {\n console.warn(`Shader \"${this.constructor.name}\" could not get uniform location for \"${uniform.name}\"`);\n return;\n }\n this.uniformLocations[uniform.name] = location;\n });\n }\n bindBufferAttribute(location, buffer, attribute) {\n const { glw } = this;\n glw.enableVertexAttribArray(location);\n glw.vertexAttribPointer(buffer, location, attribute.size, attribute.type, attribute.normalized, attribute.stride, attribute.offset);\n }\n disableAttribute(location) {\n this.glw.disableVertexAttribArray(location);\n }\n disableAttributes() {\n for (const loc in this.attributeLocations) {\n this.disableAttribute(this.attributeLocations[loc]);\n }\n this.boundBufferCollection = null;\n }\n /**\n * Given two sets of Shader props destined for this Shader, determine if they can be batched together\n * to reduce the number of draw calls.\n *\n * @remarks\n * This is used by the {@link WebGlCoreRenderer} to determine if it can batch multiple consecutive draw\n * calls into a single draw call.\n *\n * By default, this returns false (meaning no batching is allowed), but can be\n * overridden by child classes to provide more efficient batching.\n *\n * @param propsA\n * @param propsB\n * @returns\n */\n canBatchShaderProps(propsA, propsB) {\n return false;\n }\n bindRenderOp(renderOp, props) {\n this.bindBufferCollection(renderOp.buffers);\n if (renderOp.textures.length > 0) {\n this.bindTextures(renderOp.textures);\n }\n const { glw, parentHasRenderTexture, renderToTexture } = renderOp;\n // Skip if the parent and current operation both have render textures\n if (renderToTexture && parentHasRenderTexture) {\n return;\n }\n // Bind render texture framebuffer dimensions as resolution\n // if the parent has a render texture\n if (parentHasRenderTexture) {\n const { width, height } = renderOp.framebufferDimensions || {};\n // Force pixel ratio to 1.0 for render textures since they are always 1:1\n // the final render texture will be rendered to the screen with the correct pixel ratio\n this.setUniform('u_pixelRatio', 1.0);\n // Set resolution to the framebuffer dimensions\n this.setUniform('u_resolution', new Float32Array([width ?? 0, height ?? 0]));\n }\n else {\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\n this.setUniform('u_resolution', new Float32Array([glw.canvas.width, glw.canvas.height]));\n }\n if (props) {\n // Bind optional automatic uniforms\n // These are only bound if their keys are present in the props.\n if (hasOwn(props, '$dimensions')) {\n let dimensions = props.$dimensions;\n if (!dimensions) {\n dimensions = renderOp.dimensions;\n }\n this.setUniform('u_dimensions', [dimensions.width, dimensions.height]);\n }\n if (hasOwn(props, '$alpha')) {\n let alpha = props.$alpha;\n if (!alpha) {\n alpha = renderOp.alpha;\n }\n this.setUniform('u_alpha', alpha);\n }\n this.bindProps(props);\n }\n }\n setUniform(name, ...value) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-argument\n this.glw.setUniform(this.uniformTypes[name], this.uniformLocations[name], ...value);\n }\n bindBufferCollection(buffer) {\n if (this.boundBufferCollection === buffer) {\n return;\n }\n for (const attributeName in this.attributeLocations) {\n const resolvedBuffer = buffer.getBuffer(attributeName);\n const resolvedInfo = buffer.getAttributeInfo(attributeName);\n assertTruthy(resolvedBuffer, `Buffer for \"${attributeName}\" not found`);\n assertTruthy(resolvedInfo);\n this.bindBufferAttribute(this.attributeLocations[attributeName], resolvedBuffer, resolvedInfo);\n }\n this.boundBufferCollection = buffer;\n }\n bindProps(props) {\n // Implement in child class\n }\n bindTextures(textures) {\n // no defaults\n }\n attach() {\n this.glw.useProgram(this.program);\n this.glw.useProgram(this.program);\n if (this.glw.isWebGl2() && this.vao) {\n this.glw.bindVertexArray(this.vao);\n }\n }\n detach() {\n this.disableAttributes();\n }\n static shaderSources;\n}\n//# sourceMappingURL=WebGlCoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../common/EventEmitter.js';\n/**\n * Represents a source of texture data for a CoreContextTexture.\n *\n * @remarks\n * Texture sources are used to populate a CoreContextTexture when that texture\n * is loaded. Texture data retrieved by the CoreContextTexture by the\n * `getTextureData` method. It's the responsibility of the concerete `Texture`\n * subclass to implement this method appropriately.\n */\nexport class Texture extends EventEmitter {\n txManager;\n /**\n * The dimensions of the texture\n *\n * @remarks\n * Until the texture data is loaded for the first time the value will be\n * `null`.\n */\n dimensions = null;\n error = null;\n state = 'freed';\n renderableOwners = new Set();\n constructor(txManager) {\n super();\n this.txManager = txManager;\n }\n /**\n * Add/remove an owner to/from the Texture based on its renderability.\n *\n * @remarks\n * Any object can own a texture, be it a CoreNode or even the state object\n * from a Text Renderer.\n *\n * When the reference to the texture that an owner object holds is replaced\n * or cleared it must call this with `renderable=false` to release the owner\n * association.\n *\n * @param owner\n * @param renderable\n */\n setRenderableOwner(owner, renderable) {\n if (renderable) {\n this.renderableOwners.add(owner);\n }\n else {\n this.renderableOwners.delete(owner);\n }\n }\n /**\n * Returns true if the texture is assigned to any Nodes that are renderable.\n */\n get renderable() {\n return this.renderableOwners.size > 0;\n }\n /**\n * Set the state of the texture\n *\n * @remark\n * Intended for internal-use only but declared public so that it can be set\n * by it's associated {@link CoreContextTexture}\n *\n * @param state\n * @param args\n */\n setState(state, ...args) {\n if (this.state !== state) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.state = state;\n if (state === 'loaded') {\n const loadedArgs = args;\n this.dimensions = loadedArgs[0];\n }\n else if (state === 'failed') {\n const failedArgs = args;\n this.error = failedArgs[0];\n }\n this.emit(state, ...args);\n }\n }\n /**\n * Make a cache key for this texture.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide an\n * appropriate cache key for the texture type including the texture's\n * properties that uniquely identify a copy of the texture. If the texture\n * type does not support caching, then this method should return `false`.\n *\n * @param props\n * @returns\n * A cache key for this texture or `false` if the texture type does not\n * support caching.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n /**\n * Resolve the default values for the texture's properties.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide\n * default values for the texture's optional properties.\n *\n * @param props\n * @returns\n * The default values for the texture's properties.\n */\n static resolveDefaults(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props) {\n return {};\n }\n}\n//# sourceMappingURL=Texture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nexport class TrFontFace extends EventEmitter {\n fontFamily;\n descriptors;\n loaded = false;\n constructor(fontFamily, descriptors) {\n super();\n this.fontFamily = fontFamily;\n this.descriptors = {\n style: 'normal',\n weight: 'normal',\n stretch: 'normal',\n ...descriptors,\n };\n }\n /**\n * Convert a TrFontFaceDescriptors to a FontFaceDescriptors which differ slightly\n *\n * @param descriptors\n * @returns\n */\n static convertToCssFontFaceDescriptors(descriptors) {\n return {\n style: descriptors.style,\n weight: typeof descriptors.weight === 'number'\n ? `${descriptors.weight}`\n : descriptors.weight,\n stretch: descriptors.stretch,\n unicodeRange: descriptors.unicodeRange,\n variant: descriptors.variant,\n featureSettings: descriptors.featureSettings,\n display: descriptors.display,\n };\n }\n}\n//# sourceMappingURL=TrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreContextTexture {\n memManager;\n textureSource;\n constructor(memManager, textureSource) {\n this.memManager = memManager;\n this.textureSource = textureSource;\n }\n}\n//# sourceMappingURL=CoreContextTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreContextTexture } from './CoreContextTexture.js';\nexport class CoreRenderer {\n stage;\n constructor(stage) {\n this.stage = stage;\n }\n}\n//# sourceMappingURL=CoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreRenderOp {\n}\n//# sourceMappingURL=CoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreRenderOp } from '../CoreRenderOp.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nconst MAX_TEXTURES = 8; // TODO: get from gl\n/**\n * Can render multiple quads with multiple textures (up to vertex shader texture limit)\n *\n */\nexport class WebGlCoreRenderOp extends CoreRenderOp {\n glw;\n options;\n buffers;\n shader;\n shaderProps;\n alpha;\n clippingRect;\n dimensions;\n bufferIdx;\n zIndex;\n renderToTexture;\n parentHasRenderTexture;\n framebufferDimensions;\n length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex, renderToTexture, parentHasRenderTexture, framebufferDimensions) {\n super();\n this.glw = glw;\n this.options = options;\n this.buffers = buffers;\n this.shader = shader;\n this.shaderProps = shaderProps;\n this.alpha = alpha;\n this.clippingRect = clippingRect;\n this.dimensions = dimensions;\n this.bufferIdx = bufferIdx;\n this.zIndex = zIndex;\n this.renderToTexture = renderToTexture;\n this.parentHasRenderTexture = parentHasRenderTexture;\n this.framebufferDimensions = framebufferDimensions;\n this.maxTextures = shader.supportsIndexedTextures\n ? glw.getParameter(glw.MAX_VERTEX_TEXTURE_IMAGE_UNITS)\n : 1;\n }\n addTexture(texture) {\n const { textures, maxTextures } = this;\n const existingIdx = textures.findIndex((t) => t === texture);\n if (existingIdx !== -1) {\n return existingIdx;\n }\n const newIdx = textures.length;\n if (newIdx >= maxTextures) {\n return 0xffffffff;\n }\n this.textures.push(texture);\n return newIdx;\n }\n draw() {\n const { glw, shader, shaderProps, options } = this;\n const { shManager } = options;\n shManager.useShader(shader);\n shader.bindRenderOp(this, shaderProps);\n // TODO: Reduce calculations required\n const quadIdx = (this.bufferIdx / 24) * 6 * 2;\n // Clipping\n if (this.clippingRect.valid) {\n const { x, y, width, height } = this.clippingRect;\n const pixelRatio = options.pixelRatio;\n const canvasHeight = options.canvas.height;\n const clipX = Math.round(x * pixelRatio);\n const clipWidth = Math.round(width * pixelRatio);\n const clipHeight = Math.round(height * pixelRatio);\n const clipY = Math.round(canvasHeight - clipHeight - y * pixelRatio);\n glw.setScissorTest(true);\n glw.scissor(clipX, clipY, clipWidth, clipHeight);\n }\n else {\n glw.setScissorTest(false);\n }\n glw.drawElements(glw.TRIANGLES, 6 * this.numQuads, glw.UNSIGNED_SHORT, quadIdx);\n }\n}\n//# sourceMappingURL=WebGlCoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Get device specific webgl parameters\n * @param glw\n */\nexport function getWebGlParameters(glw) {\n const params = {\n MAX_RENDERBUFFER_SIZE: 0,\n MAX_TEXTURE_SIZE: 0,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n MAX_VIEWPORT_DIMS: 0,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0,\n MAX_TEXTURE_IMAGE_UNITS: 0,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0,\n MAX_VERTEX_ATTRIBS: 0,\n MAX_VARYING_VECTORS: 0,\n MAX_VERTEX_UNIFORM_VECTORS: 0,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0,\n };\n // Map over all parameters and get them\n const keys = Object.keys(params);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params[key] = glw.getParameter(glw[key]);\n });\n return params;\n}\n/**\n * Get device webgl extensions\n * @param glw\n */\nexport function getWebGlExtensions(glw) {\n const extensions = {\n ANGLE_instanced_arrays: null,\n WEBGL_compressed_texture_s3tc: null,\n WEBGL_compressed_texture_astc: null,\n WEBGL_compressed_texture_etc: null,\n WEBGL_compressed_texture_etc1: null,\n WEBGL_compressed_texture_pvrtc: null,\n WEBKIT_WEBGL_compressed_texture_pvrtc: null,\n WEBGL_compressed_texture_s3tc_srgb: null,\n OES_vertex_array_object: null,\n };\n // Map over all extensions and get them\n const keys = Object.keys(extensions);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n extensions[key] = glw.getExtension(key);\n });\n return extensions;\n}\n/**\n * Allocate big memory chunk that we\n * can re-use to draw quads\n *\n * @param glw\n * @param size\n */\nexport function createIndexBuffer(glw, size) {\n const maxQuads = ~~(size / 80);\n const indices = new Uint16Array(maxQuads * 6);\n for (let i = 0, j = 0; i < maxQuads; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 2;\n indices[i + 4] = j + 1;\n indices[i + 5] = j + 3;\n }\n const buffer = glw.createBuffer();\n glw.elementArrayBufferData(buffer, indices, glw.STATIC_DRAW);\n}\n/**\n * Checks if an object is of type HTMLImageElement.\n * This is used because we cant check for HTMLImageElement directly when the\n * renderer is running in a seperate web worker context.\n *\n * @param obj\n * @returns\n */\nexport function isHTMLImageElement(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n obj.constructor &&\n obj.constructor.name === 'HTMLImageElement');\n}\n//# sourceMappingURL=RendererUtils.js.map","/**\n * Memize options object.\n *\n * @typedef MemizeOptions\n *\n * @property {number} [maxSize] Maximum size of the cache.\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef MemizeCacheNode\n *\n * @property {?MemizeCacheNode|undefined} [prev] Previous node.\n * @property {?MemizeCacheNode|undefined} [next] Next node.\n * @property {Array<*>} args Function arguments for cache\n * entry.\n * @property {*} val Function result.\n */\n\n/**\n * Properties of the enhanced function for controlling cache.\n *\n * @typedef MemizeMemoizedFunction\n *\n * @property {()=>void} clear Clear the cache.\n */\n\n/**\n * Accepts a function to be memoized, and returns a new memoized function, with\n * optional options.\n *\n * @template {(...args: any[]) => any} F\n *\n * @param {F} fn Function to memoize.\n * @param {MemizeOptions} [options] Options object.\n *\n * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function.\n */\nfunction memize(fn, options) {\n\tvar size = 0;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar head;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar tail;\n\n\toptions = options || {};\n\n\tfunction memoized(/* ...args */) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs,\n\t\t\ti;\n\n\t\tsearchCache: while (node) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif (node.args.length !== arguments.length) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (node.args[i] !== arguments[i]) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== head) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif (node === tail) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\t/** @type {MemizeCacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {MemizeCacheNode} */ (head).prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply(null, args),\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (head) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif (size === /** @type {MemizeOptions} */ (options).maxSize) {\n\t\t\ttail = /** @type {MemizeCacheNode} */ (tail).prev;\n\t\t\t/** @type {MemizeCacheNode} */ (tail).next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function () {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\t// Ignore reason: There's not a clear solution to create an intersection of\n\t// the function with additional properties, where the goal is to retain the\n\t// function signature of the incoming argument and add control properties\n\t// on the return value.\n\n\t// @ts-ignore\n\treturn memoized;\n}\n\nexport { memize as default };\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Core Utility Functions\n *\n * @module\n */\nimport memo from 'memize';\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\nconst degree = Math.PI / 180;\nexport const setMatrixArrayType = (type) => {\n ARRAY_TYPE = type;\n};\nexport const toRadian = (a) => {\n return a * degree;\n};\nexport const equals = (a, b) => {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n};\nexport const rand = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\nexport const isPowerOfTwo = (value) => {\n return value && !(value & (value - 1));\n};\nconst getTimingBezier = (a, b, c, d) => {\n const xc = 3.0 * a;\n const xb = 3.0 * (c - a) - xc;\n const xa = 1.0 - xc - xb;\n const yc = 3.0 * b;\n const yb = 3.0 * (d - b) - yc;\n const ya = 1.0 - yc - yb;\n return function (time) {\n if (time >= 1.0) {\n return 1;\n }\n if (time <= 0) {\n return 0;\n }\n let t = 0.5, cbx, cbxd, dx;\n for (let it = 0; it < 20; it++) {\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n return t * (t * (t * ya + yb) + yc);\n }\n // Cubic bezier derivative.\n cbxd = t * (t * (3 * xa) + 2 * xb) + xc;\n if (cbxd > 1e-10 && cbxd < 1e-10) {\n // Problematic. Fall back to binary search method.\n break;\n }\n t += dx / cbxd;\n }\n // Fallback: binary search method. This is more reliable when there are near-0 slopes.\n let minT = 0;\n let maxT = 1;\n for (let it = 0; it < 20; it++) {\n t = 0.5 * (minT + maxT);\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n // Solution found!\n return t * (t * (t * ya + yb) + yc);\n }\n if (dx < 0) {\n maxT = t;\n }\n else {\n minT = t;\n }\n }\n };\n};\nexport const getTimingFunction = memo((str) => {\n switch (str) {\n case 'linear':\n return function (time) {\n return time;\n };\n case 'ease':\n return getTimingBezier(0.25, 0.1, 0.25, 1.0);\n case 'ease-in':\n return getTimingBezier(0.42, 0, 1.0, 1.0);\n case 'ease-out':\n return getTimingBezier(0, 0, 0.58, 1.0);\n case 'ease-in-out':\n return getTimingBezier(0.42, 0, 0.58, 1.0);\n case 'ease-in-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-out-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-in-out-sine':\n return getTimingBezier(0.37, 0, 0.63, 1);\n case 'ease-in-cubic':\n return getTimingBezier(0.32, 0, 0.67, 0);\n case 'ease-out-cubic':\n return getTimingBezier(0.33, 1, 0.68, 1);\n case 'ease-in-out-cubic':\n return getTimingBezier(0.65, 0, 0.35, 1);\n case 'ease-in-circ':\n return getTimingBezier(0.55, 0, 1, 0.45);\n case 'ease-out-circ':\n return getTimingBezier(0, 0.55, 0.45, 1);\n case 'ease-in-out-circ':\n return getTimingBezier(0.85, 0, 0.15, 1);\n case 'ease-in-back':\n return getTimingBezier(0.36, 0, 0.66, -0.56);\n case 'ease-out-back':\n return getTimingBezier(0.34, 1.56, 0.64, 1);\n case 'ease-in-out-back':\n return getTimingBezier(0.68, -0.6, 0.32, 1.6);\n case 'step-start':\n return function () {\n return 1;\n };\n case 'step-end':\n return function (time) {\n return time === 1 ? 1 : 0;\n };\n default:\n // eslint-disable-next-line no-case-declarations\n const s = 'cubic-bezier(';\n if (str && str.indexOf(s) === 0) {\n const parts = str\n .substr(s.length, str.length - s.length - 1)\n .split(',');\n if (parts.length !== 4) {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n const a = parseFloat(parts[0] || '0.42');\n const b = parseFloat(parts[1] || '0');\n const c = parseFloat(parts[2] || '1');\n const d = parseFloat(parts[3] || '1');\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\n console.warn(' Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n return getTimingBezier(a, b, c, d);\n }\n else {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n }\n});\nif (!Math.hypot)\n Math.hypot = (...args) => {\n let y = 0, i = args.length;\n while (i--) {\n y += args[i] * args[i];\n }\n return Math.sqrt(y);\n };\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { isPowerOfTwo } from '../../utils.js';\nimport { CoreContextTexture } from '../CoreContextTexture.js';\nimport { isHTMLImageElement } from './internal/RendererUtils.js';\nconst TRANSPARENT_TEXTURE_DATA = new Uint8Array([0, 0, 0, 0]);\n/**\n * A wrapper around a WebGLTexture that handles loading the texture data\n * from a Texture source and uploading it to the GPU as well as freeing\n * the uploaded texture.\n *\n * @remarks\n * When accessing the ctxTexture property, the texture will be loaded if\n * it hasn't been already. ctxTexture will always return a valid WebGLTexture\n * and trigger the loading/uploading of the texture's data if it hasn't been\n * loaded yet.\n */\nexport class WebGlCoreCtxTexture extends CoreContextTexture {\n glw;\n _nativeCtxTexture = null;\n _state = 'freed';\n _w = 0;\n _h = 0;\n constructor(glw, memManager, textureSource) {\n super(memManager, textureSource);\n this.glw = glw;\n }\n get ctxTexture() {\n if (this._state === 'freed') {\n this.load();\n }\n assertTruthy(this._nativeCtxTexture);\n return this._nativeCtxTexture;\n }\n get renderable() {\n return this.textureSource.renderable;\n }\n get w() {\n return this._w;\n }\n get h() {\n return this._h;\n }\n /**\n * Load the texture data from the Texture source and upload it to the GPU\n *\n * @remarks\n * This method is called automatically when accessing the ctxTexture property\n * if the texture hasn't been loaded yet. But it can also be called manually\n * to force the texture to be pre-loaded prior to accessing the ctxTexture\n * property.\n */\n load() {\n // If the texture is already loading or loaded, don't load it again.\n if (this._state === 'loading' || this._state === 'loaded') {\n return;\n }\n this._state = 'loading';\n this.textureSource.setState('loading');\n this._nativeCtxTexture = this.createNativeCtxTexture();\n this.onLoadRequest()\n .then(({ width, height }) => {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'loaded';\n this._w = width;\n this._h = height;\n // Update the texture source's width and height so that it can be used\n // for rendering.\n this.textureSource.setState('loaded', { width, height });\n })\n .catch((err) => {\n this._state = 'failed';\n this.textureSource.setState('failed', err);\n console.error(err);\n });\n }\n /**\n * Called when the texture data needs to be loaded and uploaded to a texture\n */\n async onLoadRequest() {\n const { glw, memManager } = this;\n // Set to a 1x1 transparent texture\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, null);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n const textureData = await this.textureSource?.getTextureData();\n // If the texture has been freed while loading, return early.\n if (!this._nativeCtxTexture) {\n assertTruthy(this._state === 'freed');\n return { width: 0, height: 0 };\n }\n let width = 0;\n let height = 0;\n assertTruthy(this._nativeCtxTexture);\n glw.activeTexture(0);\n // If textureData is null, the texture is empty (0, 0) and we don't need to\n // upload any data to the GPU.\n if (textureData.data instanceof ImageBitmap ||\n textureData.data instanceof ImageData ||\n // not using typeof HTMLImageElement due to web worker\n isHTMLImageElement(textureData.data)) {\n const data = textureData.data;\n width = data.width;\n height = data.height;\n glw.bindTexture(this._nativeCtxTexture);\n glw.pixelStorei(glw.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !!textureData.premultiplyAlpha);\n glw.texImage2D(0, glw.RGBA, glw.RGBA, glw.UNSIGNED_BYTE, data);\n memManager.setTextureMemUse(this, width * height * 4);\n // generate mipmaps for power-of-2 textures or in WebGL2RenderingContext\n if (glw.isWebGl2() || (isPowerOfTwo(width) && isPowerOfTwo(height))) {\n glw.generateMipmap();\n }\n }\n else if (textureData.data === null) {\n width = 0;\n height = 0;\n // Reset to a 1x1 transparent texture\n glw.bindTexture(this._nativeCtxTexture);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n }\n else if ('mipmaps' in textureData.data && textureData.data.mipmaps) {\n const { mipmaps, width = 0, height = 0, type, glInternalFormat, } = textureData.data;\n const view = type === 'ktx'\n ? new DataView(mipmaps[0] ?? new ArrayBuffer(0))\n : mipmaps[0];\n glw.bindTexture(this._nativeCtxTexture);\n glw.compressedTexImage2D(0, glInternalFormat, width, height, 0, view);\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n memManager.setTextureMemUse(this, view.byteLength);\n }\n else {\n console.error(`WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned`, textureData);\n }\n return {\n width,\n height,\n };\n }\n /**\n * Free the WebGLTexture from the GPU\n *\n * @returns\n */\n free() {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'freed';\n this.textureSource.setState('freed');\n this._w = 0;\n this._h = 0;\n if (!this._nativeCtxTexture) {\n return;\n }\n const { glw, memManager } = this;\n glw.deleteTexture(this._nativeCtxTexture);\n memManager.setTextureMemUse(this, 0);\n this._nativeCtxTexture = null;\n }\n /**\n * Create native context texture\n *\n * @remarks\n * When this method returns the returned texture will be bound to the GL context state.\n *\n * @param width\n * @param height\n * @returns\n */\n createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\n // On initial load request, create a 1x1 transparent texture to use until\n // the texture data is finally loaded.\n glw.activeTexture(0);\n glw.bindTexture(nativeTexture);\n // linear texture filtering\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n // texture wrapping method\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n return nativeTexture;\n }\n}\n//# sourceMappingURL=WebGlCoreCtxTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of only a 1x1 color pixel\n *\n * @remarks\n * The pixel color is set with the {@link ColorTextureProps.color} prop.\n *\n * This is the default texture used for a Node if it's\n * {@link INodeWritableProps.texture} prop is set to `null` (the default)\n *\n * Generally the 1x1 color pixel is stretched to whatever the set dimensions of\n * a Node are.\n */\nexport class ColorTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ColorTexture.resolveDefaults(props || {});\n }\n get color() {\n return this.props.color;\n }\n set color(color) {\n this.props.color = color;\n }\n async getTextureData() {\n const pixelData32 = new Uint32Array([this.color]);\n const pixelData8 = new Uint8ClampedArray(pixelData32.buffer);\n return {\n data: new ImageData(pixelData8, 1, 1),\n premultiplyAlpha: true,\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = ColorTexture.resolveDefaults(props);\n return `ColorTexture,${resolvedProps.color}`;\n }\n static resolveDefaults(props) {\n return {\n color: props.color || 0xffffffff,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ColorTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture, } from './Texture.js';\n/**\n * A Texture that is a sub-region of another Texture.\n *\n * @remarks\n * The parent texture can be a Sprite Sheet/Texture Atlas and set using the\n * {@link SubTextureProps.texture} prop. The sub-region relative to the parent\n * texture is defined with the {@link SubTextureProps.x},\n * {@link SubTextureProps.y}, {@link SubTextureProps.width}, and\n * {@link SubTextureProps.height} pixel values.\n */\nexport class SubTexture extends Texture {\n props;\n parentTexture;\n constructor(txManager, props) {\n super(txManager);\n this.parentTexture = this.txManager.loadTexture(props.texture.txType, props.texture.props, props.texture.options);\n this.props = SubTexture.resolveDefaults(props || {});\n // If parent texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n const parentTx = this.parentTexture;\n if (parentTx.state === 'loaded') {\n this.onParentTxLoaded(parentTx, parentTx.dimensions);\n }\n else if (parentTx.state === 'failed') {\n this.onParentTxFailed(parentTx, parentTx.error);\n }\n parentTx.on('loaded', this.onParentTxLoaded);\n parentTx.on('failed', this.onParentTxFailed);\n });\n }\n onParentTxLoaded = () => {\n // We ignore the parent's passed dimensions, and simply use the SubTexture's\n // configured dimensions (because that's all that matters here)\n this.setState('loaded', {\n width: this.props.width,\n height: this.props.height,\n });\n };\n onParentTxFailed = (target, error) => {\n this.setState('failed', error);\n };\n async getTextureData() {\n return {\n data: this.props,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {\n texture: props.texture,\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 0,\n height: props.height || 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=SubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxSubTexture extends WebGlCoreCtxTexture {\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n }\n async onLoadRequest() {\n const props = await this.textureSource.getTextureData();\n return {\n width: props.data?.width || 0,\n height: props.data?.height || 0,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxSubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a collection of WebGL Buffers along with their associated\n * vertex attribute formats.\n */\nexport class BufferCollection {\n config;\n constructor(config) {\n this.config = config;\n }\n /**\n * Get the WebGLBuffer associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getBuffer(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])?.buffer;\n }\n /**\n * Get the AttributeInfo associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getAttributeInfo(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])\n ?.attributes[attributeName];\n }\n}\n//# sourceMappingURL=BufferCollection.js.map","/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport { assertTruthy } from '../../utils.js';\nimport { isWebGl2 } from '../renderers/webgl/internal/WebGlUtils.js';\n/**\n * Optimized WebGL Context Wrapper\n *\n * @remarks\n * This class contains the subset of the WebGLRenderingContext & WebGL2RenderingContext\n * API that is used by the renderer. Select high volume WebGL methods include\n * caching optimizations to avoid making WebGL calls if the state is already set\n * to the desired value.\n *\n * While most methods contained are direct passthroughs to the WebGL context,\n * some methods combine multiple WebGL calls into one for convenience, modify\n * arguments to be more convenient, or are replaced by more specific methods.\n *\n * Not all methods are optimized. Only methods that are called frequently\n * and/or have a high cost are optimized.\n *\n * A subset of GLenum constants are also exposed as properties on this class\n * for convenience.\n */\nexport class WebGlContextWrapper {\n gl;\n //#region Cached WebGL State\n activeTextureUnit = 0;\n texture2dUnits;\n texture2dParams = new WeakMap();\n scissorEnabled;\n scissorX;\n scissorY;\n scissorWidth;\n scissorHeight;\n blendEnabled;\n blendSrcRgb;\n blendDstRgb;\n blendSrcAlpha;\n blendDstAlpha;\n boundArrayBuffer;\n boundElementArrayBuffer;\n curProgram;\n programUniforms = new WeakMap();\n //#endregion Cached WebGL State\n //#region Canvas\n canvas;\n //#endregion Canvas\n //#region WebGL Enums\n MAX_RENDERBUFFER_SIZE;\n MAX_TEXTURE_SIZE;\n MAX_VIEWPORT_DIMS;\n MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n MAX_TEXTURE_IMAGE_UNITS;\n MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n MAX_VERTEX_ATTRIBS;\n MAX_VARYING_VECTORS;\n MAX_VERTEX_UNIFORM_VECTORS;\n MAX_FRAGMENT_UNIFORM_VECTORS;\n TEXTURE_MAG_FILTER;\n TEXTURE_MIN_FILTER;\n TEXTURE_WRAP_S;\n TEXTURE_WRAP_T;\n LINEAR;\n CLAMP_TO_EDGE;\n RGBA;\n UNSIGNED_BYTE;\n UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n UNPACK_FLIP_Y_WEBGL;\n FLOAT;\n TRIANGLES;\n UNSIGNED_SHORT;\n ONE;\n ONE_MINUS_SRC_ALPHA;\n VERTEX_SHADER;\n FRAGMENT_SHADER;\n STATIC_DRAW;\n COMPILE_STATUS;\n LINK_STATUS;\n DYNAMIC_DRAW;\n COLOR_ATTACHMENT0;\n //#endregion WebGL Enums\n constructor(gl) {\n this.gl = gl;\n // The following code extracts the current state of the WebGL context\n // to our local JavaScript cached version of it. This is so we can\n // avoid making WebGL calls if we don't need to.\n // We could assume that the WebGL context is in a default state, but\n // in the future we may want to support restoring a broken WebGL context\n // and this will help with that.\n this.activeTextureUnit =\n gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0;\n const maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // save current texture units\n this.texture2dUnits = new Array(maxTextureUnits)\n .fill(undefined)\n .map((_, i) => {\n this.activeTexture(i);\n return gl.getParameter(gl.TEXTURE_BINDING_2D);\n });\n // restore active texture unit\n this.activeTexture(this.activeTextureUnit);\n this.scissorEnabled = gl.isEnabled(gl.SCISSOR_TEST);\n const scissorBox = gl.getParameter(gl.SCISSOR_BOX);\n this.scissorX = scissorBox[0];\n this.scissorY = scissorBox[1];\n this.scissorWidth = scissorBox[2];\n this.scissorHeight = scissorBox[3];\n this.blendEnabled = gl.isEnabled(gl.BLEND);\n this.blendSrcRgb = gl.getParameter(gl.BLEND_SRC_RGB);\n this.blendDstRgb = gl.getParameter(gl.BLEND_DST_RGB);\n this.blendSrcAlpha = gl.getParameter(gl.BLEND_SRC_ALPHA);\n this.blendDstAlpha = gl.getParameter(gl.BLEND_DST_ALPHA);\n this.boundArrayBuffer = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n this.boundElementArrayBuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);\n this.curProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n this.canvas = gl.canvas;\n // Extract GLenums\n this.MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE;\n this.MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE;\n this.MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS;\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n this.MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS;\n this.MAX_VARYING_VECTORS = gl.MAX_VARYING_VECTORS;\n this.MAX_VERTEX_UNIFORM_VECTORS = gl.MAX_VERTEX_UNIFORM_VECTORS;\n this.MAX_FRAGMENT_UNIFORM_VECTORS = gl.MAX_FRAGMENT_UNIFORM_VECTORS;\n this.TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T;\n this.LINEAR = gl.LINEAR;\n this.CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE;\n this.RGBA = gl.RGBA;\n this.UNSIGNED_BYTE = gl.UNSIGNED_BYTE;\n this.UNPACK_PREMULTIPLY_ALPHA_WEBGL = gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n this.UNPACK_FLIP_Y_WEBGL = gl.UNPACK_FLIP_Y_WEBGL;\n this.FLOAT = gl.FLOAT;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.ONE = gl.ONE;\n this.ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.VERTEX_SHADER = gl.VERTEX_SHADER;\n this.FRAGMENT_SHADER = gl.FRAGMENT_SHADER;\n this.STATIC_DRAW = gl.STATIC_DRAW;\n this.COMPILE_STATUS = gl.COMPILE_STATUS;\n this.LINK_STATUS = gl.LINK_STATUS;\n this.DYNAMIC_DRAW = gl.DYNAMIC_DRAW;\n this.COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0;\n }\n /**\n * Returns true if the WebGL context is WebGL2\n *\n * @returns\n */\n isWebGl2() {\n return isWebGl2(this.gl);\n }\n /**\n * ```\n * gl.activeTexture(textureUnit + gl.TEXTURE0);\n * ```\n *\n * @remarks\n * **WebGL Difference**: `textureUnit` is based from 0, not `gl.TEXTURE0`.\n *\n * @param textureUnit\n */\n activeTexture(textureUnit) {\n const { gl } = this;\n if (this.activeTextureUnit !== textureUnit) {\n gl.activeTexture(textureUnit + gl.TEXTURE0);\n this.activeTextureUnit = textureUnit;\n }\n }\n /**\n * ```\n * gl.bindTexture(gl.TEXTURE_2D, texture);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param texture\n */\n bindTexture(texture) {\n const { gl, activeTextureUnit, texture2dUnits } = this;\n if (texture2dUnits[activeTextureUnit] === texture) {\n return;\n }\n texture2dUnits[activeTextureUnit] = texture;\n gl.bindTexture(this.gl.TEXTURE_2D, texture);\n }\n _getActiveTexture() {\n const { activeTextureUnit, texture2dUnits } = this;\n return texture2dUnits[activeTextureUnit];\n }\n /**\n * ```\n * gl.texParameteri(gl.TEXTURE_2D, pname, param);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param pname\n * @param param\n * @returns\n */\n texParameteri(pname, param) {\n const { gl, texture2dParams } = this;\n const activeTexture = this._getActiveTexture();\n if (!activeTexture) {\n throw new Error('No active texture');\n }\n let textureParams = texture2dParams.get(activeTexture);\n if (!textureParams) {\n textureParams = {};\n texture2dParams.set(activeTexture, textureParams);\n }\n if (textureParams[pname] === param) {\n return;\n }\n textureParams[pname] = param;\n gl.texParameteri(gl.TEXTURE_2D, pname, param);\n }\n texImage2D(level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels) {\n const { gl } = this;\n if (format) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource);\n }\n }\n /**\n * ```\n * gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, data);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n compressedTexImage2D(level, internalformat, width, height, border, data) {\n const { gl } = this;\n gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalformat, width, height, border, data);\n }\n /**\n * ```\n * gl.pixelStorei(pname, param);\n * ```\n *\n * @param pname\n * @param param\n */\n pixelStorei(pname, param) {\n const { gl } = this;\n gl.pixelStorei(pname, param);\n }\n /**\n * ```\n * gl.generateMipmap(gl.TEXTURE_2D);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n generateMipmap() {\n const { gl } = this;\n gl.generateMipmap(gl.TEXTURE_2D);\n }\n /**\n * ```\n * gl.createTexture();\n * ```\n *\n * @returns\n */\n createTexture() {\n const { gl } = this;\n return gl.createTexture();\n }\n /**\n * ```\n * gl.deleteTexture(texture);\n * ```\n *\n * @param texture\n */\n deleteTexture(texture) {\n const { gl } = this;\n if (texture) {\n this.texture2dParams.delete(texture);\n }\n gl.deleteTexture(texture);\n }\n /**\n * ```\n * gl.viewport(x, y, width, height);\n * ```\n */\n viewport(x, y, width, height) {\n const { gl } = this;\n gl.viewport(x, y, width, height);\n }\n /**\n * ```\n * gl.clearColor(red, green, blue, alpha);\n * ```\n *\n * @param red\n * @param green\n * @param blue\n * @param alpha\n */\n clearColor(red, green, blue, alpha) {\n const { gl } = this;\n gl.clearColor(red, green, blue, alpha);\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.SCISSOR_TEST);\n * ```\n * @param enable\n */\n setScissorTest(enable) {\n const { gl, scissorEnabled } = this;\n if (enable === scissorEnabled) {\n return;\n }\n if (enable) {\n gl.enable(gl.SCISSOR_TEST);\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n this.scissorEnabled = enable;\n }\n /**\n * ```\n * gl.scissor(x, y, width, height);\n * ```\n *\n * @param x\n * @param y\n * @param width\n * @param height\n */\n scissor(x, y, width, height) {\n const { gl, scissorX, scissorY, scissorWidth, scissorHeight } = this;\n if (x !== scissorX ||\n y !== scissorY ||\n width !== scissorWidth ||\n height !== scissorHeight) {\n gl.scissor(x, y, width, height);\n this.scissorX = x;\n this.scissorY = y;\n this.scissorWidth = width;\n this.scissorHeight = height;\n }\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.BLEND);\n * ```\n *\n * @param blend\n * @returns\n */\n setBlend(blend) {\n const { gl, blendEnabled } = this;\n if (blend === blendEnabled) {\n return;\n }\n if (blend) {\n gl.enable(gl.BLEND);\n }\n else {\n gl.disable(gl.BLEND);\n }\n this.blendEnabled = blend;\n }\n /**\n * ```\n * gl.blendFunc(src, dst);\n * ```\n *\n * @param src\n * @param dst\n */\n blendFunc(src, dst) {\n const { gl, blendSrcRgb, blendDstRgb, blendSrcAlpha, blendDstAlpha } = this;\n if (src !== blendSrcRgb ||\n dst !== blendDstRgb ||\n src !== blendSrcAlpha ||\n dst !== blendDstAlpha) {\n gl.blendFunc(src, dst);\n this.blendSrcRgb = src;\n this.blendDstRgb = dst;\n this.blendSrcAlpha = src;\n this.blendDstAlpha = dst;\n }\n }\n /**\n * ```\n * gl.createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\n }\n /**\n * ```\n * gl.createFramebuffer();\n * ```\n * @returns\n */\n createFramebuffer() {\n const { gl } = this;\n return gl.createFramebuffer();\n }\n /**\n * ```\n * gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n * ```\n *\n * @param framebuffer\n */\n bindFramebuffer(framebuffer) {\n const { gl } = this;\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n }\n /**\n * ```\n * gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.FRAMEBUFFER` and textarget is always `gl.TEXTURE_2D`\n */\n framebufferTexture2D(attachment, texture, level) {\n const { gl } = this;\n gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, texture, level);\n }\n /**\n * ```\n * gl.clear(gl.COLOR_BUFFER_BIT);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Clear mask is always `gl.COLOR_BUFFER_BIT`\n */\n clear() {\n const { gl } = this;\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n arrayBufferData(buffer, data, usage) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n * ```\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n elementArrayBufferData(buffer, data, usage) {\n const { gl, boundElementArrayBuffer } = this;\n if (boundElementArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n this.boundElementArrayBuffer = buffer;\n }\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.vertexAttribPointer` are combined into one function.\n *\n * @param buffer\n * @param index\n * @param size\n * @param type\n * @param normalized\n * @param stride\n * @param offset\n */\n vertexAttribPointer(buffer, index, size, type, normalized, stride, offset) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n }\n /**\n * ```\n * gl.useProgram(program);\n * ```\n *\n * @param program\n * @returns\n */\n useProgram(program) {\n const { gl, curProgram } = this;\n if (curProgram === program) {\n return;\n }\n gl.useProgram(program);\n this.curProgram = program;\n }\n setUniform(type, location, ...args) {\n const { gl, programUniforms } = this;\n let uniforms = programUniforms.get(this.curProgram);\n if (!uniforms) {\n uniforms = new Map();\n programUniforms.set(this.curProgram, uniforms);\n }\n const uniformArgs = uniforms.get(location);\n if (!uniformArgs || !compareArrays(uniformArgs, args)) {\n uniforms.set(location, args);\n gl[type](location, ...args);\n }\n }\n /**\n * ```\n * gl.getParameter(pname);\n * ```\n *\n * @param pname\n * @returns\n */\n getParameter(pname) {\n const { gl } = this;\n return gl.getParameter(pname);\n }\n /**\n * ```\n * gl.drawElements(mode, count, type, offset);\n * ```\n *\n * @param mode\n * @param count\n * @param type\n * @param offset\n */\n drawElements(mode, count, type, offset) {\n const { gl } = this;\n gl.drawElements(mode, count, type, offset);\n }\n /**\n * ```\n * gl.drawArrays(mode, first, count);\n * ```\n *\n * @param name\n * @returns\n */\n getExtension(name) {\n const { gl } = this;\n return gl.getExtension(name);\n }\n /**\n * ```\n * gl.createVertexArray();\n * ```\n *\n * @returns\n */\n createVertexArray() {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n return gl.createVertexArray();\n }\n /**\n * ```\n * gl.bindVertexArray(vertexArray);\n * ```\n *\n * @param vertexArray\n */\n bindVertexArray(vertexArray) {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n gl.bindVertexArray(vertexArray);\n }\n /**\n * ```\n * gl.getAttribLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getAttribLocation(program, name) {\n const { gl } = this;\n return gl.getAttribLocation(program, name);\n }\n /**\n * ```\n * gl.getUniformLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getUniformLocation(program, name) {\n const { gl } = this;\n return gl.getUniformLocation(program, name);\n }\n /**\n * ```\n * gl.enableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n enableVertexAttribArray(index) {\n const { gl } = this;\n gl.enableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.disableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n disableVertexAttribArray(index) {\n const { gl } = this;\n gl.disableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.createShader(type);\n * ```\n *\n * @param type\n * @returns\n */\n createShader(type) {\n const { gl } = this;\n return gl.createShader(type);\n }\n /**\n * ```\n * gl.compileShader(shader);\n * ```\n *\n * @param shader\n * @returns\n */\n compileShader(shader) {\n const { gl } = this;\n gl.compileShader(shader);\n }\n /**\n * ```\n * gl.attachShader(program, shader);\n * ```\n *\n * @param program\n * @param shader\n */\n attachShader(program, shader) {\n const { gl } = this;\n gl.attachShader(program, shader);\n }\n /**\n * ```\n * gl.linkProgram(program);\n * ```\n *\n * @param program\n */\n linkProgram(program) {\n const { gl } = this;\n gl.linkProgram(program);\n }\n /**\n * ```\n * gl.deleteProgram(shader);\n * ```\n *\n * @param shader\n */\n deleteProgram(shader) {\n const { gl } = this;\n gl.deleteProgram(shader);\n }\n /**\n * ```\n * gl.getShaderParameter(shader, pname);\n * ```\n *\n * @param shader\n * @param pname\n */\n getShaderParameter(shader, pname) {\n const { gl } = this;\n return gl.getShaderParameter(shader, pname);\n }\n /**\n * ```\n * gl.getShaderInfoLog(shader);\n * ```\n *\n * @param shader\n */\n getShaderInfoLog(shader) {\n const { gl } = this;\n return gl.getShaderInfoLog(shader);\n }\n /**\n * ```\n * gl.createProgram();\n * ```\n *\n * @returns\n */\n createProgram() {\n const { gl } = this;\n return gl.createProgram();\n }\n /**\n * ```\n * gl.getProgramParameter(program, pname);\n * ```\n *\n * @param program\n * @param pname\n * @returns\n */\n getProgramParameter(program, pname) {\n const { gl } = this;\n return gl.getProgramParameter(program, pname);\n }\n /**\n * ```\n * gl.getProgramInfoLog(program);\n * ```\n *\n * @param program\n * @returns\n */\n getProgramInfoLog(program) {\n const { gl } = this;\n return gl.getProgramInfoLog(program);\n }\n /**\n * ```\n * gl.shaderSource(shader, source);\n * ```\n *\n * @param shader\n * @param source\n */\n shaderSource(shader, source) {\n const { gl } = this;\n gl.shaderSource(shader, source);\n }\n /**\n * ```\n * gl.deleteShader(shader);\n * ```\n *\n * @param shader\n */\n deleteShader(shader) {\n const { gl } = this;\n gl.deleteShader(shader);\n }\n}\n/**\n * Compare two arrays for equality.\n *\n * @remarks\n * This function will not try to compare nested arrays or Float32Arrays and\n * instead will always return false when they are encountered.\n *\n * @param a\n * @param b\n * @returns\n */\nexport function compareArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((v, i) => {\n // Don't bother to compare nested arrays or Float32Arrays\n if (Array.isArray(v) || v instanceof Float32Array) {\n return false;\n }\n else {\n return v === b[i];\n }\n });\n}\n//# sourceMappingURL=WebGlContextWrapper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generic WebGL Utility Functions\n *\n * @remarks\n * Nothing here should be coupled to Renderer logic / types.\n *\n * @param gl\n * @returns\n */\nexport function isWebGl2(gl) {\n return (self.WebGL2RenderingContext && gl instanceof self.WebGL2RenderingContext);\n}\n//# sourceMappingURL=WebGlUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nexport class RenderTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = RenderTexture.resolveDefaults(props || {});\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n }\n async getTextureData() {\n return {\n data: null,\n premultiplyAlpha: null,\n };\n }\n static resolveDefaults(props) {\n return {\n width: props.width || 256,\n height: props.height || 256,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=RenderTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2024 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxRenderTexture extends WebGlCoreCtxTexture {\n framebuffer;\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n // Create Framebuffer object\n const framebuffer = glw.createFramebuffer();\n assertTruthy(framebuffer, 'Unable to create framebuffer');\n this.framebuffer = framebuffer;\n }\n async onLoadRequest() {\n const { glw, memManager } = this;\n const nativeTexture = (this._nativeCtxTexture =\n this.createNativeCtxTexture());\n const { width, height } = this.textureSource;\n // Set the dimensions of the render texture\n glw.texImage2D(0, glw.RGBA, width, height, 0, glw.RGBA, glw.UNSIGNED_BYTE, null);\n // Update the texture memory manager\n memManager.setTextureMemUse(this, width * height * 4);\n // Bind the framebuffer\n glw.bindFramebuffer(this.framebuffer);\n // Attach the texture to the framebuffer\n glw.framebufferTexture2D(glw.COLOR_ATTACHMENT0, nativeTexture, 0);\n // Unbind the framebuffer\n glw.bindFramebuffer(null);\n return {\n width,\n height,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxRenderTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, createWebGLContext, hasOwn, mergeColorAlphaPremultiplied, } from '../../../utils.js';\nimport { CoreRenderer } from '../CoreRenderer.js';\nimport { WebGlCoreRenderOp } from './WebGlCoreRenderOp.js';\nimport { createIndexBuffer, getWebGlParameters, getWebGlExtensions, } from './internal/RendererUtils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nimport { Texture } from '../../textures/Texture.js';\nimport { ColorTexture } from '../../textures/ColorTexture.js';\nimport { SubTexture } from '../../textures/SubTexture.js';\nimport { WebGlCoreCtxSubTexture } from './WebGlCoreCtxSubTexture.js';\nimport { CoreShaderManager } from '../../CoreShaderManager.js';\nimport { BufferCollection } from './internal/BufferCollection.js';\nimport { compareRect, getNormalizedRgbaComponents, } from '../../lib/utils.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nimport { RoundedRectangle } from './shaders/RoundedRectangle.js';\nimport { ContextSpy } from '../../lib/ContextSpy.js';\nimport { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';\nimport { RenderTexture } from '../../textures/RenderTexture.js';\nimport { WebGlCoreCtxRenderTexture } from './WebGlCoreCtxRenderTexture.js';\nconst WORDS_PER_QUAD = 24;\nconst BYTES_PER_QUAD = WORDS_PER_QUAD * 4;\nexport class WebGlCoreRenderer extends CoreRenderer {\n //// WebGL Native Context and Data\n glw;\n system;\n //// Core Managers\n txManager;\n txMemManager;\n shManager;\n //// Options\n options;\n //// Persistent data\n quadBuffer = new ArrayBuffer(1024 * 1024 * 4);\n fQuadBuffer = new Float32Array(this.quadBuffer);\n uiQuadBuffer = new Uint32Array(this.quadBuffer);\n renderOps = [];\n //// Render Op / Buffer Filling State\n curBufferIdx = 0;\n curRenderOp = null;\n rttNodes = [];\n activeRttNode = null;\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\n /**\n * Whether the renderer is currently rendering to a texture.\n */\n renderToTextureActive = false;\n constructor(options) {\n super(options.stage);\n const { canvas, clearColor, bufferMemory } = options;\n this.options = options;\n this.txManager = options.txManager;\n this.txMemManager = options.txMemManager;\n this.shManager = options.shManager;\n this.defaultTexture = new ColorTexture(this.txManager);\n // When the default texture is loaded, request a render in case the\n // RAF is paused. Fixes: https://github.com/lightning-js/renderer/issues/123\n this.defaultTexture.once('loaded', () => {\n this.stage.requestRender();\n });\n const gl = createWebGLContext(canvas, options.contextSpy);\n const glw = (this.glw = new WebGlContextWrapper(gl));\n const color = getNormalizedRgbaComponents(clearColor);\n glw.viewport(0, 0, canvas.width, canvas.height);\n glw.clearColor(color[0], color[1], color[2], color[3]);\n glw.setBlend(true);\n glw.blendFunc(glw.ONE, glw.ONE_MINUS_SRC_ALPHA);\n createIndexBuffer(glw, bufferMemory);\n this.system = {\n parameters: getWebGlParameters(this.glw),\n extensions: getWebGlExtensions(this.glw),\n };\n this.shManager.renderer = this;\n this.defaultShader = this.shManager.loadShader('DefaultShader').shader;\n const quadBuffer = glw.createBuffer();\n assertTruthy(quadBuffer);\n const stride = 6 * Float32Array.BYTES_PER_ELEMENT;\n this.quadBufferCollection = new BufferCollection([\n {\n buffer: quadBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_color: {\n name: 'a_color',\n size: 4,\n type: glw.UNSIGNED_BYTE,\n normalized: true,\n stride,\n offset: 4 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_textureIndex: {\n name: 'a_textureIndex',\n size: 1,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 5 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n }\n reset() {\n const { glw } = this;\n this.curBufferIdx = 0;\n this.curRenderOp = null;\n this.renderOps.length = 0;\n glw.setScissorTest(false);\n glw.clear();\n }\n getShaderManager() {\n return this.shManager;\n }\n createCtxTexture(textureSource) {\n if (textureSource instanceof SubTexture) {\n return new WebGlCoreCtxSubTexture(this.glw, this.txMemManager, textureSource);\n }\n else if (textureSource instanceof RenderTexture) {\n return new WebGlCoreCtxRenderTexture(this.glw, this.txMemManager, textureSource);\n }\n return new WebGlCoreCtxTexture(this.glw, this.txMemManager, textureSource);\n }\n /**\n * This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.\n *\n * It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix.\n * The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided.\n * It then checks if a new render operation is needed, based on the current shader and clipping rectangle.\n * If a new render operation is needed, it creates one and updates the current render operation.\n * The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.\n *\n * Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer.\n * The function updates the length and number of quads in the current render operation, and updates the current buffer index.\n */\n addQuad(params) {\n const { fQuadBuffer, uiQuadBuffer } = this;\n const { width, height, colorTl, colorTr, colorBl, colorBr, textureOptions, shader, shaderProps, alpha, clippingRect, tx, ty, ta, tb, tc, td, rtt: renderToTexture, parentHasRenderTexture, framebufferDimensions, } = params;\n let { texture } = params;\n /**\n * If the shader props contain any automatic properties, update it with the\n * current dimensions that will be used to render the quad.\n */\n if (shaderProps && hasOwn(shaderProps, '$dimensions')) {\n const dimensions = shaderProps.$dimensions;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n dimensions.width = width;\n dimensions.height = height;\n }\n texture = texture ?? this.defaultTexture;\n assertTruthy(texture instanceof Texture, 'Invalid texture type');\n let { curBufferIdx: bufferIdx, curRenderOp } = this;\n const targetDims = {\n width,\n height,\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (!this.reuseRenderOp(params)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx, renderToTexture, parentHasRenderTexture, framebufferDimensions);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n }\n const flipX = textureOptions?.flipX ?? false;\n const flipY = textureOptions?.flipY ?? false;\n let texCoordX1 = 0;\n let texCoordY1 = 0;\n let texCoordX2 = 1;\n let texCoordY2 = 1;\n if (texture instanceof SubTexture) {\n const { x: tx, y: ty, width: tw, height: th } = texture.props;\n const { width: parentW = 0, height: parentH = 0 } = texture.parentTexture\n .dimensions || { width: 0, height: 0 };\n texCoordX1 = tx / parentW;\n texCoordX2 = texCoordX1 + tw / parentW;\n texCoordY1 = ty / parentH;\n texCoordY2 = texCoordY1 + th / parentH;\n texture = texture.parentTexture;\n }\n // Flip texture coordinates if dictated by texture options\n if (flipX) {\n [texCoordX1, texCoordX2] = [texCoordX2, texCoordX1];\n }\n if (flipY) {\n [texCoordY1, texCoordY2] = [texCoordY2, texCoordY1];\n }\n const { txManager } = this.stage;\n const ctxTexture = txManager.getCtxTexture(texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxTexture);\n const textureIdx = this.addTexture(ctxTexture, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n // render quad advanced\n if (tb !== 0 || tc !== 0) {\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta;\n fQuadBuffer[bufferIdx++] = ty + width * tc;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx + height * tb;\n fQuadBuffer[bufferIdx++] = ty + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta + height * tb;\n fQuadBuffer[bufferIdx++] = ty + width * tc + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n else {\n // Calculate the right corner of the quad\n // multiplied by the scale\n const rightCornerX = tx + width * ta;\n const rightCornerY = ty + height * td;\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = ty;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n // Update the length of the current render op\n curRenderOp.length += WORDS_PER_QUAD;\n curRenderOp.numQuads++;\n this.curBufferIdx = bufferIdx;\n }\n /**\n * Replace the existing RenderOp with a new one that uses the specified Shader\n * and starts at the specified buffer index.\n *\n * @param shader\n * @param bufferIdx\n */\n newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx, renderToTexture, parentHasRenderTexture, framebufferDimensions) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0, // Z-Index is only used for explictly added Render Ops\n renderToTexture, parentHasRenderTexture, framebufferDimensions);\n this.curRenderOp = curRenderOp;\n this.renderOps.push(curRenderOp);\n }\n /**\n * Add a texture to the current RenderOp. If the texture cannot be added to the\n * current RenderOp, a new RenderOp will be created and the texture will be added\n * to that one.\n *\n * If the texture cannot be added to the new RenderOp, an error will be thrown.\n *\n * @param texture\n * @param bufferIdx\n * @param recursive\n * @returns Assigned Texture Index of the texture in the render op\n */\n addTexture(texture, bufferIdx, recursive) {\n const { curRenderOp } = this;\n assertTruthy(curRenderOp);\n const textureIdx = curRenderOp.addTexture(texture);\n // TODO: Refactor to be more DRY\n if (textureIdx === 0xffffffff) {\n if (recursive) {\n throw new Error('Unable to add texture to render op');\n }\n const { shader, shaderProps, dimensions, clippingRect, alpha } = curRenderOp;\n this.newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx);\n return this.addTexture(texture, bufferIdx, true);\n }\n return textureIdx;\n }\n /**\n * Test if the current Render operation can be reused for the specified parameters.\n * @param params\n * @returns\n */\n reuseRenderOp(params) {\n const { shader, shaderProps, parentHasRenderTexture, rtt, clippingRect } = params;\n const targetShader = shader || this.defaultShader;\n // Switching shader program will require a new render operation\n if (this.curRenderOp?.shader !== targetShader) {\n return false;\n }\n // Switching clipping rect will require a new render operation\n if (!compareRect(this.curRenderOp.clippingRect, clippingRect)) {\n return false;\n }\n // Force new render operation if rendering to texture\n // @todo: This needs to be improved, render operations could also be reused\n // for rendering to texture\n if (parentHasRenderTexture || rtt) {\n return false;\n }\n // Check if the shader can batch the shader properties\n if (this.curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !this.curRenderOp.shader.canBatchShaderProps(this.curRenderOp.shaderProps, shaderProps))) {\n return false;\n }\n // Render operation can be reused\n return true;\n }\n /**\n * add RenderOp to the render pipeline\n */\n addRenderOp(renderable) {\n this.renderOps.push(renderable);\n this.curRenderOp = null;\n }\n /**\n * Render the current set of RenderOps to render to the specified surface.\n *\n * TODO: 'screen' is the only supported surface at the moment.\n *\n * @param surface\n */\n render(surface = 'screen') {\n const { glw, quadBuffer } = this;\n const arr = new Float32Array(quadBuffer, 0, this.curBufferIdx);\n const buffer = this.quadBufferCollection.getBuffer('a_position') ?? null;\n glw.arrayBufferData(buffer, arr, glw.STATIC_DRAW);\n const doLog = false; // idx++ % 100 === 0;\n if (doLog) {\n console.log('renderOps', this.renderOps.length);\n }\n this.renderOps.forEach((renderOp, i) => {\n if (doLog) {\n console.log('Quads per operation', renderOp.numQuads);\n }\n renderOp.draw();\n });\n }\n renderToTexture(node) {\n for (let i = 0; i < this.rttNodes.length; i++) {\n if (this.rttNodes[i] === node) {\n return;\n }\n }\n // @todo: Better bottom up rendering order\n this.rttNodes.unshift(node);\n }\n renderRTTNodes() {\n const { glw } = this;\n const { txManager } = this.stage;\n // Render all associated RTT nodes to their textures\n for (let i = 0; i < this.rttNodes.length; i++) {\n const node = this.rttNodes[i];\n // Skip nodes that don't have RTT updates\n if (!node || !node.hasRTTupdates) {\n continue;\n }\n // Set the active RTT node to the current node\n // So we can prevent rendering children of nested RTT nodes\n this.activeRttNode = node;\n assertTruthy(node.texture, 'RTT node missing texture');\n const ctxTexture = txManager.getCtxTexture(node.texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxRenderTexture);\n this.renderToTextureActive = true;\n // Bind the the texture's framebuffer\n glw.bindFramebuffer(ctxTexture.framebuffer);\n glw.viewport(0, 0, ctxTexture.w, ctxTexture.h);\n glw.clear();\n // Render all associated quads to the texture\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n child.update(this.stage.deltaTime, {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n });\n this.stage.addQuads(child);\n child.hasRTTupdates = false;\n }\n // Render all associated quads to the texture\n this.render();\n // Reset render operations\n this.renderOps.length = 0;\n node.hasRTTupdates = false;\n }\n // Bind the default framebuffer\n glw.bindFramebuffer(null);\n glw.viewport(0, 0, this.glw.canvas.width, this.glw.canvas.height);\n this.renderToTextureActive = false;\n }\n}\n//# sourceMappingURL=WebGlCoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const SpecialCodepoints = {\n LINE_FEED: 0x0a,\n CARRIAGE_RETURN: 0x0d,\n SPACE: 0x20,\n TAB: 0x09,\n ZERO_WIDTH_SPACE: 0x200b,\n ZERO_WIDTH_NON_JOINER: 0x200c,\n ZERO_WIDTH_JOINER: 0x200d,\n LEFT_TO_RIGHT_MARK: 0x200e,\n RIGHT_TO_LEFT_MARK: 0x200f,\n LEFT_TO_RIGHT_EMBEDDING: 0x202a,\n RIGHT_TO_LEFT_EMBEDDING: 0x202b,\n POP_DIRECTIONAL_FORMATTING: 0x202c,\n LEFT_TO_RIGHT_OVERRIDE: 0x202d,\n RIGHT_TO_LEFT_OVERRIDE: 0x202e,\n LINE_SEPARATOR: 0x2028,\n PARAGRAPH_SEPARATOR: 0x2029,\n OBJECT_REPLACEMENT_CHARACTER: 0xfffc,\n REPLACEMENT_CHARACTER: 0xfffd,\n ZERO_WIDTH_NO_BREAK_SPACE: 0xfeff,\n LEFT_TO_RIGHT_ISOLATE: 0x2066,\n RIGHT_TO_LEFT_ISOLATE: 0x2067,\n FIRST_STRONG_ISOLATE: 0x2068,\n POP_DIRECTIONAL_ISOLATE: 0x2069,\n INHIBIT_SYMMETRIC_SWAPPING: 0x206a,\n ACTIVATE_SYMMETRIC_SWAPPING: 0x206b,\n INHIBIT_ARABIC_FORM_SHAPING: 0x206c,\n ACTIVATE_ARABIC_FORM_SHAPING: 0x206d,\n NATIONAL_DIGIT_SHAPES: 0x206e,\n NOMINAL_DIGIT_SHAPES: 0x206f,\n LEFT_TO_RIGHT_BOUNDARY: 0x200e,\n RIGHT_TO_LEFT_BOUNDARY: 0x200f,\n};\n//# sourceMappingURL=SpecialCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FontShaper {\n}\n//# sourceMappingURL=FontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SpecialCodepoints } from '../../../renderers/SdfTextRenderer/internal/SpecialCodepoints.js';\nimport { FontShaper, } from './FontShaper.js';\nexport class SdfFontShaper extends FontShaper {\n data;\n glyphMap;\n kernings;\n constructor(data, glyphMap) {\n super();\n this.data = data;\n this.glyphMap = glyphMap;\n const kernings = (this.kernings = {});\n data.kernings.forEach((kerning) => {\n const second = kerning.second;\n const firsts = (kernings[second] = kernings[second] || {});\n firsts[kerning.first] = kerning.amount;\n });\n this.kernings = kernings;\n }\n *shapeText(props, codepoints) {\n let codepointResult;\n let lastGlyphId = undefined;\n while ((codepointResult = codepoints.peek()) && !codepointResult.done) {\n const codepoint = codepointResult.value;\n const glyph = this.glyphMap.get(codepoint);\n codepoints.next();\n if (glyph !== undefined) {\n // We found a glyph for this codepoint\n // Yield the mapped glyph info\n /**\n * Kerning includes any possible additional letter spacing\n */\n const kerning = lastGlyphId !== undefined\n ? (this.kernings[glyph.id]?.[lastGlyphId] || 0) +\n props.letterSpacing\n : 0;\n lastGlyphId = glyph.id;\n yield {\n mapped: true,\n glyphId: glyph.id,\n codepoint,\n cluster: codepoints.lastIndex,\n xAdvance: glyph.xadvance + kerning,\n yAdvance: 0,\n xOffset: glyph.xoffset + kerning,\n yOffset: glyph.yoffset,\n xBearing: 0,\n yBearing: 0,\n width: glyph.width,\n height: glyph.height,\n };\n }\n else {\n // We didn't find a glyph for this codepoint\n // Yield the unmapped codepoint info\n // If this codepoint is a linebreak, we should reset the last glyph id\n // so that the next glyph will not be kerned with the last glyph of the\n // previous line.\n if (codepoint === SpecialCodepoints.LINE_FEED) {\n lastGlyphId = undefined;\n }\n yield {\n mapped: false,\n codepoint,\n cluster: codepoints.lastIndex,\n };\n }\n }\n }\n}\n//# sourceMappingURL=SdfFontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// import type { Renderer } from '../../../Renderer';\nimport { assertTruthy } from '../../../../utils.js';\nimport { WebGlCoreRenderer } from '../../../renderers/webgl/WebGlCoreRenderer.js';\nimport { ImageTexture } from '../../../textures/ImageTexture.js';\nimport { TrFontFace } from '../TrFontFace.js';\nimport { SdfFontShaper } from './internal/SdfFontShaper.js';\nexport class SdfTrFontFace extends TrFontFace {\n type;\n texture;\n /**\n * Height of the tallest character in the font including the whitespace above it\n */\n maxCharHeight = 0;\n data;\n shaper;\n glyphMap = new Map();\n constructor(fontFamily, descriptors, type, stage, atlasUrl, atlasDataUrl) {\n super(fontFamily, descriptors);\n this.type = type;\n const renderer = stage.renderer;\n assertTruthy(renderer instanceof WebGlCoreRenderer, 'SDF Font Faces can only be used with the WebGL Renderer');\n this.texture = stage.txManager.loadTexture('ImageTexture', {\n src: atlasUrl,\n // IMPORTANT: The SDF shader requires the alpha channel to NOT be\n // premultiplied on the atlas texture. If it is premultiplied, the\n // rendering of SDF glyphs (especially single-channel SDF fonts) will\n // be very jagged.\n premultiplyAlpha: false,\n }, {\n preload: true,\n });\n this.texture.on('loaded', () => {\n this.checkLoaded();\n });\n // Set this.data to the fetched data from dataUrl\n fetch(atlasDataUrl)\n .then(async (response) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.data = await response.json();\n // Add all the glyphs to the glyph map\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let maxCharHeight = 0;\n this.data.chars.forEach((glyph) => {\n this.glyphMap.set(glyph.id, glyph);\n const charHeight = glyph.yoffset + glyph.height;\n if (charHeight > maxCharHeight) {\n maxCharHeight = charHeight;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.maxCharHeight = maxCharHeight;\n // We know `data` is defined here, because we just set it\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shaper = new SdfFontShaper(this.data, this.glyphMap);\n this.checkLoaded();\n })\n .catch(console.error);\n }\n getAtlasEntry(glyphId) {\n const glyph = this.glyphMap.get(glyphId);\n if (glyph === undefined) {\n throw new Error(`Glyph ${glyphId} not found in font ${this.fontFamily}`);\n }\n return {\n x: glyph.x,\n y: glyph.y,\n width: glyph.width,\n height: glyph.height,\n };\n }\n checkLoaded() {\n if (this.loaded)\n return;\n if (this.texture.state === 'loaded' && this.data) {\n this.loaded = true;\n this.emit('loaded');\n }\n }\n}\n//# sourceMappingURL=SdfTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Base class for Core extensions.\n *\n * @remarks\n * Core extensions are used to extend the Core Renderer with custom code such as\n * custom fonts, custom shaders, custom textures, custom animation functions,\n * and more.\n */\nexport class CoreExtension {\n}\n//# sourceMappingURL=CoreExtension.js.map"],"names":["assertTruthy","condition","message","hasOwn","obj","prop","Object","prototype","hasOwnProperty","call","isProductionEnvironment","BASE_URL","MODE","DEV","PROD","SSR","LEGACY","a","b","out","intersection","createBound","Math","max","x1","y1","min","x2","y2","x","y","width","height","rgba","color","r","floor","g","toFixed","bound","alpha","flipEndianess","newAlpha","trunc","rgba1","rgba2","p","r1","g1","b1","a1","r2","g2","b2","a2","round","bound1","bound2","EventEmitter","constructor","_defineProperty","this","on","event","listener","listeners","eventListeners","push","off","index","indexOf","splice","once","onceListener","target","data","emit","forEach","removeAllListeners","exports","CoreShader","makeCacheKey","props","resolveDefaults","createShader","glw","type","source","shader","Error","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","log","getShaderInfoLog","deleteShader","WebGlCoreShader","options","super","renderer","supportsIndexedTextures","webGl2","isWebGl2","requiredExtensions","webgl2Extensions","webgl1Extensions","glVersion","extensionName","getExtension","name","shaderSources","fragment","vertex","textureUnits","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","vertexSource","Function","fragmentSource","vertexShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","program","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","deleteProgram","vao","createVertexArray","bindVertexArray","attributeLocations","attributeBuffers","attributeNames","attributes","attributeName","location","getAttribLocation","buffer","createBuffer","uniformLocations","uniformTypes","uniforms","uniform","getUniformLocation","warn","bindBufferAttribute","attribute","enableVertexAttribArray","vertexAttribPointer","size","normalized","stride","offset","disableAttribute","disableVertexAttribArray","disableAttributes","loc","boundBufferCollection","canBatchShaderProps","propsA","propsB","bindRenderOp","renderOp","bindBufferCollection","buffers","textures","length","bindTextures","parentHasRenderTexture","renderToTexture","_ref","framebufferDimensions","setUniform","Float32Array","pixelRatio","canvas","dimensions","$dimensions","$alpha","bindProps","value","resolvedBuffer","getBuffer","resolvedInfo","getAttributeInfo","attach","useProgram","detach","Texture","txManager","Set","setRenderableOwner","owner","renderable","renderableOwners","add","delete","setState","state","args","loadedArgs","failedArgs","error","getNormalizedRgbaComponents","TrFontFace","fontFamily","descriptors","_objectSpread","style","weight","stretch","convertToCssFontFaceDescriptors","unicodeRange","variant","featureSettings","display","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","shaderProps","clippingRect","bufferIdx","zIndex","maxTextures","getParameter","addTexture","texture","existingIdx","findIndex","t","newIdx","draw","shManager","useShader","quadIdx","valid","_this$clippingRect","canvasHeight","clipX","clipWidth","clipHeight","clipY","setScissorTest","scissor","drawElements","TRIANGLES","numQuads","UNSIGNED_SHORT","getWebGlParameters","params","MAX_RENDERBUFFER_SIZE","MAX_TEXTURE_SIZE","MAX_VIEWPORT_DIMS","MAX_TEXTURE_IMAGE_UNITS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_VERTEX_ATTRIBS","MAX_VARYING_VECTORS","MAX_VERTEX_UNIFORM_VECTORS","MAX_FRAGMENT_UNIFORM_VECTORS","keys","key","getWebGlExtensions","extensions","ANGLE_instanced_arrays","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc_srgb","OES_vertex_array_object","memize","fn","head","tail","memoized","i","node","len","arguments","searchCache","next","prev","val","Array","apply","maxSize","clear","isPowerOfTwo","getTimingBezier","c","d","xc","xb","xa","yc","yb","ya","time","cbxd","dx","it","minT","maxT","memo","str","s","parts","substr","split","parseFloat","isNaN","hypot","sqrt","TRANSPARENT_TEXTURE_DATA","Uint8Array","WebGlCoreCtxTexture","ctxTexture","_state","load","_nativeCtxTexture","w","_w","h","_h","createNativeCtxTexture","onLoadRequest","then","catch","err","_this","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this$textureSource","textureData","_mipmaps$","_textureData$data","mipmaps","_textureData$data$wid","_width","_textureData$data$hei","_height","glInternalFormat","view","wrap","_callee$","_context","texImage2D","RGBA","UNSIGNED_BYTE","setTextureMemUse","byteLength","getTextureData","sent","abrupt","activeTexture","ImageBitmap","ImageData","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","premultiplyAlpha","generateMipmap","DataView","ArrayBuffer","compressedTexImage2D","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","stop","free","deleteTexture","nativeTexture","createTexture","ColorTexture","_this2","_callee2","pixelData32","pixelData8","_context2","Uint32Array","Uint8ClampedArray","SubTexture","parentTexture","loadTexture","txType","queueMicrotask","parentTx","onParentTxLoaded","onParentTxFailed","_this3","_callee3","_context3","WebGlCoreCtxSubTexture","_this4","_callee4","_props$data","_props$data2","_context4","BufferCollection","config","_this$config$find","find","item","_this$config$find2","WebGlContextWrapper","gl","WeakMap","activeTextureUnit","ACTIVE_TEXTURE","TEXTURE0","maxTextureUnits","texture2dUnits","fill","undefined","map","_","TEXTURE_BINDING_2D","scissorEnabled","isEnabled","SCISSOR_TEST","scissorBox","SCISSOR_BOX","scissorX","scissorY","scissorWidth","scissorHeight","blendEnabled","BLEND","blendSrcRgb","BLEND_SRC_RGB","blendDstRgb","BLEND_DST_RGB","blendSrcAlpha","BLEND_SRC_ALPHA","blendDstAlpha","BLEND_DST_ALPHA","boundArrayBuffer","ARRAY_BUFFER_BINDING","boundElementArrayBuffer","ELEMENT_ARRAY_BUFFER_BINDING","curProgram","CURRENT_PROGRAM","UNPACK_FLIP_Y_WEBGL","FLOAT","ONE","ONE_MINUS_SRC_ALPHA","STATIC_DRAW","DYNAMIC_DRAW","COLOR_ATTACHMENT0","self","WebGL2RenderingContext","textureUnit","TEXTURE_2D","_getActiveTexture","pname","param","texture2dParams","textureParams","get","set","level","internalFormat","widthOrFormat","heightOrType","borderOrSource","format","pixels","internalformat","border","viewport","clearColor","red","green","blue","enable","disable","setBlend","blend","blendFunc","src","dst","createFramebuffer","bindFramebuffer","framebuffer","FRAMEBUFFER","framebufferTexture2D","attachment","COLOR_BUFFER_BIT","arrayBufferData","usage","bindBuffer","ARRAY_BUFFER","bufferData","elementArrayBufferData","ELEMENT_ARRAY_BUFFER","programUniforms","Map","uniformArgs","every","v","isArray","compareArrays","mode","count","vertexArray","RenderTexture","_callee5","_context5","WebGlCoreCtxRenderTexture","_this5","_callee6","_this5$textureSource","_callee6$","_context6","WebGlCoreRenderer","quadBuffer","bufferMemory","txMemManager","defaultTexture","requestRender","contextSpy","antialias","depth","stencil","desynchronized","powerPreference","premultipliedAlpha","preserveDrawingBuffer","getContext","Proxy","increment","String","bind","createWebGLContext","maxQuads","indices","Uint16Array","j","createIndexBuffer","defaultShader","loadShader","BYTES_PER_ELEMENT","quadBufferCollection","a_position","a_textureCoordinate","a_color","a_textureIndex","reset","curBufferIdx","curRenderOp","renderOps","getShaderManager","createCtxTexture","addQuad","_texture","_textureOptions$flipX","_textureOptions$flipY","fQuadBuffer","uiQuadBuffer","colorTl","colorTr","colorBl","colorBr","textureOptions","tx","ty","ta","tb","tc","td","rtt","targetDims","targetShader","reuseRenderOp","newRenderOp","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","_texture$props","tw","th","_ref2","_ref2$width","parentW","_ref2$height","parentH","_ref3","_ref4","getCtxTexture","textureIdx","rightCornerX","rightCornerY","recursive","_this$curRenderOp","addRenderOp","render","surface","_this$quadBufferColle","arr","rttNodes","unshift","renderRTTNodes","hasRTTupdates","activeRttNode","renderToTextureActive","children","child","update","deltaTime","addQuads","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","first","amount","shapeText","codepoints","_this6","_callee7","codepointResult","lastGlyphId","codepoint","glyph","_this6$kernings$glyph","_context7","peek","done","id","letterSpacing","mapped","glyphId","cluster","lastIndex","xAdvance","xadvance","yAdvance","xOffset","xoffset","yOffset","yoffset","xBearing","yBearing","atlasUrl","atlasDataUrl","_this7","preload","checkLoaded","fetch","_ref5","_callee8","response","maxCharHeight","_context8","json","chars","charHeight","shaper","_x","getAtlasEntry","loaded"],"mappings":"8hPAkEgB,SAAAA,EAAaC,EAAWC,GAMxC,CA2FgB,SAAAC,EAAOC,EAAKC,GACxB,OAAOC,OAAOC,UAAUC,eAAeC,KAAKL,EAAKC,EACrD,CAyBO,SAASK,IACZ,MAAO,CAAmBC,SAAA,mBAAAC,KAAA,aAAAC,KAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,QAAA,KAAA,CAC9B,cC9GO,SAAwBC,EAAGC,EAAGC,GACjC,IAAMC,EAAeC,EAAYC,KAAKC,IAAIN,EAAEO,GAAIN,EAAEM,IAAKF,KAAKC,IAAIN,EAAEQ,GAAIP,EAAEO,IAAKH,KAAKI,IAAIT,EAAEU,GAAIT,EAAES,IAAKL,KAAKI,IAAIT,EAAEW,GAAIV,EAAEU,IAAKT,GACzH,GAAIC,EAAaI,GAAKJ,EAAaO,IAAMP,EAAaK,GAAKL,EAAaQ,GACpE,OAAOR,EAEX,OAAOC,EAAY,EAAG,EAAG,EAAG,EAAGD,EACnC,IAmBO,SAAuBH,EAAGC,EAAGC,GAChC,IAAMU,EAAIP,KAAKC,IAAIN,EAAEY,EAAGX,EAAEW,GACpBC,EAAIR,KAAKC,IAAIN,EAAEa,EAAGZ,EAAEY,GACpBC,EAAQT,KAAKI,IAAIT,EAAEY,EAAIZ,EAAEc,MAAOb,EAAEW,EAAIX,EAAEa,OAASF,EACjDG,EAASV,KAAKI,IAAIT,EAAEa,EAAIb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,WAAAA,GACQnmB,KAAKgnB,QAEkB,WAAvBhnB,KAAKgL,QAAQhC,OAAsBhJ,KAAKc,OACxCd,KAAKgnB,QAAS,EACdhnB,KAAKe,KAAK,UAEjB,ICpELG,EAAA,IADO","x_google_ignoreList":[13]} \ No newline at end of file diff --git a/assets/CoreExtension-legacy-SS_VGrQO.js b/assets/CoreExtension-legacy-SS_VGrQO.js deleted file mode 100644 index 4707d03..0000000 --- a/assets/CoreExtension-legacy-SS_VGrQO.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var e,r={},i=Object.prototype,n=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",h=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(e){d=function(t,e,r){return t[e]=r}}function c(t,e,r,i){var n=e&&e.prototype instanceof T?e:T,a=Object.create(n.prototype),o=new N(i||[]);return s(a,"_invoke",{value:S(t,r,o)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=c;var f="suspendedStart",v="suspendedYield",g="executing",p="completed",E={};function T(){}function x(){}function _(){}var m={};d(m,o,(function(){return this}));var R=Object.getPrototypeOf,A=R&&R(R(U([])));A&&A!==i&&n.call(A,o)&&(m=A);var b=_.prototype=T.prototype=Object.create(m);function y(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(i,s,a,o){var h=l(t[i],t,s);if("throw"!==h.type){var u=h.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,a,o)}),(function(t){r("throw",t,a,o)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,o)}))}o(h.arg)}var i;s(this,"_invoke",{value:function(t,n){function s(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(s,s):s()}})}function S(t,r,i){var n=f;return function(s,a){if(n===g)throw Error("Generator is already running");if(n===p){if("throw"===s)throw a;return{value:e,done:!0}}for(i.method=s,i.arg=a;;){var o=i.delegate;if(o){var h=M(o,i);if(h){if(h===E)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===f)throw n=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=g;var u=l(t,r,i);if("normal"===u.type){if(n=i.done?p:v,u.arg===E)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(n=p,i.method="throw",i.arg=u.arg)}}}function M(t,r){var i=r.method,n=t.iterator[i];if(n===e)return r.delegate=null,"throw"===i&&t.iterator.return&&(r.method="return",r.arg=e,M(t,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),E;var s=l(n,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,E;var a=s.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,E):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,E)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function U(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function r(){for(;++i=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var h=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(h&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),E}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;L(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,r,i){return this.delegate={iterator:U(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=e),E}},r}function e(t,e,r,i,n,s,a){try{var o=t[s](a),h=o.value}catch(u){return void r(u)}o.done?e(h):Promise.resolve(h).then(i,n)}function r(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var a=t.apply(r,i);function o(t){e(a,n,s,o,h,"next",t)}function h(t){e(a,n,s,o,h,"throw",t)}o(void 0)}))}}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}System.register([],(function(e,s){"use strict";return{execute:function(){function s(t,e){if(!t)throw new Error(e||"Assertion failed")}function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function o(){return{BASE_URL:"/solid-demo-app/",MODE:"development",DEV:!0,PROD:!1,SSR:!1,LEGACY:!0}&&!1}e({a:s,c:v,d:function(t,e,r){var i=v(Math.max(t.x1,e.x1),Math.max(t.y1,e.y1),Math.min(t.x2,e.x2),Math.min(t.y2,e.y2),r);if(i.x10&&a>0)return r?(r.x=i,r.y=n,r.width=s,r.height=a,r):{x:i,y:n,width:s,height:a};if(r)return r.x=0,r.y=0,r.width=0,r.height=0,r;return{x:0,y:0,width:0,height:0}},f:function(t){return(255&t)/255},g:function(t){var e=Math.floor(255*t[0]),r=Math.floor(255*t[1]),i=Math.floor(255*t[2]),n=Math.floor(255*t[3]);return`rgba(${e},${r},${i},${n.toFixed(4)})`},h:R,i:o,k:function(t){return t.x1e.x1&&t.y1e.y1},m:function(t,e,r=!1){var i=(255&t)/255*e,n=Math.trunc((t>>>24)*i),s=Math.trunc((t>>>16&255)*i),a=Math.trunc((t>>>8&255)*i),o=Math.trunc(255*i);if(r)return(o<<24|a<<16|s<<8|n)>>>0;return(n<<24|s<<16|a<<8|o)>>>0},n:function(t,e){if(e)return e.x=t.x1,e.y=t.y1,e.width=t.x2-t.x1,e.height=t.y2-t.y1,e;return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}},o:function(t,e){if(e)return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e;return{x:t.x,y:t.y,width:t.width,height:t.height}},q:function(t,e){var r=t>>>24,i=t>>>16&255,n=t>>>8&255,s=Math.trunc((255&t)*e);return(r<<24|i<<16|n<<8|s)>>>0},s:function(t,e,r){var i=Math.trunc(t>>>24),n=Math.trunc(t>>>16&255),s=Math.trunc(t>>>8&255),a=Math.trunc(255&t),o=Math.trunc(e>>>24),h=Math.trunc(e>>>16&255),u=Math.trunc(e>>>8&255),d=Math.trunc(255&e),c=Math.round(o*r+i*(1-r)),l=Math.round(h*r+n*(1-r)),f=Math.round(u*r+s*(1-r)),v=Math.round(d*r+a*(1-r));return(c<<24|l<<16|f<<8|v)>>>0},t:function(t,e){return t.x1<=e.x2&&t.y1<=e.y2&&t.x2>=e.x1&&t.y2>=e.y1}});class h{constructor(){n(this,"eventListeners",{})}on(t,e){var r=this.eventListeners[t];r||(r=[]),r.push(e),this.eventListeners[t]=r}off(t,e){var r=this.eventListeners[t];if(r)if(e){var i=r.indexOf(e);i>=0&&r.splice(i,1)}else delete this.eventListeners[t]}once(t,e){var r=(i,n)=>{this.off(t,r),e(i,n)};this.on(t,r)}emit(t,e){var r=this.eventListeners[t];r&&[...r].forEach((t=>{t(this,e)}))}removeAllListeners(){this.eventListeners={}}}e("E",h);class u{static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}function d(t,e,r){var i=t.createShader(e);if(!i)throw new Error;if(t.shaderSource(i,r),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS))return i;console.log(t.getShaderInfoLog(i)),t.deleteShader(i)}class c extends u{constructor(t){super(),n(this,"boundBufferCollection",null),n(this,"buffersBound",!1),n(this,"program",void 0),n(this,"vao",void 0),n(this,"renderer",void 0),n(this,"glw",void 0),n(this,"attributeBuffers",void 0),n(this,"attributeLocations",void 0),n(this,"attributeNames",void 0),n(this,"uniformLocations",void 0),n(this,"uniformTypes",void 0),n(this,"supportsIndexedTextures",void 0);var e=this.renderer=t.renderer,r=this.glw=this.renderer.glw;this.supportsIndexedTextures=t.supportsIndexedTextures||!1;var i=r.isWebGl2(),s=i&&t.webgl2Extensions||!i&&t.webgl1Extensions||[],a=i?"2.0":"1.0";s.forEach((t=>{if(!r.getExtension(t))throw new Error(`Shader "${this.constructor.name}" requires extension "${t}" for WebGL ${a} but wasn't found`)}));var o=t.shaderSources||this.constructor.shaderSources;if(!o)throw new Error(`Shader "${this.constructor.name}" is missing shaderSources.`);i&&null!=o&&o.webGl2&&(o.fragment=o.webGl2.fragment,o.vertex=o.webGl2.vertex,delete o.webGl2);var h=e.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,u=o.vertex instanceof Function?o.vertex(h):o.vertex,c=o.fragment instanceof Function?o.fragment(h):o.fragment,l=d(r,r.VERTEX_SHADER,u),f=d(r,r.FRAGMENT_SHADER,c);if(!l||!f)throw new Error;var v=function(t,e,r){var i=t.createProgram();if(!i)throw new Error;if(t.attachShader(i,e),t.attachShader(i,r),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS))return i;console.log(t.getProgramInfoLog(i)),t.deleteProgram(i)}(r,l,f);if(!v)throw new Error;if(this.program=v,i){var g=r.createVertexArray();if(!g)throw new Error;this.vao=g,r.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...t.attributes].forEach((t=>{var e=r.getAttribLocation(this.program,t);if(e<0)throw new Error(`${this.constructor.name}: Vertex shader must have an attribute "${t}"!`);var i=r.createBuffer();if(!i)throw new Error(`${this.constructor.name}: Could not create buffer for attribute "${t}"`);this.attributeLocations[t]=e,this.attributeBuffers[t]=i,this.attributeNames.push(t)})),this.uniformLocations={},this.uniformTypes={},t.uniforms.forEach((t=>{var e=r.getUniformLocation(this.program,t.name);this.uniformTypes[t.name]=t.uniform,e?this.uniformLocations[t.name]=e:console.warn(`Shader "${this.constructor.name}" could not get uniform location for "${t.name}"`)}))}bindBufferAttribute(t,e,r){var i=this.glw;i.enableVertexAttribArray(t),i.vertexAttribPointer(e,t,r.size,r.type,r.normalized,r.stride,r.offset)}disableAttribute(t){this.glw.disableVertexAttribArray(t)}disableAttributes(){for(var t in this.attributeLocations)this.disableAttribute(this.attributeLocations[t]);this.boundBufferCollection=null}canBatchShaderProps(t,e){return!1}bindRenderOp(t,e){this.bindBufferCollection(t.buffers),t.textures.length>0&&this.bindTextures(t.textures);var r=t.glw,i=t.parentHasRenderTexture;if(!t.renderToTexture||!i){if(i){var n=t.framebufferDimensions||{},s=n.width,o=n.height;this.setUniform("u_pixelRatio",1),this.setUniform("u_resolution",new Float32Array([null!=s?s:0,null!=o?o:0]))}else this.setUniform("u_pixelRatio",t.options.pixelRatio),this.setUniform("u_resolution",new Float32Array([r.canvas.width,r.canvas.height]));if(e){if(a(e,"$dimensions")){var h=e.$dimensions;h||(h=t.dimensions),this.setUniform("u_dimensions",[h.width,h.height])}if(a(e,"$alpha")){var u=e.$alpha;u||(u=t.alpha),this.setUniform("u_alpha",u)}this.bindProps(e)}}}setUniform(t,...e){this.glw.setUniform(this.uniformTypes[t],this.uniformLocations[t],...e)}bindBufferCollection(t){if(this.boundBufferCollection!==t){for(var e in this.attributeLocations){var r=t.getBuffer(e),i=t.getAttributeInfo(e);s(r,`Buffer for "${e}" not found`),s(i),this.bindBufferAttribute(this.attributeLocations[e],r,i)}this.boundBufferCollection=t}}bindProps(t){}bindTextures(t){}attach(){this.glw.useProgram(this.program),this.glw.useProgram(this.program),this.glw.isWebGl2()&&this.vao&&this.glw.bindVertexArray(this.vao)}detach(){this.disableAttributes()}}n(c,"shaderSources",void 0),e("W",c);class l extends h{constructor(t){super(),n(this,"txManager",void 0),n(this,"dimensions",null),n(this,"error",null),n(this,"state","freed"),n(this,"renderableOwners",new Set),this.txManager=t}setRenderableOwner(t,e){e?this.renderableOwners.add(t):this.renderableOwners.delete(t)}get renderable(){return this.renderableOwners.size>0}setState(t,...e){if(this.state!==t){if(this.state=t,"loaded"===t){var r=e;this.dimensions=r[0]}else if("failed"===t){var i=e;this.error=i[0]}this.emit(t,...e)}}static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}e("j",l);var f=e("b",(t=>[(t>>>24)/255,(t>>>16&255)/255,(t>>>8&255)/255,(255&t)/255]));function v(t,e,r,i,n){return n?(n.x1=t,n.y1=e,n.x2=r,n.y2=i,n):{x1:t,y1:e,x2:r,y2:i}}class g extends h{constructor(t,e){super(),n(this,"fontFamily",void 0),n(this,"descriptors",void 0),n(this,"loaded",!1),this.fontFamily=t,this.descriptors=function(t){for(var e=1;ee===t));if(-1!==i)return i;var n=e.length;return n>=r?4294967295:(this.textures.push(t),n)}draw(){var t=this.glw,e=this.shader,r=this.shaderProps,i=this.options;i.shManager.useShader(e),e.bindRenderOp(this,r);var n=this.bufferIdx/24*6*2;if(this.clippingRect.valid){var s=this.clippingRect,a=s.x,o=s.y,h=s.width,u=s.height,d=i.pixelRatio,c=i.canvas.height,l=Math.round(a*d),f=Math.round(h*d),v=Math.round(u*d),g=Math.round(c-v-o*d);t.setScissorTest(!0),t.scissor(l,g,f,v)}else t.setScissorTest(!1);t.drawElements(t.TRIANGLES,6*this.numQuads,t.UNSIGNED_SHORT,n)}}function _(t){var e={MAX_RENDERBUFFER_SIZE:0,MAX_TEXTURE_SIZE:0,MAX_VIEWPORT_DIMS:0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:0,MAX_TEXTURE_IMAGE_UNITS:0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:0,MAX_VERTEX_ATTRIBS:0,MAX_VARYING_VECTORS:0,MAX_VERTEX_UNIFORM_VECTORS:0,MAX_FRAGMENT_UNIFORM_VECTORS:0};return Object.keys(e).forEach((r=>{e[r]=t.getParameter(t[r])})),e}function m(t){var e={ANGLE_instanced_arrays:null,WEBGL_compressed_texture_s3tc:null,WEBGL_compressed_texture_astc:null,WEBGL_compressed_texture_etc:null,WEBGL_compressed_texture_etc1:null,WEBGL_compressed_texture_pvrtc:null,WEBKIT_WEBGL_compressed_texture_pvrtc:null,WEBGL_compressed_texture_s3tc_srgb:null,OES_vertex_array_object:null};return Object.keys(e).forEach((r=>{e[r]=t.getExtension(r)})),e}function R(t,e){var r,i,n=0;function s(){var s,a,o=r,h=arguments.length;t:for(;o;){if(o.args.length===arguments.length){for(a=0;at&&!(t&t-1),b=(t,e,r,i)=>{var n=3*t,s=3*(r-t)-n,a=1-n-s,o=3*e,h=3*(i-e)-o,u=1-o-h;return function(t){if(t>=1)return 1;if(t<=0)return 0;for(var e,r,i=.5,d=0;d<20;d++){if((r=t-i*(i*(i*a+s)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);if((e=i*(i*(3*a)+2*s)+n)>1e-10&&e<1e-10)break;i+=r/e}for(var c=0,l=1,f=0;f<20;f++){if((r=t-(i=.5*(c+l))*(i*(i*a+s)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);r<0?l=i:c=i}}};e("r",R((t=>{switch(t){case"linear":return function(t){return t};case"ease":return b(.25,.1,.25,1);case"ease-in":return b(.42,0,1,1);case"ease-out":return b(0,0,.58,1);case"ease-in-out":return b(.42,0,.58,1);case"ease-in-sine":case"ease-out-sine":return b(.12,0,.39,0);case"ease-in-out-sine":return b(.37,0,.63,1);case"ease-in-cubic":return b(.32,0,.67,0);case"ease-out-cubic":return b(.33,1,.68,1);case"ease-in-out-cubic":return b(.65,0,.35,1);case"ease-in-circ":return b(.55,0,1,.45);case"ease-out-circ":return b(0,.55,.45,1);case"ease-in-out-circ":return b(.85,0,.15,1);case"ease-in-back":return b(.36,0,.66,-.56);case"ease-out-back":return b(.34,1.56,.64,1);case"ease-in-out-back":return b(.68,-.6,.32,1.6);case"step-start":return function(){return 1};case"step-end":return function(t){return 1===t?1:0};default:var e="cubic-bezier(";if(t&&0===t.indexOf(e)){var r=t.substr(13,t.length-13-1).split(",");if(4!==r.length)return console.warn("Unknown timing function: "+t),function(t){return t};var i=parseFloat(r[0]||"0.42"),n=parseFloat(r[1]||"0"),s=parseFloat(r[2]||"1"),a=parseFloat(r[3]||"1");return isNaN(i)||isNaN(n)||isNaN(s)||isNaN(a)?(console.warn(" Unknown timing function: "+t),function(t){return t}):b(i,n,s,a)}return console.warn("Unknown timing function: "+t),function(t){return t}}})));Math.hypot||(Math.hypot=(...t)=>{for(var e=0,r=t.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var y=new Uint8Array([0,0,0,0]);class w extends p{constructor(t,e,r){super(e,r),n(this,"glw",void 0),n(this,"_nativeCtxTexture",null),n(this,"_state","freed"),n(this,"_w",0),n(this,"_h",0),this.glw=t}get ctxTexture(){return"freed"===this._state&&this.load(),s(this._nativeCtxTexture),this._nativeCtxTexture}get renderable(){return this.textureSource.renderable}get w(){return this._w}get h(){return this._h}load(){"loading"!==this._state&&"loaded"!==this._state&&(this._state="loading",this.textureSource.setState("loading"),this._nativeCtxTexture=this.createNativeCtxTexture(),this.onLoadRequest().then((({width:t,height:e})=>{"freed"!==this._state&&(this._state="loaded",this._w=t,this._h=e,this.textureSource.setState("loaded",{width:t,height:e}))})).catch((t=>{this._state="failed",this.textureSource.setState("failed",t),console.error(t)})))}onLoadRequest(){var e=this;return r(t().mark((function r(){var i,n,a,o,h,u,d,c,l,f,v,g,p,E,T,x,_;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.glw,a=e.memManager,n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,null),a.setTextureMemUse(e,y.byteLength),t.next=5,null===(i=e.textureSource)||void 0===i?void 0:i.getTextureData();case 5:if(o=t.sent,e._nativeCtxTexture){t.next=9;break}return s("freed"===e._state),t.abrupt("return",{width:0,height:0});case 9:return h=0,u=0,s(e._nativeCtxTexture),n.activeTexture(0),o.data instanceof ImageBitmap||o.data instanceof ImageData||null!==(r=o.data)&&"object"==typeof r&&r.constructor&&"HTMLImageElement"===r.constructor.name?(d=o.data,h=d.width,u=d.height,n.bindTexture(e._nativeCtxTexture),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!!o.premultiplyAlpha),n.texImage2D(0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,d),a.setTextureMemUse(e,h*u*4),(n.isWebGl2()||A(h)&&A(u))&&n.generateMipmap()):null===o.data?(h=0,u=0,n.bindTexture(e._nativeCtxTexture),n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,y),a.setTextureMemUse(e,y.byteLength)):"mipmaps"in o.data&&o.data.mipmaps?(l=o.data,f=l.mipmaps,v=l.width,g=void 0===v?0:v,p=l.height,E=void 0===p?0:p,T=l.type,x=l.glInternalFormat,_="ktx"===T?new DataView(null!==(c=f[0])&&void 0!==c?c:new ArrayBuffer(0)):f[0],n.bindTexture(e._nativeCtxTexture),n.compressedTexImage2D(0,x,g,E,0,_),n.texParameteri(n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_MIN_FILTER,n.LINEAR),a.setTextureMemUse(e,_.byteLength)):console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",o),t.abrupt("return",{width:h,height:u});case 15:case"end":return t.stop()}var r}),r)})))()}free(){if("freed"!==this._state&&(this._state="freed",this.textureSource.setState("freed"),this._w=0,this._h=0,this._nativeCtxTexture)){var t=this.glw,e=this.memManager;t.deleteTexture(this._nativeCtxTexture),e.setTextureMemUse(this,0),this._nativeCtxTexture=null}}createNativeCtxTexture(){var t=this.glw,e=t.createTexture();if(!e)throw new Error("Could not create WebGL Texture");return t.activeTexture(0),t.bindTexture(e),t.texParameteri(t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}}class S extends l{constructor(t,e){super(t),n(this,"props",void 0),this.props=S.resolveDefaults(e||{})}get color(){return this.props.color}set color(t){this.props.color=t}getTextureData(){var e=this;return r(t().mark((function r(){var i,n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new Uint32Array([e.color]),n=new Uint8ClampedArray(i.buffer),t.abrupt("return",{data:new ImageData(n,1,1),premultiplyAlpha:!0});case 3:case"end":return t.stop()}}),r)})))()}static makeCacheKey(t){return`ColorTexture,${S.resolveDefaults(t).color}`}static resolveDefaults(t){return{color:t.color||4294967295}}}n(S,"z$__type__Props",void 0),e("u",S);class M extends l{constructor(t,e){super(t),n(this,"props",void 0),n(this,"parentTexture",void 0),n(this,"onParentTxLoaded",(()=>{this.setState("loaded",{width:this.props.width,height:this.props.height})})),n(this,"onParentTxFailed",((t,e)=>{this.setState("failed",e)})),this.parentTexture=this.txManager.loadTexture(e.texture.txType,e.texture.props,e.texture.options),this.props=M.resolveDefaults(e||{}),queueMicrotask((()=>{var t=this.parentTexture;"loaded"===t.state?this.onParentTxLoaded(t,t.dimensions):"failed"===t.state&&this.onParentTxFailed(t,t.error),t.on("loaded",this.onParentTxLoaded),t.on("failed",this.onParentTxFailed)}))}getTextureData(){var e=this;return r(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:e.props});case 1:case"end":return t.stop()}}),r)})))()}static makeCacheKey(t){return!1}static resolveDefaults(t){return{texture:t.texture,x:t.x||0,y:t.y||0,width:t.width||0,height:t.height||0}}}n(M,"z$__type__Props",void 0),e("v",M);class I extends w{constructor(t,e,r){super(t,e,r)}onLoadRequest(){var e=this;return r(t().mark((function r(){var i,n,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.textureSource.getTextureData();case 2:return s=t.sent,t.abrupt("return",{width:(null===(i=s.data)||void 0===i?void 0:i.width)||0,height:(null===(n=s.data)||void 0===n?void 0:n.height)||0});case 4:case"end":return t.stop()}}),r)})))()}}class L{constructor(t){n(this,"config",void 0),this.config=t}getBuffer(t){var e;return null===(e=this.config.find((e=>e.attributes[t])))||void 0===e?void 0:e.buffer}getAttributeInfo(t){var e;return null===(e=this.config.find((e=>e.attributes[t])))||void 0===e?void 0:e.attributes[t]}}e("B",L);class N{constructor(t){n(this,"gl",void 0),n(this,"activeTextureUnit",0),n(this,"texture2dUnits",void 0),n(this,"texture2dParams",new WeakMap),n(this,"scissorEnabled",void 0),n(this,"scissorX",void 0),n(this,"scissorY",void 0),n(this,"scissorWidth",void 0),n(this,"scissorHeight",void 0),n(this,"blendEnabled",void 0),n(this,"blendSrcRgb",void 0),n(this,"blendDstRgb",void 0),n(this,"blendSrcAlpha",void 0),n(this,"blendDstAlpha",void 0),n(this,"boundArrayBuffer",void 0),n(this,"boundElementArrayBuffer",void 0),n(this,"curProgram",void 0),n(this,"programUniforms",new WeakMap),n(this,"canvas",void 0),n(this,"MAX_RENDERBUFFER_SIZE",void 0),n(this,"MAX_TEXTURE_SIZE",void 0),n(this,"MAX_VIEWPORT_DIMS",void 0),n(this,"MAX_VERTEX_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_COMBINED_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_VERTEX_ATTRIBS",void 0),n(this,"MAX_VARYING_VECTORS",void 0),n(this,"MAX_VERTEX_UNIFORM_VECTORS",void 0),n(this,"MAX_FRAGMENT_UNIFORM_VECTORS",void 0),n(this,"TEXTURE_MAG_FILTER",void 0),n(this,"TEXTURE_MIN_FILTER",void 0),n(this,"TEXTURE_WRAP_S",void 0),n(this,"TEXTURE_WRAP_T",void 0),n(this,"LINEAR",void 0),n(this,"CLAMP_TO_EDGE",void 0),n(this,"RGBA",void 0),n(this,"UNSIGNED_BYTE",void 0),n(this,"UNPACK_PREMULTIPLY_ALPHA_WEBGL",void 0),n(this,"UNPACK_FLIP_Y_WEBGL",void 0),n(this,"FLOAT",void 0),n(this,"TRIANGLES",void 0),n(this,"UNSIGNED_SHORT",void 0),n(this,"ONE",void 0),n(this,"ONE_MINUS_SRC_ALPHA",void 0),n(this,"VERTEX_SHADER",void 0),n(this,"FRAGMENT_SHADER",void 0),n(this,"STATIC_DRAW",void 0),n(this,"COMPILE_STATUS",void 0),n(this,"LINK_STATUS",void 0),n(this,"DYNAMIC_DRAW",void 0),n(this,"COLOR_ATTACHMENT0",void 0),this.gl=t,this.activeTextureUnit=t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.texture2dUnits=new Array(e).fill(void 0).map(((e,r)=>(this.activeTexture(r),t.getParameter(t.TEXTURE_BINDING_2D)))),this.activeTexture(this.activeTextureUnit),this.scissorEnabled=t.isEnabled(t.SCISSOR_TEST);var r=t.getParameter(t.SCISSOR_BOX);this.scissorX=r[0],this.scissorY=r[1],this.scissorWidth=r[2],this.scissorHeight=r[3],this.blendEnabled=t.isEnabled(t.BLEND),this.blendSrcRgb=t.getParameter(t.BLEND_SRC_RGB),this.blendDstRgb=t.getParameter(t.BLEND_DST_RGB),this.blendSrcAlpha=t.getParameter(t.BLEND_SRC_ALPHA),this.blendDstAlpha=t.getParameter(t.BLEND_DST_ALPHA),this.boundArrayBuffer=t.getParameter(t.ARRAY_BUFFER_BINDING),this.boundElementArrayBuffer=t.getParameter(t.ELEMENT_ARRAY_BUFFER_BINDING),this.curProgram=t.getParameter(t.CURRENT_PROGRAM),this.canvas=t.canvas,this.MAX_RENDERBUFFER_SIZE=t.MAX_RENDERBUFFER_SIZE,this.MAX_TEXTURE_SIZE=t.MAX_TEXTURE_SIZE,this.MAX_VIEWPORT_DIMS=t.MAX_VIEWPORT_DIMS,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.MAX_TEXTURE_IMAGE_UNITS=t.MAX_TEXTURE_IMAGE_UNITS,this.MAX_COMBINED_TEXTURE_IMAGE_UNITS=t.MAX_COMBINED_TEXTURE_IMAGE_UNITS,this.MAX_VERTEX_ATTRIBS=t.MAX_VERTEX_ATTRIBS,this.MAX_VARYING_VECTORS=t.MAX_VARYING_VECTORS,this.MAX_VERTEX_UNIFORM_VECTORS=t.MAX_VERTEX_UNIFORM_VECTORS,this.MAX_FRAGMENT_UNIFORM_VECTORS=t.MAX_FRAGMENT_UNIFORM_VECTORS,this.TEXTURE_MAG_FILTER=t.TEXTURE_MAG_FILTER,this.TEXTURE_MIN_FILTER=t.TEXTURE_MIN_FILTER,this.TEXTURE_WRAP_S=t.TEXTURE_WRAP_S,this.TEXTURE_WRAP_T=t.TEXTURE_WRAP_T,this.LINEAR=t.LINEAR,this.CLAMP_TO_EDGE=t.CLAMP_TO_EDGE,this.RGBA=t.RGBA,this.UNSIGNED_BYTE=t.UNSIGNED_BYTE,this.UNPACK_PREMULTIPLY_ALPHA_WEBGL=t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.UNPACK_FLIP_Y_WEBGL=t.UNPACK_FLIP_Y_WEBGL,this.FLOAT=t.FLOAT,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.ONE=t.ONE,this.ONE_MINUS_SRC_ALPHA=t.ONE_MINUS_SRC_ALPHA,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.VERTEX_SHADER=t.VERTEX_SHADER,this.FRAGMENT_SHADER=t.FRAGMENT_SHADER,this.STATIC_DRAW=t.STATIC_DRAW,this.COMPILE_STATUS=t.COMPILE_STATUS,this.LINK_STATUS=t.LINK_STATUS,this.DYNAMIC_DRAW=t.DYNAMIC_DRAW,this.COLOR_ATTACHMENT0=t.COLOR_ATTACHMENT0}isWebGl2(){return t=this.gl,self.WebGL2RenderingContext&&t instanceof self.WebGL2RenderingContext;var t}activeTexture(t){var e=this.gl;this.activeTextureUnit!==t&&(e.activeTexture(t+e.TEXTURE0),this.activeTextureUnit=t)}bindTexture(t){var e=this.gl,r=this.activeTextureUnit,i=this.texture2dUnits;i[r]!==t&&(i[r]=t,e.bindTexture(this.gl.TEXTURE_2D,t))}_getActiveTexture(){var t=this.activeTextureUnit;return this.texture2dUnits[t]}texParameteri(t,e){var r=this.gl,i=this.texture2dParams,n=this._getActiveTexture();if(!n)throw new Error("No active texture");var s=i.get(n);s||(s={},i.set(n,s)),s[t]!==e&&(s[t]=e,r.texParameteri(r.TEXTURE_2D,t,e))}texImage2D(t,e,r,i,n,s,a,o){var h=this.gl;s?h.texImage2D(h.TEXTURE_2D,t,e,r,i,n,s,a,o):h.texImage2D(h.TEXTURE_2D,t,e,r,i,n)}compressedTexImage2D(t,e,r,i,n,s){var a=this.gl;a.compressedTexImage2D(a.TEXTURE_2D,t,e,r,i,n,s)}pixelStorei(t,e){this.gl.pixelStorei(t,e)}generateMipmap(){var t=this.gl;t.generateMipmap(t.TEXTURE_2D)}createTexture(){return this.gl.createTexture()}deleteTexture(t){var e=this.gl;t&&this.texture2dParams.delete(t),e.deleteTexture(t)}viewport(t,e,r,i){this.gl.viewport(t,e,r,i)}clearColor(t,e,r,i){this.gl.clearColor(t,e,r,i)}setScissorTest(t){var e=this.gl;t!==this.scissorEnabled&&(t?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST),this.scissorEnabled=t)}scissor(t,e,r,i){var n=this.gl,s=this.scissorX,a=this.scissorY,o=this.scissorWidth,h=this.scissorHeight;t===s&&e===a&&r===o&&i===h||(n.scissor(t,e,r,i),this.scissorX=t,this.scissorY=e,this.scissorWidth=r,this.scissorHeight=i)}setBlend(t){var e=this.gl;t!==this.blendEnabled&&(t?e.enable(e.BLEND):e.disable(e.BLEND),this.blendEnabled=t)}blendFunc(t,e){var r=this.gl,i=this.blendSrcRgb,n=this.blendDstRgb,s=this.blendSrcAlpha,a=this.blendDstAlpha;t===i&&e===n&&t===s&&e===a||(r.blendFunc(t,e),this.blendSrcRgb=t,this.blendDstRgb=e,this.blendSrcAlpha=t,this.blendDstAlpha=e)}createBuffer(){return this.gl.createBuffer()}createFramebuffer(){return this.gl.createFramebuffer()}bindFramebuffer(t){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t)}framebufferTexture2D(t,e,r){var i=this.gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,i.TEXTURE_2D,e,r)}clear(){var t=this.gl;t.clear(t.COLOR_BUFFER_BIT)}arrayBufferData(t,e,r){var i=this.gl;this.boundArrayBuffer!==t&&(i.bindBuffer(i.ARRAY_BUFFER,t),this.boundArrayBuffer=t),i.bufferData(i.ARRAY_BUFFER,e,r)}elementArrayBufferData(t,e,r){var i=this.gl;this.boundElementArrayBuffer!==t&&(i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t),this.boundElementArrayBuffer=t),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e,r)}vertexAttribPointer(t,e,r,i,n,s,a){var o=this.gl;this.boundArrayBuffer!==t&&(o.bindBuffer(o.ARRAY_BUFFER,t),this.boundArrayBuffer=t),o.vertexAttribPointer(e,r,i,n,s,a)}useProgram(t){var e=this.gl;this.curProgram!==t&&(e.useProgram(t),this.curProgram=t)}setUniform(t,e,...r){var i=this.gl,n=this.programUniforms,s=n.get(this.curProgram);s||(s=new Map,n.set(this.curProgram,s));var a=s.get(e);a&&function(t,e){if(t.length!==e.length)return!1;return t.every(((t,r)=>!(Array.isArray(t)||t instanceof Float32Array)&&t===e[r]))}(a,r)||(s.set(e,r),i[t](e,...r))}getParameter(t){return this.gl.getParameter(t)}drawElements(t,e,r,i){this.gl.drawElements(t,e,r,i)}getExtension(t){return this.gl.getExtension(t)}createVertexArray(){var t=this.gl;return s(t instanceof WebGL2RenderingContext),t.createVertexArray()}bindVertexArray(t){var e=this.gl;s(e instanceof WebGL2RenderingContext),e.bindVertexArray(t)}getAttribLocation(t,e){return this.gl.getAttribLocation(t,e)}getUniformLocation(t,e){return this.gl.getUniformLocation(t,e)}enableVertexAttribArray(t){this.gl.enableVertexAttribArray(t)}disableVertexAttribArray(t){this.gl.disableVertexAttribArray(t)}createShader(t){return this.gl.createShader(t)}compileShader(t){this.gl.compileShader(t)}attachShader(t,e){this.gl.attachShader(t,e)}linkProgram(t){this.gl.linkProgram(t)}deleteProgram(t){this.gl.deleteProgram(t)}getShaderParameter(t,e){return this.gl.getShaderParameter(t,e)}getShaderInfoLog(t){return this.gl.getShaderInfoLog(t)}createProgram(){return this.gl.createProgram()}getProgramParameter(t,e){return this.gl.getProgramParameter(t,e)}getProgramInfoLog(t){return this.gl.getProgramInfoLog(t)}shaderSource(t,e){this.gl.shaderSource(t,e)}deleteShader(t){this.gl.deleteShader(t)}}class U extends l{constructor(t,e){super(t),n(this,"props",void 0),this.props=U.resolveDefaults(e||{})}get width(){return this.props.width}set width(t){this.props.width=t}get height(){return this.props.height}set height(t){this.props.height=t}getTextureData(){return r(t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:null,premultiplyAlpha:null});case 1:case"end":return t.stop()}}),e)})))()}static resolveDefaults(t){return{width:t.width||256,height:t.height||256}}}n(U,"z$__type__Props",void 0),e("R",U);class P extends w{constructor(t,e,r){super(t,e,r),n(this,"framebuffer",void 0);var i=t.createFramebuffer();s(i,"Unable to create framebuffer"),this.framebuffer=i}onLoadRequest(){var e=this;return r(t().mark((function r(){var i,n,s,a,o,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.glw,n=e.memManager,s=e._nativeCtxTexture=e.createNativeCtxTexture(),a=e.textureSource,o=a.width,h=a.height,i.texImage2D(0,i.RGBA,o,h,0,i.RGBA,i.UNSIGNED_BYTE,null),n.setTextureMemUse(e,o*h*4),i.bindFramebuffer(e.framebuffer),i.framebufferTexture2D(i.COLOR_ATTACHMENT0,s,0),i.bindFramebuffer(null),t.abrupt("return",{width:o,height:h});case 9:case"end":return t.stop()}}),r)})))()}}class O extends E{constructor(t){super(t.stage),n(this,"glw",void 0),n(this,"system",void 0),n(this,"txManager",void 0),n(this,"txMemManager",void 0),n(this,"shManager",void 0),n(this,"options",void 0),n(this,"quadBuffer",new ArrayBuffer(4194304)),n(this,"fQuadBuffer",new Float32Array(this.quadBuffer)),n(this,"uiQuadBuffer",new Uint32Array(this.quadBuffer)),n(this,"renderOps",[]),n(this,"curBufferIdx",0),n(this,"curRenderOp",null),n(this,"rttNodes",[]),n(this,"activeRttNode",null),n(this,"defaultShader",void 0),n(this,"quadBufferCollection",void 0),n(this,"defaultTexture",void 0),n(this,"renderToTextureActive",!1);var e=t.canvas,r=t.clearColor,i=t.bufferMemory;this.options=t,this.txManager=t.txManager,this.txMemManager=t.txMemManager,this.shManager=t.shManager,this.defaultTexture=new S(this.txManager),this.defaultTexture.once("loaded",(()=>{this.stage.requestRender()}));var a=function(t,e){var r={alpha:!0,antialias:!1,depth:!1,stencil:!0,desynchronized:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:!1},i=t.getContext("webgl",r)||t.getContext("experimental-webgl",r);if(!i)throw new Error("Unable to create WebGL context");return e?new Proxy(i,{get(t,r){var i=t[r];return"function"==typeof i?(e.increment(String(r)),i.bind(t)):i}}):i}(e,t.contextSpy),o=this.glw=new N(a),h=f(r);o.viewport(0,0,e.width,e.height),o.clearColor(h[0],h[1],h[2],h[3]),o.setBlend(!0),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),function(t,e){for(var r=~~(e/80),i=new Uint16Array(6*r),n=0,s=0;n{t.draw()}))}renderToTexture(t){for(var e=0;e{var e=t.second;(r[e]=r[e]||{})[t.first]=t.amount})),this.kernings=r}shapeText(e,r){var i=this;return t().mark((function n(){var s,a,o,h,u,d;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=void 0;case 1:if(!(s=r.peek())||s.done){t.next=17;break}if(o=s.value,h=i.glyphMap.get(o),r.next(),void 0===h){t.next=12;break}return d=void 0!==a?((null===(u=i.kernings[h.id])||void 0===u?void 0:u[a])||0)+e.letterSpacing:0,a=h.id,t.next=10,{mapped:!0,glyphId:h.id,codepoint:o,cluster:r.lastIndex,xAdvance:h.xadvance+d,yAdvance:0,xOffset:h.xoffset+d,yOffset:h.yoffset,xBearing:0,yBearing:0,width:h.width,height:h.height};case 10:t.next=15;break;case 12:return o===B&&(a=void 0),t.next=15,{mapped:!1,codepoint:o,cluster:r.lastIndex};case 15:t.next=1;break;case 17:case"end":return t.stop()}}),n)}))()}}e("S",class extends g{constructor(e,i,a,o,h,u){var d;super(e,i),d=this,n(this,"type",void 0),n(this,"texture",void 0),n(this,"maxCharHeight",0),n(this,"data",void 0),n(this,"shaper",void 0),n(this,"glyphMap",new Map),this.type=a,s(o.renderer instanceof O,"SDF Font Faces can only be used with the WebGL Renderer"),this.texture=o.txManager.loadTexture("ImageTexture",{src:h,premultiplyAlpha:!1},{preload:!0}),this.texture.on("loaded",(()=>{this.checkLoaded()})),fetch(u).then(function(){var e=r(t().mark((function e(r){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.json();case 2:d.data=t.sent,i=0,d.data.chars.forEach((t=>{d.glyphMap.set(t.id,t);var e=t.yoffset+t.height;e>i&&(i=e)})),d.maxCharHeight=i,d.shaper=new X(d.data,d.glyphMap),d.checkLoaded();case 8:case"end":return t.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch(console.error)}getAtlasEntry(t){var e=this.glyphMap.get(t);if(void 0===e)throw new Error(`Glyph ${t} not found in font ${this.fontFamily}`);return{x:e.x,y:e.y,width:e.width,height:e.height}}checkLoaded(){this.loaded||"loaded"===this.texture.state&&this.data&&(this.loaded=!0,this.emit("loaded"))}});e("C",class{})}}}))}(); -//# sourceMappingURL=CoreExtension-legacy-SS_VGrQO.js.map diff --git a/assets/index-By475dcY.js b/assets/index-By475dcY.js new file mode 100644 index 0000000..2dd1cc4 --- /dev/null +++ b/assets/index-By475dcY.js @@ -0,0 +1,2 @@ +var mi=Object.defineProperty;var xi=(n,r,e)=>r in n?mi(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e;var h=(n,r,e)=>(xi(n,typeof r!="symbol"?r+"":r,e),e);import{a as L,i as yo,T as yi,g as Ir,c as gt,E as nt,b as ke,d as vi,e as tn,f as wi,m as Tt,W as zt,h as vo,j as wo,k as bi,l as Br,S as Tn,B as Si,n as Ai,o as bo,p as Ci,q as Ti,C as _i,r as Ri,s as _n,t as Rn,u as Ii,v as Bi,R as ki,w as Ei}from"./CoreExtension-BfzrAcK3.js";function yd(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))t(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&t(s)}).observe(document,{childList:!0,subtree:!0});function e(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function t(o){if(o.ep)return;o.ep=!0;const i=e(o);fetch(o.href,i)}})();const So=(n,r)=>n===r,lr=Symbol("solid-proxy"),Fi=Symbol("solid-track"),cr={equals:So};let Ao=Eo;const Ae=1,dr=2,Co={owned:null,cleanups:null,context:null,owner:null},kr={};var $=null;let Er=null,Ni=null,H=null,ae=null,Ie=null,br=0;function mt(n,r){const e=H,t=$,o=n.length===0,i=r===void 0?t:r,s=o?Co:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?n:()=>n(()=>le(()=>Ar(s)));$=s,H=null;try{return Be(a,!0)}finally{H=e,$=t}}function W(n,r){r=r?Object.assign({},cr,r):cr;const e={value:n,observers:null,observerSlots:null,comparator:r.equals||void 0},t=o=>(typeof o=="function"&&(o=o(e.value)),ko(e,o));return[Bo.bind(e),t]}function Pr(n,r,e){const t=Dt(n,r,!0,Ae);it(t)}function Re(n,r,e){const t=Dt(n,r,!1,Ae);it(t)}function je(n,r,e){Ao=Wi;const t=Dt(n,r,!1,Ae);(!e||!e.render)&&(t.user=!0),Ie?Ie.push(t):it(t)}function q(n,r,e){e=e?Object.assign({},cr,e):cr;const t=Dt(n,r,!0,0);return t.observers=null,t.observerSlots=null,t.comparator=e.equals||void 0,it(t),Bo.bind(t)}function Li(n){return n&&typeof n=="object"&&"then"in n}function et(n,r,e){let t,o,i;arguments.length===2&&typeof r=="object"||arguments.length===1?(t=!0,o=n,i=r||{}):(t=n,o=r,i=e||{});let s=null,a=kr,c=!1,d="initialValue"in i,u=typeof t=="function"&&q(t);const g=new Set,[w,A]=(i.storage||W)(i.initialValue),[p,y]=W(void 0),[S,b]=W(void 0,{equals:!1}),[v,x]=W(d?"ready":"unresolved");function m(T,_,k,z){return s===T&&(s=null,z!==void 0&&(d=!0),(T===a||_===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(z,{value:_})),a=kr,C(_,k)),_}function C(T,_){Be(()=>{_===void 0&&A(()=>T),x(_!==void 0?"errored":d?"ready":"unresolved"),y(_);for(const k of g.keys())k.decrement();g.clear()},!1)}function I(){const T=Pi,_=w(),k=p();if(k!==void 0&&!s)throw k;return H&&!H.user&&T&&Pr(()=>{S(),s&&(T.resolved||g.has(T)||(T.increment(),g.add(T)))}),_}function R(T=!0){if(T!==!1&&c)return;c=!1;const _=u?u():t;if(_==null||_===!1){m(s,le(w));return}const k=a!==kr?a:le(()=>o(_,{value:w(),refetching:T}));return Li(k)?(s=k,"value"in k?(k.status==="success"?m(s,k.value,void 0,_):m(s,void 0,void 0,_),k):(c=!0,queueMicrotask(()=>c=!1),Be(()=>{x(d?"refreshing":"pending"),b()},!1),k.then(z=>m(k,z,void 0,_),z=>m(k,void 0,No(z),_)))):(m(s,k,void 0,_),k)}return Object.defineProperties(I,{state:{get:()=>v()},error:{get:()=>p()},loading:{get(){const T=v();return T==="pending"||T==="refreshing"}},latest:{get(){if(!d)return I();const T=p();if(T&&!s)throw T;return w()}}}),u?Pr(()=>R(!1)):R(!1),[I,{refetch:R,mutate:A}]}function To(n,r=So,e){const t=new Map,o=Dt(i=>{const s=n();for(const[a,c]of t.entries())if(r(a,s)!==r(a,i))for(const d of c.values())d.state=Ae,d.pure?ae.push(d):Ie.push(d);return s},void 0,!0,Ae);return it(o),i=>{const s=H;if(s){let a;(a=t.get(i))?a.add(s):t.set(i,a=new Set([s])),Me(()=>{a.delete(s),!a.size&&t.delete(i)})}return r(i,o.value)}}function Mi(n){return Be(n,!1)}function le(n){if(H===null)return n();const r=H;H=null;try{return n()}finally{H=r}}function ot(n,r,e){const t=Array.isArray(n);let o,i=e&&e.defer;return s=>{let a;if(t){a=Array(n.length);for(let d=0;dr(a,o,s));return o=a,c}}function Qe(n){je(()=>le(n))}function Me(n){return $===null||($.cleanups===null?$.cleanups=[n]:$.cleanups.push(n)),n}function Pt(){return $}function _o(n,r){const e=$,t=H;$=n,H=null;try{return Be(r,!0)}catch(o){rn(o)}finally{$=e,H=t}}function zi(n){const r=H,e=$;return Promise.resolve().then(()=>{H=r,$=e;let t;return Be(n,!1),H=$=null,t?t.done:void 0})}function Ro(n,r){const e=Symbol("context");return{id:e,Provider:Ui(e),defaultValue:n}}function Io(n){return $&&$.context&&$.context[n.id]!==void 0?$.context[n.id]:n.defaultValue}function Sr(n){const r=q(n),e=q(()=>Dr(r()));return e.toArray=()=>{const t=e();return Array.isArray(t)?t:t!=null?[t]:[]},e}let Pi;function Bo(){if(this.sources&&this.state)if(this.state===Ae)it(this);else{const n=ae;ae=null,Be(()=>hr(this),!1),ae=n}if(H){const n=this.observers?this.observers.length:0;H.sources?(H.sources.push(this),H.sourceSlots.push(n)):(H.sources=[this],H.sourceSlots=[n]),this.observers?(this.observers.push(H),this.observerSlots.push(H.sources.length-1)):(this.observers=[H],this.observerSlots=[H.sources.length-1])}return this.value}function ko(n,r,e){let t=n.value;return(!n.comparator||!n.comparator(t,r))&&(n.value=r,n.observers&&n.observers.length&&Be(()=>{for(let o=0;o1e6)throw ae=[],new Error},!1)),r}function it(n){if(!n.fn)return;Ar(n);const r=br;Di(n,n.value,r)}function Di(n,r,e){let t;const o=$,i=H;H=$=n;try{t=n.fn(r)}catch(s){return n.pure&&(n.state=Ae,n.owned&&n.owned.forEach(Ar),n.owned=null),n.updatedAt=e+1,rn(s)}finally{H=i,$=o}(!n.updatedAt||n.updatedAt<=e)&&(n.updatedAt!=null&&"observers"in n?ko(n,t):n.value=t,n.updatedAt=e)}function Dt(n,r,e,t=Ae,o){const i={fn:n,state:t,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:r,owner:$,context:$?$.context:null,pure:e};return $===null||$!==Co&&($.owned?$.owned.push(i):$.owned=[i]),i}function ur(n){if(n.state===0)return;if(n.state===dr)return hr(n);if(n.suspense&&le(n.suspense.inFallback))return n.suspense.effects.push(n);const r=[n];for(;(n=n.owner)&&(!n.updatedAt||n.updatedAt=0;e--)if(n=r[e],n.state===Ae)it(n);else if(n.state===dr){const t=ae;ae=null,Be(()=>hr(n,r[0]),!1),ae=t}}function Be(n,r){if(ae)return n();let e=!1;r||(ae=[]),Ie?e=!0:Ie=[],br++;try{const t=n();return Oi(e),t}catch(t){e||(Ie=null),ae=null,rn(t)}}function Oi(n){if(ae&&(Eo(ae),ae=null),n)return;const r=Ie;Ie=null,r.length&&Be(()=>Ao(r),!1)}function Eo(n){for(let r=0;r=0;r--)Ar(n.owned[r]);n.owned=null}if(n.cleanups){for(r=n.cleanups.length-1;r>=0;r--)n.cleanups[r]();n.cleanups=null}n.state=0}function No(n){return n instanceof Error?n:new Error(typeof n=="string"?n:"Unknown error",{cause:n})}function rn(n,r=$){throw No(n)}function Dr(n){if(typeof n=="function"&&!n.length)return Dr(n());if(Array.isArray(n)){const r=[];for(let e=0;eo=le(()=>($.context={...$.context,[n]:t.value},Sr(()=>t.children))),void 0),o}}const Yi=Symbol("fallback");function In(n){for(let r=0;r1?[]:null;return Me(()=>In(i)),()=>{let c=n()||[],d,u;return c[Fi],le(()=>{let w=c.length,A,p,y,S,b,v,x,m,C;if(w===0)s!==0&&(In(i),i=[],t=[],o=[],s=0,a&&(a=[])),e.fallback&&(t=[Yi],o[0]=mt(I=>(i[0]=I,e.fallback())),s=1);else if(s===0){for(o=new Array(w),u=0;u=v&&m>=v&&t[x]===c[m];x--,m--)y[m]=o[x],S[m]=i[x],a&&(b[m]=a[x]);for(A=new Map,p=new Array(m+1),u=m;u>=v;u--)C=c[u],d=A.get(C),p[u]=d===void 0?-1:d,A.set(C,u);for(d=v;d<=x;d++)C=t[d],u=A.get(C),u!==void 0&&u!==-1?(y[u]=o[d],S[u]=i[d],a&&(b[u]=a[d]),u=p[u],A.set(C,u)):i[d]();for(u=v;un(r||{}))}function $t(){return!0}const Or={get(n,r,e){return r===lr?e:n.get(r)},has(n,r){return r===lr?!0:n.has(r)},set:$t,deleteProperty:$t,getOwnPropertyDescriptor(n,r){return{configurable:!0,enumerable:!0,get(){return n.get(r)},set:$t,deleteProperty:$t}},ownKeys(n){return n.keys()}};function Fr(n){return(n=typeof n=="function"?n():n)?n:{}}function Hi(){for(let n=0,r=this.length;n=0;a--){const c=Fr(n[a])[s];if(c!==void 0)return c}},has(s){for(let a=n.length-1;a>=0;a--)if(s in Fr(n[a]))return!0;return!1},keys(){const s=[];for(let a=0;a=0;s--){const a=n[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let d=c.length-1;d>=0;d--){const u=c[d];if(u==="__proto__"||u==="constructor")continue;const g=Object.getOwnPropertyDescriptor(a,u);if(!t[u])t[u]=g.get?{enumerable:!0,configurable:!0,get:Hi.bind(e[u]=[g.get.bind(a)])}:g.value!==void 0?g:void 0;else{const w=e[u];w&&(g.get?w.push(g.get.bind(a)):g.value!==void 0&&w.push(()=>g.value))}}}const o={},i=Object.keys(t);for(let s=i.length-1;s>=0;s--){const a=i[s],c=t[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function ji(n,...r){if(lr in n){const o=new Set(r.length>1?r.flat():r[0]),i=r.map(s=>new Proxy({get(a){return s.includes(a)?n[a]:void 0},has(a){return s.includes(a)&&a in n},keys(){return s.filter(a=>a in n)}},Or));return i.push(new Proxy({get(s){return o.has(s)?void 0:n[s]},has(s){return o.has(s)?!1:s in n},keys(){return Object.keys(n).filter(s=>!o.has(s))}},Or)),i}const e={},t=r.map(()=>({}));for(const o of Object.getOwnPropertyNames(n)){const i=Object.getOwnPropertyDescriptor(n,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,c=0;for(const d of r)d.includes(o)&&(a=!0,s?t[c][o]=i.value:Object.defineProperty(t[c],o,i)),++c;a||(s?e[o]=i.value:Object.defineProperty(e,o,i))}return[...t,e]}const Qi=n=>"Stale read from <".concat(n,">.");function Cr(n){const r="fallback"in n&&{fallback:()=>n.fallback};return q($i(()=>n.each,n.children,r||void 0))}function ze(n){const r=n.keyed,e=q(()=>n.when,void 0,{equals:(t,o)=>r?t===o:!t==!o});return q(()=>{const t=e();if(t){const o=n.children;return typeof o=="function"&&o.length>0?le(()=>o(r?t:()=>{if(!le(e))throw Qi("Show");return n.when})):o}return n.fallback},void 0,void 0)}const Xi=void 0,[on,Mo]=W(void 0);class zo{constructor(r){h(this,"releaseCallback");this.releaseCallback=r}}class Ki extends zo{constructor(e,t){var o,i;super(e);h(this,"textureMap",new Map);h(this,"zeroReferenceTextureSet",new Set);h(this,"options");this.options={textureCleanupIntervalMs:(o=t.textureCleanupIntervalMs)!=null?o:1e4,textureCleanupAgeThreadholdMs:(i=t.textureCleanupAgeThreadholdMs)!=null?i:6e4},setInterval(()=>{const s=Date.now(),a=this.options.textureCleanupAgeThreadholdMs;for(const c of this.zeroReferenceTextureSet)s-c.lastUpdate>a&&(this.releaseCallback(c.id),this.textureMap.delete(c.id),this.zeroReferenceTextureSet.delete(c))},this.options.textureCleanupIntervalMs)}registerTexture(e){var o;const t=(o=e.options)==null?void 0:o.id;if(L(t,"Texture must have an id to be registered"),!this.textureMap.has(t)){const i={id:t,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(t,i),this.zeroReferenceTextureSet.add(i)}}incrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;L(t,"Texture must have an id to be registered");let o=this.textureMap.get(t);o||(this.registerTexture(e),o=this.textureMap.get(t)),L(o,"Texture must have been registered"),e.txType==="SubTexture"&&this.incrementTextureRefCount(e.props.texture),o.nodeRefCount++,o.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(o)&&this.zeroReferenceTextureSet.delete(o)}decrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;L(t,"Texture must have an id to be registered");const o=this.textureMap.get(t);L(o,"Texture must have been registered"),o.nodeRefCount--,o.lastUpdate=Date.now(),o.nodeRefCount===0&&this.zeroReferenceTextureSet.add(o),e.txType==="SubTexture"&&this.decrementTextureRefCount(e.props.texture)}}class Vi extends zo{constructor(e){super(e);h(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,o;L((t=e.options)==null?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,(o=e.options)==null?void 0:o.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}const bt={alpha:n=>n===1?null:{prop:"opacity",value:"".concat(n)},x:n=>({prop:"left",value:"".concat(n,"px")}),y:n=>({prop:"top",value:"".concat(n,"px")}),width:n=>n===0?null:{prop:"width",value:"".concat(n,"px")},height:n=>n===0?null:{prop:"height",value:"".concat(n,"px")},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:n=>n===!1?null:{prop:"overflow",value:n?"hidden":"visible"},rotation:n=>n===0?null:{prop:"transform",value:"rotate(".concat(n,"rad)")},scale:n=>n===1?null:{prop:"transform",value:"scale(".concat(n,")")},scaleX:n=>n===1?null:{prop:"transform",value:"scaleX(".concat(n,")")},scaleY:n=>n===1?null:{prop:"transform",value:"scaleY(".concat(n,")")},color:n=>n===0?null:{prop:"color",value:Po(n)}},Po=n=>{const r=(n&255)/255,e=n>>8&255,t=n>>16&255,o=n>>24&255;return"rgba(".concat(o,",").concat(t,",").concat(e,",").concat(r,")")},Gi={id:"id"};class qi{constructor(r,e){h(this,"root",null);h(this,"canvas",null);h(this,"height",1080);h(this,"width",1920);h(this,"scaleX",1);h(this,"scaleY",1);var i,s,a,c,d,u;if(yo())return;if(!e)throw new Error("settings is required");this.height=Math.ceil((s=e.appHeight)!=null?s:1080/((i=e.deviceLogicalPixelRatio)!=null?i:1)),this.width=Math.ceil((c=e.appWidth)!=null?c:1900/((a=e.deviceLogicalPixelRatio)!=null?a:1)),this.scaleX=(d=e.deviceLogicalPixelRatio)!=null?d:1,this.scaleY=(u=e.deviceLogicalPixelRatio)!=null?u:1,this.canvas=r,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(r,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(r),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}setRootPosition(){if(this.root===null||this.canvas===null)return;const r=this.canvas.getBoundingClientRect(),e=document.documentElement.scrollTop+r.top,t=document.documentElement.scrollLeft+r.left;this.root.id="root",this.root.style.left="".concat(t,"px"),this.root.style.top="".concat(e,"px"),this.root.style.width="".concat(this.width,"px"),this.root.style.height="".concat(this.height,"px"),this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform="scale(".concat(this.scaleX,", ").concat(this.scaleY,")"),this.root.style.overflow="hidden",this.root.style.zIndex="65534"}createDiv(r,e){const t=document.createElement("div");t.style.position="absolute",t.id=r.id.toString();for(const o in e)this.updateNodeProperty(t,o,e[o]);return t}createNode(r,e){const t=r.createNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createTextNode(r,e){const t=r.createTextNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createProxy(r,e){return new Proxy(r,{set:(t,o,i)=>(this.updateNodeProperty(e,o,i),Reflect.set(t,o,i)),get:(t,o,i)=>(o==="destroy"&&this.destroyNode(t),o==="animate"?(s,a)=>{const c=t.animate(s,a);return new Proxy(c,{get:(d,u,g)=>(u==="start"&&this.animateNode(e,r,s,a),Reflect.get(d,u,g))})}:Reflect.get(t,o,i))})}destroyNode(r){const e=document.getElementById(r.id.toString());e==null||e.remove()}updateNodeProperty(r,e,t){var o;if(!(this.root===null||t===void 0||t===null)){if(e==="parent"){const i=t.id;if(i===1){this.root.appendChild(r);return}const s=document.getElementById(i.toString());s==null||s.appendChild(r);return}if(e==="text"){r.innerHTML=String(t),r.style.visibility="hidden";return}if(e==="src"&&t){r.setAttribute("data-src",String(t));return}if(bt[e]){const i=(o=bt[e])==null?void 0:o.call(bt,t);if(i===null)return;if(typeof i=="string"){r.style.setProperty(i,String(t));return}typeof i=="object"&&r.style.setProperty(i.prop,i.value);return}if(Gi[e]){r.setAttribute(String(bt[e]),String(t));return}if(e==="data"){for(const i in t)r.setAttribute("data-".concat(i),String(t[i]));return}}}animateNode(r,e,t,o){const{duration:i=1e3,delay:s=0}=o,{x:a,y:c,width:d,height:u,alpha:g=1,rotation:w=0,scale:A=1,color:p}=t;function y(){setTimeout(()=>{r.style.top="".concat(c,"px"),r.style.left="".concat(a,"px"),r.style.width="".concat(d,"px"),r.style.height="".concat(u,"px"),r.style.opacity="".concat(g),r.style.rotate="".concat(w,"rad"),r.style.scale="".concat(A),r.style.color=Po(p)},i)}setTimeout(y,s)}}const Zi="modulepreload",Ji=function(n){return"/solid-demo-app/"+n},Bn={},es=function(r,e,t){let o=Promise.resolve();if(e&&e.length>0){const i=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.all(e.map(c=>{if(c=Ji(c),c in Bn)return;Bn[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(!!t)for(let A=i.length-1;A>=0;A--){const p=i[A];if(p.href===c&&(!d||p.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(c,'"]').concat(u)))return;const w=document.createElement("link");if(w.rel=d?"stylesheet":Zi,d||(w.as="script",w.crossOrigin=""),w.href=c,a&&w.setAttribute("nonce",a),document.head.appendChild(w),d)return new Promise((A,p)=>{w.addEventListener("load",A),w.addEventListener("error",()=>p(new Error("Unable to preload CSS for ".concat(c))))})}))}return o.then(()=>r()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};class ie{constructor(r){h(this,"priority",1);h(this,"name","");h(this,"ref");h(this,"target");h(this,"passParameters","");h(this,"declaredUniforms","");h(this,"uniformInfo",{});const{ref:e,target:t,props:o={}}=r;this.ref=e,this.target=t;const i={},s=[];let a="";const c=this.constructor.uniforms||{};for(const d in c){const u=c[d],g=u.type,w="".concat(e,"_").concat(d);let A="";u.size&&(A="[".concat(u.size(o),"]")),s.push(w),a+="uniform ".concat(g," ").concat(w).concat(A,";"),i[d]={name:w,uniform:c[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static getEffectKey(r){return""}static getMethodParameters(r,e){const t=[];for(const o in r){const i=r[o];let s="";i.size&&(s="[".concat(i.size(e),"]")),t.push("".concat(i.type," ").concat(o).concat(s))}return t.join(",")}static resolveDefaults(r){return{}}static makeEffectKey(r){return!1}}h(ie,"uniforms",{}),h(ie,"methods"),h(ie,"onShaderMask"),h(ie,"onColorize"),h(ie,"onEffectMask");const ts={x:(n,r)=>{n.props.x=r},y:(n,r)=>{n.props.y=r},width:(n,r)=>{n.props.width=r},height:(n,r)=>{n.props.height=r},color:(n,r)=>{n.props.color=r},zIndex:(n,r)=>{n.props.zIndex=r},fontFamily:(n,r)=>{n.props.fontFamily=r},fontWeight:(n,r)=>{n.props.fontWeight=r},fontStyle:(n,r)=>{n.props.fontStyle=r},fontStretch:(n,r)=>{n.props.fontStretch=r},fontSize:(n,r)=>{n.props.fontSize=r},text:(n,r)=>{n.props.text=r},textAlign:(n,r)=>{n.props.textAlign=r},contain:(n,r)=>{n.props.contain=r},offsetY:(n,r)=>{n.props.offsetY=r},scrollable:(n,r)=>{n.props.scrollable=r},scrollY:(n,r)=>{n.props.scrollY=r},letterSpacing:(n,r)=>{n.props.letterSpacing=r},lineHeight:(n,r)=>{n.props.lineHeight=r},maxLines:(n,r)=>{n.props.maxLines=r},textBaseline:(n,r)=>{n.props.textBaseline=r},verticalAlign:(n,r)=>{n.props.verticalAlign=r},overflowSuffix:(n,r)=>{n.props.overflowSuffix=r},debug:(n,r)=>{n.props.debug=r}};class Do{constructor(r){h(this,"stage");h(this,"set");this.stage=r;const e={...ts,...this.getPropertySetters()};this.set=Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,(i,s)=>{i.props[t]!==s&&(o(i,s),this.stage.requestRender())}])))}setStatus(r,e,t){r.status!==e&&(r.status=e,r.emitter.emit(e,t))}setIsRenderable(r,e){r.isRenderable=e}destroyState(r){["loading","loaded","failed"].forEach(t=>{r.emitter.off(t)})}scheduleUpdateState(r){r.updateScheduled||(r.updateScheduled=!0,queueMicrotask(()=>{r.updateScheduled=!1,this.updateState(r)}))}}class kn extends yi{constructor(e,t,o){super(e,t);h(this,"fontFace");h(this,"fontUrl");const i=o.replace(/\(|\)/g,""),s=this.descriptors,a={style:s.style,weight:typeof s.weight=="number"?"".concat(s.weight):s.weight,stretch:s.stretch,unicodeRange:s.unicodeRange,variant:s.variant,featureSettings:s.featureSettings,display:s.display},c=new FontFace(e,"url(".concat(i,")"),a);c.load().then(()=>{this.loaded=!0,this.emit("loaded")}).catch(console.error),this.fontFace=c,this.fontUrl=o}}const En=2048;function Fn(n,r,e,t,o){const i=n!=="bottom"?.5*r:0;return e*(t-1)+i+Math.max(e,r)+(o||0)}class rs{constructor(r,e){h(this,"_canvas");h(this,"_context");h(this,"_settings");h(this,"renderInfo");this._canvas=r,this._context=e,this._settings=this.mergeDefaults({})}set settings(r){this._settings=this.mergeDefaults(r)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){const r=[this._settings.fontFace],e=[];for(let t=0,o=r.length;t{console.warn("[Lightning] Font load error",e,r)}).then(()=>{document.fonts.check(r,this._settings.text)||console.warn("[Lightning] Font not found",r)})}catch(e){console.warn("[Lightning] Can't check font loading for "+r)}}}calculateRenderInfo(){const r={},e=this.getPrecision(),t=this._settings.paddingLeft*e,o=this._settings.paddingRight*e,i=this._settings.fontSize*e;let s=this._settings.offsetY===null?null:this._settings.offsetY*e,a=(this._settings.lineHeight||i)*e;const c=this._settings.w*e,d=this._settings.h*e;let u=this._settings.wordWrapWidth*e;const g=this._settings.cutSx*e,w=this._settings.cutEx*e,A=this._settings.cutSy*e,p=this._settings.cutEy*e,y=(this._settings.letterSpacing||0)*e,S=this._settings.textIndent*e;this.setFontProperties();let b=c||2048/this.getPrecision(),v=b-t;if(v<10&&(b+=10-v,v=10),u||(u=v),this._settings.textOverflow&&!this._settings.wordWrap){let T;switch(this._settings.textOverflow){case"clip":T="";break;case"ellipsis":T=this._settings.overflowSuffix;break;default:T=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,u-S,T)}let x;if(this._settings.wordWrap)x=this.wrapText(this._settings.text,u,y,S);else{x={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const T=x.l.length;for(let _=0;_this._settings.maxLines){const T=m.slice(0,this._settings.maxLines);let _=null;if(this._settings.overflowSuffix){const O=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,D=this.wrapText(T[T.length-1],u-O,y,S);T[T.length-1]="".concat(D.l[0]).concat(this._settings.overflowSuffix),_=[D.l.length>1?D.l[1]:""]}else _=[""];let k;const z=m.length;let F=0;const P=x.n.length;for(k=this._settings.maxLines;k=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(r.cutSx||r.cutSy)&&this._context.translate(-r.cutSx,-r.cutSy);let a,c;const d=[];for(let g=0,w=o.length;ge)for(;a>0&&(c=this._context.measureText(r.substring(0,a)).width+o,c>e);)a-=1;else for(;a=o?t:"")}wrapText(r,e,t,o=0){const i=r.split(/\r?\n/g);let s=[];const a=[];for(let c=0;cg?(A>0&&(d.push(u),u=""),u+=w[A],g=e-p-(A===0?o:0)):(g-=y,u+=" ".concat(w[A]))}d.push(u),u="",s=s.concat(d),ct+this._context.measureText(o).width+e,0):this._context.measureText(r).width}mergeDefaults(r){return{text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0,...r}}}const Nn=typeof self>"u"?globalThis:self;var xo;const Ln=((xo=Nn.document)==null?void 0:xo.fonts)||Nn.fonts;function ns(n){const{fontFamily:r,fontStyle:e,fontWeight:t,fontStretch:o,fontSize:i}=n;return[e,t,o,"".concat(i,"px"),r].join(" ")}const os=gt(0,0,0,0);class is extends Do{constructor(e){super(e);h(this,"canvas");h(this,"context");h(this,"rendererBounds");typeof OffscreenCanvas<"u"?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");let t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),L(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof kn}addFontFace(e){L(e instanceof kn),Ln.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new nt,canvasPages:void 0,lightning2TextRenderer:new rs(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){var p,y;if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const S=ns(e.props);if(e.fontInfo={cssString:S,loaded:!1},!e.fontInfo.loaded){Ln.load(S).then(this.onFontLoaded.bind(this,e,S)).catch(this.onFontLoadError.bind(this,e,S));return}}if(!e.fontInfo.loaded)return;if(!e.renderInfo){const S=e.props.maxLines,b=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,v=b>0&&S>0?Math.min(b,S):Math.max(b,S);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:ke(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:e.props.contain!=="none",wordWrapWidth:e.props.contain==="none"?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:v,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}const{x:t,y:o,width:i,height:s,scrollY:a,contain:c}=e.props,{visibleWindow:d}=e;let{renderWindow:u,canvasPages:g}=e;if(!d.valid){const S=gt(t,o,c!=="none"?t+i:1/0,c==="both"?o+s:1/0,os);vi(this.rendererBounds,S,d),d.valid=!0}const w=d.y2-d.y1,A=Math.ceil(w/e.renderInfo.lineHeight);if(w===0){g=void 0,u=void 0,this.setStatus(e,"loaded");return}else if(u&&g){const S=t+u.x1,b=o-a+u.y1,v=t+u.x2,x=o-a+u.y2;if(S<=d.x1&&v>=d.x2&&b<=d.y1&&x>=d.y2){this.setStatus(e,"loaded");return}xd.y1&&(u.y1-=A*e.renderInfo.lineHeight,u.y2-=A*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-A,g[0].lineNumEnd=g[0].lineNumStart+A,g[0].valid=!1)}else{const S=e.renderInfo.lineHeight*A,b=Math.ceil(a/S),v=b*A,x=v-A,m=v+A;g=[{texture:g==null?void 0:g[0].texture,lineNumStart:x,lineNumEnd:x+A,valid:!1},{texture:g==null?void 0:g[1].texture,lineNumStart:v,lineNumEnd:v+A,valid:!1},{texture:g==null?void 0:g[2].texture,lineNumStart:m,lineNumEnd:m+A,valid:!1}],e.canvasPages=g;const C=b*S;u={x1:0,y1:C-S,x2:i,y2:C+S*2}}e.renderWindow=u,performance.now();for(const S of g)if(!S.valid){if(S.lineNumStart<0){(p=S.texture)==null||p.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),S.texture.setRenderableOwner(e,e.isRenderable),S.valid=!0;continue}e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(S.lineNumStart,S.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(S.lineNumStart,S.lineNumEnd)}),this.canvas.width===0||this.canvas.height===0||((y=S.texture)==null||y.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),S.texture.setRenderableOwner(e,e.isRenderable)),S.valid=!0}this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var T,_,k,z,F,P,O,D,U,j,se,re;const{stage:s}=this,{canvasPages:a,textW:c=0,textH:d=0,renderWindow:u}=e;if(!a||!u)return;const{x:g,y:w,scrollY:A,contain:p,width:y,height:S}=e.props,b={x:g,y:w,width:p!=="none"?y:c,height:p==="both"?S:d};tn({x:0,y:0,width:s.options.appWidth,height:s.options.appHeight},b),L(a,"canvasPages is not defined"),L(u,"renderWindow is not defined");const x=(u.y2-u.y1)/3,{zIndex:m,color:C}=e.props,I=i*wi(C),R=Tt(4294967295,I);a[0].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((_=(T=a[0].texture)==null?void 0:T.dimensions)==null?void 0:_.width)||0,height:((z=(k=a[0].texture)==null?void 0:k.dimensions)==null?void 0:z.height)||0,texture:a[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-A+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[1].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((P=(F=a[1].texture)==null?void 0:F.dimensions)==null?void 0:P.width)||0,height:((D=(O=a[1].texture)==null?void 0:O.dimensions)==null?void 0:D.height)||0,texture:a[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-A+u.y1+x,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[2].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((j=(U=a[2].texture)==null?void 0:U.dimensions)==null?void 0:j.width)||0,height:((re=(se=a[2].texture)==null?void 0:se.dimensions)==null?void 0:re.height)||0,texture:a[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-A+u.y1+x+x,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.canvasPages)==null||o.forEach(i=>{var s;(s=i.texture)==null||s.setRenderableOwner(e,t)})}destroyState(e){var t;(t=e.canvasPages)==null||t.forEach(o=>{var i;(i=o.texture)==null||i.setRenderableOwner(e,!1)})}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var o;t!==((o=e.fontInfo)==null?void 0:o.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,o){var i;t!==((i=e.fontInfo)==null?void 0:i.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,console.error("CanvasTextRenderer: Error loading font '".concat(e.fontInfo.cssString,"'"),o),this.scheduleUpdateState(e))}}class Oo extends zt{constructor(r){super({renderer:r,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(r){const{glw:e}=this;e.activeTexture(0),e.bindTexture(r[0].ctxTexture)}}h(Oo,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class Wo extends zt{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]});h(this,"supportsIndexedTextures",!0)}bindTextures(e){const{renderer:t,glw:o}=this;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error("DefaultShaderBatched: Cannot bind more than ".concat(t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS," textures"));e.forEach((s,a)=>{o.activeTexture(a),o.bindTexture(s.ctxTexture)});const i=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",i)}}h(Wo,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>"\n #define txUnits ".concat(e,"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[").concat(e,"], int idx, vec2 uv) {\n ").concat(Array.from(Array(e).keys()).map(t=>"\n ".concat(t!==0?"else ":"","if (idx == ").concat(t,") {\n return texture2D(textures[").concat(t,"], uv);\n }\n ")).join(""),"\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n ")});const Nr=new Map,ss=(n,r)=>{const e=JSON.stringify(n);if(Nr.has(e))return Nr.get(e);const t=(n!=null?n:[]).map(o=>({type:o.type,props:r[o.type].resolveDefaults(o.props||{})}));return Nr.set(e,t),t},Ne=class Ne extends zt{constructor(e,t,o){const i=Ne.createShader(t,o);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...i.uniforms],shaderSources:{vertex:i.vertex,fragment:i.fragment}});h(this,"effects",[]);this.effects=i.effects,this.calculateProps=vo(this.calculateProps.bind(this))}bindTextures(e){const{glw:t}=this;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){const t=this.renderer.shManager.getRegisteredEffects(),o=[];return e==null||e.forEach((i,s)=>{var g;const a=this.effects[s],c=t[a.name],d=(g=i.props)!=null?g:{},u=a.uniformInfo;Object.keys(d).forEach(w=>{const A=c.uniforms[w],p=u[w];let y=A.validator?A.validator(d[w],d):d[w];Array.isArray(y)&&(y=new Float32Array(y)),o.push({name:p.name,value:y})})}),o}bindProps(e){this.calculateProps(e.effects).forEach(o=>{this.setUniform(o.name,o.value)})}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;const o=e.effects.length;let i=0;for(;i{const y=t[p.type],S=y.getEffectKey(p.props||{});o[S]=o[S]?++o[S]:1;const b=o[S];b===1&&c.push({key:S,type:p.type,props:p.props});const v=new y({ref:"".concat(S).concat(b===1?"":b),target:S,props:p.props});return s+=v.declaredUniforms,a.push(...Object.values(v.uniformInfo)),v});let u="";c==null||c.forEach(p=>{var R;const y=t[p.type],S=y.resolveDefaults((R=p.props)!=null?R:{}),b=[];for(const T in y.methods){let _=T;const k=y.methods[T];i[T]&&i[T]!==k&&(_=Ne.resolveMethodDuplicate(T,k,i)),i[_]=k.replace("function",_),b.push({m:T,cm:_})}let v=y.onShaderMask instanceof Function?y.onShaderMask(S):y.onShaderMask,x=y.onColorize instanceof Function?y.onColorize(S):y.onColorize,m=y.onEffectMask instanceof Function?y.onEffectMask(S):y.onEffectMask;b.forEach(T=>{const{m:_,cm:k}=T,z=new RegExp("\\$".concat(_),"g");v&&(v=v.replace(z,k)),x&&(x=x.replace(z,k)),m&&(m=m.replace(z,k))});const C=y.getMethodParameters(y.uniforms,S),I=C.length>0?", ".concat(C):"";v&&(u+="\n float fx_".concat(p.key,"_onShaderMask(float shaderMask ").concat(I,") {\n ").concat(v,"\n }\n ")),x&&(u+="\n vec4 fx_".concat(p.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(I,") {\n ").concat(x,"\n }\n ")),m&&(u+="\n vec4 fx_".concat(p.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(I,") {\n ").concat(m,"\n }\n "))});let g="";for(const p in i)g+=i[p];let w="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",A="\n\n ";for(let p=0;p0?", ".concat(y.passParameters):"",b=t[y.name];b.onShaderMask&&(A+="\n shaderMask = fx_".concat(y.target,"_onShaderMask(shaderMask ").concat(S,");\n ")),b.onColorize&&(A+="\n maskColor = fx_".concat(y.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(S,");\n ")),b.onEffectMask&&(w="fx_".concat(y.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(S,")"));const v=d[p+1];(v===void 0||t[v.name].onEffectMask)&&(A+="\n shaderColor = ".concat(w,";\n "))}return{effects:d,uniforms:a,fragment:Ne.fragment(s,g,u,A),vertex:Ne.vertex()}}static resolveMethodDuplicate(e,t,o,i=0){const s=e+(i>0?i:"");return o[s]&&o[s]!==t?this.resolveMethodDuplicate(e,t,o,++i):s}static resolveDefaults(e,t){return{effects:ss(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var i;let o="";return(i=e.effects)==null||i.forEach(s=>{const c=t[s.type].getEffectKey(s.props||{});o+=",".concat(c)}),"DynamicShader".concat(o)}};h(Ne,"z$__type__Props"),h(Ne,"vertex",()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n "),h(Ne,"fragment",(e,t,o,i)=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ".concat(e,"\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ").concat(t,"\n\n ").concat(o,"\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ").concat(i,"\n\n gl_FragColor = shaderColor * u_alpha;\n }\n "));let pt=Ne;class Wr extends zt{constructor(r){super({renderer:r,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(r){return{radius:r.radius||10,$dimensions:{width:0,height:0}}}bindTextures(r){const{glw:e}=this;e.activeTexture(0),e.bindTexture(r[0].ctxTexture)}bindProps(r){this.setUniform("u_radius",r.radius)}canBatchShaderProps(r,e){return r.radius===e.radius&&r.$dimensions.width===e.$dimensions.width&&r.$dimensions.height===e.$dimensions.height}}h(Wr,"z$__type__Props"),h(Wr,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});const as=new Float32Array([1,0,0,0,1,0,0,0,1]),wr=class wr extends zt{constructor(r){super({renderer:r,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(r){const{glw:e}=this;e.activeTexture(0),e.bindTexture(r[0].ctxTexture)}bindProps(r){const e=wr.resolveDefaults(r);for(const t in e)if(t==="transform")this.setUniform("u_transform",!1,e[t]);else if(t==="scrollY")this.setUniform("u_scrollY",e[t]);else if(t==="color"){const o=ke(e.color);this.setUniform("u_color",o)}else t==="size"?this.setUniform("u_size",e[t]):t==="distanceRange"?this.setUniform("u_distanceRange",e[t]):t==="debug"&&this.setUniform("u_debug",e[t]?1:0)}static resolveDefaults(r={}){var e,t,o,i,s,a;return{transform:(e=r.transform)!=null?e:as,scrollY:(t=r.scrollY)!=null?t:0,color:(o=r.color)!=null?o:4294967295,size:(i=r.size)!=null?i:16,distanceRange:(s=r.distanceRange)!=null?s:1,debug:(a=r.debug)!=null?a:!1}}};h(wr,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});let Ur=wr;class at extends ie{constructor(){super(...arguments);h(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:(t=e.radius)!=null?t:10}}}h(at,"z$__type__Props"),h(at,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(at,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),h(at,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),h(at,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class _t extends ie{constructor(){super(...arguments);h(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(_t,"z$__type__Props"),h(_t,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(_t,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),h(_t,"onColorize","\n return color;\n ");const $e=class $e extends ie{constructor(){super(...arguments);h(this,"name","linearGradient")}static getEffectKey(e){return"linearGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const a=t.length;let c=0;const d=o;for(;ce.map(o=>ke(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),h($e,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),h($e,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ".concat($e.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Yr=$e;class $r extends ie{constructor(){super(...arguments);h(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:(t=e.amount)!=null?t:1}}}h($r,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),h($r,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class lt extends ie{constructor(){super(...arguments);h(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(lt,"z$__type__Props"),h(lt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(lt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(lt,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(lt,"onColorize","\n return color;\n ");class ct extends ie{constructor(){super(...arguments);h(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(ct,"z$__type__Props"),h(ct,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(ct,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(ct,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(ct,"onColorize","\n return color;\n ");class dt extends ie{constructor(){super(...arguments);h(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(dt,"z$__type__Props"),h(dt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(dt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(dt,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(dt,"onColorize","\n return color;\n ");class ut extends ie{constructor(){super(...arguments);h(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(ut,"z$__type__Props"),h(ut,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(ut,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(ut,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(ut,"onColorize","\n return color;\n ");class Rt extends ie{constructor(){super(...arguments);h(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,o,i,s,a;return{amplitude:(t=e.amplitude)!=null?t:.2,narrowness:(o=e.narrowness)!=null?o:4,blockiness:(i=e.blockiness)!=null?i:2,minimizer:(s=e.minimizer)!=null?s:8,time:(a=e.time)!=null?a:Date.now()}}}h(Rt,"z$__type__Props"),h(Rt,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),h(Rt,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),h(Rt,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class sr extends ie{constructor(){super(...arguments);h(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:(t=e.fade)!=null?t:10}}}h(sr,"z$__type__Props"),h(sr,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(sr,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");const Ze=class Ze extends ie{constructor(){super(...arguments);h(this,"name","radialGradient")}static getEffectKey(e){return"radialGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s,a,c,d;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const u=t.length;let g=0;const w=o;for(;ge.map(o=>ke(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),h(Ze,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ".concat(Ze.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Hr=Ze;class ht extends ie{constructor(){super(...arguments);h(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,o,i,s,a,c,d;return{width:(t=e.width)!=null?t:10,progress:(o=e.progress)!=null?o:.5,offset:(i=e.offset)!=null?i:0,range:(s=e.range)!=null?s:Math.PI*2,rounded:(a=e.rounded)!=null?a:!1,radius:(c=e.radius)!=null?c:1,color:(d=e.color)!=null?d:4294967295}}}h(ht,"z$__type__Props"),h(ht,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(ht,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),h(ht,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),h(ht,"onColorize","\n return color;\n ");class ft extends ie{constructor(){super(...arguments);h(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:(t=e.radius)!=null?t:0}}}h(ft,"z$__type__Props"),h(ft,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(ft,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),h(ft,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),h(ft,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class ls{constructor(){h(this,"shCache",new Map);h(this,"shConstructors",{});h(this,"attachedShader",null);h(this,"effectConstructors",{});h(this,"renderer");this.registerShaderType("DefaultShader",Oo),this.registerShaderType("DefaultShaderBatched",Wo),this.registerShaderType("RoundedRectangle",Wr),this.registerShaderType("DynamicShader",pt),this.registerShaderType("SdfShader",Ur),this.registerEffectType("border",_t),this.registerEffectType("borderBottom",dt),this.registerEffectType("borderLeft",ut),this.registerEffectType("borderRight",lt),this.registerEffectType("borderTop",ct),this.registerEffectType("fadeOut",sr),this.registerEffectType("linearGradient",Yr),this.registerEffectType("radialGradient",Hr),this.registerEffectType("grayscale",$r),this.registerEffectType("glitch",Rt),this.registerEffectType("radius",at),this.registerEffectType("radialProgress",ht),this.registerEffectType("holePunch",ft)}registerShaderType(r,e){this.shConstructors[r]=e}registerEffectType(r,e){this.effectConstructors[r]=e}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(r,e){if(!this.renderer)throw new Error("Renderer is not been defined");const t=this.shConstructors[r];if(!t)throw new Error('Shader type "'.concat(r,'" is not registered'));if(r==="DynamicShader")return this.loadDynamicShader(e);const o=t.resolveDefaults(e),i=t.makeCacheKey(o)||t.name;if(i&&this.shCache.has(i))return{shader:this.shCache.get(i),props:o};const s=new t(this.renderer,e);return i&&this.shCache.set(i,s),{shader:s,props:o}}loadDynamicShader(r){if(!this.renderer)throw new Error("Renderer is not been defined");const e=pt.resolveDefaults(r,this.effectConstructors),t=pt.makeCacheKey(e,this.effectConstructors);if(t&&this.shCache.has(t))return{shader:this.shCache.get(t),props:e};const o=new pt(this.renderer,r,this.effectConstructors);return t&&this.shCache.set(t,o),{shader:o,props:e}}useShader(r){this.attachedShader!==r&&(this.attachedShader&&this.attachedShader.detach(),r.attach(),this.attachedShader=r)}}class cs{constructor(){h(this,"data",{})}reset(){this.data={}}increment(r){this.data[r]||(this.data[r]=0),this.data[r]++}getData(){return{...this.data}}}function ds(n){return/\.(ktx|pvr)$/.test(n)}const us=async n=>{const e=await(await fetch(n)).arrayBuffer();return n.indexOf(".ktx")!==-1?hs(e):fs(e)},hs=async n=>{const r=new DataView(n),e=r.getUint32(12)===16909060,t=[],o={glInternalFormat:r.getUint32(28,e),pixelWidth:r.getUint32(36,e),pixelHeight:r.getUint32(40,e),numberOfMipmapLevels:r.getUint32(56,e),bytesOfKeyValueData:r.getUint32(60,e)};let i=64;i+=o.bytesOfKeyValueData;for(let s=0;s{const a=n,c=new Int32Array(a,0,13),d=c[12]+52,u=new Uint8Array(a,d),g=[],w={pixelWidth:c[7],pixelHeight:c[6],numberOfMipmapLevels:c[11]||0};let A=0,p=w.pixelWidth||0,y=w.pixelHeight||0;for(let S=0;S>2)*(y+3>>2)*8,v=new Uint8Array(a,u.byteOffset+A,b);g.push(v),A+=b,p=p>>1,y=y>>1}return{data:{glInternalFormat:36196,mipmaps:g,width:w.pixelWidth||0,height:w.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},Nt=class Nt extends wo{constructor(e,t){super(e);h(this,"props");this.props=Nt.resolveDefaults(t)}hasAlphaChannel(e){return e.indexOf("image/png")!==-1}async getTextureData(){const{src:e,premultiplyAlpha:t}=this.props;if(!e)return{data:null};if(e instanceof ImageData)return{data:e,premultiplyAlpha:t};if(ds(e))return us(e);if(this.txManager.imageWorkerManager)return await this.txManager.imageWorkerManager.getImage(e,t);if(this.txManager.hasCreateImageBitmap){const i=await(await fetch(e)).blob(),s=t!=null?t:this.hasAlphaChannel(i.type);return{data:await createImageBitmap(i,{premultiplyAlpha:s?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"}),premultiplyAlpha:s}}else{const o=new Image;return e.substr(0,5)!="data:"&&(o.crossOrigin="Anonymous"),o.src=e,await new Promise((i,s)=>{o.onload=()=>i(),o.onerror=()=>s(new Error("Failed to load image"))}).catch(i=>{console.error(i)}),{data:o,premultiplyAlpha:t!=null?t:!0}}}static makeCacheKey(e){const t=Nt.resolveDefaults(e);return t.src instanceof ImageData?!1:"ImageTexture,".concat(t.src,",").concat(t.premultiplyAlpha)}static resolveDefaults(e){var t,o;return{src:(t=e.src)!=null?t:"",premultiplyAlpha:(o=e.premultiplyAlpha)!=null?o:!0}}};h(Nt,"z$__type__Props");let jr=Nt;const gs=24;function ps(n,r,e,t,o,i,s,a,c){const d=Math.min(Math.max(s.firstLineIdx,0),a.length),u=0;let g=0;t==="middle"?g=(r-n)/2:t==="bottom"&&(g=r-n);const A=o/i+d*r+g;if(!(c&&A>=c/i))return{sdfX:u,sdfY:A,lineIndex:d}}class It{constructor(r,e=0){h(this,"iterator");h(this,"peekBuffer",[]);h(this,"_lastIndex");this.iterator=r,this.iterator=r,this._lastIndex=e-1,this.peekBuffer=[]}next(){const r=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return r.done?this._lastIndex=-1:this._lastIndex++,r}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];const r=this.iterator.next();return this.peekBuffer.push(r),r}get lastIndex(){return this._lastIndex}}function*Bt(n,r=0){let e=r;for(;e=A.y1,Oe=O<=A.y2,xe=De&&Oe;for(;(de=re.next())&&!de.done;){const K=de.value;if(n===w.length)w.push({codepointIndex:K.cluster,maxY:F,maxX:z});else if(n>w.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?U.codepointIndex!==-1&&(U.codepointIndex=-1,ne=P):U.codepointIndex===-1&&(U.codepointIndex=K.cluster,U.bufferOffset=D,U.xStart=ne),K.mapped){const Yt=P+K.xOffset+K.width;if(g!=="none"&&Yt>=me&&U.codepointIndex!==-1&&U.xStart>0)if(Se){re=j.shapeText(se,new It(Bt(t,U.codepointIndex),U.codepointIndex)),D=U.bufferOffset;break}else re=j.shapeText(se,new It(Bt(b,0),0)),P=U.xStart,D=U.bufferOffset,g="none";else{const We=P+K.xOffset,Ue=O+K.yOffset;if(xe){Ce===-1&&(Ce=D);const Ke=p.getAtlasEntry(K.glyphId),Ve=Ke.x/p.data.common.scaleW,Ge=Ke.y/p.data.common.scaleH,vt=Ke.width/p.data.common.scaleW,wt=Ke.height/p.data.common.scaleH;u[D++]=We,u[D++]=Ue,u[D++]=Ve,u[D++]=Ge,u[D++]=We+K.width,u[D++]=Ue,u[D++]=Ve+vt,u[D++]=Ge,u[D++]=We,u[D++]=Ue+K.height,u[D++]=Ve,u[D++]=Ge+wt,u[D++]=We+K.width,u[D++]=Ue+K.height,u[D++]=Ve+vt,u[D++]=Ge+wt}F=Math.max(F,Ue+K.height),z=Math.max(z,We+K.width),P+=K.xAdvance}}else if(K.codepoint===10){if(Se)break;re=j.shapeText(se,new It(Bt(b,0),0)),g="none"}}Ce!==-1&&(Pe.push({bufferStart:Ce,bufferEnd:D}),Ce=-1),P=0,O+=m,n++,U.codepointIndex=-1,ne=0,!y&&g==="both"&&O>A.y2||de&&de.done?Xe=!1:Se||(Xe=!1)}if(o==="center"){const Se=g==="none"?z:C;for(let me=0;metypeof n=="number"?n:bs[n]||400;function Ss(n,r,e,t,o){let i=Mn(e);for(const s of n){const a=s[r];if(!a)continue;if(a.size===1)return console.warn("TrFontManager: Only one font face found for family: '".concat(r,"' - will be used for all weights and styles")),a.values().next().value;const c=new Map;for(const u of a){const g=Mn(u.descriptors.weight);if(g===i&&u.descriptors.style===t&&u.descriptors.stretch===o)return u;c.set(g,u)}const d="TrFontManager: No exact match: '".concat(r," Weight: ").concat(i," Style: ").concat(t," Stretch: ").concat(o,"'");if(console.error(d),i===400&&c.has(500))return c.get(500);if(i===500&&c.has(400))return c.get(400);if(i<400){for(;i>0;){if(c.has(i))return c.get(i);i-=100}i=600}for(;i<1e3;){if(c.has(i))return c.get(i);i+=100}for(i=500;i>0;){if(c.has(i))return c.get(i);i-=100}}}const As=vo(Ss);class Uo{constructor(r){h(this,"textRenderers");this.textRenderers=r}addFontFace(r){for(const e in this.textRenderers){const t=this.textRenderers[e];t&&t.isFontFaceSupported(r)&&t.addFontFace(r)}}static resolveFontFace(r,e){const{fontFamily:t,fontWeight:o,fontStyle:i,fontStretch:s}=e;return As(r,t,o,i,s)}}const Cs={x:0,y:0,width:0,height:0};class Ts extends Do{constructor(e){super(e);h(this,"ssdfFontFamilies",{});h(this,"msdfFontFamilies",{});h(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]);h(this,"sdfShader");h(this,"rendererBounds");this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&Br(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&Br(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){const{fontFamily:t}=e;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||t==="$$SDF_FAILURE_TEST$$"}isFontFaceSupported(e){return e instanceof Tn}addFontFace(e){L(e instanceof Tn);const t=e.fontFamily,o=e.type==="ssdf"?this.ssdfFontFamilies:e.type==="msdf"?this.msdfFontFamilies:void 0;if(!o){console.warn("Invalid font face type: ".concat(e.type));return}let i=o[t];i||(i=new Set,o[t]=i),i.add(e)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new nt,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){let{trFontFace:t}=e;const{textH:o,lineCache:i,debugData:s,forceFullLayoutCalc:a}=e;if(s.updateCount++,e.status==="initialState"&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){const j="SdfTextRenderer: Could not resolve font face for family: '".concat(e.props.fontFamily,"'");console.error(j),this.setStatus(e,"failed",new Error(j));return}t.texture.setRenderableOwner(e,e.isRenderable)}if(!t.loaded){t.once("loaded",()=>{this.scheduleUpdateState(e)});return}L(t.data,"Font face data should be loaded");const{text:c,fontSize:d,x:u,y:g,contain:w,width:A,height:p,lineHeight:y,verticalAlign:S,scrollable:b,overflowSuffix:v,maxLines:x}=e.props,m=w==="both"&&b?e.props.scrollY:0,{renderWindow:C}=e,I=t.data.info.size,R=d/I,T=y/R;e.distanceRange=R*t.data.distanceField.distanceRange;const _=c.length*gs;let k=e.vertexBuffer;(!k||k.length<_)&&(k=new Float32Array(_*2));const z=e.elementBounds;if(z.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),z.valid=!0),!a&&C.valid){const j=C.screen;if(u+j.x1<=z.x1&&u+j.x2>=z.x2&&g-m+j.y1<=z.y1&&g-m+j.y2>=z.y2){this.setStatus(e,"loaded");return}C.valid=!1,this.setStatus(e,"loading")}const{offsetY:F,textAlign:P}=e.props;if(!C.valid){if(!Br(z,this.rendererBounds))return;ws(C,u,g,m,y,w==="both"?z.y2-z.y1:0,z,R)}const O=ps(I,T,y,S,F,R,C,i,o);if(!O){this.setStatus(e,"loaded");return}const{letterSpacing:D}=e.props,U=xs(O.lineIndex,O.sdfX,O.sdfY,c,P,A,p,d,y,D,k,w,i,C.sdf,t,a,b,v,x);e.bufferUploaded=!1,e.bufferNumFloats=U.bufferNumFloats,e.bufferNumQuads=U.bufferNumQuads,e.vertexBuffer=k,e.renderWindow=C,s.lastLayoutNumCharacters=U.layoutNumCharacters,s.bufferSize=k.byteLength,U.fullyProcessed&&(e.textW=U.maxX*R,e.textH=U.maxY*R),this.setStatus(e,"loaded")}renderQuads(e,t,o,i,s,a){var z,F,P;if(!e.vertexBuffer)return;const{renderer:c}=this.stage,{fontSize:d,color:u,contain:g,scrollable:w,zIndex:A,debug:p}=e.props,y=g==="both"&&w?e.props.scrollY:0,{textW:S=0,textH:b=0,distanceRange:v,vertexBuffer:x,bufferUploaded:m,trFontFace:C,elementBounds:I}=e;let{webGlBuffers:R}=e;if(!R){const O=c.glw,D=4*Float32Array.BYTES_PER_ELEMENT,U=O.createBuffer();L(U),e.webGlBuffers=new Si([{buffer:U,attributes:{a_position:{name:"a_position",size:2,type:O.FLOAT,normalized:!1,stride:D,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:O.FLOAT,normalized:!1,stride:D,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,L(e.webGlBuffers),R=e.webGlBuffers}if(!m){const O=c.glw,D=(z=R==null?void 0:R.getBuffer("a_textureCoordinate"))!=null?z:null;O.arrayBufferData(D,x,O.STATIC_DRAW),e.bufferUploaded=!0}if(L(C),w&&g==="both"){L(I.valid);const O=Ai(I,Cs);o.valid?(e.clippingRect.valid=!0,o=tn(o,O,e.clippingRect)):(e.clippingRect.valid=!0,o=bo(O,e.clippingRect))}const T=new Ci(c.glw,c.options,R,this.sdfShader,{transform:t.data,color:Ti(u,i),size:d/(((F=C.data)==null?void 0:F.info.size)||0),scrollY:y,distanceRange:v,debug:p.sdfShaderDebug},i,o,{height:b,width:S},0,A,!1,s,a),_=(P=e.trFontFace)==null?void 0:P.texture;L(_);const k=this.stage.txManager.getCtxTexture(_);T.addTexture(k),T.length=e.bufferNumFloats,T.numQuads=e.bufferNumQuads,c.addRenderOp(T)}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.trFontFace)==null||o.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),(t=e.trFontFace)==null||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return Uo.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){const{x:t,contain:o,width:i}=e.props,{elementBounds:s}=e;s.x1=t,s.x2=o!=="none"?t+i:1/0}setElementBoundsY(e){const{y:t,contain:o,height:i}=e.props,{elementBounds:s}=e;s.y1=t,s.y2=o==="both"?t+i:1/0}}function _s(n){return n.prototype instanceof _i}async function Rs(n,r){let e;try{console.log("Loading core extension",n),e=await es(()=>import(n),[])}catch(o){console.error("The core extension module at '".concat(n,"' could not be loaded.")),console.error(o);return}if(!e.default){console.error("The core extension module at '".concat(n,"' does not have a default export."));return}const t=e.default;if(_s(t)){const o=new t;try{await o.run(r)}catch(i){console.error("The core extension at '".concat(n,"' threw an error.")),console.error(i)}}else console.error("The core extension at '".concat(n,"' does not extend CoreExtension."))}function Yo(n){const r={boolean:!0,string:!0,number:!0},e=Object.keys(n);for(let t=0;t2048&&(console.warn("Custom Data value for ".concat(o," is too long, it will be truncated to 2048 characters")),n[o]=i.substring(0,2048)),r[s]||(console.warn("Custom Data value for ".concat(o," is not a boolean, string, or number, it will be ignored")),delete n[o])}return n}class Is extends nt{constructor(e,t,o){var b,v,x,m;super();h(this,"root",null);h(this,"driver");h(this,"canvas");h(this,"settings");h(this,"inspector",null);h(this,"nodes",new Map);h(this,"nextTextureId",1);h(this,"textureTracker");const i={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:(b=e.clearColor)!=null?b:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:(v=e.experimental_FinalizationRegistryTextureUsageTracker)!=null?v:!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:(x=e.enableContextSpy)!=null?x:!1,enableInspector:(m=e.enableInspector)!=null?m:!1};this.settings=i;const{appWidth:s,appHeight:a,deviceLogicalPixelRatio:c,devicePhysicalPixelRatio:d,enableInspector:u}=i,g=C=>{this.driver.releaseTexture(C)},w=i.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=w?new Vi(g):new Ki(g,this.settings.textureCleanupOptions);const A=s*c,p=a*c;this.driver=o;const y=document.createElement("canvas");this.canvas=y,y.width=A*d,y.height=p*d,y.style.width="".concat(A,"px"),y.style.height="".concat(p,"px");let S;if(typeof t=="string"?S=document.getElementById(t):S=t,!S)throw new Error("Could not find target element");o.onCreateNode=C=>{this.nodes.set(C.id,C)},o.onBeforeDestroyNode=C=>{this.nodes.delete(C.id)},o.onFpsUpdate=C=>{this.emit("fpsUpdate",C)},o.onFrameTick=C=>{this.emit("frameTick",C)},o.onIdle=()=>{this.emit("idle")},S.appendChild(y),u&&!yo()&&(this.inspector=new qi(y,i))}async init(){await this.driver.init(this,this.settings,this.canvas),this.root=this.driver.getRootNode()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var i,s,a,c,d,u,g,w,A,p,y,S,b,v,x,m,C,I,R;const t=(i=e.fontSize)!=null?i:16,o={...this.resolveNodeDefaults(e),text:(s=e.text)!=null?s:"",textRendererOverride:(a=e.textRendererOverride)!=null?a:null,fontSize:t,fontFamily:(c=e.fontFamily)!=null?c:"sans-serif",fontStyle:(d=e.fontStyle)!=null?d:"normal",fontWeight:(u=e.fontWeight)!=null?u:"normal",fontStretch:(g=e.fontStretch)!=null?g:"normal",textAlign:(w=e.textAlign)!=null?w:"left",contain:(A=e.contain)!=null?A:"none",scrollable:(p=e.scrollable)!=null?p:!1,scrollY:(y=e.scrollY)!=null?y:0,offsetY:(S=e.offsetY)!=null?S:0,letterSpacing:(b=e.letterSpacing)!=null?b:0,lineHeight:(v=e.lineHeight)!=null?v:t,maxLines:(x=e.maxLines)!=null?x:0,textBaseline:(m=e.textBaseline)!=null?m:"alphabetic",verticalAlign:(C=e.verticalAlign)!=null?C:"top",overflowSuffix:(I=e.overflowSuffix)!=null?I:"...",debug:(R=e.debug)!=null?R:{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(e){var u,g,w,A,p,y,S,b,v,x,m,C,I,R,T,_,k,z,F,P,O,D,U,j,se,re,de,Ce,Pe,Wt,Ut,Xe,Se,me,ne,De,Oe,xe,K,Yt,We,Ue,Ke,Ve,Ge,vt,wt,wn,bn,Sn,An,Cn;const t=(u=e.color)!=null?u:4294967295,o=(A=(w=(g=e.colorTl)!=null?g:e.colorTop)!=null?w:e.colorLeft)!=null?A:t,i=(S=(y=(p=e.colorTr)!=null?p:e.colorTop)!=null?y:e.colorRight)!=null?S:t,s=(x=(v=(b=e.colorBl)!=null?b:e.colorBottom)!=null?v:e.colorLeft)!=null?x:t,a=(I=(C=(m=e.colorBr)!=null?m:e.colorBottom)!=null?C:e.colorRight)!=null?I:t,c=Yo((R=e.data)!=null?R:{}),d=(z=(k=(T=e.parent)==null?void 0:T.rtt)!=null?k:(_=e.parent)==null?void 0:_.parentHasRenderTexture)!=null?z:!1;return{x:(F=e.x)!=null?F:0,y:(P=e.y)!=null?P:0,width:(O=e.width)!=null?O:0,height:(D=e.height)!=null?D:0,alpha:(U=e.alpha)!=null?U:1,autosize:(j=e.autosize)!=null?j:!1,clipping:(se=e.clipping)!=null?se:!1,color:t,colorTop:(re=e.colorTop)!=null?re:t,colorBottom:(de=e.colorBottom)!=null?de:t,colorLeft:(Ce=e.colorLeft)!=null?Ce:t,colorRight:(Pe=e.colorRight)!=null?Pe:t,colorBl:s,colorBr:a,colorTl:o,colorTr:i,zIndex:(Wt=e.zIndex)!=null?Wt:0,zIndexLocked:(Ut=e.zIndexLocked)!=null?Ut:0,parent:(Xe=e.parent)!=null?Xe:null,texture:(Se=e.texture)!=null?Se:null,shader:(me=e.shader)!=null?me:null,src:(ne=e.src)!=null?ne:"",scale:(De=e.scale)!=null?De:null,scaleX:(xe=(Oe=e.scaleX)!=null?Oe:e.scale)!=null?xe:1,scaleY:(Yt=(K=e.scaleY)!=null?K:e.scale)!=null?Yt:1,mount:(We=e.mount)!=null?We:0,mountX:(Ke=(Ue=e.mountX)!=null?Ue:e.mount)!=null?Ke:0,mountY:(Ge=(Ve=e.mountY)!=null?Ve:e.mount)!=null?Ge:0,pivot:(vt=e.pivot)!=null?vt:.5,pivotX:(wn=(wt=e.pivotX)!=null?wt:e.pivot)!=null?wn:.5,pivotY:(Sn=(bn=e.pivotY)!=null?bn:e.pivot)!=null?Sn:.5,rotation:(An=e.rotation)!=null?An:0,rtt:(Cn=e.rtt)!=null?Cn:!1,parentHasRenderTexture:d,data:c}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,o){const i=this.nextTextureId++,s={descType:"texture",txType:e,props:t,options:{...o,id:i}};return this.textureTracker.registerTexture(s),s}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class Bs extends nt{constructor(e,t,o){super();h(this,"node");h(this,"props");h(this,"settings");h(this,"propStartValues",{});h(this,"restoreValues",{});h(this,"progress",0);h(this,"delayFor",0);h(this,"timingFunction");h(this,"propsList");this.node=e,this.props=t,this.settings=o,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach(i=>{this.propStartValues[i]=e[i]}),this.timingFunction=i=>i,o.easing&&typeof o.easing=="string"&&(this.timingFunction=Ri(o.easing)),this.delayFor=o.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach(e=>{this.node[e]=this.propStartValues[e]})}reverse(){this.progress=0,Object.keys(this.props).forEach(e=>{const t=this.props[e],o=this.propStartValues[e];this.props[e]=o,this.propStartValues[e]=t}),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,o){return(this.timingFunction(e)||e)*(o-t)+t}update(e){const{duration:t,loop:o,easing:i,stopMethod:s}=this.settings;if(!t){this.emit("finished",{});return}if(this.delayFor>0){this.delayFor-=e;return}if(this.delayFor<=0&&this.progress===0&&this.emit("start",{}),this.progress+=e/t,this.progress>1&&(this.progress=o?0:1,s)){this.emit("finished",{});return}for(let a=0;a{this.startedResolve=r}))}makeStoppedPromise(){this.stoppedResolve===null&&(this.stoppedPromise=new Promise(r=>{this.stoppedResolve=r}))}started(){L(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){L(this.stoppedResolve);const{loop:r,stopMethod:e}=this.animation.settings;if(e==="reverse"){this.animation.reverse(),this.start();return}this.stoppedResolve(),this.stoppedResolve=null,!r&&this.manager.unregisterAnimation(this.animation)}}const Z=0,J=3,ce=6,V=1,ee=4,ue=7,ye=2,ve=5,we=8;class fe{constructor(r){h(this,"data");r?(this.data=new Float32Array(9),this.data[Z]=r[0],this.data[J]=r[3],this.data[ce]=r[6],this.data[V]=r[1],this.data[ee]=r[4],this.data[ue]=r[7],this.data[ye]=r[2],this.data[ve]=r[5],this.data[we]=r[8]):this.data=new Float32Array(9)}static get temp(){return Es}static multiply(r,e,t){const o=r.data[Z]*e.data[Z]+r.data[J]*e.data[V]+r.data[ce]*e.data[ye],i=r.data[Z]*e.data[J]+r.data[J]*e.data[ee]+r.data[ce]*e.data[ve],s=r.data[Z]*e.data[ce]+r.data[J]*e.data[ue]+r.data[ce]*e.data[we],a=r.data[V]*e.data[Z]+r.data[ee]*e.data[V]+r.data[ue]*e.data[ye],c=r.data[V]*e.data[J]+r.data[ee]*e.data[ee]+r.data[ue]*e.data[ve],d=r.data[V]*e.data[ce]+r.data[ee]*e.data[ue]+r.data[ue]*e.data[we],u=r.data[ye]*e.data[Z]+r.data[ve]*e.data[V]+r.data[we]*e.data[ye],g=r.data[ye]*e.data[J]+r.data[ve]*e.data[ee]+r.data[we]*e.data[ve],w=r.data[ye]*e.data[ce]+r.data[ve]*e.data[ue]+r.data[we]*e.data[we];return t||(t=new fe),t.data[Z]=o,t.data[J]=i,t.data[ce]=s,t.data[V]=a,t.data[ee]=c,t.data[ue]=d,t.data[ye]=u,t.data[ve]=g,t.data[we]=w,t}static identity(r){return r||(r=new fe),r.data[Z]=1,r.data[J]=0,r.data[ce]=0,r.data[V]=0,r.data[ee]=1,r.data[ue]=0,r.data[ye]=0,r.data[ve]=0,r.data[we]=1,r}static translate(r,e,t){return t||(t=new fe),t.data[Z]=1,t.data[J]=0,t.data[ce]=r,t.data[V]=0,t.data[ee]=1,t.data[ue]=e,t.data[ye]=0,t.data[ve]=0,t.data[we]=1,t}static scale(r,e,t){return t||(t=new fe),t.data[Z]=r,t.data[J]=0,t.data[ce]=0,t.data[V]=0,t.data[ee]=e,t.data[ue]=0,t.data[ye]=0,t.data[ve]=0,t.data[we]=1,t}static rotate(r,e){const t=Math.cos(r),o=Math.sin(r);return e||(e=new fe),e.data[Z]=t,e.data[J]=-o,e.data[ce]=0,e.data[V]=o,e.data[ee]=t,e.data[ue]=0,e.data[ye]=0,e.data[ve]=0,e.data[we]=1,e}static copy(r,e,t){return e||(e=new fe),e.data[0]=r.data[0],e.data[1]=r.data[1],e.data[2]=r.data[2],e.data[3]=r.data[3],e.data[4]=r.data[4],e.data[5]=r.data[5],e.data[6]=r.data[6],e.data[7]=r.data[7],e.data[8]=r.data[8],e}translate(r,e){return this.data[ce]=this.data[Z]*r+this.data[J]*e+this.data[ce],this.data[ue]=this.data[V]*r+this.data[ee]*e+this.data[ue],this}scale(r,e){return this.data[Z]=this.data[Z]*r,this.data[J]=this.data[J]*e,this.data[V]=this.data[V]*r,this.data[ee]=this.data[ee]*e,this}rotate(r){if(r===0||!(r%Math.PI*2))return this;const e=Math.cos(r),t=Math.sin(r),o=this.data[Z]*e+this.data[J]*t,i=this.data[J]*e-this.data[Z]*t,s=this.data[V]*e+this.data[ee]*t,a=this.data[ee]*e-this.data[V]*t;return this.data[Z]=o,this.data[J]=i,this.data[V]=s,this.data[ee]=a,this}multiply(r){return fe.multiply(this,r,this)}get tx(){return this.data[ce]}get ty(){return this.data[ue]}get ta(){return this.data[Z]}get tb(){return this.data[J]}get tc(){return this.data[V]}get td(){return this.data[ee]}transformPoint(r,e){return[this.data[Z]*r+this.data[J]*e+this.data[ce],this.data[V]*r+this.data[ee]*e+this.data[V]]}}const Es=new fe,Ht=0,jt=2,Qt=4,Xt=6,Kt=1,Vt=3,Gt=5,qt=7;class fr{constructor(r){h(this,"data");this.data=new Float32Array(8),r&&(this.data[Ht]=r[Ht],this.data[jt]=r[jt],this.data[Qt]=r[Qt],this.data[Xt]=r[Xt],this.data[Kt]=r[Kt],this.data[Vt]=r[Vt],this.data[Gt]=r[Gt],this.data[qt]=r[qt])}static translate(r,e,t,o,i,s,a,c,d){return d||(d=new fr),d.data[Ht]=r,d.data[jt]=t,d.data[Qt]=i,d.data[Xt]=a,d.data[Kt]=e,d.data[Vt]=o,d.data[Gt]=s,d.data[qt]=c,d}get x1(){return this.data[Ht]}get x2(){return this.data[jt]}get x3(){return this.data[Qt]}get x4(){return this.data[Xt]}get y1(){return this.data[Kt]}get y2(){return this.data[Vt]}get y3(){return this.data[Gt]}get y4(){return this.data[qt]}}var G;(function(n){n[n.Init=0]="Init",n[n.OutOfBounds=2]="OutOfBounds",n[n.InBounds=4]="InBounds",n[n.InViewport=8]="InViewport"})(G||(G={}));const tt=new Map;tt.set(G.Init,"init");tt.set(G.OutOfBounds,"outOfBounds");tt.set(G.InBounds,"inBounds");tt.set(G.InViewport,"inViewport");var B;(function(n){n[n.Children=1]="Children",n[n.ScaleRotate=2]="ScaleRotate",n[n.Local=4]="Local",n[n.Global=8]="Global",n[n.Clipping=16]="Clipping",n[n.CalculatedZIndex=32]="CalculatedZIndex",n[n.ZIndexSortedChildren=64]="ZIndexSortedChildren",n[n.PremultipliedColors=128]="PremultipliedColors",n[n.WorldAlpha=256]="WorldAlpha",n[n.RenderState=512]="RenderState",n[n.IsRenderable=1024]="IsRenderable",n[n.None=0]="None",n[n.All=2047]="All"})(B||(B={}));class sn extends nt{constructor(e,t){super();h(this,"stage");h(this,"children",[]);h(this,"props");h(this,"updateType",B.All);h(this,"globalTransform");h(this,"scaleRotateTransform");h(this,"localTransform");h(this,"renderCoords");h(this,"renderBound");h(this,"strictBound");h(this,"preloadBound");h(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1});h(this,"isRenderable",!1);h(this,"renderState",G.Init);h(this,"worldAlpha",1);h(this,"premultipliedColorTl",0);h(this,"premultipliedColorTr",0);h(this,"premultipliedColorBl",0);h(this,"premultipliedColorBr",0);h(this,"calcZIndex",0);h(this,"hasRTTupdates",!1);h(this,"onTextureLoaded",(e,t)=>{this.autosizeNode(t),this.parentHasRenderTexture&&this.setRTTUpdates(1),this.emit("loaded",{type:"texture",dimensions:t}),queueMicrotask(()=>{this.stage.requestRender()})});h(this,"onTextureFailed",(e,t)=>{this.emit("failed",{type:"texture",error:t})});h(this,"onTextureFreed",e=>{this.emit("freed",{type:"texture"})});this.stage=e,this.props={...t,parent:null,parentHasRenderTexture:!1},this.parent=t.parent,this.rtt=t.rtt,this.updateScaleRotateTransform()}loadTexture(e,t,o=null){this.props.texture&&this.unloadTexture();const{txManager:i}=this.stage,s=i.loadTexture(e,t,o);this.props.texture=s,this.props.textureOptions=o,this.setUpdateType(B.IsRenderable),queueMicrotask(()=>{s.state==="loaded"?this.onTextureLoaded(s,s.dimensions):s.state==="failed"?this.onTextureFailed(s,s.error):s.state==="freed"&&this.onTextureFreed(s),s.on("loaded",this.onTextureLoaded),s.on("failed",this.onTextureFailed),s.on("freed",this.onTextureFreed)})}unloadTexture(){if(this.props.texture){const{texture:e}=this.props;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(B.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){const o=this.stage.renderer.getShaderManager();L(o);const{shader:i,props:s}=o.loadShader(e,t);this.props.shader=i,this.props.shaderProps=s,this.setUpdateType(B.IsRenderable)}setUpdateType(e){this.updateType|=e;const t=this.props.parent;t&&!(t.updateType&B.Children)&&t.setUpdateType(B.Children),this.parentHasRenderTexture&&this.setRTTUpdates(e)}sortChildren(){this.children.sort((e,t)=>e.calcZIndex-t.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=fe.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){L(this.scaleRotateTransform);const e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,o=this.props.mountX*this.props.width,i=this.props.mountY*this.props.height;this.localTransform=fe.translate(e-o+this.props.x,t-i+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(B.Global)}update(e,t){var s;this.updateType&B.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(B.Local)),this.updateType&B.Local&&(this.updateLocalTransform(),this.setUpdateType(B.Global));const o=this.props.parent;let i=B.None;this.updateType&B.Global&&(L(this.localTransform),this.globalTransform=fe.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),this.parentHasRenderTexture&&((s=this.props.parent)!=null&&s.rtt)&&(this.globalTransform=fe.identity()),o&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(B.Clipping|B.RenderState|B.Children),i|=B.Global),this.updateType&B.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(B.Children),i|=B.Clipping),this.updateType&B.WorldAlpha&&(o?this.worldAlpha=o.worldAlpha*this.props.alpha:this.worldAlpha=this.props.alpha,this.setUpdateType(B.Children|B.PremultipliedColors|B.IsRenderable),i|=B.WorldAlpha),this.updateType&B.PremultipliedColors&&(this.premultipliedColorTl=Tt(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=Tt(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=Tt(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=Tt(this.props.colorBr,this.worldAlpha,!0))),this.updateType&B.RenderState&&(this.updateRenderState(t),this.setUpdateType(B.IsRenderable)),this.updateType&B.IsRenderable&&this.updateIsRenderable(),o&&this.updateType&B.CalculatedZIndex&&(this.calculateZIndex(),o.setUpdateType(B.ZIndexSortedChildren)),this.updateType&B.Children&&this.children.length&&!this.rtt&&this.children.forEach(a=>{a.setUpdateType(i),a.updateType!==0&&a.update(e,this.clippingRect)}),this.updateType&B.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return this.props.texture?!0:!this.props.width||!this.props.height?!1:!!(this.props.shader||this.props.clipping||this.props.color!==0||this.props.colorTop!==0||this.props.colorBottom!==0||this.props.colorLeft!==0||this.props.colorRight!==0||this.props.colorTl!==0||this.props.colorTr!==0||this.props.colorBl!==0||this.props.colorBr!==0)}checkRenderBounds(e){L(this.renderBound);const t=e.width||this.stage.root.width,o=e.height||this.stage.root.height;this.strictBound=gt(e.x,e.y,e.x+t,e.y+o,this.strictBound);const i=this.stage.boundsMargin;return this.preloadBound=gt(e.x-i[3],e.y-i[0],e.x+t+i[1],e.y+o+i[2],this.preloadBound),Rn(this.renderBound,this.strictBound)?G.InViewport:Rn(this.renderBound,this.preloadBound)?G.InBounds:G.OutOfBounds}updateRenderState(e){const t=this.checkRenderBounds(e);if(t!==this.renderState){let o=this.renderState;this.renderState=t,o===G.InViewport&&this.emit("outOfViewport",{previous:o,current:t}),oG.InBounds&&t===G.OutOfBounds&&(this.emit(tt.get(G.InBounds),{previous:o,current:t}),o=G.InBounds);const i=tt.get(t);L(i),this.emit(i,{previous:o,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(G[e]))}updateIsRenderable(){let e;this.worldAlpha===0||!this.checkRenderProps()?e=!1:e=this.renderState>G.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;(t=this.props.texture)==null||t.setRenderableOwner(this,e)}calculateRenderCoords(){const{width:e,height:t,globalTransform:o}=this;L(o);const{tx:i,ty:s,ta:a,tb:c,tc:d,td:u}=o;if(c===0&&d===0){const g=i,w=i+e*a,A=s,p=s+t*u;this.renderCoords=fr.translate(g,A,w,A,w,p,g,p,this.renderCoords)}else this.renderCoords=fr.translate(i,s,i+e*a,s+e*d,i+e*a+t*c,s+e*d+t*u,i+t*c,s+t*u,this.renderCoords)}updateBoundingRect(){const{renderCoords:e,globalTransform:t}=this;L(t),L(e);const{tb:o,tc:i}=t,{x1:s,y1:a,x3:c,y3:d}=e;if(o===0||i===0)this.renderBound=gt(s,a,c,d,this.renderBound);else{const{x2:u,x4:g,y2:w,y4:A}=e;this.renderBound=gt(Math.min(s,u,c,g),Math.min(a,w,d,A),Math.max(s,u,c,g),Math.max(a,w,d,A),this.renderBound)}}calculateClippingRect(e){L(this.globalTransform);const{clippingRect:t,props:o,globalTransform:i}=this,{clipping:s}=o,a=i.tb!==0||i.tc!==0;s&&!a?(t.x=i.tx,t.y=i.ty,t.width=this.width*i.ta,t.height=this.height*i.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?tn(e,t,t):e.valid&&(bo(e,t),t.valid=!0)}calculateZIndex(){var s,a;const e=this.props,t=e.zIndex||0,o=((s=e.parent)==null?void 0:s.zIndex)||0;let i=t;(a=e.parent)!=null&&a.zIndexLocked&&(i=t{t.setUpdateType(B.CalculatedZIndex)})}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(B.CalculatedZIndex|B.Children),this.children.forEach(t=>{t.setUpdateType(B.CalculatedZIndex)})}get parent(){return this.props.parent}set parent(e){const t=this.props.parent;if(t!==e){if(this.props.parent=e,t){const o=t.children.indexOf(this);L(o!==-1,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(o,1),t.setUpdateType(B.Children|B.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(B.All),e.setUpdateType(B.Children|B.ZIndexSortedChildren),(e.rtt||e.parentHasRenderTexture)&&this.setRTTUpdates(B.All)),this.parentHasRenderTexture=(e==null?void 0:e.rtt)||(e==null?void 0:e.parentHasRenderTexture),this.updateScaleRotateTransform()}}get rtt(){return this.props.rtt}set rtt(e){var t;e&&(this.props.rtt=!0,this.hasRTTupdates=!0,(t=this.stage.renderer)==null||t.renderToTexture(this))}set parentHasRenderTexture(e){this.props.parentHasRenderTexture=!!e}get parentHasRenderTexture(){return this.props.parentHasRenderTexture}get framebufferDimensions(){var e;return this.parentHasRenderTexture&&!this.rtt?(e=this.parent)==null?void 0:e.framebufferDimensions:{width:this.width,height:this.height}}get parentRenderTexture(){let e=this.parent;for(;e;){if(e.rtt)return e;e=e.parent}return null}get texture(){return this.props.texture}setRTTUpdates(e){var t;this.hasRTTupdates=!0,(t=this.parent)==null||t.setRTTUpdates(e)}}let Fs=1;function an(){return Fs++}class Qr extends nt{constructor(e,t,o,i){var s;super();h(this,"rendererMain");h(this,"stage");h(this,"id");h(this,"coreNode");h(this,"_children",[]);h(this,"_src","");h(this,"_parent",null);h(this,"_texture",null);h(this,"_shader",null);h(this,"_data",{});h(this,"onTextureLoaded",(e,t)=>{this.emit("loaded",t)});h(this,"onTextureFailed",(e,t)=>{this.emit("failed",t)});h(this,"onTextureFreed",(e,t)=>{this.emit("freed",t)});h(this,"onOutOfBounds",(e,t)=>{this.emit("outOfBounds",t)});h(this,"onInBounds",(e,t)=>{this.emit("inBounds",t)});h(this,"onOutOfViewport",(e,t)=>{this.emit("outOfViewport",t)});h(this,"onInViewport",(e,t)=>{this.emit("inViewport",t)});this.rendererMain=t,this.stage=o,this.id=(s=i==null?void 0:i.id)!=null?s:an(),this.coreNode=i||new sn(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null,rtt:e.rtt,parentHasRenderTexture:e.parentHasRenderTexture}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this.rtt=e.rtt,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){e!==null&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var o;const t=this._parent;if(this._parent=e,this.coreNode.parent=(o=e==null?void 0:e.coreNode)!=null?o:null,t){const i=t.children.indexOf(this);L(i!==-1,"MainOnlyNode.parent: Node not found in old parent's children!"),t.children.splice(i,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){if(this._src!==e){if(this._src=e,!e){this.texture=null;return}this.texture=this.rendererMain.createTexture("ImageTexture",{src:e})}}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get rtt(){return this.coreNode.rtt}set rtt(e){e&&(this.texture=this.rendererMain.createTexture("RenderTexture",{width:this.width,height:this.height},{preload:!0,flipY:!0})),this.coreNode.rtt=e}get parentHasRenderTexture(){return this.coreNode.parentHasRenderTexture}set parentHasRenderTexture(e){this.coreNode.parentHasRenderTexture=e}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=Yo(e)}destroy(){this.emit("beforeDestroy",{});let e=this.children[0];for(;e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){const o=new Bs(this.coreNode,e,t);return new ks(this.stage.animationManager,o)}}const Ns=n=>{let r=!1;const e=()=>{if(n.updateAnimations(),!n.hasSceneUpdates()){n.calculateFps(),setTimeout(e,16.666666666666668),r||(n.emit("idle"),r=!0);return}r=!1,n.drawFrame(),requestAnimationFrame(e)};requestAnimationFrame(e)},Ls=()=>performance?performance.now():Date.now();class Ms{constructor(){h(this,"activeAnimations",new Set)}registerAnimation(r){this.activeAnimations.add(r)}unregisterAnimation(r){this.activeAnimations.delete(r)}update(r){this.activeAnimations.forEach(e=>{e.update(r)})}}class zs{constructor(r){h(this,"imageWorkersEnabled",!0);h(this,"messageManager",{});h(this,"workers",[]);h(this,"workerIndex",0);this.workers=this.createWorkers(r),this.workers.forEach(e=>{e.onmessage=this.handleMessage.bind(this)})}handleMessage(r){const{src:e,data:t,error:o}=r.data,i=this.messageManager[e];if(i){const[s,a]=i;delete this.messageManager[e],o?a(new Error(o)):s(t)}}createWorkers(r=1){const e="\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ",t=new Blob([e.replace('"use strict";',"")],{type:"application/javascript"}),o=(self.URL?URL:webkitURL).createObjectURL(t),i=[];for(let s=0;s{try{if(this.workers){const i=this.convertUrlToAbsolute(r);this.messageManager[i]=[t,o],this.getNextWorker().postMessage({src:i,premultiplyAlpha:e})}}catch(i){o(i)}})}}const Lt=class Lt extends wo{constructor(e,t){super(e);h(this,"props");this.props=Lt.resolveDefaults(t)}async getTextureData(){const{width:e,height:t}=this.props,o=e*t*4,i=new Uint8ClampedArray(o);for(let s=0;s{})}setTextureMemUse(r,e){if(this.textures.has(r)&&(this.memUsed-=this.textures.get(r)),e===0){this.textures.delete(r);return}else this.memUsed+=e,this.textures.set(r,e);this.memUsed>this.threshold&&this.gc()}gc(){this.textures.forEach((r,e)=>{e.renderable||e.free()})}}const Os=2e6;class Ws extends nt{constructor(e){super();h(this,"options");h(this,"animationManager");h(this,"txManager");h(this,"txMemManager");h(this,"fontManager");h(this,"textRenderers");h(this,"shManager");h(this,"renderer");h(this,"root");h(this,"boundsMargin");h(this,"deltaTime",0);h(this,"lastFrameTime",0);h(this,"currentFrameTime",0);h(this,"fpsNumFrames",0);h(this,"fpsElapsedTime",0);h(this,"renderRequested",!1);h(this,"contextSpy",null);this.options=e;const{canvas:t,clearColor:o,rootId:i,debug:s,appWidth:a,appHeight:c,boundsMargin:d,enableContextSpy:u,numImageWorkers:g,txMemByteThreshold:w}=e;this.txManager=new Ps(g),this.txMemManager=new Ds(w),this.shManager=new ls,this.animationManager=new Ms,this.contextSpy=u?new cs:null;let A=[0,0,0,0];d&&(A=Array.isArray(d)?d:[d,d,d,d]),this.boundsMargin=A,s!=null&&s.monitorTextureCache&&setInterval(()=>{L(this.txManager);const y=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",y.idCacheSize),console.log("Texture Key Cache Size: ",y.keyCacheSize)},1e3),this.renderer=new Ei({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:o!=null?o:4278190080,bufferMemory:Os,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new is(this),sdf:new Ts(this)},this.fontManager=new Uo(this.textRenderers);const p=new sn(this,{id:i,x:0,y:0,width:a,height:c,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null,rtt:!1});this.root=p,Ns(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=Ls(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){const{renderer:e,renderRequested:t}=this;this.root.updateType!==0&&this.root.update(this.deltaTime,this.root.clippingRect),e==null||e.reset(),e.rttNodes.length>0&&e.renderRTTNodes(),this.addQuads(this.root),e==null||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var t,o,i;const{fpsUpdateInterval:e}=this.options;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){const s=Math.round(this.fpsNumFrames*1e3/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:s,contextSpyData:(o=(t=this.contextSpy)==null?void 0:t.getData())!=null?o:null}),(i=this.contextSpy)==null||i.reset()}}addQuads(e){L(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(let t=0;t{const{contain:e}=this,t=this.trState.props.width,o=this.trState.props.height,i=this.trState.textW||0,s=this.trState.textH||0;e==="both"?(this.props.width=t,this.props.height=o):e==="width"?(this.props.width=t,this.props.height=s):e==="none"&&(this.props.width=i,this.props.height=s),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})});h(this,"onTextFailed",(e,t)=>{this.emit("failed",{type:"text",error:t})});this._textRendererOverride=t.textRendererOverride;const{resolvedTextRenderer:o,textRendererState:i}=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix});this.textRenderer=o,this.trState=i}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),this.contain==="none"&&this.setUpdateType(B.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),this.contain!=="both"&&this.setUpdateType(B.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);const{resolvedTextRenderer:t,textRendererState:o}=this.resolveTextRendererAndState(this.trState.props);this.textRenderer=t,this.trState=o}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),L(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return this.trState.props.text!==""?!0:super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){var t,o;L(this.globalTransform),!(this.parentHasRenderTexture&&(!e.renderToTextureActive||this.parentRenderTexture!==e.activeRttNode))&&(this.parentHasRenderTexture&&((t=this.props.parent)!=null&&t.rtt)&&(this.globalTransform=fe.identity(),this.globalTransform.multiply((o=this.localTransform)!=null?o:fe.identity())),L(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha,this.parentHasRenderTexture,this.framebufferDimensions))}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){const t=this.stage.resolveTextRenderer(e,this._textRendererOverride),o=t.createState(e);return o.emitter.on("loaded",this.onTextLoaded),o.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(o),{resolvedTextRenderer:t,textRendererState:o}}}class Ys extends Qr{constructor(r,e,t){super(r,e,t,new Us(t,{id:an(),x:r.x,y:r.y,width:r.width,height:r.height,alpha:r.alpha,autosize:r.autosize,clipping:r.clipping,color:r.color,colorTop:r.colorTop,colorBottom:r.colorBottom,colorLeft:r.colorLeft,colorRight:r.colorRight,colorTl:r.colorTl,colorTr:r.colorTr,colorBl:r.colorBl,colorBr:r.colorBr,zIndex:r.zIndex,zIndexLocked:r.zIndexLocked,scaleX:r.scaleX,scaleY:r.scaleY,mountX:r.mountX,mountY:r.mountY,mount:r.mount,pivot:r.pivot,pivotX:r.pivotX,pivotY:r.pivotY,rotation:r.rotation,text:r.text,fontSize:r.fontSize,fontFamily:r.fontFamily,fontWeight:r.fontWeight,fontStretch:r.fontStretch,fontStyle:r.fontStyle,contain:r.contain,scrollable:r.scrollable,letterSpacing:r.letterSpacing,textAlign:r.textAlign,scrollY:r.scrollY,offsetY:r.offsetY,textRendererOverride:r.textRendererOverride,lineHeight:r.lineHeight,maxLines:r.maxLines,textBaseline:r.textBaseline,verticalAlign:r.verticalAlign,overflowSuffix:r.overflowSuffix,debug:r.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null,rtt:!1,parentHasRenderTexture:!1}))}get text(){return this.coreNode.text}set text(r){this.coreNode.text=r}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(r){this.coreNode.textRendererOverride=r}get fontSize(){return this.coreNode.fontSize}set fontSize(r){this.coreNode.fontSize=r}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(r){this.coreNode.fontFamily=r}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(r){this.coreNode.fontWeight=r}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(r){this.coreNode.fontStretch=r}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(r){this.coreNode.fontStyle=r}get textAlign(){return this.coreNode.textAlign}set textAlign(r){this.coreNode.textAlign=r}get contain(){return this.coreNode.contain}set contain(r){this.coreNode.contain=r}get scrollable(){return this.coreNode.scrollable}set scrollable(r){this.coreNode.scrollable=r}get scrollY(){return this.coreNode.scrollY}set scrollY(r){this.coreNode.scrollY=r}get offsetY(){return this.coreNode.offsetY}set offsetY(r){this.coreNode.offsetY=r}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(r){this.coreNode.letterSpacing=r}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(r){r&&(this.coreNode.lineHeight=r)}get maxLines(){return this.coreNode.maxLines}set maxLines(r){r&&(this.coreNode.maxLines=r)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(r){r&&(this.coreNode.textBaseline=r)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(r){r&&(this.coreNode.verticalAlign=r)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(r){r&&(this.coreNode.overflowSuffix=r)}get debug(){return this.coreNode.debug}set debug(r){this.coreNode.debug=r}}class $s{constructor(){h(this,"root",null);h(this,"stage",null);h(this,"rendererMain",null)}async init(r,e,t){this.stage=new Ws({rootId:an(),appWidth:e.appWidth,appHeight:e.appHeight,txMemByteThreshold:e.txMemByteThreshold,boundsMargin:e.boundsMargin,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio,clearColor:e.clearColor,canvas:t,fpsUpdateInterval:e.fpsUpdateInterval,enableContextSpy:e.enableContextSpy,numImageWorkers:e.numImageWorkers,debug:{monitorTextureCache:!1}}),this.rendererMain=r,L(this.stage.root);const o=new Qr(r.resolveNodeDefaults({}),this.rendererMain,this.stage,this.stage.root);this.root=o,o.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,o)),this.onCreateNode(o),e.coreExtensionModule&&await Rs(e.coreExtensionModule,this.stage),this.stage.on("fpsUpdate",(i,s)=>{this.onFpsUpdate(s)}),this.stage.on("frameTick",(i,s)=>{this.onFrameTick(s)}),this.stage.on("idle",()=>{this.onIdle()})}createNode(r){L(this.rendererMain),L(this.stage);const e=new Qr(r,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(r){L(this.rendererMain),L(this.stage);const e=new Ys(r,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}destroyNode(r){r.destroy()}releaseTexture(r){const{stage:e}=this;L(e),e.txManager.removeTextureIdFromCache(r)}getRootNode(){return L(this.root),this.root}onCreateNode(r){throw new Error("Method not implemented.")}onBeforeDestroyNode(r){throw new Error("Method not implemented.")}onFpsUpdate(r){throw new Error("Method not implemented.")}onFrameTick(r){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}let Le,ln;function Hs(n={},r="app"){const e=new $s;return Le=new Is(n,r,e),ln=Le.createShader.bind(Le),Le}class js extends Array{constructor(r){super(),this._parent=r}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(r,e){if(e){const t=this.indexOf(e);this.splice(t,0,r)}else this.push(r);r.parent=this._parent,this._parent._isDirty=!0}remove(r){const e=this.indexOf(r);e>=0&&this.splice(e,1)}}function Qs(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!1}const Xs=Qs()||!1,pe={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function zn(n){return Ks(n)&&n.debug}function Je(n,r,...e){Xs&&(pe.debug||zn(r)||zn(e[0]))&&console.log(n,r,...e)}function Zt(n){return typeof n=="function"}function Ks(n){return typeof n=="object"}function gr(n){return Array.isArray(n)}function Vs(n){return typeof n=="string"}function Gs(n){return typeof n=="number"}function qs(n){return Number.isInteger(n)}function Zs(n,r){for(const e of r)if(e in n)return!0;return!1}function $o(n,r={}){if(gr(n))n.forEach(e=>{$o(e,r)});else if(n)for(const e in n)r[e]===void 0&&(r[e]=n[e]);return r}class Pn extends Array{constructor(r,e={}){return gr(e)?super(...e):Vs(e)?super(e):super(...Object.entries(e).filter(([t,o])=>o).map(([t])=>t)),this.onChange=r,this}has(r){return this.indexOf(r)>=0}is(r){return this.indexOf(r)>=0}add(r){this.push(r),this.onChange()}toggle(r){this.has(r)?this.remove(r):this.add(r)}remove(r){const e=this.indexOf(r);e>=0&&(this.splice(e,1),this.onChange())}}function Js(n){const r=[];let e=!1;for(let x=0;x(x.flexOrder||0)-(m.flexOrder||0));const t=r.length,i=(n.flexDirection||"row")==="row",s=i?"width":"height",a=i?"height":"width",c=i?"marginLeft":"marginTop",d=i?"marginRight":"marginBottom",u=i?"x":"y",g=i?"y":"x",w=n[s]||0,A=n[a]||0,p=n.gap||0,y=n.justifyContent||"flexStart",S=n.alignItems;let b=0;["center","spaceBetween","spaceEvenly"].includes(y)&&(b=r.reduce((x,m)=>x+(m[s]||0),0));const v=A&&S?x=>{S==="flexStart"?x[g]=0:S==="center"?x[g]=(A-(x[a]||0))/2:S==="flexEnd"&&(x[g]=A-(x[a]||0))}:x=>x;if(y==="flexStart"){let x=0;if(r.forEach(m=>{m[u]=x+(m[c]||0),x+=(m[s]||0)+p+(m[c]||0)+(m[d]||0),v(m)}),n.flexBoundary!=="fixed"){const m=x-p;if(m!==n[s])return n[s]=m,!0}}else if(y==="flexEnd"){let x=w;for(let m=t-1;m>=0;m--){const C=r[m];L(C),C[u]=x-(C[s]||0)-(C[d]||0),x-=(C[s]||0)+p+(C[c]||0)+(C[d]||0),v(C)}}else if(y==="center"){let x=(w-(b+p*(t-1)))/2;r.forEach(m=>{m[u]=x,x+=(m[s]||0)+p,v(m)})}else if(y==="spaceBetween"){const x=(w-b)/(t-1);let m=0;r.forEach(C=>{C[u]=m,m+=(C[s]||0)+x,v(C)})}else if(y==="spaceEvenly"){const x=(w-b)/(t+1);let m=x;r.forEach(C=>{C[u]=m,m+=(C[s]||0)+x,v(C)})}return!1}const{animationSettings:ea}=pe;function Dn(n){const r=[];for(const[e,t]of Object.entries(n))r.push({type:e,props:t});return ln("DynamicShader",{effects:r})}function St(n=""){return{set(r){Gs(r)&&(r={width:r,color:255}),this.effects={...this.effects||{},["border".concat(n)]:r},this["_border".concat(n)]=r},get(){return this["_border".concat(n)]}}}const ta=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"],ra=["autosize","clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"];class be extends Object{constructor(r){super(),this._animationQueue=[],this._animationRunning=!1,this.name=r,this._renderProps={},this.children=new js(this)}get effects(){return this._effects}set effects(r){this._effects=r,this.lng&&(this.shader=Dn(r))}get parent(){return this._parent}set parent(r){var e;this._parent=r,this.lng&&(this.lng.parent=(e=r==null?void 0:r.lng)!=null?e:null)}get shader(){return this._shader}set shader(r){gr(r)?this._shader=ln(...r):this._shader=r,this._sendToLightning("shader",this._shader)}_sendToLightningAnimatable(r,e){if(this.lng){if(pe.animationsEnabled&&this.transition&&(this.transition===!0||this.transition[r])){const t=this.transition===!0||this.transition[r]===!0?void 0:this.transition[r];return this.animate({[r]:e},t).start()}this.lng[r]=e}else this._renderProps[r]=e}_sendToLightning(r,e){this.lng?this.lng[r]=e:this._renderProps[r]=e}animate(r,e){return L(this.lng,"Node must be rendered before animating"),this.lng.animate(r,e||this.animationSettings)}chain(r,e){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),e?this._animationQueueSettings=e:this._animationQueueSettings||(this._animationQueueSettings=e||this.animationSettings),e=e||this._animationQueueSettings,this._animationQueue.push({props:r,animationSettings:e}),this}async start(){let r=this._animationQueue.shift();for(;r;)this._animationRunning=!0,await this.animate(r.props,r.animationSettings).start().waitUntilStopped(),r=this._animationQueue.shift();this._animationRunning=!1,this._animationQueueSettings=void 0}setFocus(){if(this.lng){if(this.forwardFocus!==void 0)if(Zt(this.forwardFocus)){if(this.forwardFocus.call(this,this)!==!1)return}else{const r=typeof this.forwardFocus=="number"?this.forwardFocus:null;if(r!==null&&rMo(this))}else this.autofocus=!0}isTextNode(){return this.name==="text"}_resizeOnTextLoad(){this.lng.on("loaded",(r,e)=>{if(e.type==="text"){const{dimensions:t}=e;this.parent.updateLayout(this,t)}})}getText(){return this.children.map(r=>r.text).join("")}destroy(){var r;this._queueDelete&&((r=this.lng)==null||r.destroy())}set onEvents(r){this._events=r}get onEvents(){return this._events||[]}set style(r){gr(r)?this._style=$o(r):this._style=r;for(const e in this._style)this[e]===void 0&&(this[e]=this._style[e])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(r){return this.children.find(e=>e.id===r)}searchChildrenById(r){for(const e of this.children){if(e.id===r)return e;if(e instanceof be){const t=e.searchChildrenById(r);if(t)return t}}}set states(r){this._states=new Pn(this._stateChanged.bind(this),r),this.lng&&this._stateChanged()}get states(){return this._states=this._states||new Pn(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||ea}set animationSettings(r){this._animationSettings=r}updateLayout(r,e){var t,o;if(this.hasChildren){Je("Layout: ",this);let i=!1;Zt(this.onBeforeLayout)&&(i=this.onBeforeLayout.call(this,r,e)),this.display==="flex"?(Js(this)||i)&&((t=this.parent)==null||t.updateLayout()):i&&((o=this.parent)==null||o.updateLayout()),Zt(this.onLayout)&&this.onLayout.call(this,r,e)}}_stateChanged(){if(Je("State Changed: ",this,this.states),this.forwardStates){const e=this.states.slice();this.children.forEach(t=>t.states=e)}const r=this.states;if(this._undoStyles||this.style&&Zs(this.style,r)){this._undoStyles=this._undoStyles||[];const e={};this._undoStyles.forEach(o=>{e[o]=this.style[o]});const t=r.reduce((o,i)=>{const s=this.style[i];return s&&(o={...o,...s}),o},{});this._undoStyles=Object.keys(t),t.transition!==void 0&&(this.transition=t.transition),Object.assign(this,e,t)}}render(){const r=this,e=this.parent;if(!e){console.warn("Parent not set - no node created for: ",this);return}if(!e.lng){console.warn("Parent not rendered yet: ",this);return}if(this.lng){console.warn("Node already rendered: ",this);return}e._isDirty&&(e.updateLayout(),e._isDirty=!1),this.states.length&&this._stateChanged();const t=r._renderProps;if(t.x=t.x||0,t.y=t.y||0,e.lng&&(t.parent=e.lng),r._effects&&(this.shader=Dn(r._effects)),r.isTextNode()){if(pe.fontSettings)for(const o in pe.fontSettings)t[o]===void 0&&(t[o]=pe.fontSettings[o]);t.text=r.getText(),t.contain&&(t.width||(t.width=(e.width||0)-t.x-(t.marginRight||0),r._autosized=!0),t.contain==="both"&&!t.height&&!t.maxLines&&(t.height=(e.height||0)-t.y-(t.marginBottom||0),r._autosized=!0)),Je("Rendering: ",this,t),r.lng=Le.createTextNode(t),(!t.width||!t.height)&&(r._autosized=!0,r._resizeOnTextLoad())}else t.texture||(isNaN(t.width)&&(t.width=(e.width||0)-t.x,r._autosized=!0),isNaN(t.height)&&(t.height=(e.height||0)-t.y,r._autosized=!0),!t.color&&!t.src&&(t.color=0)),Je("Rendering: ",this,t),r.lng=Le.createNode(t);r.onFail&&r.lng.on("failed",r.onFail),r.onLoad&&r.lng.on("loaded",r.onLoad),Zt(this.onCreate)&&this.onCreate.call(this,r),r.onEvents.forEach(([o,i])=>{var s;(s=r.lng)==null||s.on(o,(a,c)=>i(r,c))}),r.lng.div&&(r.lng.div.solid=r),r.name!=="text"&&r.children.forEach(o=>{o.render?o.render():o.text!==""&&console.warn("TextNode outside of : ",o)}),r.autofocus&&r.setFocus(),delete this._renderProps}}for(const n of ta)Object.defineProperty(be.prototype,n,{get(){return this.lng?this.lng[n]:this._renderProps[n]},set(r){this._sendToLightningAnimatable(n,r)}});for(const n of ra)Object.defineProperty(be.prototype,n,{get(){return this.lng?this.lng[n]:this._renderProps[n]},set(r){this._sendToLightning(n,r)}});Object.defineProperties(be.prototype,{borderRadius:{set(n){this._borderRadius=n,this.effects={...this.effects||{},radius:{radius:n}}},get(){return this._borderRadius}},border:St(),borderLeft:St("Left"),borderRight:St("Right"),borderTop:St("Top"),borderBottom:St("Bottom")});Object.defineProperties(be.prototype,{linearGradient:{set(n={}){this._linearGradient=n,this.effects={...this.effects||{},linearGradient:n}},get(){return this._linearGradient}}});const E=n=>(()=>{var r=Ot("text");return Tr(r,n,!1),r})(),N=n=>(()=>{var r=Ot("node");return Tr(r,n,!1),r})();function na({createElement:n,createTextNode:r,isTextNode:e,replaceText:t,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:c,getNextSibling:d}){function u(v,x,m,C){if(m!==void 0&&!C&&(C=[]),typeof x!="function")return g(v,x,C,m);Re(I=>g(v,x(),I,m),C)}function g(v,x,m,C,I){for(;typeof m=="function";)m=m();if(x===m)return m;const R=typeof x,T=C!==void 0;if(R==="string"||R==="number")if(R==="number"&&(x=x.toString()),T){let _=m[0];_&&e(_)?t(_,x):_=r(x),m=p(v,m,C,_)}else m!==""&&typeof m=="string"?t(c(v),m=x):(p(v,m,C,r(x)),m=x);else if(x==null||R==="boolean")m=p(v,m,C);else{if(R==="function")return Re(()=>{let _=x();for(;typeof _=="function";)_=_();m=g(v,_,m,C)}),()=>m;if(Array.isArray(x)){const _=[];if(w(_,x,I))return Re(()=>m=g(v,_,m,C,!0)),()=>m;if(_.length===0){const k=p(v,m,C);if(T)return m=k}else Array.isArray(m)?m.length===0?y(v,_,C):A(v,m,_):m==null||m===""?y(v,_):A(v,T&&m||[c(v)],_);m=_}else{if(Array.isArray(m)){if(T)return m=p(v,m,C,x);p(v,m,null,x)}else m==null||m===""||!c(v)?o(v,x):S(v,x,c(v));m=x}}return m}function w(v,x,m){let C=!1;for(let I=0,R=x.length;IF-_){const U=x[T];for(;_=0;T--){const _=x[T];if(I!==_){const k=a(_)===v;!R&&!T?k?S(v,I,_):o(v,I,m):k&&i(v,_)}else R=!0}}else o(v,I,m);return[I]}function y(v,x,m){for(let C=0,I=x.length;Cm.children=g(v,x.children,m.children)),Re(()=>x.ref&&x.ref(v)),Re(()=>{for(const I in x){if(I==="children"||I==="ref")continue;const R=x[I];R!==m[I]&&(s(v,I,R,m[I]),m[I]=R)}}),m}return{render(v,x){let m;return mt(C=>{m=C,u(x,v())}),m},insert:u,spread(v,x,m){typeof x=="function"?Re(C=>b(v,x(),C,m)):b(v,x,void 0,m)},createElement:n,createTextNode:r,insertNode:o,setProp(v,x,m,C){return s(v,x,m,C),m},mergeProps:nn,effect:Re,memo:q,createComponent:Lo,use(v,x,m){return le(()=>v(x,m))}}}function oa(n){const r=na(n);return r.mergeProps=nn,r}const ia={createElement(n){return new be(n)},createTextNode(n){return{name:"TextNode",text:n,parent:void 0}},replaceText(n,r){Je("Replace Text: ",n,r),n.text=r;const e=n.parent;L(e),e.text=e.getText()},setProperty(n,r,e=!0){n[r]=e},insertNode(n,r,e){Je("INSERT: ",n,r,e),n.children.insert(r,e),r._queueDelete=!1,r instanceof be?n.lng&&r.render():n.isTextNode()&&(n.text=n.getText())},isTextNode(n){return n.isTextNode()},removeNode(n,r){Je("REMOVE: ",n,r),n.children.remove(r),r._queueDelete=!0,r instanceof be&&queueMicrotask(()=>r.destroy())},getParentNode(n){return n.parent},getFirstChild(n){return n.children[0]},getNextSibling(n){const r=n.parent.children||[],e=r.indexOf(n)+1;if(en.delete(o)}let e=!1;function t(o,i){if(e)return!(e=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of n)a.listener({...s,from:a.location,retry:c=>{c&&(e=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:r,confirm:t}}let Kr;function cn(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Kr=window.history.state._depth}cn();function ua(n){return{...n,_depth:window.history.state&&window.history.state._depth}}function ha(n,r){let e=!1;return()=>{const t=Kr;cn();const o=t==null?null:Kr-t;if(e){e=!1;return}o&&r(o)?(e=!0,window.history.go(-o)):n()}}const fa=/^(?:[a-z0-9]+:)?\/\//i,ga=/^\/+|(\/)\/+$/g,Ko="http://sr";function kt(n,r=!1){const e=n.replace(ga,"$1");return e?r||/^[?#]/.test(e)?e:"/"+e:""}function ar(n,r,e){if(fa.test(r))return;const t=kt(n),o=e&&kt(e);let i="";return!o||r.startsWith("/")?i=t:o.toLowerCase().indexOf(t.toLowerCase())!==0?i=t+o:i=o,(i||"/")+kt(r,!i)}function pa(n,r){if(n==null)throw new Error(r);return n}function ma(n,r){return kt(n).replace(/\/*(\*.*)?$/g,"")+kt(r)}function Vo(n){const r={};return n.searchParams.forEach((e,t)=>{r[t]=e}),r}function Go(n,r,e){const[t,o]=n.split("/*",2),i=t.split("/").filter(Boolean),s=i.length;return a=>{const c=a.split("/").filter(Boolean),d=c.length-s;if(d<0||d>0&&o===void 0&&!r)return null;const u={path:s?"":"/",params:{}},g=w=>e===void 0?void 0:e[w];for(let w=0;wt.localeCompare(n,void 0,{sensitivity:"base"})===0;return r===void 0?!0:typeof r=="string"?e(r):typeof r=="function"?r(n):Array.isArray(r)?r.some(e):r instanceof RegExp?r.test(n):!1}function xa(n){const[r,e]=n.pattern.split("/*",2),t=r.split("/").filter(Boolean);return t.reduce((o,i)=>o+(i.startsWith(":")?2:3),t.length-(e===void 0?0:1))}function qo(n){const r=new Map,e=Pt();return new Proxy({},{get(t,o){return r.has(o)||_o(e,()=>r.set(o,q(()=>n()[o]))),r.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(n())}})}function dn(n){let r=/(\/?\:[^\/]+)\?/.exec(n);if(!r)return[n];let e=n.slice(0,r.index),t=n.slice(r.index+r[0].length);const o=[e,e+=r[1]];for(;r=/^(\/\:[^\/]+)\?/.exec(t);)o.push(e+=r[1]),t=t.slice(r[0].length);return dn(t).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const ya=100,Zo=Ro(),Jo=Ro(),un=()=>pa(Io(Zo)," and 'use' router primitives can be only used inside a Route."),yt=()=>un().navigatorFactory(),ei=()=>un().location,va=(n,r)=>{const e=ei(),t=q(()=>dn(n()).map(o=>Go(o,void 0,r)));return q(()=>{for(const o of t()){const i=o(e.pathname);if(i)return i}})},hn=()=>un().params;function wa(n,r=""){const{component:e,load:t,children:o,info:i}=n,s=!o||Array.isArray(o)&&!o.length,a={key:n,component:e,load:t,info:i};return ti(n.path).reduce((c,d)=>{for(const u of dn(d)){const g=ma(r,u);let w=s?g:g.split("/*",1)[0];w=w.split("/").map(A=>A.startsWith(":")||A.startsWith("*")?A:encodeURIComponent(A)).join("/"),c.push({...a,originalPath:u,pattern:w,matcher:Go(w,!s,n.matchFilters)})}return c},[])}function ba(n,r=0){return{routes:n,score:xa(n[n.length-1])*1e4-r,matcher(e){const t=[];for(let o=n.length-1;o>=0;o--){const i=n[o],s=i.matcher(e);if(!s)return null;t.unshift({...s,route:i})}return t}}}function ti(n){return Array.isArray(n)?n:[n]}function ri(n,r="",e=[],t=[]){const o=ti(n);for(let i=0,s=o.length;is.score-i.score)}function Wn(n,r){for(let e=0,t=n.length;e{const d=n();try{return new URL(d,e)}catch(u){return console.error("Invalid path ".concat(d)),c}},e,{equals:(c,d)=>c.href===d.href}),o=q(()=>t().pathname),i=q(()=>t().search,!0),s=q(()=>t().hash),a=()=>"";return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return r()},get key(){return a()},query:qo(ot(i,()=>Vo(t())))}}let Ye;function Aa(n,r,e,t={}){const{signal:[o,i],utils:s={}}=n,a=s.parsePath||(F=>F),c=s.renderPath||(F=>F),d=s.beforeLeave||Xo(),u=ar("",t.base||"");if(u===void 0)throw new Error("".concat(u," is not a valid base path"));u&&!o().value&&i({value:u,replace:!0,scroll:!1});const[g,w]=W(!1),A=async F=>{w(!0);try{await zi(F)}finally{w(!1)}},[p,y]=W(o().value),[S,b]=W(o().state),v=Sa(p,S),x=[],m=W([]),C=q(()=>Wn(r(),v.pathname)),I=qo(()=>{const F=C(),P={};for(let O=0;Ou,outlet:()=>null,resolvePath(F){return ar(u,F)}};return Re(()=>{const{value:F,state:P}=o();le(()=>{F!==p()&&A(()=>{Ye="native",y(F),b(P),m[1]([])}).then(()=>{Ye=void 0})})}),{base:R,location:v,params:I,isRouting:g,renderPath:c,parsePath:a,navigatorFactory:_,matches:C,beforeLeave:d,preloadRoute:z,singleFlight:t.singleFlight===void 0?!0:t.singleFlight,submissions:m};function T(F,P,O){le(()=>{if(typeof P=="number"){P&&(s.go?s.go(P):console.warn("Router integration does not support relative routing"));return}const{replace:D,resolve:U,scroll:j,state:se}={replace:!1,resolve:!0,scroll:!0,...O},re=U?F.resolvePath(P):ar("",P);if(re===void 0)throw new Error("Path '".concat(P,"' is not a routable path"));if(x.length>=ya)throw new Error("Too many redirects");const de=p();if((re!==de||se!==S())&&!da){if(d.confirm(re,O)){const Ce=x.push({value:de,replace:D,scroll:j,state:S()});A(()=>{Ye="navigate",y(re),b(se),m[1]([])}).then(()=>{x.length===Ce&&(Ye=void 0,k({value:re,state:se}))})}}})}function _(F){return F=F||Io(Jo)||R,(P,O)=>T(F,P,O)}function k(F){const P=x[0];P&&((F.value!==P.value||F.state!==P.state)&&i({...F,replace:P.replace,scroll:P.scroll}),x.length=0)}function z(F,P){const O=Wn(r(),F.pathname),D=Ye;Ye="preload";for(let U in O){const{route:j,params:se}=O[U];j.component&&j.component.preload&&j.component.preload();const{load:re}=j;P&&re&&_o(e(),()=>re({params:se,location:{pathname:F.pathname,search:F.search,hash:F.hash,query:Vo(F),state:null,key:""},intent:"preload"}))}Ye=D}}function Ca(n,r,e,t){const{base:o,location:i,params:s}=n,{pattern:a,component:c,load:d}=t().route,u=q(()=>t().path);c&&c.preload&&c.preload();const g=d?d({params:s,location:i,intent:Ye||"initial"}):void 0;return{parent:r,pattern:a,path:u,outlet:()=>c?Lo(c,{params:s,location:i,data:g,get children(){return e()}}):e(),resolvePath(A){return ar(o.path(),A,u())}}}const Ta=n=>r=>{const{base:e}=r,t=Sr(()=>r.children),o=q(()=>ri(t(),r.base||""));let i;const s=Aa(n,o,()=>i,{base:e,singleFlight:r.singleFlight});return n.create&&n.create(s),l(Zo.Provider,{value:s,get children(){return l(_a,{routerState:s,get root(){return r.root},get load(){return r.rootLoad},get children(){return[xt(()=>(i=Pt())&&null),l(Ra,{routerState:s,get branches(){return o()}})]}})}})};function _a(n){const r=n.routerState.location,e=n.routerState.params,t=q(()=>n.load&&le(()=>n.load({params:e,location:r,intent:"preload"})));return l(ze,{get when(){return n.root},keyed:!0,get fallback(){return n.children},children:o=>l(o,{params:e,location:r,get data(){return t()},get children(){return n.children}})})}function Ra(n){const r=[];let e;const t=q(ot(n.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const c=[];for(let d=0,u=o.length;d{r[d]=A,c[d]=Ca(n.routerState,c[d-1]||n.routerState.base,Un(()=>t()[d+1]),()=>n.routerState.matches()[d])}))}return r.splice(o.length).forEach(d=>d()),s&&a?s:(e=c[0],c)}));return Un(()=>t()&&e)()}const Un=n=>()=>l(ze,{get when(){return n()},keyed:!0,children:r=>l(Jo.Provider,{value:r,get children(){return r.outlet()}})}),he=n=>{const r=Sr(()=>n.children);return nn(n,{get children(){return r()}})};function Ia([n,r],e,t){return[e?()=>e(n()):n,t?o=>r(t(o)):r]}function Ba(n){if(n==="#")return null;try{return document.querySelector(n)}catch(r){return null}}function ka(n){let r=!1;const e=o=>typeof o=="string"?{value:o}:o,t=Ia(W(e(n.get()),{equals:(o,i)=>o.value===i.value}),void 0,o=>(!r&&n.set(o),o));return n.init&&Me(n.init((o=n.get())=>{r=!0,t[1](e(o)),r=!1})),Ta({signal:t,create:n.create,utils:n.utils})}function Ea(n,r,e){return n.addEventListener(r,e),()=>n.removeEventListener(r,e)}function Fa(n,r){const e=Ba("#".concat(n));e?e.scrollIntoView():r&&window.scrollTo(0,0)}const Na=new Map;function La(n=!0,r=!1,e="/_server"){return t=>{const o=t.base.path(),i=t.navigatorFactory(t.base);let s={};function a(p){return p.namespaceURI==="http://www.w3.org/2000/svg"}function c(p){if(p.defaultPrevented||p.button!==0||p.metaKey||p.altKey||p.ctrlKey||p.shiftKey)return;const y=p.composedPath().find(C=>C instanceof Node&&C.nodeName.toUpperCase()==="A");if(!y||r&&!y.hasAttribute("link"))return;const S=a(y),b=S?y.href.baseVal:y.href;if((S?y.target.baseVal:y.target)||!b&&!y.hasAttribute("state"))return;const x=(y.getAttribute("rel")||"").split(/\s+/);if(y.hasAttribute("download")||x&&x.includes("external"))return;const m=S?new URL(b,document.baseURI):new URL(b);if(!(m.origin!==window.location.origin||o&&m.pathname&&!m.pathname.toLowerCase().startsWith(o.toLowerCase())))return[y,m]}function d(p){const y=c(p);if(!y)return;const[S,b]=y,v=t.parsePath(b.pathname+b.search+b.hash),x=S.getAttribute("state");p.preventDefault(),i(v,{resolve:!1,replace:S.hasAttribute("replace"),scroll:!S.hasAttribute("noscroll"),state:x&&JSON.parse(x)})}function u(p){const y=c(p);if(!y)return;const[S,b]=y;s[b.pathname]||t.preloadRoute(b,S.getAttribute("preload")!=="false")}function g(p){const y=c(p);if(!y)return;const[S,b]=y;s[b.pathname]||(s[b.pathname]=setTimeout(()=>{t.preloadRoute(b,S.getAttribute("preload")!=="false"),delete s[b.pathname]},200))}function w(p){const y=c(p);if(!y)return;const[,S]=y;s[S.pathname]&&(clearTimeout(s[S.pathname]),delete s[S.pathname])}function A(p){let y=p.submitter&&p.submitter.hasAttribute("formaction")?p.submitter.getAttribute("formaction"):p.target.getAttribute("action");if(!y)return;if(!y.startsWith("https://action/")){const b=new URL(y,Ko);if(y=t.parsePath(b.pathname+b.search),!y.startsWith(e))return}if(p.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const S=Na.get(y);if(S){p.preventDefault();const b=new FormData(p.target);p.submitter&&p.submitter.name&&b.append(p.submitter.name,p.submitter.value),S.call({r:t,f:p.target},b)}}la(["click","submit"]),document.addEventListener("click",d),n&&(document.addEventListener("mouseover",g),document.addEventListener("mouseout",w),document.addEventListener("focusin",u),document.addEventListener("touchstart",u)),document.addEventListener("submit",A),Me(()=>{document.removeEventListener("click",d),n&&(document.removeEventListener("mouseover",g),document.removeEventListener("mouseout",w),document.removeEventListener("focusin",u),document.removeEventListener("touchstart",u)),document.removeEventListener("submit",A)})}}function Ma(n){const r=n.replace(/^.*?#/,"");if(!r.startsWith("/")){const[,e="/"]=window.location.hash.split("#",2);return"".concat(e,"#").concat(r)}return r}function za(n){const r=()=>window.location.hash.slice(1),e=Xo();return ka({get:r,set({value:t,replace:o,scroll:i,state:s}){o?window.history.replaceState(ua(s),"","#"+t):window.location.hash=t;const a=t.indexOf("#"),c=a>=0?t.slice(a+1):"";Fa(c,i),cn()},init:t=>Ea(window,"hashchange",ha(t,o=>!e.confirm(o&&o<0?o:r()))),create:La(n.preload,n.explicitLinks,n.actionBase),utils:{go:t=>window.history.go(t),renderPath:t=>"#".concat(t),parsePath:Ma,beforeLeave:e}})(n)}var Pa=!!Xi,Da=Pa?n=>Pt()?Me(n):n:Me;function Oa(n,r,e,t){return n.addEventListener(r,e,t),Da(n.removeEventListener.bind(n,r,e,t))}function Wa(n,r=Pt()){let e=0,t,o;return()=>(e++,Me(()=>{e--,queueMicrotask(()=>{!e&&o&&(o(),o=t=void 0)})}),o||mt(i=>t=n(o=i),r),t)}var Ua=Wa(()=>{const[n,r]=W(null);return Oa(window,"keydown",e=>{r(e),setTimeout(()=>r(null))}),n});function Jt(n){return typeof n=="function"}function Ya(n){return Array.isArray(n)}const er={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},[pr,$a]=W([]),Ha=n=>{const r=Ua();if(n)for(const[e,t]of Object.entries(n))Ya(t)?t.forEach(o=>{er[o]=e}):er[t]=e;return je(ot(on,(e,t,o=[])=>{let i=e;const s=[];for(;i;)i.states.has("focus")||(i.states.add("focus"),Jt(i.onFocus)&&i.onFocus.call(i,e,t)),s.push(i),i=i.parent;return o.forEach(a=>{s.includes(a)||(a.states.remove("focus"),Jt(a.onBlur)&&a.onBlur.call(a,e,t))}),$a(s),s},{defer:!0})),je(()=>{const e=r();if(e){const t=er[e.key]||er[e.keyCode];le(()=>{const o=pr();let i;for(const s of o){if(i=i||s,t){const a=s["on".concat(t)];if(Jt(a)&&a.call(s,e,s,i)===!0)break}else console.log("Unhandled key event: ".concat(e.key));if(Jt(s.onKeyPress)&&s.onKeyPress.call(s,e,t,s,i)===!0)break}return!1})}}),pr};function ni(n,r){const e=r();let t,o,i,s;Array.isArray(e)?e.length===2?(t=s=e[0],o=i=e[1]):e.length===3?(t=e[0],o=i=e[1],s=e[2]):[t,i,s,o]=e:t=i=s=o=e,n.onBeforeLayout=(a,c)=>{if(c){n.width=n.children.reduce((g,w)=>g+(w.width||0),0)+o+i;const d=n.children[0];d&&(d.x=o,d.marginLeft=o);let u=0;return n.children.forEach(g=>{g.y=t,g.marginTop=t,u=Math.max(u,g.height||0)}),n.height=u+t+s,!0}}}function ja(n=[]){const r=[];let e;for(e=0;e{setTimeout(r,n)})}function Qa(n,r,e="en-US"){const t=window.speechSynthesis;return new Promise((o,i)=>{const s=new SpeechSynthesisUtterance(n);s.lang=e,s.onend=()=>{o()},s.onerror=a=>{i(a)},r.push(s),t.speak(s)})}function Vr(n,r,e=!0){const t=window.speechSynthesis,o=ja(Array.isArray(n)?n:[n]),i=[],s=[];let a=!0;return{series:(async()=>{try{for(;a&&o.length;){const d=await Promise.resolve(o.shift());if(a){if(typeof d=="string"&&d.includes("PAUSE-")){let u=Number(d.split("PAUSE-")[1])*1e3;isNaN(u)&&(u=0),await Yn(u)}else if(typeof d=="string"&&d.length){let g=3;for(;a&&g>0;)try{await Qa(d,s,r),g=0}catch(w){if(w instanceof SpeechSynthesisErrorEvent)if(w.error==="network")g--,console.warn("Speech synthesis network error. Retries left: ".concat(g)),await Yn(500*(3-g));else if(w.error==="canceled"||w.error==="interrupted")g=0;else throw new Error("SpeechSynthesisErrorEvent: ".concat(w.error));else throw w}}else if(typeof d=="function"){const u=Vr(d(),r,!1);i.push(u),await u.series}else if(Array.isArray(d)){const u=Vr(d,r,!1);i.push(u),await u.series}}else break}}finally{a=!1}})(),get active(){return a},append:d=>{o.push(d)},cancel:()=>{a&&(e&&t.cancel(),i.forEach(d=>{d.cancel()}),a=!1)}}}let tr;function Xa(n,r="en-US"){return tr&&tr.cancel(),tr=Vr(n,r),tr}var Gr=(n,r)=>{let e;const t=()=>clearTimeout(e);return Pt()&&Me(t),Object.assign((...i)=>{e!==void 0&&t(),e=setTimeout(()=>n(...i),r)},{clear:t})};let qr,Et=[],_e,Zr=!1;const Ka=3e5;function $n(n,r){const e=Gr(n,r);let t;const o=i=>{t=i,e(i)};return o.flush=()=>{e.clear(),n(t)},o.clear=e.clear,o}function At(n){return n.id||n.name}function Va(n=[]){if(!oe.onFocusChange||!oe.enabled)return;const r=n.every(i=>!i.loading),e=n.filter(i=>!Et.includes(i));if(qr(),!r&&oe.onFocusChange){oe.onFocusChange([]);return}Et=n.slice(0);const t=[],o=e.reduce((i,s)=>(s.announce?(i.push([At(s),"Announce",s.announce]),t.push(s.announce)):s.title?(i.push([At(s),"Title",s.title]),t.push(s.title)):i.push([At(s),"No Announce",""]),i),[]);if(e.reverse().reduce((i,s)=>(s.announceContext?(i.push([At(s),"Context",s.announceContext]),t.push(s.announceContext)):i.push([At(s),"No Context",""]),i),o),oe.debug&&console.table(o),t.length)return oe.speak(t.reduce((i,s)=>i.concat(s),[]))}function Ga(n){if(!Zr)return _e=Xa(n)}const oe={debug:!1,enabled:!0,cancel:function(){_e&&_e.cancel()},clearPrevFocus:function(n=0){Et=Et.slice(0,n),qr()},speak:function(n,{append:r=!1,notification:e=!1}={}){return oe.onFocusChange&&oe.enabled&&(oe.onFocusChange.flush(),r&&_e&&_e.active?_e.append(n):(oe.cancel(),Ga(n)),e&&(Zr=!0,_e==null||_e.series.finally(()=>{Zr=!1,oe.refresh()}).catch(console.error))),_e},refresh:function(n=0){oe.clearPrevFocus(n),oe.onFocusChange&&oe.onFocusChange(le(()=>pr()))},setupTimers:function({focusDebounce:n=400,focusChangeTimeout:r=Ka}={}){oe.onFocusChange=$n(Va,n),qr=$n(()=>{Et=[]},r)}},qa=()=>(oe.setupTimers(),je(ot(pr,oe.onFocusChange,{defer:!0})),oe);function Za(n,r){const e=Le.createTexture("ImageTexture",{src:n});return r.reduce((t,o)=>{const{x:i,y:s,width:a,height:c}=o;return t[o.name]=Le.createTexture("SubTexture",{texture:e,x:i,y:s,width:a,height:c}),t},{})}const[Ja,Ee]=W(""),f={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLB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oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC",check:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9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kBKhB9DMBLnQWfJMjoLFuTZpJsO/ONAB7UUcBLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function el(){let n,r,e,t=0;const o=1,i={duration:750,easing:"ease-in-out"},s={alpha:o,color:4294967295};function a(c){if(c.startsWith("#")){n.color=M(c),n.src="",n.alpha=1,t=1,r.alpha=0,e.alpha=0;return}else n.color=4294967295,e.alpha=1;if(t===0){n.src=c,t=1;return}if(t===1){r.src=c,t=2,r.alpha=0,r.animate({alpha:o},i).start(),n.animate({alpha:0},i).start();return}t===2&&(n.src=c,t=1,n.alpha=0,n.animate({alpha:o},i).start(),r.animate({alpha:0},i).start())}return je(ot(Ja,c=>{a(c)},{defer:!0})),l(N,{width:1920,height:1080,zIndex:-5,get children(){return[l(N,{ref(c){var d=n;typeof d=="function"?d(c):n=c},style:s}),l(N,{ref(c){var d=r;typeof d=="function"?d(c):r=c},style:s,alpha:0}),l(N,{ref(c){var d=e;typeof d=="function"?d(c):e=c},src:"./assets/hero-mask-inverted.png",get color(){return M(f.color.materialBrand)},width:1920,height:1080})]}})}var Hn,jn,Qn,Xn,Kn,Vn,Gn,qn,Zn,Jn,eo,to,ro,no,oo,io,so,ao;function rr(n){if(!n||!n[Symbol.iterator])throw new Error("objectFromEntries requires a single iterable argument");const r={};for(const[e,t]of n)r[e]=t;return r}const tl=["focus","disabled"],rl=["brand","inverse","neutral"];function Y({themeKeys:n,base:r,modes:e,tones:t,themeStyles:o,modeKeys:i=tl,toneKeys:s=rl},a=!1){const c=(p,y,S)=>{const b=s.map(v=>{var C,I;const x={};return new Set([].concat.apply([],[(C=p==null?void 0:p[v])!=null?C:{},(I=y==null?void 0:y[v])!=null?I:{}].map(Object.keys))).forEach(R=>{var k;var T,_;i.includes(R)||(x[R]=(k=(T=y==null?void 0:y[v])==null?void 0:T[R])!=null?k:(_=p==null?void 0:p[v])==null?void 0:_[R])}),i.forEach(R=>{var T,_;x[R]={...S[R],...(T=p==null?void 0:p[v])==null?void 0:T[R],...(_=y==null?void 0:y[v])==null?void 0:_[R]}}),[v,x]});return rr(b)},d=(p,y)=>{const S=i.map(v=>[v,{...p==null?void 0:p[v],...y==null?void 0:y[v]}]);return rr(S)},u=(p,y)=>({...p,...y.base}),g=p=>rr(Object.entries(n).filter(([y,S])=>p[S]).map(([y,S])=>[y,p[S]])),w=p=>rr(Object.entries(p).map(([S,b])=>{const v=g(b);return Object.entries(b).filter(([x,m])=>i.includes(x)).forEach(([x,m])=>{v[x]=g(m)}),[S,v]}));return((p,y,S)=>{const b=w(o);a&&console.log(b);const v=u(p,b);a&&console.log(v);const x=d(y,b);a&&console.log(x);const m=c(S,b,x);return a&&console.log(m),{base:{...v,...x},tones:m}})(r,e,t)}function mr(n=0){return(r,e,t=0,o)=>{var S,b,v,x;if(r.children.length===0)return;const i=r.flexDirection==="row"?"width":"height",s=r.flexDirection==="row"?"x":"y",a=r.gap||0,c=r.scroll||"auto",[d,u]=nl(r);let g=(S=r[s])!=null?S:0;const w=(b=e==null?void 0:e[s])!=null?b:0,A=(v=e==null?void 0:e[i])!=null?v:0,p=o===void 0?"none":t>o?"positive":"negative";let y=g;if(c==="auto")r.scrollIndex!=null&&r.scrollIndex>=0?r.selected>=r.scrollIndex&&(p==="positive"?y=g-A-a:y=g+A+a):(Math.abs(g)+uw)y=-w+n;else if(c==="edge"&&p==="positive"&&Math.abs(g)+u{const r=n.filter(e=>typeof e=="function");if(r.length!==0)return r.length===1?r[0]:function(...e){let t;for(const o of r)if(t=o.apply(this,e),t===!0)return t;return t}};function oi(){if(!this||this.selected===void 0||this.children.length===0)return!1;let n=this.children[this.selected];for(;n!=null&&n.skipFocus;)this.selected++,n=this.children[this.selected];return n instanceof be?(n.setFocus(),!0):!1}function xr(n){return function(){var r,e,t;const o=this.children.length,i=this.wrap,s=this.selected||0;if(o===0)return!1;if(n==="right"||n==="down")do if(this.selected=(this.selected||0)%o+1,this.selected>=o){if(!i){this.selected=void 0;break}this.selected=0}while((r=this.children[this.selected])!=null&&r.skipFocus);else if(n==="left"||n==="up")do if(this.selected=(this.selected||0)%o-1,this.selected<0){if(!i){this.selected=void 0;break}this.selected=o-1}while((e=this.children[this.selected])!=null&&e.skipFocus);if(this.selected===void 0&&(this.selected=s,(t=this.children[this.selected])!=null&&t.states.has("focus")))return!1;const a=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,a,this.selected,s),this.plinko&&s!==void 0){const d=this.children[s].selected||0;a.selected=dt){console.error("Column expects a number between 1 & ".concat(t,". Received ").concat(r));return}const s=e-o*2,a=(r-1)*i;return(s-a)/r}const{Artwork:{defaultTone:Ad,...il}={styles:{}}}=(Hn=f)==null?void 0:Hn.componentConfig,sl={themeKeys:{fillColor:"fillColor",scale:"imageScale",pivotX:"imageScalePivotX",pivotY:"imageScalePivotY"},base:{fallbackSrc:void 0,fillColor:f.color.overlay,gradientColor:f.color.material,pivotX:.5,pivotY:.5,scale:void 0},themeStyles:il};Y(sl);const{Badge:{defaultTone:Cd,...fn}={styles:{}}}=(jn=f)==null?void 0:jn.componentConfig,al={themeKeys:{color:"backgroundColor"},base:{color:f.color.fillInverseSecondary,borderRadius:f.radius.sm,border:{color:f.color.strokeInverse,width:f.stroke.sm},display:"flex",justifyContent:"spaceEvenly",padding:[f.spacer.md-f.stroke.sm,f.spacer.xs+f.stroke.sm,f.spacer.md+f.stroke.sm,f.spacer.md+f.stroke.sm]},tones:{inverse:{color:f.color.fillNeutralSecondary,borderRadius:f.radius.sm,border:{color:f.color.strokeInverseSecondary,width:f.stroke.sm}},brand:{color:f.color.fillBrand,borderRadius:f.radius.sm,border:{color:f.color.strokeInverseSecondary,width:f.stroke.sm}}},themeStyles:fn},ll={themeKeys:{color:"textColor"},base:{...f.typography.tag1,color:f.color.textNeutral},tones:{inverse:{color:f.color.textInverse},brand:{color:f.color.textNeutral}},themeStyles:fn},cl={themeKeys:{color:"iconColor"},base:{color:f.color.textNeutral},tones:{inverse:{color:f.color.textInverse},brand:{color:f.color.textNeutral}},themeStyles:fn};Y(al);Y(cl);Y(ll);const{Button:{defaultTone:dl,...gn}={styles:{}}}=(Qn=f)==null?void 0:Qn.componentConfig,{Surface:{surfaceDefaultTone:ul,...pn}={styles:{}}}=(Xn=f)==null?void 0:Xn.componentConfig,hl={themeKeys:{textAlign:"textAlign",borderRadius:"radius",color:"backgroundColor",justifyContent:"justifyContent"},base:{height:f.typography.button1.lineHeight+f.spacer.xl*2,display:"flex",padding:[f.spacer.xxxl,f.spacer.xl],color:f.color.interactiveNeutral,justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm,contentColor:f.color.fillNeutral},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse},brand:{color:f.color.interactiveBrand,focus:{color:f.color.fillNeutral}}},themeStyles:{...pn,...gn}},fl={themeKeys:{color:"contentColor"},base:{color:f.color.textNeutral},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillBrand,focus:{color:f.color.fillBrand}}},themeStyles:{...pn,...gn}},gl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.button1},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillBrand,focus:{color:f.color.fillBrand}}},themeStyles:{...pn,...gn}},pl=Y(hl),ml=Y(fl),xl=Y(gl),st={tone:dl||ul||"neutral",Container:pl,Content:ml,Text:xl},lo=n=>l(N,Q(n,{get style(){var e;var r;return[...[n.style].flat(),(r=st.Container.tones)==null?void 0:r[(e=n.tone)!=null?e:st.tone],st.Container.base]},forwardStates:!0,get children(){return l(E,{get style(){var e;var r;return[...[(r=n.style)==null?void 0:r.Text].flat(),st.Text.tones[(e=n.tone)!=null?e:st.tone],st.Text.base]},get children(){return n.children}})}})),{Checkbox:{defaultTone:Td,...ii}={styles:{}}}=(Kn=f)==null?void 0:Kn.componentConfig,qe=f.stroke.sm,Fe=f.spacer.xxl,yl={themeKeys:{color:"color",borderRadius:"borderRadius",border:"border",justifyContent:"justifyContent"},base:{width:Fe,height:Fe,display:"flex",justifyContent:"center",color:f.color.fillNeutral,alignItems:"center",borderRadius:Fe/4,border:{color:f.color.strokeInverse,width:qe}},modes:{disabled:{alpha:f.alpha.inactive}},tones:{brand:{borderRadius:Fe/4,border:{color:f.color.strokeNeutralSecondary,width:qe},color:f.color.fillNeutralSecondary,checked:{borderRadius:Fe/4,border:{color:f.color.strokeNeutralSecondary,width:qe},color:f.color.fillBrand}},neutral:{borderRadius:Fe/4,border:{color:f.color.strokeNeutralSecondary,width:qe},color:f.color.fillInverseSecondary,checked:{borderRadius:Fe/4,border:{color:f.color.strokeNeutralSecondary,width:qe},color:f.color.fillNeutral}},inverse:{borderRadius:Fe/4,border:{color:f.color.strokeInverseSecondary,width:qe},color:f.color.fillNeutralSecondary,checked:{borderRadius:Fe/4,border:{color:f.color.strokeInverseSecondary,width:qe},color:f.color.fillInverse}}},modeKeys:["focus","disabled","checked"],themeStyles:ii},vl={themeKeys:{color:"color"},base:{width:f.spacer.lg,height:f.spacer.lg,src:f.asset.check},tones:{neutral:{color:f.color.fillInverse},inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillInverse}},themeStyles:ii};Y(yl);Y(vl);const{Icon:{defaultTone:_d,...wl}={styles:{}}}=(Vn=f)==null?void 0:Vn.componentConfig,bl={themeKeys:{color:"color"},base:{width:100,height:100,color:f.color.fillInverse},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:wl};Y(bl);const{Column:{defaultTone:Sl,...Al}={styles:{}}}=(Gn=f)==null?void 0:Gn.componentConfig,Cl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"column",gap:f.layout.gutterY,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:Al},Tl=Y(Cl),Mr={tone:Sl||"neutral",Container:Tl},te=n=>{const r=xr("up"),e=xr("down");return l(N,Q(n,{get onUp(){return He(n.onUp,r)},get onDown(){return He(n.onDown,e)},get selected(){return n.selected||0},forwardFocus:oi,get onCreate(){return He(t=>{var o,i;return mr(n.y).call(t,t,t.children[(o=n.selected)!=null?o:0],(i=n.selected)!=null?i:0,void 0)},n.onCreate)},get onSelectedChanged(){return He(n.onSelectedChanged,n.scroll!=="none"?mr(n.y):void 0)},get style(){var t;return[...[n.style].flat(),Mr.Container.tones[(t=n.tone)!=null?t:Mr.tone],Mr.Container.base]}}))},{Label:{defaultTone:Rd,...si}={styles:{}}}=(qn=f)==null?void 0:qn.componentConfig,_l={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:f.color.textNeutral,padding:[f.spacer.md,f.spacer.lg],borderRadius:[f.radius.md,f.radius.md,f.radius.md,f.radius.none],height:f.typography.caption1.lineHeight+f.spacer.md,neutral:{backgroundColor:f.color.fillNeutral}},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand,focus:{color:f.color.orange}}},themeStyles:si},Rl={themeKeys:{color:"textColor"},base:{...f.typography.caption1,color:f.color.textInverse},tones:{inverse:{color:f.color.textNeutral},brand:{color:f.color.textNeutral}},themeStyles:si};Y(_l);Y(Rl);const{Rating:{styles:mn,defaultTone:Id}={styles:{},defaultTone:"neutral"}}=(Zn=f)==null?void 0:Zn.componentConfig,Il={themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:f.spacer.sm},toneModes:{},themeStyles:mn},Bl={themeKeys:{color:"textColor"},base:{color:f.color.textNeutral,...f.typography.body2},toneModes:{},themeStyles:mn},kl={themeKeys:{color:"color"},base:{height:f.typography.body2.lineHeight,width:f.typography.body2.lineHeight,color:f.color.fillNeutral,marginRight:f.spacer.sm},toneModes:{},themeStyles:mn};Y(Il);Y(kl);Y(Bl);const{Details:{defaultTone:Bd,...ai}={styles:{}}}=(Jn=f)==null?void 0:Jn.componentConfig,El={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:f.spacer.lg,badgeContentSpacing:f.spacer.sm,ratingContentSpacing:f.spacer.lg},themeStyles:ai},Fl={themeKeys:{color:"textColor"},base:{...f.typography.body2,marginRight:f.spacer.lg,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:ai};Y(El);Y(Fl);const{Metadata:{defaultTone:kd,...xn}={styles:{}}}=(eo=f)==null?void 0:eo.componentConfig,Nl={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:xn},Ll={themeKeys:{color:"textColor"},base:{maxLines:1,contain:"width",...f.typography.headline3,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:xn},Ml={themeKeys:{color:"textColor"},base:{contain:"width",maxLines:2,...f.typography.body2,color:f.color.textNeutralSecondary},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverseSecondary,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutralSecondary,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:xn};Y(Nl);Y(Ml);Y(Ll);const{ProgressBar:{defaultTone:Ed,...li}={styles:{}}}=(to=f)==null?void 0:to.componentConfig,zl={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:f.spacer.md,color:f.color.fillNeutralTertiary,borderRadius:f.radius.xs},tones:{inverse:{color:f.color.fillInverseTertiary}},themeStyles:li},Pl={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:f.radius.xs,color:f.color.fillNeutral},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:li};Y(zl);Y(Pl);const{Row:{defaultTone:Dl,...Ol}={styles:{}}}=(ro=f)==null?void 0:ro.componentConfig,Wl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"row",gap:f.layout.gutterX,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:Ol},Ul=Y(Wl),Ct={tone:Dl,Container:Ul},X=n=>{const r=xr("left"),e=xr("right");return l(N,Q(n,{get selected(){return n.selected||0},get onLeft(){return He(n.onLeft,r)},get onRight(){return He(n.onRight,e)},forwardFocus:oi,get onCreate(){return He(t=>{var o,i;return mr(n.x).call(t,t,t.children[(o=n.selected)!=null?o:0],(i=n.selected)!=null?i:0,void 0)},n.onCreate)},get onSelectedChanged(){return He(n.onSelectedChanged,n.scroll!=="none"?mr(n.x):void 0)},get tone(){var t;return(t=n.tone)!=null?t:Ct.tone},get style(){return[...[n.style].flat(),Ct.Container.tones[n.tone||Ct.tone],Ct.Container.base]},get states(){var t;return(t=n.tone)!=null?t:Ct.tone}}))},{Keyboard:{defaultTone:Fd,...yn}={styles:{}}}=(no=f)==null?void 0:no.componentConfig,Yl={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:f.spacer.md,screenW:f.layout.screenW,marginX:f.layout.marginX,height:100},themeStyles:yn},$l={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:f.color.fillNeutral,padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:yn},Hl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:yn};Y(Yl);Y($l);Y(Hl);const{Key:{defaultTone:Nd,...ci}={styles:{}}}=(oo=f)==null?void 0:oo.componentConfig,jl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,contentColor:f.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[f.spacer.md],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:ci},Ql={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:ci};Y(jl);Y(Ql);const{Input:{defaultTone:Ld,...vn}={styles:{}}}=(io=f)==null?void 0:io.componentConfig,Xl={themeKeys:{justifyContent:"justifyContent"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"column",width:100,height:100,actualTitle:""},themeStyles:vn},Kl={themeKeys:{borderRadius:"borderRadius",color:"backgroundColor"},base:{width:ol(f,4),height:100,display:"flex",flexDirection:"column",padding:[f.spacer.xxxl,f.spacer.xl],color:f.color.interactiveNeutral,contentColor:f.color.fillInverse,borderRadius:f.radius.sm,marginX:f.spacer.xxxl},modes:{focus:{color:f.color.interactiveNeutralFocus},disabled:{color:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse},brand:{color:f.color.interactiveBrand,focus:{color:f.color.fillNeutral}}},themeStyles:vn},Vl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.button1},themeStyles:vn};Y(Xl);Y(Kl);Y(Vl);const{Tile:{defaultTone:Md,..._r}={styles:{}}}=(so=f)==null?void 0:so.componentConfig,{Surface:{defaultSurfaceTone:zd,...Gl}={styles:{}}}=(ao=f)==null?void 0:ao.componentConfig,ql={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:f.spacer.xl,paddingYBetweenContent:f.spacer.md,borderRadius:f.radius.md,alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:{...Gl,..._r}},Zl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:_r},Jl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:_r},ec={themeKeys:{},base:{width:f.spacer.lg*5,height:f.spacer.xxl+f.spacer.md},themeStyles:_r};Y(ql);Y(Zl);Y(Jl);Y(ec);const tc={color:255,height:150,width:330,x:1910,y:10,mountX:1,alpha:.8,zIndex:100},Te={x:10,fontSize:22,textColor:M("#f6f6f6")},nr={fontSize:22,textColor:M("#f6f6f6")},[rc,nc]=W(0),[oc,ic]=W(0),[sc,ac]=W(99),[lc,cc]=W(0),[dc,uc]=W(0),[hc,fc]=W(0),[gc,pc]=W(0);let co=0,uo=0;const mc=n=>{n&&(nc(n),ac(r=>Math.min(n,r)),cc(r=>Math.max(n,r)),uo+=n,co++,ic(Math.round(uo/co)))},xc=n=>{let r=0,e=0,t=0;n.txManager.textureIdCache.forEach((o,i,s)=>{o.state==="loaded"&&r++,o.state==="loading"&&e++,o.state==="failed"&&t++}),uc(r),fc(e),pc(t)};function yc(n){n.renderer.on("fpsUpdate",(r,e)=>{const t=typeof e=="number"?e:e.fps;t>5&&(mc(t),xc(r.root.stage))})}const vc=n=>l(N,Q(n,{style:tc,get children(){return[l(N,{get children(){return[l(E,{style:Te,children:"FPS:"}),l(E,{style:nr,x:90,get children(){return rc()}})]}}),l(N,{x:160,get children(){return[l(E,{style:Te,children:"AVG:"}),l(E,{style:nr,x:100,get children(){return oc()}})]}}),l(N,{x:0,y:20,get children(){return[l(E,{style:Te,children:"MIN:"}),l(E,{style:nr,x:90,get children(){return sc()}})]}}),l(N,{x:160,y:20,get children(){return[l(E,{style:Te,children:"MAX:"}),l(E,{style:nr,x:100,get children(){return lc()}})]}}),l(N,{x:0,y:50,get children(){return[l(E,{style:Te,children:"Loaded Textures Cnt:"}),l(E,{style:Te,x:270,get children(){return dc()}})]}}),l(N,{x:0,y:80,get children(){return[l(E,{style:Te,children:"Loading Textures Cnt:"}),l(E,{style:Te,x:270,get children(){return hc()}})]}}),l(N,{x:0,y:110,get children(){return[l(E,{style:Te,children:"Failed Textures Cnt:"}),l(E,{style:Te,x:270,get children(){return gc()}})]}})]}})),Jr={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:f.layout.marginX}},Gradient:{zIndex:99,color:M("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:M("#424242")},active:{width:328,height:70}}},wc="/solid-demo-app/",bc=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function Sc(n){const r=Za(wc+"assets/icons_white.png",bc);return l(N,Q(n,{get texture(){return r[n.name]},get width(){return r[n.name].props.width},get height(){return r[n.name].props.height},get x(){return(100-(r[n.name].props.width||0))/2},get y(){return(100-(r[n.name].props.height||0))/2}}))}function or(n){return l(N,Q(n,{forwardStates:!0,get style(){return Jr.NavButton},get children(){return[l(N,{y:-16,get children(){return l(Sc,{scale:.5,get name(){return n.icon}})}}),l(E,{style:{fontSize:38,x:116,y:18,height:50,alpha:0,active:{alpha:1}},get children(){return n.children}})]}}))}function Ac(n){let r;const e=yt();function t(){r.states.add("focus"),this.children.forEach(s=>s.states.add("active")),this.children.selected.setFocus()}function o(){r.states.remove("focus"),this.selected=0,this.children.forEach(s=>s.states.remove("active"))}function i(s){if(va(()=>s)())return n.focusPage();e(s)}return[l(N,{flexItem:!1,x:40,y:30,zIndex:105,get alpha(){return n.showWidgets?1:0},get children(){return[l(E,{x:80,fontSize:28,color:4143380036,children:"Built With:"}),l(N,{y:22,src:"./assets/solidWord.png",width:280,height:52})]}}),l(te,Q(n,{onFocus:t,onBlur:o,get style(){return Jr.Column},scroll:"none",get children(){return[l(or,{onEnter:()=>i("/browse/all"),icon:"trending",children:"Trending"}),l(or,{icon:"movie",onEnter:()=>i("/browse/movie"),children:"Movies"}),l(or,{icon:"tv",onEnter:()=>i("/browse/tv"),children:"TV"}),l(or,{icon:"experiment",onEnter:()=>i("/examples"),children:"Examples"})]}})),l(N,{ref(s){var a=r;typeof a=="function"?a(s):r=s},get style(){return Jr.Gradient}})]}const Cc=n=>{Ha({Announcer:["a"],Menu:["m"],Escape:["Escape",27],Backspace:["Backspace",8],Left:["ArrowLeft",37],Right:["ArrowRight",39],Up:["ArrowUp",38],Down:["ArrowDown",40],Enter:["Enter",13]});const r=qa();r.enabled=!1;const e=yt();let t,o;yc({renderer:Le});function i(){return t.states.has("focus")?!1:(o=on(),t.setFocus())}const[s,a]=W(!0),c=ei(),d=["/browse","/entity"];return je(()=>{const u=c.pathname;let g=d.some(w=>u.startsWith(w));u==="/"&&(g=!0),a(g)}),l(N,{ref(u){var g=window.APP;typeof g=="function"?g(u):window.APP=u},onAnnouncer:()=>r.enabled=!r.enabled,onLast:()=>history.back(),onMenu:()=>e("/"),style:{width:1920,height:1080},onBackspace:i,onLeft:i,onRight:()=>t.states.has("focus")&&o.setFocus(),get children(){return[l(el,{}),l(vc,{mountX:1,x:1910,y:10,get alpha(){return s()?1:0}}),xt(()=>n.children),l(Ac,{ref(u){var g=t;typeof g=="function"?g(u):t=u},focusPage:()=>o.setFocus(),get showWidgets(){return s()}})]}})},ge={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:f.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:M("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:M("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:M("#000000")},RowTitle:{height:60,width:300,marginBottom:-40,fontSize:36,color:M("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:64,width:f.layout.screenW-2*f.layout.marginX,x:f.layout.marginX+f.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:M("#0000ff")},peopleBio:{...f.typography.body1,fontFamily:"Ubuntu",fontWeight:"normal",contain:"both",width:780,height:340}},yr={width:120,height:40,color:M("#000000"),borderRadius:8,border:{width:2,color:M("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:M("#333333")}},transition:{scale:!0,color:!0}},Tc={color:M("#00A699"),height:8,y:2,x:-4,width:yr.width+8},_c={fontSize:12,y:12,contain:"width",textAlign:"center",color:M("#F6F6F9"),height:yr.height,width:yr.width},ho={container:yr,topBar:Tc,text:_c},fo={width:386,height:136,color:M("#715cab"),focus:{color:M("#5a39a2")},disabled:{color:M("#291d43")}},Rc={fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:M("#FFFFFF"),height:fo.height,width:fo.width,focus:{fontSize:40},disabled:{color:M("#909090")}};function Ic(n){return l(N,Q(n,{get style(){return ge.Thumbnail}}))}function vr(n){const[r,e]=ji(n,["items"]);return l(X,Q(e,{get style(){return ge.Row},get children(){return l(Cr,{get each(){return r.items},children:t=>l(Ic,t)})}}))}const Bc="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA",kc="https://api.themoviedb.org/3";let di,ui;const Ec="w185",Fc={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Bc}};function Ft(n,r=Ec){return ui+r+n}function Nc(n,r={}){return di?en(n,r):hi().then(()=>en(n,r))}function en(n,r={}){return fetch(kc+n,{...Fc,...r}).then(e=>e.json())}function hi(){return en("/configuration").then(n=>{var r;return di=n,ui=(r=n.images)==null?void 0:r.secure_base_url,n})}const rt={get:Nc,loadConfig:hi};function Lc(n,r){return n.length>r?n.substring(0,r-3)+"...":n}function Mc(n,r=7){let e=[];for(let t=0,o=n.length;t({src:Ft(r.poster_path||r.profile_path),tileSrc:Ft(r.backdrop_path||r.profile_path,"w300"),backdrop:Ft(r.backdrop_path,"w1280"),href:"/entity/".concat(r.media_type||"people","/").concat(r.id),shortTitle:Lc(r.title||r.name,30),title:r.title||r.name,data:r,entityInfo:{type:r.media_type||"people",id:r.id},heroContent:{title:r.title||r.name,description:r.overview}}))}let zr=new Map;const ir=new Map;function zc(n){return r=>{const e="/trending/".concat(n,"/week?page=").concat(r);if(zr.has(e))return zr.get(e);let t=rt.get(e).then(o=>{let i=o.results.filter(c=>!c.adult),s=(ir.has(n)?ir.get(n):[]).concat(Mt(i)),a=Mc(s);return a[a.length-1].length<7?ir.set(n,a.pop()):ir.delete(n),a});return zr.set(e,t),t}}function Pc(n){const[r,e]=W([]),[t,o]=W(1),[i,s]=W(!1),[a]=et(t,n);return Pr(()=>{const c=a();c&&Mi(()=>{c.length===0&&s(!0),e(d=>[...d,...c])})}),{pages:r,page:t,setPage:o,setPages:e,end:i,setEnd:s}}const Rr=900,Dc={...f.typography.display2,fontFamily:"Ubuntu",fontWeight:700,maxLines:1,width:Rr,contain:"width"},Oc=n=>l(E,Q(n,{style:Dc})),Wc={...f.typography.body1,fontFamily:"Ubuntu",fontWeight:400,lineHeight:32,width:Rr,maxLines:3,contain:"width"},Uc={fontSize:16,lineHeight:20},Yc=n=>l(E,Q(n,{style:Wc,get children(){return n.children}})),$c=n=>(()=>{var r=Ot("node");return Qo(ni,r,()=>[8,13,11,13]),Tr(r,Q(n,{style:{color:"0x00000099",borderRadius:8,border:{width:2,color:"0xffffffff"}}}),!0),jo(r,l(E,{style:Uc,get children(){return n.children}})),r})(),go={...f.typography.body2,fontFamily:"Ubuntu",fontWeight:400},Hc=n=>l(N,{style:{display:"flex",flexDirection:"row",gap:18,width:Rr,height:48},get children(){return[l(N,{y:-4,src:"./assets/stars.png",width:188,height:31}),l(N,{y:-4,flexItem:!1,clipping:!0,get width(){return 188*n.voteAverage/10},height:31,get children(){return l(N,{src:"./assets/stars-full.png",width:188,height:31})}}),l(E,{style:go,get children(){return[xt(()=>n.voteCount)," reviews"]}}),l(E,{style:go,get children(){return n.metaText}}),l(Cr,{get each(){return n.badges},children:r=>l($c,{y:-5,children:r})})]}}),fi=n=>l(N,Q(n,{style:{display:"flex",flexDirection:"column",width:Rr,height:220,gap:16},get children(){return[l(Oc,{get children(){return n.title}}),l(Yc,{get children(){return n.description}}),l(ze,{get when(){return n.voteCount},get children(){return l(Hc,{get metaText(){return n.metaText},get badges(){return n.badges},get voteCount(){return n.voteCount},get voteAverage(){return n.voteAverage}})}})]}}));function jc(n){const r=Math.floor(n/60),e=n%60;return r+"h "+(e<10?"0":"")+e+"min"}function Qc(n){const r=n.split("-");return r[1]+"/"+r[2]+"/"+r[0]}function po(n){return n.split("-")[0]}function Xc({type:n,id:r}){return rt.get("/".concat(n,"/").concat(r,"/recommendations")).then(({results:e})=>e.length?Mt(e.slice(0,7)):rt.get("/trending/".concat(n,"/week?page=1")).then(({results:t})=>Mt(t.slice(0,7))))}function Kc({type:n,id:r}){return rt.get("/".concat(n,"/").concat(r,"/credits")).then(({cast:e})=>Mt(e.slice(0,7)))}function gi({type:n,id:r}){let e=n==="movie"?{rtCrit:86,rtFan:92}:{};return rt.get("/".concat(n,"/").concat(r)).then(t=>({backgroundImage:Ft(t.backdrop_path,"w1280"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD","CC"],voteAverage:t.vote_average,voteCount:t.vote_count,metaText:n==="movie"?jc(t.runtime)+" "+Qc(t.release_date):"".concat(po(t.first_air_date)," - ").concat(po(t.last_air_date)),reviews:e},...t}))}const mo=()=>{const n=hn(),[r,e]=W(0),[t,o]=W();et(t,gi);const[i,s]=W({}),a=yt(),c=To(()=>0),d=q(()=>Pc(zc(n.filter||"all"))),u=Gr(p=>Ee(p),400),g=Gr(p=>s(p),200);je(ot(on,p=>{p.backdrop&&u(p.backdrop),p.heroContent&&g(p.heroContent)},{defer:!0}));function w(){var y;(y=this.children.selected)==null||y.setFocus(),e((this.y||0)*-1+24);let p=d().pages().length;(p===0||this.parent.selected&&this.parent.selected>=p-2)&&d().setPage(S=>S+1)}function A(){let p=this.children.selected;return L(p&&p.href),a(p.href),!0}return l(ze,{get when(){return d().pages().length},get children(){return[l(fi,Q({y:360,x:162},i)),l(N,{clipping:!0,get style(){return ge.itemsContainer},get children(){return l(te,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return ge.Column},get children(){return l(Cr,{get each(){return d().pages()},children:(p,y)=>l(vr,{get autofocus(){return c(y())},items:p,width:1620,onFocus:w,onEnter:A})})}})}})]}})},Vc=()=>{const n=yt(),r=To(()=>0);function e(){let c=this.children.selected;L(c&&c.id),n("/"+c.id)}const t=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(c){const d={width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},[u,g]=W(4294967295);return l(N,Q(c,{onFocus:()=>g(255),onBlur:()=>g(4294967295),style:d,get children(){return l(N,{x:30,get children(){return[l(E,{y:30,fontSize:84,get color(){return u()},get children(){return c.index}}),l(E,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return u()},get children(){return c.title}}),l(E,{y:200,fontSize:28,width:330,contain:"width",get color(){return u()},get children(){return c.description}})]}})}}))}const[i,s]=W(140);function a(c){s(c.selected*-400+140)}return l(N,{colorTop:1147903743,colorBottom:743406847,get children(){return[l(N,{x:120,get children(){return[l(N,{src:"./assets/solidjs.png",width:101,height:90,y:40}),l(E,{fontSize:90,x:110,y:40,children:"Examples"}),l(N,{y:140,height:1,width:1800,color:3906468351})]}}),l(X,{onSelectedChanged:a,onEnter:e,transition:{x:{delay:20,duration:300}},get x(){return i()},y:300,width:4400,get style(){return ge.Row},justifyContent:"flexStart",gap:40,get children(){return l(Cr,{each:t,children:(c,d)=>l(o,Q({get autofocus(){return r(d())},get index(){return d()}},c))})}})]}})},Gc=()=>{const n={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("00000000")},r={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:M("00000000")},e={fontSize:42},t={width:n.width,fontSize:26,contain:"width"},o={fontSize:26};return Qe(()=>{Ee("#000000")}),l(N,{autofocus:!0,style:n,get children(){return[l(E,{style:e,children:"Title of the Page"}),l(E,{style:t,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),l(N,{style:r,get children(){return[l(E,{style:o,children:"Subline Text"}),l(N,{width:28,height:28,src:"./assets/rt-popcorn.png"}),l(E,{style:o,children:"More Text"})]}})]}})},qc=()=>{const n={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("00000000")},r={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:M("00000000")},e={fontSize:42},t={fontSize:26};let o,i;Qe(()=>{Ee("#000000"),o.animate({x:100},{duration:2e3}).start()});const[s,a]=W(),[c,d]=W();setTimeout(()=>{var b;a("- Inserted -"),(b=i.getChildById("child1"))==null||b.animate({x:600},{duration:2e3}).start()},2e3);const u={width:400,height:300,color:M("#0000ff")},g={color:M("#f54242"),focus:{color:M("#4287f5")}};function w(b){const v=Sr(()=>b.children);return l(N,Q(b,{get style(){return[g,b.style,[u]]},get children(){return[l(N,{id:"child1",width:100,height:100,get color(){return M("#ff0000")},y:25,get children(){return[xt(()=>v()),l(N,{id:"subChild",x:150,width:100,height:100,get color(){return M("#00ff00")}}),l(E,{get children(){return b.title}})]}}),l(N,{width:100,height:100,get color(){return M("#ffff00")},y:175,get children(){return v()}})]}}))}const A={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},p={color:M("#cccccc"),focus:{color:M("#000000")}},y={color:M("#ffffff"),focus:{color:M("#f6f6cc")}};function S(b){return b.states.has("focus")}return l(N,{style:n,get children(){return[l(E,{style:e,children:"Title of the Page"}),l(N,{style:r,get children(){return[l(E,{get children(){return c()}}),l(E,{style:t,get children(){return["Sub ",xt(()=>s())," Text"]}}),l(ze,{get when(){return s()},get children(){return l(N,{width:28,height:28,src:"./assets/rt-popcorn.png"})}}),l(E,{style:t,children:"More Text"})]}}),l(w,{autofocus:!0,ref(b){var v=i;typeof v=="function"?v(b):i=b},style:[y,p],get children(){return l(E,{children:"Child Test"})}}),l(N,{ref(b){var v=o;typeof v=="function"?v(b):o=b},style:A,width:100,height:100,get color(){return M("#00ff00")},x:900,y:400,get alpha(){return S(o)?1:.2}})]}})},Zc=()=>{let n,r;const[e,t]=W([]),o={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:M("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},i={fontSize:32,x:960,y:540,mount:.5,lineheight:52},s=(c,d)=>Math.floor(Math.random()*(d-c+1)+c);Qe(()=>{Ee("#000000"),n.x=1820/2,n.y=980/2,r=setInterval(()=>{n.rotation=s(-90,90),n.x=s(-300,2220),n.y=s(-300,1380)},2500)});function a(c,d){t(u=>[...u,c].slice(-4)),console.log(c)}return Me(()=>{clearInterval(r)}),l(N,{get children(){return[l(E,{style:i,get children(){return e().join("\n")}}),l(N,{autofocus:!0,style:o,ref(c){var d=n;typeof d=="function"?d(c):n=c},onEvents:[["inBounds",c=>a("inBounds")],["outOfBounds",c=>a("outOfBounds")],["inViewport",c=>a("inViewport")],["outOfViewport",c=>a("outOfViewport")]]})]}})},Jc=()=>{function n(o,i){this.states.toggle("disabled")}const r={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:M("00000000"),gap:26,y:400};function e(o){return l(N,Q(o,{forwardStates:!0,get style(){return ho.container},get children(){return l(E,{get style(){return ho.text},get children(){return o.children}})}}))}const t=o=>(()=>{var i=Ot("node");return Qo(ni,i,()=>[10,15]),Tr(i,Q(o,{get style(){return{color:M("#000000be"),borderRadius:8,border:{width:2,color:M("#ffffff")}}}}),!0),jo(i,l(E,{style:{fontSize:20},get children(){return o.children}})),i})();return[l(X,{x:100,y:200,gap:5,style:r,get children(){return[l(t,{children:"HD"}),l(t,{children:"PG13"}),l(t,{children:"NC17"}),l(E,{fontSize:30,children:"I like bananas"}),l(t,{children:"DOLBY"})]}}),l(X,{x:100,gap:40,style:r,get children(){return[l(e,{autofocus:!0,onEnter:n,children:"TV Shows"}),l(e,{states:{active:!0,disabled:!1},children:"Movies"}),l(e,{states:"active",children:"Sports"}),l(e,{states:"disabled",children:"News"})]}})]},ed=()=>{const n={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:M("#4dabf5")},r={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(a){return l(N,Q(a,{style:{width:200,height:100,y:5,color:392801023}}))}const[t,o]=W(50);function i(){var a;(a=this.children.selected)==null||a.setFocus(),o(150+(this.y||0)*-1)}Qe(()=>{Ee("#333333")});const s=50;return l(te,{x:160,get y(){return t()},gap:30,height:850,get width(){return n.width},get style(){return ge.Column},get children(){return[l(E,{style:r,children:"Flex Start"}),l(X,{gap:s,style:n,onFocus:i,get children(){return[l(e,{autofocus:!0}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(E,{style:r,children:"Flex Start - Margin Left"}),l(X,{gap:s,style:n,onFocus:i,get children(){return[l(e,{marginLeft:100}),l(e,{}),l(e,{marginLeft:100}),l(e,{}),l(e,{})]}}),l(E,{style:r,children:"Flex End"}),l(X,{gap:s,justifyContent:"flexEnd",style:n,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(E,{style:r,children:"Flex End - Margin Right"}),l(X,{gap:s,justifyContent:"flexEnd",style:n,onFocus:i,get children(){return[l(e,{}),l(e,{marginRight:100}),l(e,{}),l(e,{}),l(e,{marginRight:100})]}}),l(E,{style:r,children:"Center - No Margin Support"}),l(X,{gap:s,justifyContent:"center",style:n,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(E,{style:r,children:"Space Between - No Margin Support"}),l(X,{gap:s,justifyContent:"spaceBetween",style:n,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(E,{style:r,children:"Space Evenly - No Margin Support"}),l(X,{gap:s,justifyContent:"spaceEvenly",style:n,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}})]}})},td=()=>{const n={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:M("#4dabf5")},r={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(c){return l(N,Q(c,{style:{width:200,height:100,y:5,color:392801023}}))}function t(){return Math.floor(Math.random()*91)+10}const[o,i]=W(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}Qe(()=>{Ee("#333333")});const a=50;return l(te,{x:160,get y(){return o()},gap:30,height:850,get width(){return n.width},get style(){return ge.Column},get children(){return[l(E,{style:r,children:"Flex Start - AlignItems: center"}),l(X,{alignItems:"center",gap:a,style:n,onFocus:s,get children(){return[l(e,{autofocus:!0,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:r,children:"Flex Start - Margin Left - AlignItems: flexStart"}),l(X,{gap:a,alignItems:"flexStart",style:n,onFocus:s,get children(){return[l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:r,children:"Flex End - AlignItems: flexEnd"}),l(X,{gap:a,justifyContent:"flexEnd",alignItems:"flexEnd",style:n,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:r,children:"Flex End - Margin Right"}),l(X,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}})]}}),l(E,{style:r,children:"Center - No Margin Support"}),l(X,{gap:a,justifyContent:"center",style:n,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:r,children:"Space Between - No Margin Support"}),l(X,{gap:a,justifyContent:"spaceBetween",style:n,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:r,children:"Space Evenly - No Margin Support"}),l(X,{gap:a,justifyContent:"spaceEvenly",style:n,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}})]}})},rd=()=>{const n={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:M("00000000")},r={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("#4dabf5"),height:850,width:80},e={fontSize:44,y:20,x:150};function t(d){const u={width:o(),height:80,x:5,color:M("#1769aa")};return l(N,Q(d,{style:u}))}function o(){return Math.floor(Math.random()*61)+10}const[i,s]=W(50);function a(){var d;(d=this.children.selected)==null||d.setFocus(),s(150+(this.y||0)*-1)}Qe(()=>{Ee("#333333")});const c=50;return[l(E,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(X,{gap:c,style:n,onFocus:a,get children(){return[l(te,{gap:30,style:r,alignItems:"center",get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,style:r,onFocus:a,alignItems:"flexStart",get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(te,{gap:c,alignItems:"flexEnd",justifyContent:"flexEnd",style:r,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"flexEnd",style:r,onFocus:a,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(te,{gap:c,justifyContent:"center",style:r,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"spaceBetween",style:r,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"spaceEvenly",style:r,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},nd=()=>{const n={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:M("00000000")},r={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("#4dabf5"),height:850,width:60},e={fontSize:44,y:20,x:150};function t(c){const d={width:50,height:80,x:5,color:M("#1769aa")};return l(N,Q(c,{style:d}))}const[o,i]=W(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}Qe(()=>{Ee("#333333")});const a=50;return[l(E,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(X,{gap:a,style:n,onFocus:s,get children(){return[l(te,{gap:30,style:r,get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,style:r,onFocus:s,get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"flexEnd",style:r,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"flexEnd",style:r,onFocus:s,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(te,{gap:a,justifyContent:"center",style:r,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"spaceBetween",style:r,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"spaceEvenly",style:r,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},od=()=>{function n(i,s){this.states.toggle("disabled")}const r={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:M("00000000"),gap:26,y:400,x:100},e={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},t=["RoundedRectangle",{radius:65}];function o(i){return l(N,Q(i,{forwardStates:!0,style:e,shader:t,get children(){return l(E,{style:Rc,get children(){return i.children}})}}))}return l(X,{style:r,get children(){return[l(o,{autofocus:!0,onEnter:n,children:"Focused"}),l(o,{states:{active:!0,disabled:!1},children:"Normal"}),l(o,{states:"disabled",children:"Disabled"})]}})},id="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function sd(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?ad():console.error("Browser not supported!")}async function ad(){const n=document.getElementById("video"),r=new shaka.Player;await r.attach(n),window.player=r,r.addEventListener("error",ld);try{await r.load(id),console.log("The video has now been loaded!")}catch(e){pi(e)}}function ld(n){pi(n.detail)}function pi(n){console.error("Error code",n.code,"object",n)}function cd(){const n=document.getElementById("video");return n.hidden=!1,setTimeout(()=>n.play(),50),n.focus(),n}function dd(){const n=document.getElementById("video");return n.hidden=!0,n.pause(),n}document.addEventListener("DOMContentLoaded",sd);const ud=()=>{const n=hn(),r=yt(),[e]=et(()=>({...n}),gi),[t]=et(()=>({...n}),Kc),[o]=et(()=>({...n}),Xc),[i,s]=W(0);je(ot(e,b=>{Ee(b.backgroundImage)},{defer:!0}));const a=640,c={color:M("#000000"),alpha:0,width:1900,height:890,x:-160,y:a,borderRadius:30};function d(){var b;(b=this.children.selected)==null||b.setFocus(),p.y=a,y.y=a,y.alpha=0}function u(){var b;(b=this.children.selected)==null||b.setFocus(),p.y=200,y.y=160,y.alpha=.9}function g(){let b=this.children.selected;L(b&&b.href),r(b.href)}function w(){dd(),document.getElementsByTagName("canvas")[0].focus(),S.setFocus(),s(0)}function A(){const b=cd();Mo(b),s(.9)}let p,y,S;return l(ze,{get when(){return e()},keyed:!0,get children(){return[l(N,{x:170,onUp:()=>S.setFocus(),onEscape:w,get children(){return[l(fi,Q({y:260},()=>e().heroContent)),l(X,{ref(b){var v=S;typeof v=="function"?v(b):S=b},y:500,scroll:"none",height:90,width:640,gap:40,onDown:()=>p.setFocus(),onEnter:A,get children(){return[l(lo,{width:300,autofocus:!0,children:"Play"}),l(lo,{width:300,children:"Resume"})]}}),l(te,{ref(b){var v=p;typeof v=="function"?v(b):p=b},x:0,y:a,get style(){return ge.Column},zIndex:5,get children(){return l(ze,{get when(){return xt(()=>!!o())()&&t()},get children(){return[l(E,{skipFocus:!0,get style(){return ge.RowTitle},children:"Recommendations"}),l(vr,{onFocus:d,onEnter:g,get items(){return o()},width:1620}),l(E,{skipFocus:!0,get style(){return ge.RowTitle},children:"Cast and Crew"}),l(vr,{onFocus:u,onEnter:g,get items(){return t()},width:1620})]}})}}),l(N,{ref(b){var v=y;typeof v=="function"?v(b):y=b},style:c,transition:{alpha:!0,y:!0}})]}}),l(N,{get alpha(){return i()},get color(){return M("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function hd({id:n}){return rt.get("/person/".concat(n,"/combined_credits")).then(({cast:r})=>Mt(r.slice(0,7)))}function fd({id:n}){return rt.get("/person/".concat(n)).then(r=>({backgroundImage:Ft(r.profile_path,"original"),heroContent:{title:r.title||r.name,description:r.biography},...r}))}const gd=()=>{const n=hn(),r=yt(),[e]=et(()=>({...n}),fd),[t]=et(()=>({...n}),hd),o={color:M("#000000"),alpha:.8,width:800,height:440,x:130,y:180,borderRadius:30};function i(){let s=this.children.selected;L(s&&s.href),r(s.href)}return Qe(()=>{Ee("#333333")}),l(ze,{get when(){return e()},keyed:!0,get children(){return[l(N,{get src(){return e().backgroundImage},width:400,autosize:!0,y:0,x:1800,mountX:1}),l(N,{x:150,y:200,width:800,gap:24,get style(){return ge.Column},zIndex:3,get children(){return[l(E,{contain:"width",fontFamily:"Ubuntu",get style(){return f.typography.display2},get children(){return e().name}}),l(E,{contain:"both",get style(){return ge.peopleBio},get children(){return e().biography}})]}}),l(N,{style:o}),l(te,{y:670,x:140,get style(){return ge.Column},scroll:"none",get children(){return l(ze,{get when(){return t()},get children(){return[l(E,{skipFocus:!0,get style(){return ge.RowTitle},children:"Credits"}),l(vr,{autofocus:!0,onEnter:i,get items(){return t()}})]}})}})]}})},pd=()=>(()=>{var n=Ot("node");return aa(n,"style",{width:1920,height:1080,color:868483072}),n})(),md=new URL("AppCoreExtensions-ChAx3lKK.js",import.meta.url).href;pe.debug=!1;pe.animationsEnabled=!0;pe.fontSettings.fontFamily="Ubuntu";pe.fontSettings.color=M("#f6f6f6");pe.fontSettings.fontSize=32;pe.rendererOptions={coreExtensionModule:md,fpsUpdateInterval:200,enableInspector:!0};sa(()=>l(za,{root:n=>l(Cc,n),get children(){return[l(he,{path:"",component:mo}),l(he,{path:"examples",component:Vc}),l(he,{path:"browse/:filter",component:mo}),l(he,{path:"text",component:Gc}),l(he,{path:"buttons",component:Jc}),l(he,{path:"flex",component:ed}),l(he,{path:"create",component:qc}),l(he,{path:"viewport",component:Zc}),l(he,{path:"flexsize",component:td}),l(he,{path:"flexcolumnsize",component:rd}),l(he,{path:"flexcolumn",component:nd}),l(he,{path:"buttonsmaterial",component:od}),l(he,{path:"entity/people/:id",component:gd}),l(he,{path:"entity/:type/:id",component:ud}),l(he,{path:"*all",component:pd})]}}));export{yd as __vite_legacy_guard}; +//# sourceMappingURL=index-By475dcY.js.map diff --git a/assets/index-By475dcY.js.map b/assets/index-By475dcY.js.map new file mode 100644 index 0000000..d1e63b0 --- /dev/null +++ b/assets/index-By475dcY.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":"8tCAqIA,MAAMA,GAAU,CAACC,EAAGC,IAAMD,IAAMC,EAC1BC,GAAS,OAAO,aAAa,EAC7BC,GAAS,OAAO,aAAa,EAE7BC,GAAgB,CACpB,OAAQL,EACV,EAEA,IAAIM,GAAaC,GACjB,MAAMC,GAAQ,EACRC,GAAU,EACVC,GAAU,CACd,MAAO,KACP,SAAU,KACV,QAAS,KACT,MAAO,IACT,EACMC,GAAU,GAChB,IAAIC,EAAQ,KACZ,IAAIC,GAAa,KAEbC,GAAuB,KACvBC,EAAW,KACXC,GAAU,KACVC,GAAU,KACVC,GAAY,EAChB,SAASC,GAAWC,EAAIC,EAAe,CACrC,MAAMC,EAAWP,EACfQ,EAAQX,EACRY,EAAUJ,EAAG,SAAW,EACxBK,EAAUJ,IAAkB,OAAYE,EAAQF,EAChDK,EAAOF,EACHd,GACA,CACE,MAAO,KACP,SAAU,KACV,QAASe,EAAUA,EAAQ,QAAU,KACrC,MAAOA,CACR,EACLE,EAAWH,EAAUJ,EAAK,IAAMA,EAAG,IAAMQ,GAAQ,IA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GACX,EACD,iBAAkB,CAChB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,aAAc,CACZ,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,QAAS,CACP,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,gBAAiB,CACf,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,YAAa,CACX,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,CACF,EACD,MAAO,CACL,UACE,6ZACF,WACE,iZACF,iBACE,ylHACF,MACE,gZACH,EACD,MAAO,CACL,QAAS,CACP,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,YACZ,EACD,MAAO,aACP,MAAO,aACP,KAAM,aACN,IAAK,aACL,OAAQ,aACR,OAAQ,aACR,MAAO,aACP,KAAM,aACN,OAAQ,aACR,SAAU,aACV,cAAe,aACf,QAAS,aACT,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAAc,aACd,SAAU,aACV,YAAa,aACb,gBAAiB,YACjB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAAc,aACd,SAAU,aACV,YAAa,aACb,cAAe,aACf,uBAAwB,aACxB,sBAAuB,aACvB,sBAAuB,aACvB,cAAe,aACf,uBAAwB,aACxB,sBAAuB,aACvB,sBAAuB,aACvB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,eAAgB,aAChB,eAAgB,aAChB,WAAY,aACZ,cAAe,aACf,mBAAoB,aACpB,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ROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","current","root","updateFn","untrack","cleanNode","runUpdates","createSignal","value","options","s","setter","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","v","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","error","setError","track","trigger","state","setState","loadEnd","p","key","completeLoad","err","read","SuspenseContext","load","refetching","lookup","e","castError","createSelector","subs","node","val","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","i","result","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","createContext","defaultValue","id","createProvider","useContext","context","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","res","completeUpdates","queue","userLength","ignore","index","obs","n","results","props","FALLBACK","dispose","d","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","j","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","start","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","property","receiver","resolveSource","resolveSources","length","mergeProps","sources","proxy","keys","sourcesMap","defined","sourceKeys","desc","target","definedKeys","splitProps","blocked","k","otherObject","objects","propName","isDefaultDesc","objectIndex","narrowedError","name","For","fallback","Show","keyed","condition","child","DEV","activeElement","setActiveElement","TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","x","y","w","h","convertColorToRgba","color","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","properties","div","driver","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","uni","trPropSetterDefaults","TextRenderer","stage","propSetters","status","renderable","eventName","WebTrFontFace","TrFontFace","fontFamily","descriptors","fontUrl","fontUrlWithoutParentheses","determinedDescriptors","cssDescriptors","fontFace","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","ff","ffs","fontSetting","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","m","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","drawLines","hlHeight","offset","hlPaddingLeft","hlPaddingRight","getRgbaString","drawLine","prevShadowSettings","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","truncWordWidth","text","indent","allLines","realNewlines","resultLines","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","EventEmitter","cssString","maxLines","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","scrollY","contain","visibleWindow","renderWindow","canvasPages","elementBounds","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","pageInfo","transform","clippingRect","textW","textH","elementRect","intersectRect","pageSize","zIndex","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","_h","_g","_j","_i","_l","_k","DefaultShader","WebGlCoreShader","renderer","textures","glw","DefaultShaderBatched","t","samplers","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","effect","_DynamicShader","shader","memize","regEffects","eff","fxClass","uniInfo","fxProp","propInfo","propsA","propsB","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","fxProps","remap","cm","fxMethod","onShaderMask","onColorize","onEffectMask","reg","methodParameters","pm","sharedMethods","currentMask","drawEffects","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","isCompressedTextureContainer","url","loadCompressedTexture","arrayBuffer","loadKTXData","loadPVRData","buffer","view","littleEndian","mipmaps","data","imageSize","header","dataOffset","pvrtcData","level","_ImageTexture","Texture","txManager","mimeType","src","premultiplyAlpha","blob","hasAlphaChannel","img","resolve","reject","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","codePoint","measureText","shaperProps","shaper","glyphs","glyph","layoutText","curLineIndex","startX","startY","textAlign","vertexBuffer","rwSdf","trFontFace","forceFullLayoutCalc","scrollable","overflowSuffix","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","startingMaxX","startingMaxY","maxX","maxY","curX","curY","bufferOffset","lastWord","glyphResult","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","moreLines","nextLineWillFit","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","charEndX","quadX","quadY","atlasEntry","uvWidth","uvHeight","vertexTextW","line","xOffset","roundUpToMultiple","multiple","roundDownToMultiple","setRenderWindow","outRenderWindow","bufferMargin","screen","sdf","isBoundPositive","x1","x2","y1Base","y1","y2","weightConversions","fontWeightToNumber","weight","rawResolveFontToUse","familyMapsByPriority","family","weightIn","style","stretch","fontFamiles","fontFaces","weightMap","fontFamilyWeight","msg","resolveFontToUse","TrFontManager","textRenderers","font","trId","tr","tmpRect","SdfTextRenderer","boundsOverlap","SdfTrFontFace","familyName","faceSet","debugData","neededLength","rwScreen","out2","parentHasRenderTexture","framebufferDimensions","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","validTypes","valueType","RendererMain","resolvedSettings","appWidth","appHeight","deviceLogicalPixelRatio","devicePhysicalPixelRatio","enableInspector","useFinalizationRegistryTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","fpsData","frameTickData","_m","_n","_o","_p","_q","_r","_s","colorTl","colorTr","colorBl","colorBr","_t","_u","_v","_w","_x","_y","_z","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_L","_K","_N","_M","_O","_Q","_P","_S","_R","_T","_V","_U","_X","_W","_Y","_Z","textureType","shaderType","CoreAnimation","getTimingFunction","startValue","endValue","dt","easing","stopMethod","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","promise","m0","m1","m2","m3","m4","m5","m6","m7","m8","Matrix3d","entries","tempMatrix","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","sx","sy","angle","cos","sin","dst","transpose","other","rx1","rx2","rx3","rx4","ry1","ry2","ry3","ry4","RenderCoords","x3","y3","x4","y4","CoreNodeRenderState","CoreNodeRenderStateMap","UpdateType","CoreNode","dimensions","shManager","type","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","delta","parentClippingRect","childUpdateType","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","rtt","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","worldAlpha","newParent","oldParent","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","payload","imageUrl","startLoop","isIdle","runLoop","getTimeStamp","AnimationManager","ImageWorkerManager","numImageWorkers","worker","numWorkers","workerCode","blobURL","workers","absoluteSrcUrl","_NoiseTexture","size","pixelData8","NoiseTexture","CoreTextureManager","ColorTexture","SubTexture","RenderTexture","textureClass","TextureClass","descId","textureDescId","textureIdCache","textureRefCountMap","refCountObj","textureSource","TextureMemoryManager","byteThreshold","byteSize","bufferMemory","Stage","clearColor","rootId","boundsMargin","enableContextSpy","txMemByteThreshold","bm","debugInfo","WebGlCoreRenderer","rootNode","animationManager","renderRequested","fpsUpdateInterval","fps","trProps","textRendererOverride","rendererId","overrideFallback","possibleRenderer","resolvedTextRenderer","CoreTextNode","setWidth","setHeight","calcWidth","textRendererState","MainOnlyTextNode","MainCoreDriver","rendererSettings","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","_key","stateIndexToRemove","calculateFlex","hasOrder","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","changedLayout","stylesToUndo","styleKey","newStyles","styles","handler","inode","radius","Text","_el$","_$createElement","View","createRenderer$1","createElement","createTextNode","isTextNode","replaceText","insertNode","removeNode","setProperty","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","normalized","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","arg","createRenderer","universalLightning","anchor","solidRenderer","render","spread","setProp","use","hexColor","$$EVENTS","delegateEvents","eventNames","document","eventHandler","isServer","createBeforeLeave","listeners","subscribe","confirm","to","force","depth","saveCurrentDepth","keepDepth","notifyIfNotBlocked","notify","block","prevDepth","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","from","basePath","fromPath","invariant","message","joinPaths","extractSearchParams","params","createMatcher","partial","matchFilters","pattern","splat","segments","location","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","filter","isEqual","scoreRoute","route","score","createMemoObject","expandOptionals","prefix","prefixes","expansion","MAX_REDIRECTS","RouterContextObj","RouteContextObj","useRouter","useNavigate","useLocation","useMatch","matchers","matcher","useParams","createRoutes","routeDef","component","info","isLeaf","shared","asArray","originalPath","createBranch","routes","matches","createBranches","stack","branches","routeDefs","def","isEmptyArray","branch","getRouteMatches","createLocation","origin","path_","pathname","search","hash","intent","createRouterContext","integration","getContext","setSource","utils","parsePath","renderPath","beforeLeave","isRouting","setIsRouting","reference","setReference","referrers","submissions","baseRoute","navigatorFactory","preloadRoute","navigateFromRoute","replace","scroll","nextState","resolvedTo","navigateEnd","first","preloadData","prevIntent","createRouteContext","router","outlet","createRouterComponent","routerState","singleFlight","create","_$createComponent","Provider","Root","rootLoad","_$memo","Routes","when","routeStates","nextMatches","prevMatches","equal","prevMatch","nextMatch","createOutlet","splice","forEach","Route","childRoutes","intercept","get","querySelector","selector","createRouter","wrap","signal","bindEvent","scrollToHash","fallbackTop","actions","setupNativeEvents","preload","explicitLinks","actionBase","preloadTimeout","isSvg","handleAnchor","evt","svg","href","rel","handleAnchorClick","handleAnchorPreload","handleAnchorIn","handleAnchorOut","handleFormSubmit","actionRef","hashParser","str","HashRouter","getSource","hashIndex","tryOnCleanup","makeEventListener","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","setEvent","keyMapEntries","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","elm","mappedKeyEvent","finalFocusElm","onKeyHandler","withPadding","padding","pad","right","bottom","firstChild","maxHeight","flattenStrings","series","flattenedSeries","pause","speak","phrase","utterances","lang","synth","utterance","speakSeries","remainingPhrases","nestedSeriesResults","active","retriesLeft","seriesResult","toSpeak","currentSeries","SpeechEngine","debounce","timeoutId","clear","resetFocusPathTimer","currentlySpeaking","voiceOutDisabled","fiveMinutes","debounceWithFlush","scopedValue","debounced","newValue","getElmName","onFocusChangeCore","Announcer","loaded","focusDiff","toAnnounceText","toAnnounce","textToSpeech","append","notification","focusDebounce","focusChangeTimeout","useAnnouncer","createSpriteMap","subTextures","spriteMapTexture","globalBackground","setGlobalBackground","theme","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","startsWith","r$","_ref$","_ref$2","_ref$3","materialBrand","objectFromEntries","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles2","modeKeys","toneKeys","makeToneStyles","tones2","themeComponentStyles","modeStyles","toneStyles","tone","styles2","_a2","_b2","mode","makeModeStyles","modes2","makeBaseStyles","base2","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","convertComponentConfig","themeStyles3","variantName","convertedStyles","styleName","modeName","baseStyles","withScrolling","adjustment","componentRef","selectedElement","selected","lastSelected","axis","lastItem","updateLastIndex","rootPosition","selectedPosition","selectedSize","direct","currentChildIndex","currentChild","currentChildSize","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","_c2","num","getWidthByUpCount$1","theme2","upCount","screenW","columnCount","marginX","gutterX","columnWidth","columnGapTotal","defaultTone$f","themeStyles$e","container$f","defaultTone$e","themeStyles$d","container$e","text$7","icon$2","defaultTone$d","themeStyles$c","surfaceDefaultTone","surfaceThemeStyles$1","container$d","content","text$6","Container$c","Content","Text$5","styles$c","Button","Text$7","defaultTone$c","themeStyles$b","strokeWidth","container$c","icon$1","defaultTone$b","themeStyles$a","container$b","defaultTone$a","themeStyles$9","container$a","Container$9","styles$9","Column","onUp","onDown","defaultTone$9","themeStyles$8","container$9","text$5","themeStyles$7","defaultTone$8","container$8","text$4","icon","defaultTone$7","themeStyles$6","container$7","text$3","defaultTone$6","themeStyles$5","container$6","titleText","descriptionText","defaultTone$5","themeStyles$4","container$5","progress","defaultTone$4","themeStyles$3","container$4","Container$3","styles$3","Row","onLeft","onRight","defaultTone$3","themeStyles$2","container$3","text$2","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","isLoadedCount","setIsLoadedCount","isLoadingCount","setIsLoadingCount","isFailedCount","setIsFailedCount","count","totalFps","calcFps","fps2","calcPerformanceMetrics","isLoadedCount2","isLoadingCount2","isFailedCount2","setupFPS","FPSCounter","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","handleNavigate","page","focusPage","flexItem","showWidgets","onEnter","Gradient","App","Menu","Escape","Backspace","Left","Right","Up","Down","Enter","announcer","enabled","navDrawer","lastFocused","focusNavDrawer","has","setShowWidgets","showOnPaths","currentPath","matchesPartial","some","window","APP","onAnnouncer","onLast","history","back","onMenu","onBackspace","mountX","TopBar","ButtonText","buttonStyles","MaterialButton","MaterialButtonText","Thumbnail","TileRow","local","others","each","API_KEY_V4","API_BASE","tmdbConfig","baseImageUrl","basePosterSize","defaultFetchParams","getImageUrl","posterSize","_get","loadConfig","api","truncateString","maxLength","chunkArray","convertItemsToTiles","cache","leftoverTiles","browseProvider","pageIndex","trending","tiles","chunks","createInfiniteScroll","pages","setPages","setPage","setEnd","contents","blockWidth","HeadlineStyles","typography","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","Badge","borderRadius","border","MetaTextStyle","body2","Metadata","display","flexDirection","voteAverage","voteCount","metaText","badges","ContentBlock","title","description","minutesToHMM","minutes","hours","remainingMinutes","formatDate","dateString","parts","justYear","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","delayedBackgrounds","delayedHero","onRowFocus","numPages","entity","itemsContainer","plinko","announce","autofocus","Portal","demos","DemoTile","Container","transition","focus","setColor","rowX","setRowX","moveRow","row","colorTop","colorBottom","onSelectedChanged","justifyContent","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","insertTest","setInsertTest","emptyTest","setEmptyTest","setTimeout","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","borderLeft","borderTop","borderRight","borderBottom","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","ballStatus","setBallStatus","styleBall","mount","lineheight","randomIntBetween","Math","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","marginRight","FlexSizePage","randSize","alignItems","FlexColumnPage","ColumnStyles","MaterialButtonsPage","manifestUri","initApp","initPlayer","video","player","onErrorEvent","onError","playVideo","closeVideo","Entity","credits","recommendations","backdropAlpha","setBackdropAlpha","backgroundImage","Backdrop","columnRef","backdropRef","onRowFocusAnimate","onEscape","getElementsByTagName","entityActions","onEnterTrailer","RowTitle","People","autosize","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[0,1,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,96,98],"sources":["../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/activeElement.ts","../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/lightningInit.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/children.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/config.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/utils.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/states.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/flex.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/index.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/components/Text.tsx","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/solidUniversal.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/render.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.1_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_l6qk66ywnsrdb5zvon2uxgrjiy/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n if (!(src.substr(0, 5) == \"data:\")) {\n // Base64.\n img.crossOrigin = \"Anonymous\";\n }\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha, parentHasRenderTexture, framebufferDimensions) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex, false, parentHasRenderTexture, framebufferDimensions);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n const parentHasRenderTexture = props.parent?.rtt ?? props.parent?.parentHasRenderTexture ?? false;\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n rtt: props.rtt ?? false,\n parentHasRenderTexture,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n hasRTTupdates = false;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n // Assign a default value to parentHasRenderTexture\n parentHasRenderTexture: false,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n // Allow for Render Texture to be processed appropriately\n this.rtt = props.rtt;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // If parent has a render texture, flag that we need to update\n // @todo: Reserve type for RTT updates\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(1);\n }\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n queueMicrotask(() => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n // If node is part of RTT texture\n // Flag that we need to update\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(type);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n }\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children &&\n this.children.length &&\n !this.rtt) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps, rtt, parentHasRenderTexture, } = this.props;\n // Prevent quad rendering if parent has a render texture\n // and renderer is not currently rendering to a texture\n if (parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n rtt,\n parentHasRenderTexture,\n framebufferDimensions: this.framebufferDimensions,\n });\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n if (newParent.rtt || newParent.parentHasRenderTexture) {\n this.setRTTUpdates(UpdateType.All);\n }\n }\n this.parentHasRenderTexture =\n newParent?.rtt || newParent?.parentHasRenderTexture;\n this.updateScaleRotateTransform();\n }\n get rtt() {\n return this.props.rtt;\n }\n set rtt(value) {\n if (!value) {\n return;\n }\n this.props.rtt = true;\n this.hasRTTupdates = true;\n // Store RTT nodes in a separate list\n this.stage.renderer?.renderToTexture(this);\n }\n set parentHasRenderTexture(value) {\n this.props.parentHasRenderTexture = !!value;\n }\n get parentHasRenderTexture() {\n return this.props.parentHasRenderTexture;\n }\n /**\n * Returns the framebuffer dimensions of the node.\n * If the node has a render texture, the dimensions are the same as the node's dimensions.\n * If the node does not have a render texture, the dimensions are inherited from the parent.\n * If the node parent has a render texture and the node is a render texture, the nodes dimensions are used.\n */\n get framebufferDimensions() {\n if (this.parentHasRenderTexture && !this.rtt) {\n return this.parent?.framebufferDimensions;\n }\n return { width: this.width, height: this.height };\n }\n /**\n * Returns the parent render texture node if it exists.\n */\n get parentRenderTexture() {\n let parent = this.parent;\n while (parent) {\n if (parent.rtt) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n get texture() {\n return this.props.texture;\n }\n setRTTUpdates(type) {\n this.hasRTTupdates = true;\n this.parent?.setRTTUpdates(type);\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n rtt: props.rtt,\n parentHasRenderTexture: props.parentHasRenderTexture,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this.rtt = props.rtt;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n get rtt() {\n return this.coreNode.rtt;\n }\n set rtt(value) {\n if (value) {\n this.texture = this.rendererMain.createTexture('RenderTexture', {\n width: this.width,\n height: this.height,\n }, { preload: true, flipY: true });\n }\n this.coreNode.rtt = value;\n }\n get parentHasRenderTexture() {\n return this.coreNode.parentHasRenderTexture;\n }\n set parentHasRenderTexture(value) {\n this.coreNode.parentHasRenderTexture = value;\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n this.registerTextureType('RenderTexture', RenderTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // Reset render operations and clear the canvas\n renderer?.reset();\n // If we have RTT nodes draw them first\n // So we can use them as textures in the main scene\n if (renderer.rttNodes.length > 0) {\n renderer.renderRTTNodes();\n }\n // Fill quads buffer\n this.addQuads(this.root);\n // Perform render pass\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n // Prevent quad rendering if parent has a render texture\n // and this node is not the render texture\n if (this.parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n this.globalTransform.multiply(this.localTransform ?? Matrix3d.identity());\n }\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha, this.parentHasRenderTexture, this.framebufferDimensions);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n parentHasRenderTexture: false,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n let changedLayout = false;\n if (isFunc(this.onBeforeLayout)) {\n changedLayout = this.onBeforeLayout.call(\n this,\n child,\n dimensions,\n ) as boolean;\n }\n\n if (this.display === 'flex') {\n if (calculateFlex(this) || changedLayout) {\n this.parent?.updateLayout();\n }\n } else if (changedLayout) {\n this.parent?.updateLayout();\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n // let flex know we need to re-layout\n return true;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2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6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUS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IJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For, hexColor } from \"@lightningjs/solid\";\nimport { createMemo, For as For$1, createSignal } from \"solid-js\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For$1, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For$1, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: (string | number)[];\n Menu: (string | number)[];\n Escape: (string | number)[];\n Backspace: (string | number)[];\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: [\"a\"],\n Menu: [\"m\"],\n Escape: [\"Escape\", 27],\n Backspace: [\"Backspace\", 8],\n Left: [\"ArrowLeft\", 37],\n Right: [\"ArrowRight\", 39],\n Up: [\"ArrowUp\", 38],\n Down: [\"ArrowDown\", 40],\n Enter: [\"Enter\", 13],\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n setupFPS({ renderer });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: \"normal\",\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n fontFamily: \"Ubuntu\",\n fontWeight: 700,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = {\n ...theme.typography.body2,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n};\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"file":"assets/index-By475dcY.js"} \ No newline at end of file diff --git a/assets/index-PC-bZnEO.js b/assets/index-PC-bZnEO.js deleted file mode 100644 index 3911dd5..0000000 --- a/assets/index-PC-bZnEO.js +++ /dev/null @@ -1,2 +0,0 @@ -var mi=Object.defineProperty;var xi=(r,n,e)=>n in r?mi(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var h=(r,n,e)=>(xi(r,typeof n!="symbol"?n+"":n,e),e);import{a as L,i as vo,T as yi,g as Bn,c as gt,E as ot,b as ke,d as vi,e as nr,f as wi,m as _t,W as Pt,h as wo,j as bo,k as bi,l as kn,S as _r,B as Si,n as Ai,o as So,p as Ci,q as Ti,C as _i,r as Ri,s as Rr,t as Ir,u as Ii,v as Bi,R as ki,w as Ei}from"./CoreExtension-D6FI1p2n.js";function Sd(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))t(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&t(s)}).observe(document,{childList:!0,subtree:!0});function e(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function t(o){if(o.ep)return;o.ep=!0;const i=e(o);fetch(o.href,i)}})();const Ao=(r,n)=>r===n,cn=Symbol("solid-proxy"),Fi=Symbol("solid-track"),Ni=Symbol("solid-dev-component"),dn={equals:Ao};let Co=Eo;const Ae=1,un=2,Li={owned:null,cleanups:null,context:null,owner:null},En={};var U=null;let Fn=null,Mi=null,H=null,ae=null,Ie=null,Sn=0;const zi={afterUpdate:null,afterCreateOwner:null,afterCreateSignal:null};function mt(r,n){const e=H,t=U,o=r.length===0,i=n===void 0?t:n,s=o?{owned:null,cleanups:null,context:null,owner:null}:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?()=>r(()=>{throw new Error("Dispose method must be an explicit argument to createRoot function")}):()=>r(()=>le(()=>Cn(s)));U=s,H=null;try{return Be(a,!0)}finally{H=e,U=t}}function W(r,n){n=n?Object.assign({},dn,n):dn;const e={value:r,observers:null,observerSlots:null,comparator:n.equals||void 0};n.name&&(e.name=n.name),n.internal||Ro(e);const t=o=>(typeof o=="function"&&(o=o(e.value)),rr(e,o));return[ko.bind(e),t]}function Dn(r,n,e){const t=yt(r,n,!0,Ae,e);Xe(t)}function Re(r,n,e){const t=yt(r,n,!1,Ae,e);Xe(t)}function je(r,n,e){Co=Hi;const t=yt(r,n,!1,Ae,e);(!e||!e.render)&&(t.user=!0),Ie?Ie.push(t):Xe(t)}function q(r,n,e){e=e?Object.assign({},dn,e):dn;const t=yt(r,n,!0,0,e);return t.observers=null,t.observerSlots=null,t.comparator=e.equals||void 0,Xe(t),ko.bind(t)}function Pi(r){return r&&typeof r=="object"&&"then"in r}function tt(r,n,e){let t,o,i;arguments.length===2&&typeof n=="object"||arguments.length===1?(t=!0,o=r,i=n||{}):(t=r,o=n,i=e||{});let s=null,a=En,c=!1,d="initialValue"in i,u=typeof t=="function"&&q(t);const g=new Set,[w,A]=(i.storage||W)(i.initialValue),[p,y]=W(void 0),[S,b]=W(void 0,{equals:!1}),[v,x]=W(d?"ready":"unresolved");function m(T,_,k,z){return s===T&&(s=null,z!==void 0&&(d=!0),(T===a||_===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(z,{value:_})),a=En,C(_,k)),_}function C(T,_){Be(()=>{_===void 0&&A(()=>T),x(_!==void 0?"errored":d?"ready":"unresolved"),y(_);for(const k of g.keys())k.decrement();g.clear()},!1)}function I(){const T=Ui,_=w(),k=p();if(k!==void 0&&!s)throw k;return H&&!H.user&&T&&Dn(()=>{S(),s&&(T.resolved||g.has(T)||(T.increment(),g.add(T)))}),_}function R(T=!0){if(T!==!1&&c)return;c=!1;const _=u?u():t;if(_==null||_===!1){m(s,le(w));return}const k=a!==En?a:le(()=>o(_,{value:w(),refetching:T}));return Pi(k)?(s=k,"value"in k?(k.status==="success"?m(s,k.value,void 0,_):m(s,void 0,void 0,_),k):(c=!0,queueMicrotask(()=>c=!1),Be(()=>{x(d?"refreshing":"pending"),b()},!1),k.then(z=>m(k,z,void 0,_),z=>m(k,void 0,No(z),_)))):(m(s,k,void 0,_),k)}return Object.defineProperties(I,{state:{get:()=>v()},error:{get:()=>p()},loading:{get(){const T=v();return T==="pending"||T==="refreshing"}},latest:{get(){if(!d)return I();const T=p();if(T&&!s)throw T;return w()}}}),u?Dn(()=>R(!1)):R(!1),[I,{refetch:R,mutate:A}]}function To(r,n=Ao,e){const t=new Map,o=yt(i=>{const s=r();for(const[a,c]of t.entries())if(n(a,s)!==n(a,i))for(const d of c.values())d.state=Ae,d.pure?ae.push(d):Ie.push(d);return s},void 0,!0,Ae,e);return Xe(o),i=>{const s=H;if(s){let a;(a=t.get(i))?a.add(s):t.set(i,a=new Set([s])),Me(()=>{a.delete(s),!a.size&&t.delete(i)})}return n(i,o.value)}}function Di(r){return Be(r,!1)}function le(r){if(H===null)return r();const n=H;H=null;try{return r()}finally{H=n}}function it(r,n,e){const t=Array.isArray(r);let o,i=e&&e.defer;return s=>{let a;if(t){a=Array(r.length);for(let d=0;dn(a,o,s));return o=a,c}}function Qe(r){je(()=>le(r))}function Me(r){return U===null?console.warn("cleanups created outside a `createRoot` or `render` will never be run"):U.cleanups===null?U.cleanups=[r]:U.cleanups.push(r),r}function Dt(){return U}function _o(r,n){const e=U,t=H;U=r,H=null;try{return Be(n,!0)}catch(o){or(o)}finally{U=e,H=t}}function Oi(r){const n=H,e=U;return Promise.resolve().then(()=>{H=n,U=e;let t;return Be(r,!1),H=U=null,t?t.done:void 0})}function Wi(r,n){const e=yt(()=>le(()=>(Object.assign(r,{[Ni]:!0}),r(n))),void 0,!0,0);return e.props=n,e.observers=null,e.observerSlots=null,e.name=r.name,e.component=r,Xe(e),e.tValue!==void 0?e.tValue:e.value}function Ro(r){U&&(U.sourceMap?U.sourceMap.push(r):U.sourceMap=[r],r.graph=U)}function Io(r,n){const e=Symbol("context");return{id:e,Provider:ji(e,n),defaultValue:r}}function Bo(r){return U&&U.context&&U.context[r.id]!==void 0?U.context[r.id]:r.defaultValue}function An(r){const n=q(r),e=q(()=>On(n()),void 0,{name:"children"});return e.toArray=()=>{const t=e();return Array.isArray(t)?t:t!=null?[t]:[]},e}let Ui;function ko(){if(this.sources&&this.state)if(this.state===Ae)Xe(this);else{const r=ae;ae=null,Be(()=>fn(this),!1),ae=r}if(H){const r=this.observers?this.observers.length:0;H.sources?(H.sources.push(this),H.sourceSlots.push(r)):(H.sources=[this],H.sourceSlots=[r]),this.observers?(this.observers.push(H),this.observerSlots.push(H.sources.length-1)):(this.observers=[H],this.observerSlots=[H.sources.length-1])}return this.value}function rr(r,n,e){let t=r.value;return(!r.comparator||!r.comparator(t,n))&&(r.value=n,r.observers&&r.observers.length&&Be(()=>{for(let o=0;o1e6){throw ae=[],new Error("Potential Infinite Loop Detected.");throw new Error}},!1)),n}function Xe(r){if(!r.fn)return;Cn(r);const n=Sn;Yi(r,r.value,n)}function Yi(r,n,e){let t;const o=U,i=H;H=U=r;try{t=r.fn(n)}catch(s){return r.pure&&(r.state=Ae,r.owned&&r.owned.forEach(Cn),r.owned=null),r.updatedAt=e+1,or(s)}finally{H=i,U=o}(!r.updatedAt||r.updatedAt<=e)&&(r.updatedAt!=null&&"observers"in r?rr(r,t):r.value=t,r.updatedAt=e)}function yt(r,n,e,t=Ae,o){const i={fn:r,state:t,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:U,context:U?U.context:null,pure:e};return U===null?console.warn("computations created outside a `createRoot` or `render` will never be disposed"):U!==Li&&(U.owned?U.owned.push(i):U.owned=[i]),o&&o.name&&(i.name=o.name),i}function hn(r){if(r.state===0)return;if(r.state===un)return fn(r);if(r.suspense&&le(r.suspense.inFallback))return r.suspense.effects.push(r);const n=[r];for(;(r=r.owner)&&(!r.updatedAt||r.updatedAt=0;e--)if(r=n[e],r.state===Ae)Xe(r);else if(r.state===un){const t=ae;ae=null,Be(()=>fn(r,n[0]),!1),ae=t}}function Be(r,n){if(ae)return r();let e=!1;n||(ae=[]),Ie?e=!0:Ie=[],Sn++;try{const t=r();return $i(e),t}catch(t){e||(Ie=null),ae=null,or(t)}}function $i(r){if(ae&&(Eo(ae),ae=null),r)return;const n=Ie;Ie=null,n.length&&Be(()=>Co(n),!1)}function Eo(r){for(let n=0;n=0;n--)Cn(r.owned[n]);r.owned=null}if(r.cleanups){for(n=r.cleanups.length-1;n>=0;n--)r.cleanups[n]();r.cleanups=null}r.state=0,delete r.sourceMap}function No(r){return r instanceof Error?r:new Error(typeof r=="string"?r:"Unknown error",{cause:r})}function or(r,n=U){throw No(r)}function On(r){if(typeof r=="function"&&!r.length)return On(r());if(Array.isArray(r)){const n=[];for(let e=0;eo=le(()=>(U.context={...U.context,[r]:t.value},An(()=>t.children))),void 0,n),o}}const Qi=Symbol("fallback");function Br(r){for(let n=0;n1?[]:null;return Me(()=>Br(i)),()=>{let c=r()||[],d,u;return c[Fi],le(()=>{let w=c.length,A,p,y,S,b,v,x,m,C;if(w===0)s!==0&&(Br(i),i=[],t=[],o=[],s=0,a&&(a=[])),e.fallback&&(t=[Qi],o[0]=mt(I=>(i[0]=I,e.fallback())),s=1);else if(s===0){for(o=new Array(w),u=0;u=v&&m>=v&&t[x]===c[m];x--,m--)y[m]=o[x],S[m]=i[x],a&&(b[m]=a[x]);for(A=new Map,p=new Array(m+1),u=m;u>=v;u--)C=c[u],d=A.get(C),p[u]=d===void 0?-1:d,A.set(C,u);for(d=v;d<=x;d++)C=t[d],u=A.get(C),u!==void 0&&u!==-1?(y[u]=o[d],S[u]=i[d],a&&(b[u]=a[d]),u=p[u],A.set(C,u)):i[d]();for(u=v;u=0;a--){const c=Nn(r[a])[s];if(c!==void 0)return c}},has(s){for(let a=r.length-1;a>=0;a--)if(s in Nn(r[a]))return!0;return!1},keys(){const s=[];for(let a=0;a=0;s--){const a=r[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let d=c.length-1;d>=0;d--){const u=c[d];if(u==="__proto__"||u==="constructor")continue;const g=Object.getOwnPropertyDescriptor(a,u);if(!t[u])t[u]=g.get?{enumerable:!0,configurable:!0,get:Ki.bind(e[u]=[g.get.bind(a)])}:g.value!==void 0?g:void 0;else{const w=e[u];w&&(g.get?w.push(g.get.bind(a)):g.value!==void 0&&w.push(()=>g.value))}}}const o={},i=Object.keys(t);for(let s=i.length-1;s>=0;s--){const a=i[s],c=t[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function Vi(r,...n){if(cn in r){const o=new Set(n.length>1?n.flat():n[0]),i=n.map(s=>new Proxy({get(a){return s.includes(a)?r[a]:void 0},has(a){return s.includes(a)&&a in r},keys(){return s.filter(a=>a in r)}},Wn));return i.push(new Proxy({get(s){return o.has(s)?void 0:r[s]},has(s){return o.has(s)?!1:s in r},keys(){return Object.keys(r).filter(s=>!o.has(s))}},Wn)),i}const e={},t=n.map(()=>({}));for(const o of Object.getOwnPropertyNames(r)){const i=Object.getOwnPropertyDescriptor(r,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,c=0;for(const d of n)d.includes(o)&&(a=!0,s?t[c][o]=i.value:Object.defineProperty(t[c],o,i)),++c;a||(s?e[o]=i.value:Object.defineProperty(e,o,i))}return[...t,e]}const Gi=r=>"Attempting to access a stale value from <".concat(r,"> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.");function Tn(r){const n="fallback"in r&&{fallback:()=>r.fallback};return q(Xi(()=>r.each,r.children,n||void 0),void 0,{name:"value"})}function ze(r){const n=r.keyed,e=q(()=>r.when,void 0,{equals:(t,o)=>n?t===o:!t==!o,name:"condition"});return q(()=>{const t=e();if(t){const o=r.children;return typeof o=="function"&&o.length>0?le(()=>o(n?t:()=>{if(!le(e))throw Gi("Show");return r.when})):o}return r.fallback},void 0,{name:"value"})}const qi={hooks:zi,writeSignal:rr,registerGraph:Ro};globalThis&&(globalThis.Solid$$?console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior."):globalThis.Solid$$=!0);const[sr,Mo]=W(void 0);class zo{constructor(n){h(this,"releaseCallback");this.releaseCallback=n}}class Zi extends zo{constructor(e,t){var o,i;super(e);h(this,"textureMap",new Map);h(this,"zeroReferenceTextureSet",new Set);h(this,"options");this.options={textureCleanupIntervalMs:(o=t.textureCleanupIntervalMs)!=null?o:1e4,textureCleanupAgeThreadholdMs:(i=t.textureCleanupAgeThreadholdMs)!=null?i:6e4},setInterval(()=>{const s=Date.now(),a=this.options.textureCleanupAgeThreadholdMs;for(const c of this.zeroReferenceTextureSet)s-c.lastUpdate>a&&(this.releaseCallback(c.id),this.textureMap.delete(c.id),this.zeroReferenceTextureSet.delete(c))},this.options.textureCleanupIntervalMs)}registerTexture(e){var o;const t=(o=e.options)==null?void 0:o.id;if(L(t,"Texture must have an id to be registered"),!this.textureMap.has(t)){const i={id:t,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(t,i),this.zeroReferenceTextureSet.add(i)}}incrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;L(t,"Texture must have an id to be registered");let o=this.textureMap.get(t);o||(this.registerTexture(e),o=this.textureMap.get(t)),L(o,"Texture must have been registered"),e.txType==="SubTexture"&&this.incrementTextureRefCount(e.props.texture),o.nodeRefCount++,o.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(o)&&this.zeroReferenceTextureSet.delete(o)}decrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;L(t,"Texture must have an id to be registered");const o=this.textureMap.get(t);L(o,"Texture must have been registered"),o.nodeRefCount--,o.lastUpdate=Date.now(),o.nodeRefCount===0&&this.zeroReferenceTextureSet.add(o),e.txType==="SubTexture"&&this.decrementTextureRefCount(e.props.texture)}}class Ji extends zo{constructor(e){super(e);h(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,o;L((t=e.options)==null?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,(o=e.options)==null?void 0:o.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}const St={alpha:r=>r===1?null:{prop:"opacity",value:"".concat(r)},x:r=>({prop:"left",value:"".concat(r,"px")}),y:r=>({prop:"top",value:"".concat(r,"px")}),width:r=>r===0?null:{prop:"width",value:"".concat(r,"px")},height:r=>r===0?null:{prop:"height",value:"".concat(r,"px")},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:r=>r===!1?null:{prop:"overflow",value:r?"hidden":"visible"},rotation:r=>r===0?null:{prop:"transform",value:"rotate(".concat(r,"rad)")},scale:r=>r===1?null:{prop:"transform",value:"scale(".concat(r,")")},scaleX:r=>r===1?null:{prop:"transform",value:"scaleX(".concat(r,")")},scaleY:r=>r===1?null:{prop:"transform",value:"scaleY(".concat(r,")")},color:r=>r===0?null:{prop:"color",value:Po(r)}},Po=r=>{const n=(r&255)/255,e=r>>8&255,t=r>>16&255,o=r>>24&255;return"rgba(".concat(o,",").concat(t,",").concat(e,",").concat(n,")")},es={id:"id"};class ts{constructor(n,e){h(this,"root",null);h(this,"canvas",null);h(this,"height",1080);h(this,"width",1920);h(this,"scaleX",1);h(this,"scaleY",1);var i,s,a,c,d,u;if(vo())return;if(!e)throw new Error("settings is required");this.height=Math.ceil((s=e.appHeight)!=null?s:1080/((i=e.deviceLogicalPixelRatio)!=null?i:1)),this.width=Math.ceil((c=e.appWidth)!=null?c:1900/((a=e.deviceLogicalPixelRatio)!=null?a:1)),this.scaleX=(d=e.deviceLogicalPixelRatio)!=null?d:1,this.scaleY=(u=e.deviceLogicalPixelRatio)!=null?u:1,this.canvas=n,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(n,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(n),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}setRootPosition(){if(this.root===null||this.canvas===null)return;const n=this.canvas.getBoundingClientRect(),e=document.documentElement.scrollTop+n.top,t=document.documentElement.scrollLeft+n.left;this.root.id="root",this.root.style.left="".concat(t,"px"),this.root.style.top="".concat(e,"px"),this.root.style.width="".concat(this.width,"px"),this.root.style.height="".concat(this.height,"px"),this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform="scale(".concat(this.scaleX,", ").concat(this.scaleY,")"),this.root.style.overflow="hidden",this.root.style.zIndex="65534"}createDiv(n,e){const t=document.createElement("div");t.style.position="absolute",t.id=n.id.toString();for(const o in e)this.updateNodeProperty(t,o,e[o]);return t}createNode(n,e){const t=n.createNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createTextNode(n,e){const t=n.createTextNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createProxy(n,e){return new Proxy(n,{set:(t,o,i)=>(this.updateNodeProperty(e,o,i),Reflect.set(t,o,i)),get:(t,o,i)=>(o==="destroy"&&this.destroyNode(t),o==="animate"?(s,a)=>{const c=t.animate(s,a);return new Proxy(c,{get:(d,u,g)=>(u==="start"&&this.animateNode(e,n,s,a),Reflect.get(d,u,g))})}:Reflect.get(t,o,i))})}destroyNode(n){const e=document.getElementById(n.id.toString());e==null||e.remove()}updateNodeProperty(n,e,t){var o;if(!(this.root===null||t===void 0||t===null)){if(e==="parent"){const i=t.id;if(i===1){this.root.appendChild(n);return}const s=document.getElementById(i.toString());s==null||s.appendChild(n);return}if(e==="text"){n.innerHTML=String(t),n.style.visibility="hidden";return}if(e==="src"&&t){n.setAttribute("data-src",String(t));return}if(St[e]){const i=(o=St[e])==null?void 0:o.call(St,t);if(i===null)return;if(typeof i=="string"){n.style.setProperty(i,String(t));return}typeof i=="object"&&n.style.setProperty(i.prop,i.value);return}if(es[e]){n.setAttribute(String(St[e]),String(t));return}if(e==="data"){for(const i in t)n.setAttribute("data-".concat(i),String(t[i]));return}}}animateNode(n,e,t,o){const{duration:i=1e3,delay:s=0}=o,{x:a,y:c,width:d,height:u,alpha:g=1,rotation:w=0,scale:A=1,color:p}=t;function y(){setTimeout(()=>{n.style.top="".concat(c,"px"),n.style.left="".concat(a,"px"),n.style.width="".concat(d,"px"),n.style.height="".concat(u,"px"),n.style.opacity="".concat(g),n.style.rotate="".concat(w,"rad"),n.style.scale="".concat(A),n.style.color=Po(p)},i)}setTimeout(y,s)}}const ns="modulepreload",rs=function(r){return"/solid-demo-app/"+r},kr={},os=function(n,e,t){let o=Promise.resolve();if(e&&e.length>0){const i=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.all(e.map(c=>{if(c=rs(c),c in kr)return;kr[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(!!t)for(let A=i.length-1;A>=0;A--){const p=i[A];if(p.href===c&&(!d||p.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(c,'"]').concat(u)))return;const w=document.createElement("link");if(w.rel=d?"stylesheet":ns,d||(w.as="script",w.crossOrigin=""),w.href=c,a&&w.setAttribute("nonce",a),document.head.appendChild(w),d)return new Promise((A,p)=>{w.addEventListener("load",A),w.addEventListener("error",()=>p(new Error("Unable to preload CSS for ".concat(c))))})}))}return o.then(()=>n()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};class ie{constructor(n){h(this,"priority",1);h(this,"name","");h(this,"ref");h(this,"target");h(this,"passParameters","");h(this,"declaredUniforms","");h(this,"uniformInfo",{});const{ref:e,target:t,props:o={}}=n;this.ref=e,this.target=t;const i={},s=[];let a="";const c=this.constructor.uniforms||{};for(const d in c){const u=c[d],g=u.type,w="".concat(e,"_").concat(d);let A="";u.size&&(A="[".concat(u.size(o),"]")),s.push(w),a+="uniform ".concat(g," ").concat(w).concat(A,";"),i[d]={name:w,uniform:c[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static getEffectKey(n){return""}static getMethodParameters(n,e){const t=[];for(const o in n){const i=n[o];let s="";i.size&&(s="[".concat(i.size(e),"]")),t.push("".concat(i.type," ").concat(o).concat(s))}return t.join(",")}static resolveDefaults(n){return{}}static makeEffectKey(n){return!1}}h(ie,"uniforms",{}),h(ie,"methods"),h(ie,"onShaderMask"),h(ie,"onColorize"),h(ie,"onEffectMask");const is={x:(r,n)=>{r.props.x=n},y:(r,n)=>{r.props.y=n},width:(r,n)=>{r.props.width=n},height:(r,n)=>{r.props.height=n},color:(r,n)=>{r.props.color=n},zIndex:(r,n)=>{r.props.zIndex=n},fontFamily:(r,n)=>{r.props.fontFamily=n},fontWeight:(r,n)=>{r.props.fontWeight=n},fontStyle:(r,n)=>{r.props.fontStyle=n},fontStretch:(r,n)=>{r.props.fontStretch=n},fontSize:(r,n)=>{r.props.fontSize=n},text:(r,n)=>{r.props.text=n},textAlign:(r,n)=>{r.props.textAlign=n},contain:(r,n)=>{r.props.contain=n},offsetY:(r,n)=>{r.props.offsetY=n},scrollable:(r,n)=>{r.props.scrollable=n},scrollY:(r,n)=>{r.props.scrollY=n},letterSpacing:(r,n)=>{r.props.letterSpacing=n},lineHeight:(r,n)=>{r.props.lineHeight=n},maxLines:(r,n)=>{r.props.maxLines=n},textBaseline:(r,n)=>{r.props.textBaseline=n},verticalAlign:(r,n)=>{r.props.verticalAlign=n},overflowSuffix:(r,n)=>{r.props.overflowSuffix=n},debug:(r,n)=>{r.props.debug=n}};class Do{constructor(n){h(this,"stage");h(this,"set");this.stage=n;const e={...is,...this.getPropertySetters()};this.set=Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,(i,s)=>{i.props[t]!==s&&(o(i,s),this.stage.requestRender())}])))}setStatus(n,e,t){n.status!==e&&(n.status=e,n.emitter.emit(e,t))}setIsRenderable(n,e){n.isRenderable=e}destroyState(n){["loading","loaded","failed"].forEach(t=>{n.emitter.off(t)})}scheduleUpdateState(n){n.updateScheduled||(n.updateScheduled=!0,queueMicrotask(()=>{n.updateScheduled=!1,this.updateState(n)}))}}class Er extends yi{constructor(e,t,o){super(e,t);h(this,"fontFace");h(this,"fontUrl");const i=o.replace(/\(|\)/g,""),s=this.descriptors,a={style:s.style,weight:typeof s.weight=="number"?"".concat(s.weight):s.weight,stretch:s.stretch,unicodeRange:s.unicodeRange,variant:s.variant,featureSettings:s.featureSettings,display:s.display},c=new FontFace(e,"url(".concat(i,")"),a);c.load().then(()=>{this.loaded=!0,this.emit("loaded")}).catch(console.error),this.fontFace=c,this.fontUrl=o}}const Fr=2048;function Nr(r,n,e,t,o){const i=r!=="bottom"?.5*n:0;return e*(t-1)+i+Math.max(e,n)+(o||0)}class ss{constructor(n,e){h(this,"_canvas");h(this,"_context");h(this,"_settings");h(this,"renderInfo");this._canvas=n,this._context=e,this._settings=this.mergeDefaults({})}set settings(n){this._settings=this.mergeDefaults(n)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){const n=[this._settings.fontFace],e=[];for(let t=0,o=n.length;t{console.warn("[Lightning] Font load error",e,n)}).then(()=>{document.fonts.check(n,this._settings.text)||console.warn("[Lightning] Font not found",n)})}catch(e){console.warn("[Lightning] Can't check font loading for "+n)}}}calculateRenderInfo(){const n={},e=this.getPrecision(),t=this._settings.paddingLeft*e,o=this._settings.paddingRight*e,i=this._settings.fontSize*e;let s=this._settings.offsetY===null?null:this._settings.offsetY*e,a=(this._settings.lineHeight||i)*e;const c=this._settings.w*e,d=this._settings.h*e;let u=this._settings.wordWrapWidth*e;const g=this._settings.cutSx*e,w=this._settings.cutEx*e,A=this._settings.cutSy*e,p=this._settings.cutEy*e,y=(this._settings.letterSpacing||0)*e,S=this._settings.textIndent*e;this.setFontProperties();let b=c||2048/this.getPrecision(),v=b-t;if(v<10&&(b+=10-v,v=10),u||(u=v),this._settings.textOverflow&&!this._settings.wordWrap){let T;switch(this._settings.textOverflow){case"clip":T="";break;case"ellipsis":T=this._settings.overflowSuffix;break;default:T=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,u-S,T)}let x;if(this._settings.wordWrap)x=this.wrapText(this._settings.text,u,y,S);else{x={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const T=x.l.length;for(let _=0;_this._settings.maxLines){const T=m.slice(0,this._settings.maxLines);let _=null;if(this._settings.overflowSuffix){const O=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,D=this.wrapText(T[T.length-1],u-O,y,S);T[T.length-1]="".concat(D.l[0]).concat(this._settings.overflowSuffix),_=[D.l.length>1?D.l[1]:""]}else _=[""];let k;const z=m.length;let F=0;const P=x.n.length;for(k=this._settings.maxLines;k=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(n.cutSx||n.cutSy)&&this._context.translate(-n.cutSx,-n.cutSy);let a,c;const d=[];for(let g=0,w=o.length;ge)for(;a>0&&(c=this._context.measureText(n.substring(0,a)).width+o,c>e);)a-=1;else for(;a=o?t:"")}wrapText(n,e,t,o=0){const i=n.split(/\r?\n/g);let s=[];const a=[];for(let c=0;cg?(A>0&&(d.push(u),u=""),u+=w[A],g=e-p-(A===0?o:0)):(g-=y,u+=" ".concat(w[A]))}d.push(u),u="",s=s.concat(d),ct+this._context.measureText(o).width+e,0):this._context.measureText(n).width}mergeDefaults(n){return{text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0,...n}}}const Lr=typeof self>"u"?globalThis:self;var yo;const Mr=((yo=Lr.document)==null?void 0:yo.fonts)||Lr.fonts;function as(r){const{fontFamily:n,fontStyle:e,fontWeight:t,fontStretch:o,fontSize:i}=r;return[e,t,o,"".concat(i,"px"),n].join(" ")}const ls=gt(0,0,0,0);class cs extends Do{constructor(e){super(e);h(this,"canvas");h(this,"context");h(this,"rendererBounds");typeof OffscreenCanvas<"u"?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");let t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),L(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof Er}addFontFace(e){L(e instanceof Er),Mr.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new ot,canvasPages:void 0,lightning2TextRenderer:new ss(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){var p,y;if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const S=as(e.props);if(e.fontInfo={cssString:S,loaded:!1},!e.fontInfo.loaded){Mr.load(S).then(this.onFontLoaded.bind(this,e,S)).catch(this.onFontLoadError.bind(this,e,S));return}}if(!e.fontInfo.loaded)return;if(!e.renderInfo){const S=e.props.maxLines,b=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,v=b>0&&S>0?Math.min(b,S):Math.max(b,S);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:ke(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:e.props.contain!=="none",wordWrapWidth:e.props.contain==="none"?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:v,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}const{x:t,y:o,width:i,height:s,scrollY:a,contain:c}=e.props,{visibleWindow:d}=e;let{renderWindow:u,canvasPages:g}=e;if(!d.valid){const S=gt(t,o,c!=="none"?t+i:1/0,c==="both"?o+s:1/0,ls);vi(this.rendererBounds,S,d),d.valid=!0}const w=d.y2-d.y1,A=Math.ceil(w/e.renderInfo.lineHeight);if(w===0){g=void 0,u=void 0,this.setStatus(e,"loaded");return}else if(u&&g){const S=t+u.x1,b=o-a+u.y1,v=t+u.x2,x=o-a+u.y2;if(S<=d.x1&&v>=d.x2&&b<=d.y1&&x>=d.y2){this.setStatus(e,"loaded");return}xd.y1&&(u.y1-=A*e.renderInfo.lineHeight,u.y2-=A*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-A,g[0].lineNumEnd=g[0].lineNumStart+A,g[0].valid=!1)}else{const S=e.renderInfo.lineHeight*A,b=Math.ceil(a/S),v=b*A,x=v-A,m=v+A;g=[{texture:g==null?void 0:g[0].texture,lineNumStart:x,lineNumEnd:x+A,valid:!1},{texture:g==null?void 0:g[1].texture,lineNumStart:v,lineNumEnd:v+A,valid:!1},{texture:g==null?void 0:g[2].texture,lineNumStart:m,lineNumEnd:m+A,valid:!1}],e.canvasPages=g;const C=b*S;u={x1:0,y1:C-S,x2:i,y2:C+S*2}}e.renderWindow=u,performance.now();for(const S of g)if(!S.valid){if(S.lineNumStart<0){(p=S.texture)==null||p.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),S.texture.setRenderableOwner(e,e.isRenderable),S.valid=!0;continue}e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(S.lineNumStart,S.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(S.lineNumStart,S.lineNumEnd)}),this.canvas.width===0||this.canvas.height===0||((y=S.texture)==null||y.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),S.texture.setRenderableOwner(e,e.isRenderable)),S.valid=!0}this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var T,_,k,z,F,P,O,D,Y,j,se,ne;const{stage:s}=this,{canvasPages:a,textW:c=0,textH:d=0,renderWindow:u}=e;if(!a||!u)return;const{x:g,y:w,scrollY:A,contain:p,width:y,height:S}=e.props,b={x:g,y:w,width:p!=="none"?y:c,height:p==="both"?S:d};nr({x:0,y:0,width:s.options.appWidth,height:s.options.appHeight},b),L(a,"canvasPages is not defined"),L(u,"renderWindow is not defined");const x=(u.y2-u.y1)/3,{zIndex:m,color:C}=e.props,I=i*wi(C),R=_t(4294967295,I);a[0].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((_=(T=a[0].texture)==null?void 0:T.dimensions)==null?void 0:_.width)||0,height:((z=(k=a[0].texture)==null?void 0:k.dimensions)==null?void 0:z.height)||0,texture:a[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-A+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[1].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((P=(F=a[1].texture)==null?void 0:F.dimensions)==null?void 0:P.width)||0,height:((D=(O=a[1].texture)==null?void 0:O.dimensions)==null?void 0:D.height)||0,texture:a[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-A+u.y1+x,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[2].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((j=(Y=a[2].texture)==null?void 0:Y.dimensions)==null?void 0:j.width)||0,height:((ne=(se=a[2].texture)==null?void 0:se.dimensions)==null?void 0:ne.height)||0,texture:a[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:m,tx:t.tx,ty:t.ty-A+u.y1+x+x,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.canvasPages)==null||o.forEach(i=>{var s;(s=i.texture)==null||s.setRenderableOwner(e,t)})}destroyState(e){var t;(t=e.canvasPages)==null||t.forEach(o=>{var i;(i=o.texture)==null||i.setRenderableOwner(e,!1)})}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var o;t!==((o=e.fontInfo)==null?void 0:o.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,o){var i;t!==((i=e.fontInfo)==null?void 0:i.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,console.error("CanvasTextRenderer: Error loading font '".concat(e.fontInfo.cssString,"'"),o),this.scheduleUpdateState(e))}}class Oo extends Pt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}}h(Oo,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class Wo extends Pt{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]});h(this,"supportsIndexedTextures",!0)}bindTextures(e){const{renderer:t,glw:o}=this;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error("DefaultShaderBatched: Cannot bind more than ".concat(t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS," textures"));e.forEach((s,a)=>{o.activeTexture(a),o.bindTexture(s.ctxTexture)});const i=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",i)}}h(Wo,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>"\n #define txUnits ".concat(e,"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[").concat(e,"], int idx, vec2 uv) {\n ").concat(Array.from(Array(e).keys()).map(t=>"\n ".concat(t!==0?"else ":"","if (idx == ").concat(t,") {\n return texture2D(textures[").concat(t,"], uv);\n }\n ")).join(""),"\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n ")});const Ln=new Map,ds=(r,n)=>{const e=JSON.stringify(r);if(Ln.has(e))return Ln.get(e);const t=(r!=null?r:[]).map(o=>({type:o.type,props:n[o.type].resolveDefaults(o.props||{})}));return Ln.set(e,t),t},Ne=class Ne extends Pt{constructor(e,t,o){const i=Ne.createShader(t,o);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...i.uniforms],shaderSources:{vertex:i.vertex,fragment:i.fragment}});h(this,"effects",[]);this.effects=i.effects,this.calculateProps=wo(this.calculateProps.bind(this))}bindTextures(e){const{glw:t}=this;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){const t=this.renderer.shManager.getRegisteredEffects(),o=[];return e==null||e.forEach((i,s)=>{var g;const a=this.effects[s],c=t[a.name],d=(g=i.props)!=null?g:{},u=a.uniformInfo;Object.keys(d).forEach(w=>{const A=c.uniforms[w],p=u[w];let y=A.validator?A.validator(d[w],d):d[w];Array.isArray(y)&&(y=new Float32Array(y)),o.push({name:p.name,value:y})})}),o}bindProps(e){this.calculateProps(e.effects).forEach(o=>{this.setUniform(o.name,o.value)})}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;const o=e.effects.length;let i=0;for(;i{const y=t[p.type],S=y.getEffectKey(p.props||{});o[S]=o[S]?++o[S]:1;const b=o[S];b===1&&c.push({key:S,type:p.type,props:p.props});const v=new y({ref:"".concat(S).concat(b===1?"":b),target:S,props:p.props});return s+=v.declaredUniforms,a.push(...Object.values(v.uniformInfo)),v});let u="";c==null||c.forEach(p=>{var R;const y=t[p.type],S=y.resolveDefaults((R=p.props)!=null?R:{}),b=[];for(const T in y.methods){let _=T;const k=y.methods[T];i[T]&&i[T]!==k&&(_=Ne.resolveMethodDuplicate(T,k,i)),i[_]=k.replace("function",_),b.push({m:T,cm:_})}let v=y.onShaderMask instanceof Function?y.onShaderMask(S):y.onShaderMask,x=y.onColorize instanceof Function?y.onColorize(S):y.onColorize,m=y.onEffectMask instanceof Function?y.onEffectMask(S):y.onEffectMask;b.forEach(T=>{const{m:_,cm:k}=T,z=new RegExp("\\$".concat(_),"g");v&&(v=v.replace(z,k)),x&&(x=x.replace(z,k)),m&&(m=m.replace(z,k))});const C=y.getMethodParameters(y.uniforms,S),I=C.length>0?", ".concat(C):"";v&&(u+="\n float fx_".concat(p.key,"_onShaderMask(float shaderMask ").concat(I,") {\n ").concat(v,"\n }\n ")),x&&(u+="\n vec4 fx_".concat(p.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(I,") {\n ").concat(x,"\n }\n ")),m&&(u+="\n vec4 fx_".concat(p.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(I,") {\n ").concat(m,"\n }\n "))});let g="";for(const p in i)g+=i[p];let w="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",A="\n\n ";for(let p=0;p0?", ".concat(y.passParameters):"",b=t[y.name];b.onShaderMask&&(A+="\n shaderMask = fx_".concat(y.target,"_onShaderMask(shaderMask ").concat(S,");\n ")),b.onColorize&&(A+="\n maskColor = fx_".concat(y.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(S,");\n ")),b.onEffectMask&&(w="fx_".concat(y.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(S,")"));const v=d[p+1];(v===void 0||t[v.name].onEffectMask)&&(A+="\n shaderColor = ".concat(w,";\n "))}return{effects:d,uniforms:a,fragment:Ne.fragment(s,g,u,A),vertex:Ne.vertex()}}static resolveMethodDuplicate(e,t,o,i=0){const s=e+(i>0?i:"");return o[s]&&o[s]!==t?this.resolveMethodDuplicate(e,t,o,++i):s}static resolveDefaults(e,t){return{effects:ds(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var i;let o="";return(i=e.effects)==null||i.forEach(s=>{const c=t[s.type].getEffectKey(s.props||{});o+=",".concat(c)}),"DynamicShader".concat(o)}};h(Ne,"z$__type__Props"),h(Ne,"vertex",()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n "),h(Ne,"fragment",(e,t,o,i)=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ".concat(e,"\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ").concat(t,"\n\n ").concat(o,"\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ").concat(i,"\n\n gl_FragColor = shaderColor * u_alpha;\n }\n "));let pt=Ne;class Un extends Pt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(n){return{radius:n.radius||10,$dimensions:{width:0,height:0}}}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}bindProps(n){this.setUniform("u_radius",n.radius)}canBatchShaderProps(n,e){return n.radius===e.radius&&n.$dimensions.width===e.$dimensions.width&&n.$dimensions.height===e.$dimensions.height}}h(Un,"z$__type__Props"),h(Un,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});const us=new Float32Array([1,0,0,0,1,0,0,0,1]),bn=class bn extends Pt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}bindProps(n){const e=bn.resolveDefaults(n);for(const t in e)if(t==="transform")this.setUniform("u_transform",!1,e[t]);else if(t==="scrollY")this.setUniform("u_scrollY",e[t]);else if(t==="color"){const o=ke(e.color);this.setUniform("u_color",o)}else t==="size"?this.setUniform("u_size",e[t]):t==="distanceRange"?this.setUniform("u_distanceRange",e[t]):t==="debug"&&this.setUniform("u_debug",e[t]?1:0)}static resolveDefaults(n={}){var e,t,o,i,s,a;return{transform:(e=n.transform)!=null?e:us,scrollY:(t=n.scrollY)!=null?t:0,color:(o=n.color)!=null?o:4294967295,size:(i=n.size)!=null?i:16,distanceRange:(s=n.distanceRange)!=null?s:1,debug:(a=n.debug)!=null?a:!1}}};h(bn,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});let Yn=bn;class at extends ie{constructor(){super(...arguments);h(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:(t=e.radius)!=null?t:10}}}h(at,"z$__type__Props"),h(at,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(at,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),h(at,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),h(at,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Rt extends ie{constructor(){super(...arguments);h(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(Rt,"z$__type__Props"),h(Rt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(Rt,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),h(Rt,"onColorize","\n return color;\n ");const $e=class $e extends ie{constructor(){super(...arguments);h(this,"name","linearGradient")}static getEffectKey(e){return"linearGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const a=t.length;let c=0;const d=o;for(;ce.map(o=>ke(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),h($e,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),h($e,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ".concat($e.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let $n=$e;class Hn extends ie{constructor(){super(...arguments);h(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:(t=e.amount)!=null?t:1}}}h(Hn,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),h(Hn,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class lt extends ie{constructor(){super(...arguments);h(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(lt,"z$__type__Props"),h(lt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(lt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(lt,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(lt,"onColorize","\n return color;\n ");class ct extends ie{constructor(){super(...arguments);h(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(ct,"z$__type__Props"),h(ct,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(ct,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(ct,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(ct,"onColorize","\n return color;\n ");class dt extends ie{constructor(){super(...arguments);h(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(dt,"z$__type__Props"),h(dt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(dt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(dt,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(dt,"onColorize","\n return color;\n ");class ut extends ie{constructor(){super(...arguments);h(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(ut,"z$__type__Props"),h(ut,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(ut,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(ut,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(ut,"onColorize","\n return color;\n ");class It extends ie{constructor(){super(...arguments);h(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,o,i,s,a;return{amplitude:(t=e.amplitude)!=null?t:.2,narrowness:(o=e.narrowness)!=null?o:4,blockiness:(i=e.blockiness)!=null?i:2,minimizer:(s=e.minimizer)!=null?s:8,time:(a=e.time)!=null?a:Date.now()}}}h(It,"z$__type__Props"),h(It,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),h(It,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),h(It,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class an extends ie{constructor(){super(...arguments);h(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:(t=e.fade)!=null?t:10}}}h(an,"z$__type__Props"),h(an,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(an,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");const Je=class Je extends ie{constructor(){super(...arguments);h(this,"name","radialGradient")}static getEffectKey(e){return"radialGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s,a,c,d;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const u=t.length;let g=0;const w=o;for(;ge.map(o=>ke(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),h(Je,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ".concat(Je.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let jn=Je;class ht extends ie{constructor(){super(...arguments);h(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,o,i,s,a,c,d;return{width:(t=e.width)!=null?t:10,progress:(o=e.progress)!=null?o:.5,offset:(i=e.offset)!=null?i:0,range:(s=e.range)!=null?s:Math.PI*2,rounded:(a=e.rounded)!=null?a:!1,radius:(c=e.radius)!=null?c:1,color:(d=e.color)!=null?d:4294967295}}}h(ht,"z$__type__Props"),h(ht,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(ht,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),h(ht,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),h(ht,"onColorize","\n return color;\n ");class ft extends ie{constructor(){super(...arguments);h(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:(t=e.radius)!=null?t:0}}}h(ft,"z$__type__Props"),h(ft,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(ft,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),h(ft,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),h(ft,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class hs{constructor(){h(this,"shCache",new Map);h(this,"shConstructors",{});h(this,"attachedShader",null);h(this,"effectConstructors",{});h(this,"renderer");this.registerShaderType("DefaultShader",Oo),this.registerShaderType("DefaultShaderBatched",Wo),this.registerShaderType("RoundedRectangle",Un),this.registerShaderType("DynamicShader",pt),this.registerShaderType("SdfShader",Yn),this.registerEffectType("border",Rt),this.registerEffectType("borderBottom",dt),this.registerEffectType("borderLeft",ut),this.registerEffectType("borderRight",lt),this.registerEffectType("borderTop",ct),this.registerEffectType("fadeOut",an),this.registerEffectType("linearGradient",$n),this.registerEffectType("radialGradient",jn),this.registerEffectType("grayscale",Hn),this.registerEffectType("glitch",It),this.registerEffectType("radius",at),this.registerEffectType("radialProgress",ht),this.registerEffectType("holePunch",ft)}registerShaderType(n,e){this.shConstructors[n]=e}registerEffectType(n,e){this.effectConstructors[n]=e}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(n,e){if(!this.renderer)throw new Error("Renderer is not been defined");const t=this.shConstructors[n];if(!t)throw new Error('Shader type "'.concat(n,'" is not registered'));if(n==="DynamicShader")return this.loadDynamicShader(e);const o=t.resolveDefaults(e),i=t.makeCacheKey(o)||t.name;if(i&&this.shCache.has(i))return{shader:this.shCache.get(i),props:o};const s=new t(this.renderer,e);return i&&this.shCache.set(i,s),{shader:s,props:o}}loadDynamicShader(n){if(!this.renderer)throw new Error("Renderer is not been defined");const e=pt.resolveDefaults(n,this.effectConstructors),t=pt.makeCacheKey(e,this.effectConstructors);if(t&&this.shCache.has(t))return{shader:this.shCache.get(t),props:e};const o=new pt(this.renderer,n,this.effectConstructors);return t&&this.shCache.set(t,o),{shader:o,props:e}}useShader(n){this.attachedShader!==n&&(this.attachedShader&&this.attachedShader.detach(),n.attach(),this.attachedShader=n)}}class fs{constructor(){h(this,"data",{})}reset(){this.data={}}increment(n){this.data[n]||(this.data[n]=0),this.data[n]++}getData(){return{...this.data}}}function gs(r){return/\.(ktx|pvr)$/.test(r)}const ps=async r=>{const e=await(await fetch(r)).arrayBuffer();return r.indexOf(".ktx")!==-1?ms(e):xs(e)},ms=async r=>{const n=new DataView(r),e=n.getUint32(12)===16909060,t=[],o={glInternalFormat:n.getUint32(28,e),pixelWidth:n.getUint32(36,e),pixelHeight:n.getUint32(40,e),numberOfMipmapLevels:n.getUint32(56,e),bytesOfKeyValueData:n.getUint32(60,e)};let i=64;i+=o.bytesOfKeyValueData;for(let s=0;s{const a=r,c=new Int32Array(a,0,13),d=c[12]+52,u=new Uint8Array(a,d),g=[],w={pixelWidth:c[7],pixelHeight:c[6],numberOfMipmapLevels:c[11]||0};let A=0,p=w.pixelWidth||0,y=w.pixelHeight||0;for(let S=0;S>2)*(y+3>>2)*8,v=new Uint8Array(a,u.byteOffset+A,b);g.push(v),A+=b,p=p>>1,y=y>>1}return{data:{glInternalFormat:36196,mipmaps:g,width:w.pixelWidth||0,height:w.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},Lt=class Lt extends bo{constructor(e,t){super(e);h(this,"props");this.props=Lt.resolveDefaults(t)}hasAlphaChannel(e){return e.indexOf("image/png")!==-1}async getTextureData(){const{src:e,premultiplyAlpha:t}=this.props;if(!e)return{data:null};if(e instanceof ImageData)return{data:e,premultiplyAlpha:t};if(gs(e))return ps(e);if(this.txManager.imageWorkerManager)return await this.txManager.imageWorkerManager.getImage(e,t);if(this.txManager.hasCreateImageBitmap){const i=await(await fetch(e)).blob(),s=t!=null?t:this.hasAlphaChannel(i.type);return{data:await createImageBitmap(i,{premultiplyAlpha:s?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"}),premultiplyAlpha:s}}else{const o=new Image;return e.substr(0,5)!="data:"&&(o.crossOrigin="Anonymous"),o.src=e,await new Promise((i,s)=>{o.onload=()=>i(),o.onerror=()=>s(new Error("Failed to load image"))}).catch(i=>{console.error(i)}),{data:o,premultiplyAlpha:t!=null?t:!0}}}static makeCacheKey(e){const t=Lt.resolveDefaults(e);return t.src instanceof ImageData?!1:"ImageTexture,".concat(t.src,",").concat(t.premultiplyAlpha)}static resolveDefaults(e){var t,o;return{src:(t=e.src)!=null?t:"",premultiplyAlpha:(o=e.premultiplyAlpha)!=null?o:!0}}};h(Lt,"z$__type__Props");let Qn=Lt;const ys=24;function vs(r,n,e,t,o,i,s,a,c){const d=Math.min(Math.max(s.firstLineIdx,0),a.length),u=0;let g=0;t==="middle"?g=(n-r)/2:t==="bottom"&&(g=n-r);const A=o/i+d*n+g;if(!(c&&A>=c/i))return{sdfX:u,sdfY:A,lineIndex:d}}class Bt{constructor(n,e=0){h(this,"iterator");h(this,"peekBuffer",[]);h(this,"_lastIndex");this.iterator=n,this.iterator=n,this._lastIndex=e-1,this.peekBuffer=[]}next(){const n=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return n.done?this._lastIndex=-1:this._lastIndex++,n}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];const n=this.iterator.next();return this.peekBuffer.push(n),n}get lastIndex(){return this._lastIndex}}function*kt(r,n=0){let e=n;for(;e=A.y1,Oe=O<=A.y2,xe=De&&Oe;for(;(de=ne.next())&&!de.done;){const K=de.value;if(r===w.length)w.push({codepointIndex:K.cluster,maxY:F,maxX:z});else if(r>w.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?Y.codepointIndex!==-1&&(Y.codepointIndex=-1,re=P):Y.codepointIndex===-1&&(Y.codepointIndex=K.cluster,Y.bufferOffset=D,Y.xStart=re),K.mapped){const Yt=P+K.xOffset+K.width;if(g!=="none"&&Yt>=me&&Y.codepointIndex!==-1&&Y.xStart>0)if(Se){ne=j.shapeText(se,new Bt(kt(t,Y.codepointIndex),Y.codepointIndex)),D=Y.bufferOffset;break}else ne=j.shapeText(se,new Bt(kt(b,0),0)),P=Y.xStart,D=Y.bufferOffset,g="none";else{const We=P+K.xOffset,Ue=O+K.yOffset;if(xe){Ce===-1&&(Ce=D);const Ve=p.getAtlasEntry(K.glyphId),Ge=Ve.x/p.data.common.scaleW,qe=Ve.y/p.data.common.scaleH,wt=Ve.width/p.data.common.scaleW,bt=Ve.height/p.data.common.scaleH;u[D++]=We,u[D++]=Ue,u[D++]=Ge,u[D++]=qe,u[D++]=We+K.width,u[D++]=Ue,u[D++]=Ge+wt,u[D++]=qe,u[D++]=We,u[D++]=Ue+K.height,u[D++]=Ge,u[D++]=qe+bt,u[D++]=We+K.width,u[D++]=Ue+K.height,u[D++]=Ge+wt,u[D++]=qe+bt}F=Math.max(F,Ue+K.height),z=Math.max(z,We+K.width),P+=K.xAdvance}}else if(K.codepoint===10){if(Se)break;ne=j.shapeText(se,new Bt(kt(b,0),0)),g="none"}}Ce!==-1&&(Pe.push({bufferStart:Ce,bufferEnd:D}),Ce=-1),P=0,O+=m,r++,Y.codepointIndex=-1,re=0,!y&&g==="both"&&O>A.y2||de&&de.done?Ke=!1:Se||(Ke=!1)}if(o==="center"){const Se=g==="none"?z:C;for(let me=0;metypeof r=="number"?r:Ts[r]||400;function _s(r,n,e,t,o){let i=zr(e);for(const s of r){const a=s[n];if(!a)continue;if(a.size===1)return console.warn("TrFontManager: Only one font face found for family: '".concat(n,"' - will be used for all weights and styles")),a.values().next().value;const c=new Map;for(const u of a){const g=zr(u.descriptors.weight);if(g===i&&u.descriptors.style===t&&u.descriptors.stretch===o)return u;c.set(g,u)}const d="TrFontManager: No exact match: '".concat(n," Weight: ").concat(i," Style: ").concat(t," Stretch: ").concat(o,"'");if(console.error(d),i===400&&c.has(500))return c.get(500);if(i===500&&c.has(400))return c.get(400);if(i<400){for(;i>0;){if(c.has(i))return c.get(i);i-=100}i=600}for(;i<1e3;){if(c.has(i))return c.get(i);i+=100}for(i=500;i>0;){if(c.has(i))return c.get(i);i-=100}}}const Rs=wo(_s);class Uo{constructor(n){h(this,"textRenderers");this.textRenderers=n}addFontFace(n){for(const e in this.textRenderers){const t=this.textRenderers[e];t&&t.isFontFaceSupported(n)&&t.addFontFace(n)}}static resolveFontFace(n,e){const{fontFamily:t,fontWeight:o,fontStyle:i,fontStretch:s}=e;return Rs(n,t,o,i,s)}}const Is={x:0,y:0,width:0,height:0};class Bs extends Do{constructor(e){super(e);h(this,"ssdfFontFamilies",{});h(this,"msdfFontFamilies",{});h(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]);h(this,"sdfShader");h(this,"rendererBounds");this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&kn(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&kn(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){const{fontFamily:t}=e;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||t==="$$SDF_FAILURE_TEST$$"}isFontFaceSupported(e){return e instanceof _r}addFontFace(e){L(e instanceof _r);const t=e.fontFamily,o=e.type==="ssdf"?this.ssdfFontFamilies:e.type==="msdf"?this.msdfFontFamilies:void 0;if(!o){console.warn("Invalid font face type: ".concat(e.type));return}let i=o[t];i||(i=new Set,o[t]=i),i.add(e)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new ot,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){let{trFontFace:t}=e;const{textH:o,lineCache:i,debugData:s,forceFullLayoutCalc:a}=e;if(s.updateCount++,e.status==="initialState"&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){const j="SdfTextRenderer: Could not resolve font face for family: '".concat(e.props.fontFamily,"'");console.error(j),this.setStatus(e,"failed",new Error(j));return}t.texture.setRenderableOwner(e,e.isRenderable)}if(!t.loaded){t.once("loaded",()=>{this.scheduleUpdateState(e)});return}L(t.data,"Font face data should be loaded");const{text:c,fontSize:d,x:u,y:g,contain:w,width:A,height:p,lineHeight:y,verticalAlign:S,scrollable:b,overflowSuffix:v,maxLines:x}=e.props,m=w==="both"&&b?e.props.scrollY:0,{renderWindow:C}=e,I=t.data.info.size,R=d/I,T=y/R;e.distanceRange=R*t.data.distanceField.distanceRange;const _=c.length*ys;let k=e.vertexBuffer;(!k||k.length<_)&&(k=new Float32Array(_*2));const z=e.elementBounds;if(z.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),z.valid=!0),!a&&C.valid){const j=C.screen;if(u+j.x1<=z.x1&&u+j.x2>=z.x2&&g-m+j.y1<=z.y1&&g-m+j.y2>=z.y2){this.setStatus(e,"loaded");return}C.valid=!1,this.setStatus(e,"loading")}const{offsetY:F,textAlign:P}=e.props;if(!C.valid){if(!kn(z,this.rendererBounds))return;Cs(C,u,g,m,y,w==="both"?z.y2-z.y1:0,z,R)}const O=vs(I,T,y,S,F,R,C,i,o);if(!O){this.setStatus(e,"loaded");return}const{letterSpacing:D}=e.props,Y=bs(O.lineIndex,O.sdfX,O.sdfY,c,P,A,p,d,y,D,k,w,i,C.sdf,t,a,b,v,x);e.bufferUploaded=!1,e.bufferNumFloats=Y.bufferNumFloats,e.bufferNumQuads=Y.bufferNumQuads,e.vertexBuffer=k,e.renderWindow=C,s.lastLayoutNumCharacters=Y.layoutNumCharacters,s.bufferSize=k.byteLength,Y.fullyProcessed&&(e.textW=Y.maxX*R,e.textH=Y.maxY*R),this.setStatus(e,"loaded")}renderQuads(e,t,o,i,s,a){var z,F,P;if(!e.vertexBuffer)return;const{renderer:c}=this.stage,{fontSize:d,color:u,contain:g,scrollable:w,zIndex:A,debug:p}=e.props,y=g==="both"&&w?e.props.scrollY:0,{textW:S=0,textH:b=0,distanceRange:v,vertexBuffer:x,bufferUploaded:m,trFontFace:C,elementBounds:I}=e;let{webGlBuffers:R}=e;if(!R){const O=c.glw,D=4*Float32Array.BYTES_PER_ELEMENT,Y=O.createBuffer();L(Y),e.webGlBuffers=new Si([{buffer:Y,attributes:{a_position:{name:"a_position",size:2,type:O.FLOAT,normalized:!1,stride:D,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:O.FLOAT,normalized:!1,stride:D,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,L(e.webGlBuffers),R=e.webGlBuffers}if(!m){const O=c.glw,D=(z=R==null?void 0:R.getBuffer("a_textureCoordinate"))!=null?z:null;O.arrayBufferData(D,x,O.STATIC_DRAW),e.bufferUploaded=!0}if(L(C),w&&g==="both"){L(I.valid);const O=Ai(I,Is);o.valid?(e.clippingRect.valid=!0,o=nr(o,O,e.clippingRect)):(e.clippingRect.valid=!0,o=So(O,e.clippingRect))}const T=new Ci(c.glw,c.options,R,this.sdfShader,{transform:t.data,color:Ti(u,i),size:d/(((F=C.data)==null?void 0:F.info.size)||0),scrollY:y,distanceRange:v,debug:p.sdfShaderDebug},i,o,{height:b,width:S},0,A,!1,s,a),_=(P=e.trFontFace)==null?void 0:P.texture;L(_);const k=this.stage.txManager.getCtxTexture(_);T.addTexture(k),T.length=e.bufferNumFloats,T.numQuads=e.bufferNumQuads,c.addRenderOp(T)}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.trFontFace)==null||o.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),(t=e.trFontFace)==null||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return Uo.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){const{x:t,contain:o,width:i}=e.props,{elementBounds:s}=e;s.x1=t,s.x2=o!=="none"?t+i:1/0}setElementBoundsY(e){const{y:t,contain:o,height:i}=e.props,{elementBounds:s}=e;s.y1=t,s.y2=o==="both"?t+i:1/0}}function ks(r){return r.prototype instanceof _i}async function Es(r,n){let e;try{console.log("Loading core extension",r),e=await os(()=>import(r),[])}catch(o){console.error("The core extension module at '".concat(r,"' could not be loaded.")),console.error(o);return}if(!e.default){console.error("The core extension module at '".concat(r,"' does not have a default export."));return}const t=e.default;if(ks(t)){const o=new t;try{await o.run(n)}catch(i){console.error("The core extension at '".concat(r,"' threw an error.")),console.error(i)}}else console.error("The core extension at '".concat(r,"' does not extend CoreExtension."))}function Yo(r){const n={boolean:!0,string:!0,number:!0},e=Object.keys(r);for(let t=0;t2048&&(console.warn("Custom Data value for ".concat(o," is too long, it will be truncated to 2048 characters")),r[o]=i.substring(0,2048)),n[s]||(console.warn("Custom Data value for ".concat(o," is not a boolean, string, or number, it will be ignored")),delete r[o])}return r}class Fs extends ot{constructor(e,t,o){var b,v,x,m;super();h(this,"root",null);h(this,"driver");h(this,"canvas");h(this,"settings");h(this,"inspector",null);h(this,"nodes",new Map);h(this,"nextTextureId",1);h(this,"textureTracker");const i={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:(b=e.clearColor)!=null?b:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:(v=e.experimental_FinalizationRegistryTextureUsageTracker)!=null?v:!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:(x=e.enableContextSpy)!=null?x:!1,enableInspector:(m=e.enableInspector)!=null?m:!1};this.settings=i;const{appWidth:s,appHeight:a,deviceLogicalPixelRatio:c,devicePhysicalPixelRatio:d,enableInspector:u}=i,g=C=>{this.driver.releaseTexture(C)},w=i.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=w?new Ji(g):new Zi(g,this.settings.textureCleanupOptions);const A=s*c,p=a*c;this.driver=o;const y=document.createElement("canvas");this.canvas=y,y.width=A*d,y.height=p*d,y.style.width="".concat(A,"px"),y.style.height="".concat(p,"px");let S;if(typeof t=="string"?S=document.getElementById(t):S=t,!S)throw new Error("Could not find target element");o.onCreateNode=C=>{this.nodes.set(C.id,C)},o.onBeforeDestroyNode=C=>{this.nodes.delete(C.id)},o.onFpsUpdate=C=>{this.emit("fpsUpdate",C)},o.onFrameTick=C=>{this.emit("frameTick",C)},o.onIdle=()=>{this.emit("idle")},S.appendChild(y),u&&!vo()&&(this.inspector=new ts(y,i))}async init(){await this.driver.init(this,this.settings,this.canvas),this.root=this.driver.getRootNode()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var i,s,a,c,d,u,g,w,A,p,y,S,b,v,x,m,C,I,R;const t=(i=e.fontSize)!=null?i:16,o={...this.resolveNodeDefaults(e),text:(s=e.text)!=null?s:"",textRendererOverride:(a=e.textRendererOverride)!=null?a:null,fontSize:t,fontFamily:(c=e.fontFamily)!=null?c:"sans-serif",fontStyle:(d=e.fontStyle)!=null?d:"normal",fontWeight:(u=e.fontWeight)!=null?u:"normal",fontStretch:(g=e.fontStretch)!=null?g:"normal",textAlign:(w=e.textAlign)!=null?w:"left",contain:(A=e.contain)!=null?A:"none",scrollable:(p=e.scrollable)!=null?p:!1,scrollY:(y=e.scrollY)!=null?y:0,offsetY:(S=e.offsetY)!=null?S:0,letterSpacing:(b=e.letterSpacing)!=null?b:0,lineHeight:(v=e.lineHeight)!=null?v:t,maxLines:(x=e.maxLines)!=null?x:0,textBaseline:(m=e.textBaseline)!=null?m:"alphabetic",verticalAlign:(C=e.verticalAlign)!=null?C:"top",overflowSuffix:(I=e.overflowSuffix)!=null?I:"...",debug:(R=e.debug)!=null?R:{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(e){var u,g,w,A,p,y,S,b,v,x,m,C,I,R,T,_,k,z,F,P,O,D,Y,j,se,ne,de,Ce,Pe,Wt,Ut,Ke,Se,me,re,De,Oe,xe,K,Yt,We,Ue,Ve,Ge,qe,wt,bt,br,Sr,Ar,Cr,Tr;const t=(u=e.color)!=null?u:4294967295,o=(A=(w=(g=e.colorTl)!=null?g:e.colorTop)!=null?w:e.colorLeft)!=null?A:t,i=(S=(y=(p=e.colorTr)!=null?p:e.colorTop)!=null?y:e.colorRight)!=null?S:t,s=(x=(v=(b=e.colorBl)!=null?b:e.colorBottom)!=null?v:e.colorLeft)!=null?x:t,a=(I=(C=(m=e.colorBr)!=null?m:e.colorBottom)!=null?C:e.colorRight)!=null?I:t,c=Yo((R=e.data)!=null?R:{}),d=(z=(k=(T=e.parent)==null?void 0:T.rtt)!=null?k:(_=e.parent)==null?void 0:_.parentHasRenderTexture)!=null?z:!1;return{x:(F=e.x)!=null?F:0,y:(P=e.y)!=null?P:0,width:(O=e.width)!=null?O:0,height:(D=e.height)!=null?D:0,alpha:(Y=e.alpha)!=null?Y:1,autosize:(j=e.autosize)!=null?j:!1,clipping:(se=e.clipping)!=null?se:!1,color:t,colorTop:(ne=e.colorTop)!=null?ne:t,colorBottom:(de=e.colorBottom)!=null?de:t,colorLeft:(Ce=e.colorLeft)!=null?Ce:t,colorRight:(Pe=e.colorRight)!=null?Pe:t,colorBl:s,colorBr:a,colorTl:o,colorTr:i,zIndex:(Wt=e.zIndex)!=null?Wt:0,zIndexLocked:(Ut=e.zIndexLocked)!=null?Ut:0,parent:(Ke=e.parent)!=null?Ke:null,texture:(Se=e.texture)!=null?Se:null,shader:(me=e.shader)!=null?me:null,src:(re=e.src)!=null?re:"",scale:(De=e.scale)!=null?De:null,scaleX:(xe=(Oe=e.scaleX)!=null?Oe:e.scale)!=null?xe:1,scaleY:(Yt=(K=e.scaleY)!=null?K:e.scale)!=null?Yt:1,mount:(We=e.mount)!=null?We:0,mountX:(Ve=(Ue=e.mountX)!=null?Ue:e.mount)!=null?Ve:0,mountY:(qe=(Ge=e.mountY)!=null?Ge:e.mount)!=null?qe:0,pivot:(wt=e.pivot)!=null?wt:.5,pivotX:(br=(bt=e.pivotX)!=null?bt:e.pivot)!=null?br:.5,pivotY:(Ar=(Sr=e.pivotY)!=null?Sr:e.pivot)!=null?Ar:.5,rotation:(Cr=e.rotation)!=null?Cr:0,rtt:(Tr=e.rtt)!=null?Tr:!1,parentHasRenderTexture:d,data:c}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,o){const i=this.nextTextureId++,s={descType:"texture",txType:e,props:t,options:{...o,id:i}};return this.textureTracker.registerTexture(s),s}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class Ns extends ot{constructor(e,t,o){super();h(this,"node");h(this,"props");h(this,"settings");h(this,"propStartValues",{});h(this,"restoreValues",{});h(this,"progress",0);h(this,"delayFor",0);h(this,"timingFunction");h(this,"propsList");this.node=e,this.props=t,this.settings=o,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach(i=>{this.propStartValues[i]=e[i]}),this.timingFunction=i=>i,o.easing&&typeof o.easing=="string"&&(this.timingFunction=Ri(o.easing)),this.delayFor=o.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach(e=>{this.node[e]=this.propStartValues[e]})}reverse(){this.progress=0,Object.keys(this.props).forEach(e=>{const t=this.props[e],o=this.propStartValues[e];this.props[e]=o,this.propStartValues[e]=t}),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,o){return(this.timingFunction(e)||e)*(o-t)+t}update(e){const{duration:t,loop:o,easing:i,stopMethod:s}=this.settings;if(!t){this.emit("finished",{});return}if(this.delayFor>0){this.delayFor-=e;return}if(this.delayFor<=0&&this.progress===0&&this.emit("start",{}),this.progress+=e/t,this.progress>1&&(this.progress=o?0:1,s)){this.emit("finished",{});return}for(let a=0;a{this.startedResolve=n}))}makeStoppedPromise(){this.stoppedResolve===null&&(this.stoppedPromise=new Promise(n=>{this.stoppedResolve=n}))}started(){L(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){L(this.stoppedResolve);const{loop:n,stopMethod:e}=this.animation.settings;if(e==="reverse"){this.animation.reverse(),this.start();return}this.stoppedResolve(),this.stoppedResolve=null,!n&&this.manager.unregisterAnimation(this.animation)}}const Z=0,J=3,ce=6,V=1,ee=4,ue=7,ye=2,ve=5,we=8;class fe{constructor(n){h(this,"data");n?(this.data=new Float32Array(9),this.data[Z]=n[0],this.data[J]=n[3],this.data[ce]=n[6],this.data[V]=n[1],this.data[ee]=n[4],this.data[ue]=n[7],this.data[ye]=n[2],this.data[ve]=n[5],this.data[we]=n[8]):this.data=new Float32Array(9)}static get temp(){return Ms}static multiply(n,e,t){const o=n.data[Z]*e.data[Z]+n.data[J]*e.data[V]+n.data[ce]*e.data[ye],i=n.data[Z]*e.data[J]+n.data[J]*e.data[ee]+n.data[ce]*e.data[ve],s=n.data[Z]*e.data[ce]+n.data[J]*e.data[ue]+n.data[ce]*e.data[we],a=n.data[V]*e.data[Z]+n.data[ee]*e.data[V]+n.data[ue]*e.data[ye],c=n.data[V]*e.data[J]+n.data[ee]*e.data[ee]+n.data[ue]*e.data[ve],d=n.data[V]*e.data[ce]+n.data[ee]*e.data[ue]+n.data[ue]*e.data[we],u=n.data[ye]*e.data[Z]+n.data[ve]*e.data[V]+n.data[we]*e.data[ye],g=n.data[ye]*e.data[J]+n.data[ve]*e.data[ee]+n.data[we]*e.data[ve],w=n.data[ye]*e.data[ce]+n.data[ve]*e.data[ue]+n.data[we]*e.data[we];return t||(t=new fe),t.data[Z]=o,t.data[J]=i,t.data[ce]=s,t.data[V]=a,t.data[ee]=c,t.data[ue]=d,t.data[ye]=u,t.data[ve]=g,t.data[we]=w,t}static identity(n){return n||(n=new fe),n.data[Z]=1,n.data[J]=0,n.data[ce]=0,n.data[V]=0,n.data[ee]=1,n.data[ue]=0,n.data[ye]=0,n.data[ve]=0,n.data[we]=1,n}static translate(n,e,t){return t||(t=new fe),t.data[Z]=1,t.data[J]=0,t.data[ce]=n,t.data[V]=0,t.data[ee]=1,t.data[ue]=e,t.data[ye]=0,t.data[ve]=0,t.data[we]=1,t}static scale(n,e,t){return t||(t=new fe),t.data[Z]=n,t.data[J]=0,t.data[ce]=0,t.data[V]=0,t.data[ee]=e,t.data[ue]=0,t.data[ye]=0,t.data[ve]=0,t.data[we]=1,t}static rotate(n,e){const t=Math.cos(n),o=Math.sin(n);return e||(e=new fe),e.data[Z]=t,e.data[J]=-o,e.data[ce]=0,e.data[V]=o,e.data[ee]=t,e.data[ue]=0,e.data[ye]=0,e.data[ve]=0,e.data[we]=1,e}static copy(n,e,t){return e||(e=new fe),e.data[0]=n.data[0],e.data[1]=n.data[1],e.data[2]=n.data[2],e.data[3]=n.data[3],e.data[4]=n.data[4],e.data[5]=n.data[5],e.data[6]=n.data[6],e.data[7]=n.data[7],e.data[8]=n.data[8],e}translate(n,e){return this.data[ce]=this.data[Z]*n+this.data[J]*e+this.data[ce],this.data[ue]=this.data[V]*n+this.data[ee]*e+this.data[ue],this}scale(n,e){return this.data[Z]=this.data[Z]*n,this.data[J]=this.data[J]*e,this.data[V]=this.data[V]*n,this.data[ee]=this.data[ee]*e,this}rotate(n){if(n===0||!(n%Math.PI*2))return this;const e=Math.cos(n),t=Math.sin(n),o=this.data[Z]*e+this.data[J]*t,i=this.data[J]*e-this.data[Z]*t,s=this.data[V]*e+this.data[ee]*t,a=this.data[ee]*e-this.data[V]*t;return this.data[Z]=o,this.data[J]=i,this.data[V]=s,this.data[ee]=a,this}multiply(n){return fe.multiply(this,n,this)}get tx(){return this.data[ce]}get ty(){return this.data[ue]}get ta(){return this.data[Z]}get tb(){return this.data[J]}get tc(){return this.data[V]}get td(){return this.data[ee]}transformPoint(n,e){return[this.data[Z]*n+this.data[J]*e+this.data[ce],this.data[V]*n+this.data[ee]*e+this.data[V]]}}const Ms=new fe,Ht=0,jt=2,Qt=4,Xt=6,Kt=1,Vt=3,Gt=5,qt=7;class gn{constructor(n){h(this,"data");this.data=new Float32Array(8),n&&(this.data[Ht]=n[Ht],this.data[jt]=n[jt],this.data[Qt]=n[Qt],this.data[Xt]=n[Xt],this.data[Kt]=n[Kt],this.data[Vt]=n[Vt],this.data[Gt]=n[Gt],this.data[qt]=n[qt])}static translate(n,e,t,o,i,s,a,c,d){return d||(d=new gn),d.data[Ht]=n,d.data[jt]=t,d.data[Qt]=i,d.data[Xt]=a,d.data[Kt]=e,d.data[Vt]=o,d.data[Gt]=s,d.data[qt]=c,d}get x1(){return this.data[Ht]}get x2(){return this.data[jt]}get x3(){return this.data[Qt]}get x4(){return this.data[Xt]}get y1(){return this.data[Kt]}get y2(){return this.data[Vt]}get y3(){return this.data[Gt]}get y4(){return this.data[qt]}}var G;(function(r){r[r.Init=0]="Init",r[r.OutOfBounds=2]="OutOfBounds",r[r.InBounds=4]="InBounds",r[r.InViewport=8]="InViewport"})(G||(G={}));const nt=new Map;nt.set(G.Init,"init");nt.set(G.OutOfBounds,"outOfBounds");nt.set(G.InBounds,"inBounds");nt.set(G.InViewport,"inViewport");var B;(function(r){r[r.Children=1]="Children",r[r.ScaleRotate=2]="ScaleRotate",r[r.Local=4]="Local",r[r.Global=8]="Global",r[r.Clipping=16]="Clipping",r[r.CalculatedZIndex=32]="CalculatedZIndex",r[r.ZIndexSortedChildren=64]="ZIndexSortedChildren",r[r.PremultipliedColors=128]="PremultipliedColors",r[r.WorldAlpha=256]="WorldAlpha",r[r.RenderState=512]="RenderState",r[r.IsRenderable=1024]="IsRenderable",r[r.None=0]="None",r[r.All=2047]="All"})(B||(B={}));class ar extends ot{constructor(e,t){super();h(this,"stage");h(this,"children",[]);h(this,"props");h(this,"updateType",B.All);h(this,"globalTransform");h(this,"scaleRotateTransform");h(this,"localTransform");h(this,"renderCoords");h(this,"renderBound");h(this,"strictBound");h(this,"preloadBound");h(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1});h(this,"isRenderable",!1);h(this,"renderState",G.Init);h(this,"worldAlpha",1);h(this,"premultipliedColorTl",0);h(this,"premultipliedColorTr",0);h(this,"premultipliedColorBl",0);h(this,"premultipliedColorBr",0);h(this,"calcZIndex",0);h(this,"hasRTTupdates",!1);h(this,"onTextureLoaded",(e,t)=>{this.autosizeNode(t),this.parentHasRenderTexture&&this.setRTTUpdates(1),this.emit("loaded",{type:"texture",dimensions:t}),queueMicrotask(()=>{this.stage.requestRender()})});h(this,"onTextureFailed",(e,t)=>{this.emit("failed",{type:"texture",error:t})});h(this,"onTextureFreed",e=>{this.emit("freed",{type:"texture"})});this.stage=e,this.props={...t,parent:null,parentHasRenderTexture:!1},this.parent=t.parent,this.rtt=t.rtt,this.updateScaleRotateTransform()}loadTexture(e,t,o=null){this.props.texture&&this.unloadTexture();const{txManager:i}=this.stage,s=i.loadTexture(e,t,o);this.props.texture=s,this.props.textureOptions=o,this.setUpdateType(B.IsRenderable),queueMicrotask(()=>{s.state==="loaded"?this.onTextureLoaded(s,s.dimensions):s.state==="failed"?this.onTextureFailed(s,s.error):s.state==="freed"&&this.onTextureFreed(s),s.on("loaded",this.onTextureLoaded),s.on("failed",this.onTextureFailed),s.on("freed",this.onTextureFreed)})}unloadTexture(){if(this.props.texture){const{texture:e}=this.props;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(B.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){const o=this.stage.renderer.getShaderManager();L(o);const{shader:i,props:s}=o.loadShader(e,t);this.props.shader=i,this.props.shaderProps=s,this.setUpdateType(B.IsRenderable)}setUpdateType(e){this.updateType|=e;const t=this.props.parent;t&&!(t.updateType&B.Children)&&t.setUpdateType(B.Children),this.parentHasRenderTexture&&this.setRTTUpdates(e)}sortChildren(){this.children.sort((e,t)=>e.calcZIndex-t.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=fe.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){L(this.scaleRotateTransform);const e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,o=this.props.mountX*this.props.width,i=this.props.mountY*this.props.height;this.localTransform=fe.translate(e-o+this.props.x,t-i+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(B.Global)}update(e,t){var s;this.updateType&B.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(B.Local)),this.updateType&B.Local&&(this.updateLocalTransform(),this.setUpdateType(B.Global));const o=this.props.parent;let i=B.None;this.updateType&B.Global&&(L(this.localTransform),this.globalTransform=fe.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),this.parentHasRenderTexture&&((s=this.props.parent)!=null&&s.rtt)&&(this.globalTransform=fe.identity()),o&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(B.Clipping|B.RenderState|B.Children),i|=B.Global),this.updateType&B.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(B.Children),i|=B.Clipping),this.updateType&B.WorldAlpha&&(o?this.worldAlpha=o.worldAlpha*this.props.alpha:this.worldAlpha=this.props.alpha,this.setUpdateType(B.Children|B.PremultipliedColors|B.IsRenderable),i|=B.WorldAlpha),this.updateType&B.PremultipliedColors&&(this.premultipliedColorTl=_t(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=_t(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=_t(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=_t(this.props.colorBr,this.worldAlpha,!0))),this.updateType&B.RenderState&&(this.updateRenderState(t),this.setUpdateType(B.IsRenderable)),this.updateType&B.IsRenderable&&this.updateIsRenderable(),o&&this.updateType&B.CalculatedZIndex&&(this.calculateZIndex(),o.setUpdateType(B.ZIndexSortedChildren)),this.updateType&B.Children&&this.children.length&&!this.rtt&&this.children.forEach(a=>{a.setUpdateType(i),a.updateType!==0&&a.update(e,this.clippingRect)}),this.updateType&B.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return this.props.texture?!0:!this.props.width||!this.props.height?!1:!!(this.props.shader||this.props.clipping||this.props.color!==0||this.props.colorTop!==0||this.props.colorBottom!==0||this.props.colorLeft!==0||this.props.colorRight!==0||this.props.colorTl!==0||this.props.colorTr!==0||this.props.colorBl!==0||this.props.colorBr!==0)}checkRenderBounds(e){L(this.renderBound);const t=e.width||this.stage.root.width,o=e.height||this.stage.root.height;this.strictBound=gt(e.x,e.y,e.x+t,e.y+o,this.strictBound);const i=this.stage.boundsMargin;return this.preloadBound=gt(e.x-i[3],e.y-i[0],e.x+t+i[1],e.y+o+i[2],this.preloadBound),Ir(this.renderBound,this.strictBound)?G.InViewport:Ir(this.renderBound,this.preloadBound)?G.InBounds:G.OutOfBounds}updateRenderState(e){const t=this.checkRenderBounds(e);if(t!==this.renderState){let o=this.renderState;this.renderState=t,o===G.InViewport&&this.emit("outOfViewport",{previous:o,current:t}),oG.InBounds&&t===G.OutOfBounds&&(this.emit(nt.get(G.InBounds),{previous:o,current:t}),o=G.InBounds);const i=nt.get(t);L(i),this.emit(i,{previous:o,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(G[e]))}updateIsRenderable(){let e;this.worldAlpha===0||!this.checkRenderProps()?e=!1:e=this.renderState>G.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;(t=this.props.texture)==null||t.setRenderableOwner(this,e)}calculateRenderCoords(){const{width:e,height:t,globalTransform:o}=this;L(o);const{tx:i,ty:s,ta:a,tb:c,tc:d,td:u}=o;if(c===0&&d===0){const g=i,w=i+e*a,A=s,p=s+t*u;this.renderCoords=gn.translate(g,A,w,A,w,p,g,p,this.renderCoords)}else this.renderCoords=gn.translate(i,s,i+e*a,s+e*d,i+e*a+t*c,s+e*d+t*u,i+t*c,s+t*u,this.renderCoords)}updateBoundingRect(){const{renderCoords:e,globalTransform:t}=this;L(t),L(e);const{tb:o,tc:i}=t,{x1:s,y1:a,x3:c,y3:d}=e;if(o===0||i===0)this.renderBound=gt(s,a,c,d,this.renderBound);else{const{x2:u,x4:g,y2:w,y4:A}=e;this.renderBound=gt(Math.min(s,u,c,g),Math.min(a,w,d,A),Math.max(s,u,c,g),Math.max(a,w,d,A),this.renderBound)}}calculateClippingRect(e){L(this.globalTransform);const{clippingRect:t,props:o,globalTransform:i}=this,{clipping:s}=o,a=i.tb!==0||i.tc!==0;s&&!a?(t.x=i.tx,t.y=i.ty,t.width=this.width*i.ta,t.height=this.height*i.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?nr(e,t,t):e.valid&&(So(e,t),t.valid=!0)}calculateZIndex(){var s,a;const e=this.props,t=e.zIndex||0,o=((s=e.parent)==null?void 0:s.zIndex)||0;let i=t;(a=e.parent)!=null&&a.zIndexLocked&&(i=t{t.setUpdateType(B.CalculatedZIndex)})}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(B.CalculatedZIndex|B.Children),this.children.forEach(t=>{t.setUpdateType(B.CalculatedZIndex)})}get parent(){return this.props.parent}set parent(e){const t=this.props.parent;if(t!==e){if(this.props.parent=e,t){const o=t.children.indexOf(this);L(o!==-1,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(o,1),t.setUpdateType(B.Children|B.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(B.All),e.setUpdateType(B.Children|B.ZIndexSortedChildren),(e.rtt||e.parentHasRenderTexture)&&this.setRTTUpdates(B.All)),this.parentHasRenderTexture=(e==null?void 0:e.rtt)||(e==null?void 0:e.parentHasRenderTexture),this.updateScaleRotateTransform()}}get rtt(){return this.props.rtt}set rtt(e){var t;e&&(this.props.rtt=!0,this.hasRTTupdates=!0,(t=this.stage.renderer)==null||t.renderToTexture(this))}set parentHasRenderTexture(e){this.props.parentHasRenderTexture=!!e}get parentHasRenderTexture(){return this.props.parentHasRenderTexture}get framebufferDimensions(){var e;return this.parentHasRenderTexture&&!this.rtt?(e=this.parent)==null?void 0:e.framebufferDimensions:{width:this.width,height:this.height}}get parentRenderTexture(){let e=this.parent;for(;e;){if(e.rtt)return e;e=e.parent}return null}get texture(){return this.props.texture}setRTTUpdates(e){var t;this.hasRTTupdates=!0,(t=this.parent)==null||t.setRTTUpdates(e)}}let zs=1;function lr(){return zs++}class Xn extends ot{constructor(e,t,o,i){var s;super();h(this,"rendererMain");h(this,"stage");h(this,"id");h(this,"coreNode");h(this,"_children",[]);h(this,"_src","");h(this,"_parent",null);h(this,"_texture",null);h(this,"_shader",null);h(this,"_data",{});h(this,"onTextureLoaded",(e,t)=>{this.emit("loaded",t)});h(this,"onTextureFailed",(e,t)=>{this.emit("failed",t)});h(this,"onTextureFreed",(e,t)=>{this.emit("freed",t)});h(this,"onOutOfBounds",(e,t)=>{this.emit("outOfBounds",t)});h(this,"onInBounds",(e,t)=>{this.emit("inBounds",t)});h(this,"onOutOfViewport",(e,t)=>{this.emit("outOfViewport",t)});h(this,"onInViewport",(e,t)=>{this.emit("inViewport",t)});this.rendererMain=t,this.stage=o,this.id=(s=i==null?void 0:i.id)!=null?s:lr(),this.coreNode=i||new ar(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null,rtt:e.rtt,parentHasRenderTexture:e.parentHasRenderTexture}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this.rtt=e.rtt,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){e!==null&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var o;const t=this._parent;if(this._parent=e,this.coreNode.parent=(o=e==null?void 0:e.coreNode)!=null?o:null,t){const i=t.children.indexOf(this);L(i!==-1,"MainOnlyNode.parent: Node not found in old parent's children!"),t.children.splice(i,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){if(this._src!==e){if(this._src=e,!e){this.texture=null;return}this.texture=this.rendererMain.createTexture("ImageTexture",{src:e})}}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get rtt(){return this.coreNode.rtt}set rtt(e){e&&(this.texture=this.rendererMain.createTexture("RenderTexture",{width:this.width,height:this.height},{preload:!0,flipY:!0})),this.coreNode.rtt=e}get parentHasRenderTexture(){return this.coreNode.parentHasRenderTexture}set parentHasRenderTexture(e){this.coreNode.parentHasRenderTexture=e}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=Yo(e)}destroy(){this.emit("beforeDestroy",{});let e=this.children[0];for(;e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){const o=new Ns(this.coreNode,e,t);return new Ls(this.stage.animationManager,o)}}const Ps=r=>{let n=!1;const e=()=>{if(r.updateAnimations(),!r.hasSceneUpdates()){r.calculateFps(),setTimeout(e,16.666666666666668),n||(r.emit("idle"),n=!0);return}n=!1,r.drawFrame(),requestAnimationFrame(e)};requestAnimationFrame(e)},Ds=()=>performance?performance.now():Date.now();class Os{constructor(){h(this,"activeAnimations",new Set)}registerAnimation(n){this.activeAnimations.add(n)}unregisterAnimation(n){this.activeAnimations.delete(n)}update(n){this.activeAnimations.forEach(e=>{e.update(n)})}}class Ws{constructor(n){h(this,"imageWorkersEnabled",!0);h(this,"messageManager",{});h(this,"workers",[]);h(this,"workerIndex",0);this.workers=this.createWorkers(n),this.workers.forEach(e=>{e.onmessage=this.handleMessage.bind(this)})}handleMessage(n){const{src:e,data:t,error:o}=n.data,i=this.messageManager[e];if(i){const[s,a]=i;delete this.messageManager[e],o?a(new Error(o)):s(t)}}createWorkers(n=1){const e="\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ",t=new Blob([e.replace('"use strict";',"")],{type:"application/javascript"}),o=(self.URL?URL:webkitURL).createObjectURL(t),i=[];for(let s=0;s{try{if(this.workers){const i=this.convertUrlToAbsolute(n);this.messageManager[i]=[t,o],this.getNextWorker().postMessage({src:i,premultiplyAlpha:e})}}catch(i){o(i)}})}}const Mt=class Mt extends bo{constructor(e,t){super(e);h(this,"props");this.props=Mt.resolveDefaults(t)}async getTextureData(){const{width:e,height:t}=this.props,o=e*t*4,i=new Uint8ClampedArray(o);for(let s=0;s{})}setTextureMemUse(n,e){if(this.textures.has(n)&&(this.memUsed-=this.textures.get(n)),e===0){this.textures.delete(n);return}else this.memUsed+=e,this.textures.set(n,e);this.memUsed>this.threshold&&this.gc()}gc(){this.textures.forEach((n,e)=>{e.renderable||e.free()})}}const $s=2e6;class Hs extends ot{constructor(e){super();h(this,"options");h(this,"animationManager");h(this,"txManager");h(this,"txMemManager");h(this,"fontManager");h(this,"textRenderers");h(this,"shManager");h(this,"renderer");h(this,"root");h(this,"boundsMargin");h(this,"deltaTime",0);h(this,"lastFrameTime",0);h(this,"currentFrameTime",0);h(this,"fpsNumFrames",0);h(this,"fpsElapsedTime",0);h(this,"renderRequested",!1);h(this,"contextSpy",null);this.options=e;const{canvas:t,clearColor:o,rootId:i,debug:s,appWidth:a,appHeight:c,boundsMargin:d,enableContextSpy:u,numImageWorkers:g,txMemByteThreshold:w}=e;this.txManager=new Us(g),this.txMemManager=new Ys(w),this.shManager=new hs,this.animationManager=new Os,this.contextSpy=u?new fs:null;let A=[0,0,0,0];d&&(A=Array.isArray(d)?d:[d,d,d,d]),this.boundsMargin=A,s!=null&&s.monitorTextureCache&&setInterval(()=>{L(this.txManager);const y=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",y.idCacheSize),console.log("Texture Key Cache Size: ",y.keyCacheSize)},1e3),this.renderer=new Ei({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:o!=null?o:4278190080,bufferMemory:$s,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new cs(this),sdf:new Bs(this)},this.fontManager=new Uo(this.textRenderers);const p=new ar(this,{id:i,x:0,y:0,width:a,height:c,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null,rtt:!1});this.root=p,Ps(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=Ds(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){const{renderer:e,renderRequested:t}=this;this.root.updateType!==0&&this.root.update(this.deltaTime,this.root.clippingRect),e==null||e.reset(),e.rttNodes.length>0&&e.renderRTTNodes(),this.addQuads(this.root),e==null||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var t,o,i;const{fpsUpdateInterval:e}=this.options;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){const s=Math.round(this.fpsNumFrames*1e3/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:s,contextSpyData:(o=(t=this.contextSpy)==null?void 0:t.getData())!=null?o:null}),(i=this.contextSpy)==null||i.reset()}}addQuads(e){L(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(let t=0;t{const{contain:e}=this,t=this.trState.props.width,o=this.trState.props.height,i=this.trState.textW||0,s=this.trState.textH||0;e==="both"?(this.props.width=t,this.props.height=o):e==="width"?(this.props.width=t,this.props.height=s):e==="none"&&(this.props.width=i,this.props.height=s),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})});h(this,"onTextFailed",(e,t)=>{this.emit("failed",{type:"text",error:t})});this._textRendererOverride=t.textRendererOverride;const{resolvedTextRenderer:o,textRendererState:i}=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix});this.textRenderer=o,this.trState=i}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),this.contain==="none"&&this.setUpdateType(B.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),this.contain!=="both"&&this.setUpdateType(B.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);const{resolvedTextRenderer:t,textRendererState:o}=this.resolveTextRendererAndState(this.trState.props);this.textRenderer=t,this.trState=o}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),L(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return this.trState.props.text!==""?!0:super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){var t,o;L(this.globalTransform),!(this.parentHasRenderTexture&&(!e.renderToTextureActive||this.parentRenderTexture!==e.activeRttNode))&&(this.parentHasRenderTexture&&((t=this.props.parent)!=null&&t.rtt)&&(this.globalTransform=fe.identity(),this.globalTransform.multiply((o=this.localTransform)!=null?o:fe.identity())),L(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha,this.parentHasRenderTexture,this.framebufferDimensions))}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){const t=this.stage.resolveTextRenderer(e,this._textRendererOverride),o=t.createState(e);return o.emitter.on("loaded",this.onTextLoaded),o.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(o),{resolvedTextRenderer:t,textRendererState:o}}}class Qs extends Xn{constructor(n,e,t){super(n,e,t,new js(t,{id:lr(),x:n.x,y:n.y,width:n.width,height:n.height,alpha:n.alpha,autosize:n.autosize,clipping:n.clipping,color:n.color,colorTop:n.colorTop,colorBottom:n.colorBottom,colorLeft:n.colorLeft,colorRight:n.colorRight,colorTl:n.colorTl,colorTr:n.colorTr,colorBl:n.colorBl,colorBr:n.colorBr,zIndex:n.zIndex,zIndexLocked:n.zIndexLocked,scaleX:n.scaleX,scaleY:n.scaleY,mountX:n.mountX,mountY:n.mountY,mount:n.mount,pivot:n.pivot,pivotX:n.pivotX,pivotY:n.pivotY,rotation:n.rotation,text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontStretch:n.fontStretch,fontStyle:n.fontStyle,contain:n.contain,scrollable:n.scrollable,letterSpacing:n.letterSpacing,textAlign:n.textAlign,scrollY:n.scrollY,offsetY:n.offsetY,textRendererOverride:n.textRendererOverride,lineHeight:n.lineHeight,maxLines:n.maxLines,textBaseline:n.textBaseline,verticalAlign:n.verticalAlign,overflowSuffix:n.overflowSuffix,debug:n.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null,rtt:!1,parentHasRenderTexture:!1}))}get text(){return this.coreNode.text}set text(n){this.coreNode.text=n}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(n){this.coreNode.textRendererOverride=n}get fontSize(){return this.coreNode.fontSize}set fontSize(n){this.coreNode.fontSize=n}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(n){this.coreNode.fontFamily=n}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(n){this.coreNode.fontWeight=n}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(n){this.coreNode.fontStretch=n}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(n){this.coreNode.fontStyle=n}get textAlign(){return this.coreNode.textAlign}set textAlign(n){this.coreNode.textAlign=n}get contain(){return this.coreNode.contain}set contain(n){this.coreNode.contain=n}get scrollable(){return this.coreNode.scrollable}set scrollable(n){this.coreNode.scrollable=n}get scrollY(){return this.coreNode.scrollY}set scrollY(n){this.coreNode.scrollY=n}get offsetY(){return this.coreNode.offsetY}set offsetY(n){this.coreNode.offsetY=n}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(n){this.coreNode.letterSpacing=n}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(n){n&&(this.coreNode.lineHeight=n)}get maxLines(){return this.coreNode.maxLines}set maxLines(n){n&&(this.coreNode.maxLines=n)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(n){n&&(this.coreNode.textBaseline=n)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(n){n&&(this.coreNode.verticalAlign=n)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(n){n&&(this.coreNode.overflowSuffix=n)}get debug(){return this.coreNode.debug}set debug(n){this.coreNode.debug=n}}class Xs{constructor(){h(this,"root",null);h(this,"stage",null);h(this,"rendererMain",null)}async init(n,e,t){this.stage=new Hs({rootId:lr(),appWidth:e.appWidth,appHeight:e.appHeight,txMemByteThreshold:e.txMemByteThreshold,boundsMargin:e.boundsMargin,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio,clearColor:e.clearColor,canvas:t,fpsUpdateInterval:e.fpsUpdateInterval,enableContextSpy:e.enableContextSpy,numImageWorkers:e.numImageWorkers,debug:{monitorTextureCache:!1}}),this.rendererMain=n,L(this.stage.root);const o=new Xn(n.resolveNodeDefaults({}),this.rendererMain,this.stage,this.stage.root);this.root=o,o.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,o)),this.onCreateNode(o),e.coreExtensionModule&&await Es(e.coreExtensionModule,this.stage),this.stage.on("fpsUpdate",(i,s)=>{this.onFpsUpdate(s)}),this.stage.on("frameTick",(i,s)=>{this.onFrameTick(s)}),this.stage.on("idle",()=>{this.onIdle()})}createNode(n){L(this.rendererMain),L(this.stage);const e=new Xn(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(n){L(this.rendererMain),L(this.stage);const e=new Qs(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}destroyNode(n){n.destroy()}releaseTexture(n){const{stage:e}=this;L(e),e.txManager.removeTextureIdFromCache(n)}getRootNode(){return L(this.root),this.root}onCreateNode(n){throw new Error("Method not implemented.")}onBeforeDestroyNode(n){throw new Error("Method not implemented.")}onFpsUpdate(n){throw new Error("Method not implemented.")}onFrameTick(n){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}let Le,cr;function Ks(r={},n="app"){const e=new Xs;return Le=new Fs(r,n,e),cr=Le.createShader.bind(Le),Le}class Vs extends Array{constructor(n){super(),this._parent=n}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(n,e){if(e){const t=this.indexOf(e);this.splice(t,0,n)}else this.push(n);n.parent=this._parent,this._parent._isDirty=!0}remove(n){const e=this.indexOf(n);e>=0&&this.splice(e,1)}}function Gs(){return{BASE_URL:"/solid-demo-app/",MODE:"development",DEV:!0,PROD:!1,SSR:!1,LEGACY:!1}&&!0}const qs=Gs()||!1,pe={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Pr(r){return Zs(r)&&r.debug}function et(r,n,...e){qs&&(pe.debug||Pr(n)||Pr(e[0]))&&console.log(r,n,...e)}function Zt(r){return typeof r=="function"}function Zs(r){return typeof r=="object"}function pn(r){return Array.isArray(r)}function Js(r){return typeof r=="string"}function ea(r){return typeof r=="number"}function ta(r){return Number.isInteger(r)}function na(r,n){for(const e of n)if(e in r)return!0;return!1}function $o(r,n={}){if(pn(r))r.forEach(e=>{$o(e,n)});else if(r)for(const e in r)n[e]===void 0&&(n[e]=r[e]);return n}class Dr extends Array{constructor(n,e={}){return pn(e)?super(...e):Js(e)?super(e):super(...Object.entries(e).filter(([t,o])=>o).map(([t])=>t)),this.onChange=n,this}has(n){return this.indexOf(n)>=0}is(n){return this.indexOf(n)>=0}add(n){this.push(n),this.onChange()}toggle(n){this.has(n)?this.remove(n):this.add(n)}remove(n){const e=this.indexOf(n);e>=0&&(this.splice(e,1),this.onChange())}}function ra(r){const n=[];let e=!1;for(let x=0;x(x.flexOrder||0)-(m.flexOrder||0));const t=n.length,i=(r.flexDirection||"row")==="row",s=i?"width":"height",a=i?"height":"width",c=i?"marginLeft":"marginTop",d=i?"marginRight":"marginBottom",u=i?"x":"y",g=i?"y":"x",w=r[s]||0,A=r[a]||0,p=r.gap||0,y=r.justifyContent||"flexStart",S=r.alignItems;let b=0;["center","spaceBetween","spaceEvenly"].includes(y)&&(b=n.reduce((x,m)=>x+(m[s]||0),0));const v=A&&S?x=>{S==="flexStart"?x[g]=0:S==="center"?x[g]=(A-(x[a]||0))/2:S==="flexEnd"&&(x[g]=A-(x[a]||0))}:x=>x;if(y==="flexStart"){let x=0;if(n.forEach(m=>{m[u]=x+(m[c]||0),x+=(m[s]||0)+p+(m[c]||0)+(m[d]||0),v(m)}),r.flexBoundary!=="fixed"){const m=x-p;if(m!==r[s])return r[s]=m,!0}}else if(y==="flexEnd"){let x=w;for(let m=t-1;m>=0;m--){const C=n[m];L(C),C[u]=x-(C[s]||0)-(C[d]||0),x-=(C[s]||0)+p+(C[c]||0)+(C[d]||0),v(C)}}else if(y==="center"){let x=(w-(b+p*(t-1)))/2;n.forEach(m=>{m[u]=x,x+=(m[s]||0)+p,v(m)})}else if(y==="spaceBetween"){const x=(w-b)/(t-1);let m=0;n.forEach(C=>{C[u]=m,m+=(C[s]||0)+x,v(C)})}else if(y==="spaceEvenly"){const x=(w-b)/(t+1);let m=x;n.forEach(C=>{C[u]=m,m+=(C[s]||0)+x,v(C)})}return!1}const{animationSettings:oa}=pe;function Or(r){const n=[];for(const[e,t]of Object.entries(r))n.push({type:e,props:t});return cr("DynamicShader",{effects:n})}function At(r=""){return{set(n){ea(n)&&(n={width:n,color:255}),this.effects={...this.effects||{},["border".concat(r)]:n},this["_border".concat(r)]=n},get(){return this["_border".concat(r)]}}}const ia=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"],sa=["autosize","clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"];class be extends Object{constructor(n){super(),this._animationQueue=[],this._animationRunning=!1,this.name=n,this._renderProps={},this.children=new Vs(this)}get effects(){return this._effects}set effects(n){this._effects=n,this.lng&&(this.shader=Or(n))}get parent(){return this._parent}set parent(n){var e;this._parent=n,this.lng&&(this.lng.parent=(e=n==null?void 0:n.lng)!=null?e:null)}get shader(){return this._shader}set shader(n){pn(n)?this._shader=cr(...n):this._shader=n,this._sendToLightning("shader",this._shader)}_sendToLightningAnimatable(n,e){if(this.lng){if(pe.animationsEnabled&&this.transition&&(this.transition===!0||this.transition[n])){const t=this.transition===!0||this.transition[n]===!0?void 0:this.transition[n];return this.animate({[n]:e},t).start()}this.lng[n]=e}else this._renderProps[n]=e}_sendToLightning(n,e){this.lng?this.lng[n]=e:this._renderProps[n]=e}animate(n,e){return L(this.lng,"Node must be rendered before animating"),this.lng.animate(n,e||this.animationSettings)}chain(n,e){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),e?this._animationQueueSettings=e:this._animationQueueSettings||(this._animationQueueSettings=e||this.animationSettings),e=e||this._animationQueueSettings,this._animationQueue.push({props:n,animationSettings:e}),this}async start(){let n=this._animationQueue.shift();for(;n;)this._animationRunning=!0,await this.animate(n.props,n.animationSettings).start().waitUntilStopped(),n=this._animationQueue.shift();this._animationRunning=!1,this._animationQueueSettings=void 0}setFocus(){if(this.lng){if(this.forwardFocus!==void 0)if(Zt(this.forwardFocus)){if(this.forwardFocus.call(this,this)!==!1)return}else{const n=typeof this.forwardFocus=="number"?this.forwardFocus:null;if(n!==null&&nMo(this))}else this.autofocus=!0}isTextNode(){return this.name==="text"}_resizeOnTextLoad(){this.lng.on("loaded",(n,e)=>{if(e.type==="text"){const{dimensions:t}=e;this.parent.updateLayout(this,t)}})}getText(){return this.children.map(n=>n.text).join("")}destroy(){var n;this._queueDelete&&((n=this.lng)==null||n.destroy())}set onEvents(n){this._events=n}get onEvents(){return this._events||[]}set style(n){pn(n)?this._style=$o(n):this._style=n;for(const e in this._style)this[e]===void 0&&(this[e]=this._style[e])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(n){return this.children.find(e=>e.id===n)}searchChildrenById(n){for(const e of this.children){if(e.id===n)return e;if(e instanceof be){const t=e.searchChildrenById(n);if(t)return t}}}set states(n){this._states=new Dr(this._stateChanged.bind(this),n),this.lng&&this._stateChanged()}get states(){return this._states=this._states||new Dr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||oa}set animationSettings(n){this._animationSettings=n}updateLayout(n,e){var t,o;if(this.hasChildren){et("Layout: ",this);let i=!1;Zt(this.onBeforeLayout)&&(i=this.onBeforeLayout.call(this,n,e)),this.display==="flex"?(ra(this)||i)&&((t=this.parent)==null||t.updateLayout()):i&&((o=this.parent)==null||o.updateLayout()),Zt(this.onLayout)&&this.onLayout.call(this,n,e)}}_stateChanged(){if(et("State Changed: ",this,this.states),this.forwardStates){const e=this.states.slice();this.children.forEach(t=>t.states=e)}const n=this.states;if(this._undoStyles||this.style&&na(this.style,n)){this._undoStyles=this._undoStyles||[];const e={};this._undoStyles.forEach(o=>{e[o]=this.style[o]});const t=n.reduce((o,i)=>{const s=this.style[i];return s&&(o={...o,...s}),o},{});this._undoStyles=Object.keys(t),t.transition!==void 0&&(this.transition=t.transition),Object.assign(this,e,t)}}render(){const n=this,e=this.parent;if(!e){console.warn("Parent not set - no node created for: ",this);return}if(!e.lng){console.warn("Parent not rendered yet: ",this);return}if(this.lng){console.warn("Node already rendered: ",this);return}e._isDirty&&(e.updateLayout(),e._isDirty=!1),this.states.length&&this._stateChanged();const t=n._renderProps;if(t.x=t.x||0,t.y=t.y||0,e.lng&&(t.parent=e.lng),n._effects&&(this.shader=Or(n._effects)),n.isTextNode()){if(pe.fontSettings)for(const o in pe.fontSettings)t[o]===void 0&&(t[o]=pe.fontSettings[o]);t.text=n.getText(),t.contain&&(t.width||(t.width=(e.width||0)-t.x-(t.marginRight||0),n._autosized=!0),t.contain==="both"&&!t.height&&!t.maxLines&&(t.height=(e.height||0)-t.y-(t.marginBottom||0),n._autosized=!0)),et("Rendering: ",this,t),n.lng=Le.createTextNode(t),(!t.width||!t.height)&&(n._autosized=!0,n._resizeOnTextLoad())}else t.texture||(isNaN(t.width)&&(t.width=(e.width||0)-t.x,n._autosized=!0),isNaN(t.height)&&(t.height=(e.height||0)-t.y,n._autosized=!0),!t.color&&!t.src&&(t.color=0)),et("Rendering: ",this,t),n.lng=Le.createNode(t);n.onFail&&n.lng.on("failed",n.onFail),n.onLoad&&n.lng.on("loaded",n.onLoad),Zt(this.onCreate)&&this.onCreate.call(this,n),n.onEvents.forEach(([o,i])=>{var s;(s=n.lng)==null||s.on(o,(a,c)=>i(n,c))}),n.lng.div&&(n.lng.div.solid=n),n.name!=="text"&&n.children.forEach(o=>{o.render?o.render():o.text!==""&&console.warn("TextNode outside of : ",o)}),n.autofocus&&n.setFocus(),delete this._renderProps}}for(const r of ia)Object.defineProperty(be.prototype,r,{get(){return this.lng?this.lng[r]:this._renderProps[r]},set(n){this._sendToLightningAnimatable(r,n)}});for(const r of sa)Object.defineProperty(be.prototype,r,{get(){return this.lng?this.lng[r]:this._renderProps[r]},set(n){this._sendToLightning(r,n)}});Object.defineProperties(be.prototype,{borderRadius:{set(r){this._borderRadius=r,this.effects={...this.effects||{},radius:{radius:r}}},get(){return this._borderRadius}},border:At(),borderLeft:At("Left"),borderRight:At("Right"),borderTop:At("Top"),borderBottom:At("Bottom")});Object.defineProperties(be.prototype,{linearGradient:{set(r={}){this._linearGradient=r,this.effects={...this.effects||{},linearGradient:r}},get(){return this._linearGradient}}});const E=r=>(()=>{var n=Ot("text");return _n(n,r,!1),n})(),N=r=>(()=>{var n=Ot("node");return _n(n,r,!1),n})();function aa({createElement:r,createTextNode:n,isTextNode:e,replaceText:t,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:c,getNextSibling:d}){function u(v,x,m,C){if(m!==void 0&&!C&&(C=[]),typeof x!="function")return g(v,x,C,m);Re(I=>g(v,x(),I,m),C)}function g(v,x,m,C,I){for(;typeof m=="function";)m=m();if(x===m)return m;const R=typeof x,T=C!==void 0;if(R==="string"||R==="number")if(R==="number"&&(x=x.toString()),T){let _=m[0];_&&e(_)?t(_,x):_=n(x),m=p(v,m,C,_)}else m!==""&&typeof m=="string"?t(c(v),m=x):(p(v,m,C,n(x)),m=x);else if(x==null||R==="boolean")m=p(v,m,C);else{if(R==="function")return Re(()=>{let _=x();for(;typeof _=="function";)_=_();m=g(v,_,m,C)}),()=>m;if(Array.isArray(x)){const _=[];if(w(_,x,I))return Re(()=>m=g(v,_,m,C,!0)),()=>m;if(_.length===0){const k=p(v,m,C);if(T)return m=k}else Array.isArray(m)?m.length===0?y(v,_,C):A(v,m,_):m==null||m===""?y(v,_):A(v,T&&m||[c(v)],_);m=_}else{if(Array.isArray(m)){if(T)return m=p(v,m,C,x);p(v,m,null,x)}else m==null||m===""||!c(v)?o(v,x):S(v,x,c(v));m=x}}return m}function w(v,x,m){let C=!1;for(let I=0,R=x.length;IF-_){const Y=x[T];for(;_=0;T--){const _=x[T];if(I!==_){const k=a(_)===v;!R&&!T?k?S(v,I,_):o(v,I,m):k&&i(v,_)}else R=!0}}else o(v,I,m);return[I]}function y(v,x,m){for(let C=0,I=x.length;Cm.children=g(v,x.children,m.children)),Re(()=>x.ref&&x.ref(v)),Re(()=>{for(const I in x){if(I==="children"||I==="ref")continue;const R=x[I];R!==m[I]&&(s(v,I,R,m[I]),m[I]=R)}}),m}return{render(v,x){let m;return mt(C=>{m=C,u(x,v())}),m},insert:u,spread(v,x,m){typeof x=="function"?Re(C=>b(v,x(),C,m)):b(v,x,void 0,m)},createElement:r,createTextNode:n,insertNode:o,setProp(v,x,m,C){return s(v,x,m,C),m},mergeProps:ir,effect:Re,memo:q,createComponent:Lo,use(v,x,m){return le(()=>v(x,m))}}}function la(r){const n=aa(r);return n.mergeProps=ir,n}const ca={createElement(r){return new be(r)},createTextNode(r){return{name:"TextNode",text:r,parent:void 0}},replaceText(r,n){et("Replace Text: ",r,n),r.text=n;const e=r.parent;L(e),e.text=e.getText()},setProperty(r,n,e=!0){r[n]=e},insertNode(r,n,e){et("INSERT: ",r,n,e),r.children.insert(n,e),n._queueDelete=!1,n instanceof be?r.lng&&n.render():r.isTextNode()&&(r.text=r.getText())},isTextNode(r){return r.isTextNode()},removeNode(r,n){et("REMOVE: ",r,n),r.children.remove(n),n._queueDelete=!0,n instanceof be&&queueMicrotask(()=>n.destroy())},getParentNode(r){return r.parent},getFirstChild(r){return r.children[0]},getNextSibling(r){const n=r.parent.children||[],e=n.indexOf(r)+1;if(er.delete(o)}let e=!1;function t(o,i){if(e)return!(e=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of r)a.listener({...s,from:a.location,retry:c=>{c&&(e=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:n,confirm:t}}let Vn;function dr(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Vn=window.history.state._depth}dr();function pa(r){return{...r,_depth:window.history.state&&window.history.state._depth}}function ma(r,n){let e=!1;return()=>{const t=Vn;dr();const o=t==null?null:Vn-t;if(e){e=!1;return}o&&n(o)?(e=!0,window.history.go(-o)):r()}}const xa=/^(?:[a-z0-9]+:)?\/\//i,ya=/^\/+|(\/)\/+$/g,Ko="http://sr";function Et(r,n=!1){const e=r.replace(ya,"$1");return e?n||/^[?#]/.test(e)?e:"/"+e:""}function ln(r,n,e){if(xa.test(n))return;const t=Et(r),o=e&&Et(e);let i="";return!o||n.startsWith("/")?i=t:o.toLowerCase().indexOf(t.toLowerCase())!==0?i=t+o:i=o,(i||"/")+Et(n,!i)}function va(r,n){if(r==null)throw new Error(n);return r}function wa(r,n){return Et(r).replace(/\/*(\*.*)?$/g,"")+Et(n)}function Vo(r){const n={};return r.searchParams.forEach((e,t)=>{n[t]=e}),n}function Go(r,n,e){const[t,o]=r.split("/*",2),i=t.split("/").filter(Boolean),s=i.length;return a=>{const c=a.split("/").filter(Boolean),d=c.length-s;if(d<0||d>0&&o===void 0&&!n)return null;const u={path:s?"":"/",params:{}},g=w=>e===void 0?void 0:e[w];for(let w=0;wt.localeCompare(r,void 0,{sensitivity:"base"})===0;return n===void 0?!0:typeof n=="string"?e(n):typeof n=="function"?n(r):Array.isArray(n)?n.some(e):n instanceof RegExp?n.test(r):!1}function ba(r){const[n,e]=r.pattern.split("/*",2),t=n.split("/").filter(Boolean);return t.reduce((o,i)=>o+(i.startsWith(":")?2:3),t.length-(e===void 0?0:1))}function qo(r){const n=new Map,e=Dt();return new Proxy({},{get(t,o){return n.has(o)||_o(e,()=>n.set(o,q(()=>r()[o]))),n.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(r())}})}function ur(r){let n=/(\/?\:[^\/]+)\?/.exec(r);if(!n)return[r];let e=r.slice(0,n.index),t=r.slice(n.index+n[0].length);const o=[e,e+=n[1]];for(;n=/^(\/\:[^\/]+)\?/.exec(t);)o.push(e+=n[1]),t=t.slice(n[0].length);return ur(t).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const Sa=100,Zo=Io(),Jo=Io(),hr=()=>va(Bo(Zo)," and 'use' router primitives can be only used inside a Route."),vt=()=>hr().navigatorFactory(),ei=()=>hr().location,Aa=(r,n)=>{const e=ei(),t=q(()=>ur(r()).map(o=>Go(o,void 0,n)));return q(()=>{for(const o of t()){const i=o(e.pathname);if(i)return i}})},fr=()=>hr().params;function Ca(r,n=""){const{component:e,load:t,children:o,info:i}=r,s=!o||Array.isArray(o)&&!o.length,a={key:r,component:e,load:t,info:i};return ti(r.path).reduce((c,d)=>{for(const u of ur(d)){const g=wa(n,u);let w=s?g:g.split("/*",1)[0];w=w.split("/").map(A=>A.startsWith(":")||A.startsWith("*")?A:encodeURIComponent(A)).join("/"),c.push({...a,originalPath:u,pattern:w,matcher:Go(w,!s,r.matchFilters)})}return c},[])}function Ta(r,n=0){return{routes:r,score:ba(r[r.length-1])*1e4-n,matcher(e){const t=[];for(let o=r.length-1;o>=0;o--){const i=r[o],s=i.matcher(e);if(!s)return null;t.unshift({...s,route:i})}return t}}}function ti(r){return Array.isArray(r)?r:[r]}function ni(r,n="",e=[],t=[]){const o=ti(r);for(let i=0,s=o.length;is.score-i.score)}function Ur(r,n){for(let e=0,t=r.length;e{const d=r();try{return new URL(d,e)}catch(u){return console.error("Invalid path ".concat(d)),c}},e,{equals:(c,d)=>c.href===d.href}),o=q(()=>t().pathname),i=q(()=>t().search,!0),s=q(()=>t().hash),a=()=>"";return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return n()},get key(){return a()},query:qo(it(i,()=>Vo(t())))}}let Ye;function Ra(r,n,e,t={}){const{signal:[o,i],utils:s={}}=r,a=s.parsePath||(F=>F),c=s.renderPath||(F=>F),d=s.beforeLeave||Xo(),u=ln("",t.base||"");if(u===void 0)throw new Error("".concat(u," is not a valid base path"));u&&!o().value&&i({value:u,replace:!0,scroll:!1});const[g,w]=W(!1),A=async F=>{w(!0);try{await Oi(F)}finally{w(!1)}},[p,y]=W(o().value),[S,b]=W(o().state),v=_a(p,S),x=[],m=W([]),C=q(()=>Ur(n(),v.pathname)),I=qo(()=>{const F=C(),P={};for(let O=0;Ou,outlet:()=>null,resolvePath(F){return ln(u,F)}};return Re(()=>{const{value:F,state:P}=o();le(()=>{F!==p()&&A(()=>{Ye="native",y(F),b(P),m[1]([])}).then(()=>{Ye=void 0})})}),{base:R,location:v,params:I,isRouting:g,renderPath:c,parsePath:a,navigatorFactory:_,matches:C,beforeLeave:d,preloadRoute:z,singleFlight:t.singleFlight===void 0?!0:t.singleFlight,submissions:m};function T(F,P,O){le(()=>{if(typeof P=="number"){P&&(s.go?s.go(P):console.warn("Router integration does not support relative routing"));return}const{replace:D,resolve:Y,scroll:j,state:se}={replace:!1,resolve:!0,scroll:!0,...O},ne=Y?F.resolvePath(P):ln("",P);if(ne===void 0)throw new Error("Path '".concat(P,"' is not a routable path"));if(x.length>=Sa)throw new Error("Too many redirects");const de=p();if((ne!==de||se!==S())&&!ga){if(d.confirm(ne,O)){const Ce=x.push({value:de,replace:D,scroll:j,state:S()});A(()=>{Ye="navigate",y(ne),b(se),m[1]([])}).then(()=>{x.length===Ce&&(Ye=void 0,k({value:ne,state:se}))})}}})}function _(F){return F=F||Bo(Jo)||R,(P,O)=>T(F,P,O)}function k(F){const P=x[0];P&&((F.value!==P.value||F.state!==P.state)&&i({...F,replace:P.replace,scroll:P.scroll}),x.length=0)}function z(F,P){const O=Ur(n(),F.pathname),D=Ye;Ye="preload";for(let Y in O){const{route:j,params:se}=O[Y];j.component&&j.component.preload&&j.component.preload();const{load:ne}=j;P&&ne&&_o(e(),()=>ne({params:se,location:{pathname:F.pathname,search:F.search,hash:F.hash,query:Vo(F),state:null,key:""},intent:"preload"}))}Ye=D}}function Ia(r,n,e,t){const{base:o,location:i,params:s}=r,{pattern:a,component:c,load:d}=t().route,u=q(()=>t().path);c&&c.preload&&c.preload();const g=d?d({params:s,location:i,intent:Ye||"initial"}):void 0;return{parent:n,pattern:a,path:u,outlet:()=>c?Lo(c,{params:s,location:i,data:g,get children(){return e()}}):e(),resolvePath(A){return ln(o.path(),A,u())}}}const Ba=r=>n=>{const{base:e}=n,t=An(()=>n.children),o=q(()=>ni(t(),n.base||""));let i;const s=Ra(r,o,()=>i,{base:e,singleFlight:n.singleFlight});return r.create&&r.create(s),l(Zo.Provider,{value:s,get children(){return l(ka,{routerState:s,get root(){return n.root},get load(){return n.rootLoad},get children(){return[xt(()=>(i=Dt())&&null),l(Ea,{routerState:s,get branches(){return o()}})]}})}})};function ka(r){const n=r.routerState.location,e=r.routerState.params,t=q(()=>r.load&&le(()=>r.load({params:e,location:n,intent:"preload"})));return l(ze,{get when(){return r.root},keyed:!0,get fallback(){return r.children},children:o=>l(o,{params:e,location:n,get data(){return t()},get children(){return r.children}})})}function Ea(r){const n=[];let e;const t=q(it(r.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const c=[];for(let d=0,u=o.length;d{n[d]=A,c[d]=Ia(r.routerState,c[d-1]||r.routerState.base,Yr(()=>t()[d+1]),()=>r.routerState.matches()[d])}))}return n.splice(o.length).forEach(d=>d()),s&&a?s:(e=c[0],c)}));return Yr(()=>t()&&e)()}const Yr=r=>()=>l(ze,{get when(){return r()},keyed:!0,children:n=>l(Jo.Provider,{value:n,get children(){return n.outlet()}})}),he=r=>{const n=An(()=>r.children);return ir(r,{get children(){return n()}})};function Fa([r,n],e,t){return[e?()=>e(r()):r,t?o=>n(t(o)):n]}function Na(r){if(r==="#")return null;try{return document.querySelector(r)}catch(n){return null}}function La(r){let n=!1;const e=o=>typeof o=="string"?{value:o}:o,t=Fa(W(e(r.get()),{equals:(o,i)=>o.value===i.value}),void 0,o=>(!n&&r.set(o),o));return r.init&&Me(r.init((o=r.get())=>{n=!0,t[1](e(o)),n=!1})),Ba({signal:t,create:r.create,utils:r.utils})}function Ma(r,n,e){return r.addEventListener(n,e),()=>r.removeEventListener(n,e)}function za(r,n){const e=Na("#".concat(r));e?e.scrollIntoView():n&&window.scrollTo(0,0)}const Pa=new Map;function Da(r=!0,n=!1,e="/_server"){return t=>{const o=t.base.path(),i=t.navigatorFactory(t.base);let s={};function a(p){return p.namespaceURI==="http://www.w3.org/2000/svg"}function c(p){if(p.defaultPrevented||p.button!==0||p.metaKey||p.altKey||p.ctrlKey||p.shiftKey)return;const y=p.composedPath().find(C=>C instanceof Node&&C.nodeName.toUpperCase()==="A");if(!y||n&&!y.hasAttribute("link"))return;const S=a(y),b=S?y.href.baseVal:y.href;if((S?y.target.baseVal:y.target)||!b&&!y.hasAttribute("state"))return;const x=(y.getAttribute("rel")||"").split(/\s+/);if(y.hasAttribute("download")||x&&x.includes("external"))return;const m=S?new URL(b,document.baseURI):new URL(b);if(!(m.origin!==window.location.origin||o&&m.pathname&&!m.pathname.toLowerCase().startsWith(o.toLowerCase())))return[y,m]}function d(p){const y=c(p);if(!y)return;const[S,b]=y,v=t.parsePath(b.pathname+b.search+b.hash),x=S.getAttribute("state");p.preventDefault(),i(v,{resolve:!1,replace:S.hasAttribute("replace"),scroll:!S.hasAttribute("noscroll"),state:x&&JSON.parse(x)})}function u(p){const y=c(p);if(!y)return;const[S,b]=y;s[b.pathname]||t.preloadRoute(b,S.getAttribute("preload")!=="false")}function g(p){const y=c(p);if(!y)return;const[S,b]=y;s[b.pathname]||(s[b.pathname]=setTimeout(()=>{t.preloadRoute(b,S.getAttribute("preload")!=="false"),delete s[b.pathname]},200))}function w(p){const y=c(p);if(!y)return;const[,S]=y;s[S.pathname]&&(clearTimeout(s[S.pathname]),delete s[S.pathname])}function A(p){let y=p.submitter&&p.submitter.hasAttribute("formaction")?p.submitter.getAttribute("formaction"):p.target.getAttribute("action");if(!y)return;if(!y.startsWith("https://action/")){const b=new URL(y,Ko);if(y=t.parsePath(b.pathname+b.search),!y.startsWith(e))return}if(p.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const S=Pa.get(y);if(S){p.preventDefault();const b=new FormData(p.target);p.submitter&&p.submitter.name&&b.append(p.submitter.name,p.submitter.value),S.call({r:t,f:p.target},b)}}ha(["click","submit"]),document.addEventListener("click",d),r&&(document.addEventListener("mouseover",g),document.addEventListener("mouseout",w),document.addEventListener("focusin",u),document.addEventListener("touchstart",u)),document.addEventListener("submit",A),Me(()=>{document.removeEventListener("click",d),r&&(document.removeEventListener("mouseover",g),document.removeEventListener("mouseout",w),document.removeEventListener("focusin",u),document.removeEventListener("touchstart",u)),document.removeEventListener("submit",A)})}}function Oa(r){const n=r.replace(/^.*?#/,"");if(!n.startsWith("/")){const[,e="/"]=window.location.hash.split("#",2);return"".concat(e,"#").concat(n)}return n}function Wa(r){const n=()=>window.location.hash.slice(1),e=Xo();return La({get:n,set({value:t,replace:o,scroll:i,state:s}){o?window.history.replaceState(pa(s),"","#"+t):window.location.hash=t;const a=t.indexOf("#"),c=a>=0?t.slice(a+1):"";za(c,i),dr()},init:t=>Ma(window,"hashchange",ma(t,o=>!e.confirm(o&&o<0?o:n()))),create:Da(r.preload,r.explicitLinks,r.actionBase),utils:{go:t=>window.history.go(t),renderPath:t=>"#".concat(t),parsePath:Oa,beforeLeave:e}})(r)}var Ua=!!qi,Ya=Ua?r=>Dt()?Me(r):r:Me;function $a(r,n,e,t){return r.addEventListener(n,e,t),Ya(r.removeEventListener.bind(r,n,e,t))}function Ha(r,n=Dt()){let e=0,t,o;return()=>(e++,Me(()=>{e--,queueMicrotask(()=>{!e&&o&&(o(),o=t=void 0)})}),o||mt(i=>t=r(o=i),n),t)}var ja=Ha(()=>{const[r,n]=W(null);return $a(window,"keydown",e=>{n(e),setTimeout(()=>n(null))}),r});function Jt(r){return typeof r=="function"}function Qa(r){return Array.isArray(r)}const en={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},[mn,Xa]=W([]),Ka=r=>{const n=ja();if(r)for(const[e,t]of Object.entries(r))Qa(t)?t.forEach(o=>{en[o]=e}):en[t]=e;return je(it(sr,(e,t,o=[])=>{let i=e;const s=[];for(;i;)i.states.has("focus")||(i.states.add("focus"),Jt(i.onFocus)&&i.onFocus.call(i,e,t)),s.push(i),i=i.parent;return o.forEach(a=>{s.includes(a)||(a.states.remove("focus"),Jt(a.onBlur)&&a.onBlur.call(a,e,t))}),Xa(s),s},{defer:!0})),je(()=>{const e=n();if(e){const t=en[e.key]||en[e.keyCode];le(()=>{const o=mn();let i;for(const s of o){if(i=i||s,t){const a=s["on".concat(t)];if(Jt(a)&&a.call(s,e,s,i)===!0)break}else console.log("Unhandled key event: ".concat(e.key));if(Jt(s.onKeyPress)&&s.onKeyPress.call(s,e,t,s,i)===!0)break}return!1})}}),mn};function ri(r,n){const e=n();let t,o,i,s;Array.isArray(e)?e.length===2?(t=s=e[0],o=i=e[1]):e.length===3?(t=e[0],o=i=e[1],s=e[2]):[t,i,s,o]=e:t=i=s=o=e,r.onBeforeLayout=(a,c)=>{if(c){r.width=r.children.reduce((g,w)=>g+(w.width||0),0)+o+i;const d=r.children[0];d&&(d.x=o,d.marginLeft=o);let u=0;return r.children.forEach(g=>{g.y=t,g.marginTop=t,u=Math.max(u,g.height||0)}),r.height=u+t+s,!0}}}function Va(r=[]){const n=[];let e;for(e=0;e{setTimeout(n,r)})}function Ga(r,n,e="en-US"){const t=window.speechSynthesis;return new Promise((o,i)=>{const s=new SpeechSynthesisUtterance(r);s.lang=e,s.onend=()=>{o()},s.onerror=a=>{i(a)},n.push(s),t.speak(s)})}function Gn(r,n,e=!0){const t=window.speechSynthesis,o=Va(Array.isArray(r)?r:[r]),i=[],s=[];let a=!0;return{series:(async()=>{try{for(;a&&o.length;){const d=await Promise.resolve(o.shift());if(a){if(typeof d=="string"&&d.includes("PAUSE-")){let u=Number(d.split("PAUSE-")[1])*1e3;isNaN(u)&&(u=0),await $r(u)}else if(typeof d=="string"&&d.length){let g=3;for(;a&&g>0;)try{await Ga(d,s,n),g=0}catch(w){if(w instanceof SpeechSynthesisErrorEvent)if(w.error==="network")g--,console.warn("Speech synthesis network error. Retries left: ".concat(g)),await $r(500*(3-g));else if(w.error==="canceled"||w.error==="interrupted")g=0;else throw new Error("SpeechSynthesisErrorEvent: ".concat(w.error));else throw w}}else if(typeof d=="function"){const u=Gn(d(),n,!1);i.push(u),await u.series}else if(Array.isArray(d)){const u=Gn(d,n,!1);i.push(u),await u.series}}else break}}finally{a=!1}})(),get active(){return a},append:d=>{o.push(d)},cancel:()=>{a&&(e&&t.cancel(),i.forEach(d=>{d.cancel()}),a=!1)}}}let tn;function qa(r,n="en-US"){return tn&&tn.cancel(),tn=Gn(r,n),tn}var qn=(r,n)=>{let e;const t=()=>clearTimeout(e);return Dt()&&Me(t),Object.assign((...i)=>{e!==void 0&&t(),e=setTimeout(()=>r(...i),n)},{clear:t})};let Zn,Ft=[],_e,Jn=!1;const Za=3e5;function Hr(r,n){const e=qn(r,n);let t;const o=i=>{t=i,e(i)};return o.flush=()=>{e.clear(),r(t)},o.clear=e.clear,o}function Ct(r){return r.id||r.name}function Ja(r=[]){if(!oe.onFocusChange||!oe.enabled)return;const n=r.every(i=>!i.loading),e=r.filter(i=>!Ft.includes(i));if(Zn(),!n&&oe.onFocusChange){oe.onFocusChange([]);return}Ft=r.slice(0);const t=[],o=e.reduce((i,s)=>(s.announce?(i.push([Ct(s),"Announce",s.announce]),t.push(s.announce)):s.title?(i.push([Ct(s),"Title",s.title]),t.push(s.title)):i.push([Ct(s),"No Announce",""]),i),[]);if(e.reverse().reduce((i,s)=>(s.announceContext?(i.push([Ct(s),"Context",s.announceContext]),t.push(s.announceContext)):i.push([Ct(s),"No Context",""]),i),o),oe.debug&&console.table(o),t.length)return oe.speak(t.reduce((i,s)=>i.concat(s),[]))}function el(r){if(!Jn)return _e=qa(r)}const oe={debug:!1,enabled:!0,cancel:function(){_e&&_e.cancel()},clearPrevFocus:function(r=0){Ft=Ft.slice(0,r),Zn()},speak:function(r,{append:n=!1,notification:e=!1}={}){return oe.onFocusChange&&oe.enabled&&(oe.onFocusChange.flush(),n&&_e&&_e.active?_e.append(r):(oe.cancel(),el(r)),e&&(Jn=!0,_e==null||_e.series.finally(()=>{Jn=!1,oe.refresh()}).catch(console.error))),_e},refresh:function(r=0){oe.clearPrevFocus(r),oe.onFocusChange&&oe.onFocusChange(le(()=>mn()))},setupTimers:function({focusDebounce:r=400,focusChangeTimeout:n=Za}={}){oe.onFocusChange=Hr(Ja,r),Zn=Hr(()=>{Ft=[]},n)}},tl=()=>(oe.setupTimers(),je(it(mn,oe.onFocusChange,{defer:!0})),oe);function nl(r,n){const e=Le.createTexture("ImageTexture",{src:r});return n.reduce((t,o)=>{const{x:i,y:s,width:a,height:c}=o;return t[o.name]=Le.createTexture("SubTexture",{texture:e,x:i,y:s,width:a,height:c}),t},{})}const[rl,Ee]=W(""),f={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZ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6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFE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ZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function ol(){let r,n,e,t=0;const o=1,i={duration:750,easing:"ease-in-out"},s={alpha:o,color:4294967295};function a(c){if(c.startsWith("#")){r.color=M(c),r.src="",r.alpha=1,t=1,n.alpha=0,e.alpha=0;return}else r.color=4294967295,e.alpha=1;if(t===0){r.src=c,t=1;return}if(t===1){n.src=c,t=2,n.alpha=0,n.animate({alpha:o},i).start(),r.animate({alpha:0},i).start();return}t===2&&(r.src=c,t=1,r.alpha=0,r.animate({alpha:o},i).start(),n.animate({alpha:0},i).start())}return je(it(rl,c=>{a(c)},{defer:!0})),l(N,{width:1920,height:1080,zIndex:-5,get children(){return[l(N,{ref(c){var d=r;typeof d=="function"?d(c):r=c},style:s}),l(N,{ref(c){var d=n;typeof d=="function"?d(c):n=c},style:s,alpha:0}),l(N,{ref(c){var d=e;typeof d=="function"?d(c):e=c},src:"./assets/hero-mask-inverted.png",get color(){return M(f.color.materialBrand)},width:1920,height:1080})]}})}var jr,Qr,Xr,Kr,Vr,Gr,qr,Zr,Jr,eo,to,no,ro,oo,io,so,ao,lo;function nn(r){if(!r||!r[Symbol.iterator])throw new Error("objectFromEntries requires a single iterable argument");const n={};for(const[e,t]of r)n[e]=t;return n}const il=["focus","disabled"],sl=["brand","inverse","neutral"];function $({themeKeys:r,base:n,modes:e,tones:t,themeStyles:o,modeKeys:i=il,toneKeys:s=sl},a=!1){const c=(p,y,S)=>{const b=s.map(v=>{var C,I;const x={};return new Set([].concat.apply([],[(C=p==null?void 0:p[v])!=null?C:{},(I=y==null?void 0:y[v])!=null?I:{}].map(Object.keys))).forEach(R=>{var k;var T,_;i.includes(R)||(x[R]=(k=(T=y==null?void 0:y[v])==null?void 0:T[R])!=null?k:(_=p==null?void 0:p[v])==null?void 0:_[R])}),i.forEach(R=>{var T,_;x[R]={...S[R],...(T=p==null?void 0:p[v])==null?void 0:T[R],...(_=y==null?void 0:y[v])==null?void 0:_[R]}}),[v,x]});return nn(b)},d=(p,y)=>{const S=i.map(v=>[v,{...p==null?void 0:p[v],...y==null?void 0:y[v]}]);return nn(S)},u=(p,y)=>({...p,...y.base}),g=p=>nn(Object.entries(r).filter(([y,S])=>p[S]).map(([y,S])=>[y,p[S]])),w=p=>nn(Object.entries(p).map(([S,b])=>{const v=g(b);return Object.entries(b).filter(([x,m])=>i.includes(x)).forEach(([x,m])=>{v[x]=g(m)}),[S,v]}));return((p,y,S)=>{const b=w(o);a&&console.log(b);const v=u(p,b);a&&console.log(v);const x=d(y,b);a&&console.log(x);const m=c(S,b,x);return a&&console.log(m),{base:{...v,...x},tones:m}})(n,e,t)}function xn(r=0){return(n,e,t=0,o)=>{var S,b,v,x;if(n.children.length===0)return;const i=n.flexDirection==="row"?"width":"height",s=n.flexDirection==="row"?"x":"y",a=n.gap||0,c=n.scroll||"auto",[d,u]=al(n);let g=(S=n[s])!=null?S:0;const w=(b=e==null?void 0:e[s])!=null?b:0,A=(v=e==null?void 0:e[i])!=null?v:0,p=o===void 0?"none":t>o?"positive":"negative";let y=g;if(c==="auto")n.scrollIndex!=null&&n.scrollIndex>=0?n.selected>=n.scrollIndex&&(p==="positive"?y=g-A-a:y=g+A+a):(Math.abs(g)+uw)y=-w+r;else if(c==="edge"&&p==="positive"&&Math.abs(g)+u{const n=r.filter(e=>typeof e=="function");if(n.length!==0)return n.length===1?n[0]:function(...e){let t;for(const o of n)if(t=o.apply(this,e),t===!0)return t;return t}};function oi(){if(!this||this.selected===void 0||this.children.length===0)return!1;let r=this.children[this.selected];for(;r!=null&&r.skipFocus;)this.selected++,r=this.children[this.selected];return r instanceof be?(r.setFocus(),!0):!1}function yn(r){return function(){var n,e,t;const o=this.children.length,i=this.wrap,s=this.selected||0;if(o===0)return!1;if(r==="right"||r==="down")do if(this.selected=(this.selected||0)%o+1,this.selected>=o){if(!i){this.selected=void 0;break}this.selected=0}while((n=this.children[this.selected])!=null&&n.skipFocus);else if(r==="left"||r==="up")do if(this.selected=(this.selected||0)%o-1,this.selected<0){if(!i){this.selected=void 0;break}this.selected=o-1}while((e=this.children[this.selected])!=null&&e.skipFocus);if(this.selected===void 0&&(this.selected=s,(t=this.children[this.selected])!=null&&t.states.has("focus")))return!1;const a=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,a,this.selected,s),this.plinko&&s!==void 0){const d=this.children[s].selected||0;a.selected=dt){console.error("Column expects a number between 1 & ".concat(t,". Received ").concat(n));return}const s=e-o*2,a=(n-1)*i;return(s-a)/n}const{Artwork:{defaultTone:Rd,...cl}={styles:{}}}=(jr=f)==null?void 0:jr.componentConfig,dl={themeKeys:{fillColor:"fillColor",scale:"imageScale",pivotX:"imageScalePivotX",pivotY:"imageScalePivotY"},base:{fallbackSrc:void 0,fillColor:f.color.overlay,gradientColor:f.color.material,pivotX:.5,pivotY:.5,scale:void 0},themeStyles:cl};$(dl);const{Badge:{defaultTone:Id,...gr}={styles:{}}}=(Qr=f)==null?void 0:Qr.componentConfig,ul={themeKeys:{color:"backgroundColor"},base:{color:f.color.fillInverseSecondary,borderRadius:f.radius.sm,border:{color:f.color.strokeInverse,width:f.stroke.sm},display:"flex",justifyContent:"spaceEvenly",padding:[f.spacer.md-f.stroke.sm,f.spacer.xs+f.stroke.sm,f.spacer.md+f.stroke.sm,f.spacer.md+f.stroke.sm]},tones:{inverse:{color:f.color.fillNeutralSecondary,borderRadius:f.radius.sm,border:{color:f.color.strokeInverseSecondary,width:f.stroke.sm}},brand:{color:f.color.fillBrand,borderRadius:f.radius.sm,border:{color:f.color.strokeInverseSecondary,width:f.stroke.sm}}},themeStyles:gr},hl={themeKeys:{color:"textColor"},base:{...f.typography.tag1,color:f.color.textNeutral},tones:{inverse:{color:f.color.textInverse},brand:{color:f.color.textNeutral}},themeStyles:gr},fl={themeKeys:{color:"iconColor"},base:{color:f.color.textNeutral},tones:{inverse:{color:f.color.textInverse},brand:{color:f.color.textNeutral}},themeStyles:gr};$(ul);$(fl);$(hl);const{Button:{defaultTone:gl,...pr}={styles:{}}}=(Xr=f)==null?void 0:Xr.componentConfig,{Surface:{surfaceDefaultTone:pl,...mr}={styles:{}}}=(Kr=f)==null?void 0:Kr.componentConfig,ml={themeKeys:{textAlign:"textAlign",borderRadius:"radius",color:"backgroundColor",justifyContent:"justifyContent"},base:{height:f.typography.button1.lineHeight+f.spacer.xl*2,display:"flex",padding:[f.spacer.xxxl,f.spacer.xl],color:f.color.interactiveNeutral,justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm,contentColor:f.color.fillNeutral},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse},brand:{color:f.color.interactiveBrand,focus:{color:f.color.fillNeutral}}},themeStyles:{...mr,...pr}},xl={themeKeys:{color:"contentColor"},base:{color:f.color.textNeutral},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillBrand,focus:{color:f.color.fillBrand}}},themeStyles:{...mr,...pr}},yl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.button1},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillBrand,focus:{color:f.color.fillBrand}}},themeStyles:{...mr,...pr}},vl=$(ml),wl=$(xl),bl=$(yl),st={tone:gl||pl||"neutral",Container:vl,Content:wl,Text:bl},co=r=>l(N,Q(r,{get style(){var e;var n;return[...[r.style].flat(),(n=st.Container.tones)==null?void 0:n[(e=r.tone)!=null?e:st.tone],st.Container.base]},forwardStates:!0,get children(){return l(E,{get style(){var e;var n;return[...[(n=r.style)==null?void 0:n.Text].flat(),st.Text.tones[(e=r.tone)!=null?e:st.tone],st.Text.base]},get children(){return r.children}})}})),{Checkbox:{defaultTone:Bd,...ii}={styles:{}}}=(Vr=f)==null?void 0:Vr.componentConfig,Ze=f.stroke.sm,Fe=f.spacer.xxl,Sl={themeKeys:{color:"color",borderRadius:"borderRadius",border:"border",justifyContent:"justifyContent"},base:{width:Fe,height:Fe,display:"flex",justifyContent:"center",color:f.color.fillNeutral,alignItems:"center",borderRadius:Fe/4,border:{color:f.color.strokeInverse,width:Ze}},modes:{disabled:{alpha:f.alpha.inactive}},tones:{brand:{borderRadius:Fe/4,border:{color:f.color.strokeNeutralSecondary,width:Ze},color:f.color.fillNeutralSecondary,checked:{borderRadius:Fe/4,border:{color:f.color.strokeNeutralSecondary,width:Ze},color:f.color.fillBrand}},neutral:{borderRadius:Fe/4,border:{color:f.color.strokeNeutralSecondary,width:Ze},color:f.color.fillInverseSecondary,checked:{borderRadius:Fe/4,border:{color:f.color.strokeNeutralSecondary,width:Ze},color:f.color.fillNeutral}},inverse:{borderRadius:Fe/4,border:{color:f.color.strokeInverseSecondary,width:Ze},color:f.color.fillNeutralSecondary,checked:{borderRadius:Fe/4,border:{color:f.color.strokeInverseSecondary,width:Ze},color:f.color.fillInverse}}},modeKeys:["focus","disabled","checked"],themeStyles:ii},Al={themeKeys:{color:"color"},base:{width:f.spacer.lg,height:f.spacer.lg,src:f.asset.check},tones:{neutral:{color:f.color.fillInverse},inverse:{color:f.color.fillNeutral},brand:{color:f.color.fillInverse}},themeStyles:ii};$(Sl);$(Al);const{Icon:{defaultTone:kd,...Cl}={styles:{}}}=(Gr=f)==null?void 0:Gr.componentConfig,Tl={themeKeys:{color:"color"},base:{width:100,height:100,color:f.color.fillInverse},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:Cl};$(Tl);const{Column:{defaultTone:_l,...Rl}={styles:{}}}=(qr=f)==null?void 0:qr.componentConfig,Il={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"column",gap:f.layout.gutterY,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:Rl},Bl=$(Il),zn={tone:_l||"neutral",Container:Bl},te=r=>{const n=yn("up"),e=yn("down");return l(N,Q(r,{get onUp(){return He(r.onUp,n)},get onDown(){return He(r.onDown,e)},get selected(){return r.selected||0},forwardFocus:oi,get onCreate(){return He(t=>{var o,i;return xn(r.y).call(t,t,t.children[(o=r.selected)!=null?o:0],(i=r.selected)!=null?i:0,void 0)},r.onCreate)},get onSelectedChanged(){return He(r.onSelectedChanged,r.scroll!=="none"?xn(r.y):void 0)},get style(){var t;return[...[r.style].flat(),zn.Container.tones[(t=r.tone)!=null?t:zn.tone],zn.Container.base]}}))},{Label:{defaultTone:Ed,...si}={styles:{}}}=(Zr=f)==null?void 0:Zr.componentConfig,kl={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:f.color.textNeutral,padding:[f.spacer.md,f.spacer.lg],borderRadius:[f.radius.md,f.radius.md,f.radius.md,f.radius.none],height:f.typography.caption1.lineHeight+f.spacer.md,neutral:{backgroundColor:f.color.fillNeutral}},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand,focus:{color:f.color.orange}}},themeStyles:si},El={themeKeys:{color:"textColor"},base:{...f.typography.caption1,color:f.color.textInverse},tones:{inverse:{color:f.color.textNeutral},brand:{color:f.color.textNeutral}},themeStyles:si};$(kl);$(El);const{Rating:{styles:xr,defaultTone:Fd}={styles:{},defaultTone:"neutral"}}=(Jr=f)==null?void 0:Jr.componentConfig,Fl={themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:f.spacer.sm},toneModes:{},themeStyles:xr},Nl={themeKeys:{color:"textColor"},base:{color:f.color.textNeutral,...f.typography.body2},toneModes:{},themeStyles:xr},Ll={themeKeys:{color:"color"},base:{height:f.typography.body2.lineHeight,width:f.typography.body2.lineHeight,color:f.color.fillNeutral,marginRight:f.spacer.sm},toneModes:{},themeStyles:xr};$(Fl);$(Ll);$(Nl);const{Details:{defaultTone:Nd,...ai}={styles:{}}}=(eo=f)==null?void 0:eo.componentConfig,Ml={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:f.spacer.lg,badgeContentSpacing:f.spacer.sm,ratingContentSpacing:f.spacer.lg},themeStyles:ai},zl={themeKeys:{color:"textColor"},base:{...f.typography.body2,marginRight:f.spacer.lg,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:ai};$(Ml);$(zl);const{Metadata:{defaultTone:Ld,...yr}={styles:{}}}=(to=f)==null?void 0:to.componentConfig,Pl={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:yr},Dl={themeKeys:{color:"textColor"},base:{maxLines:1,contain:"width",...f.typography.headline3,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:yr},Ol={themeKeys:{color:"textColor"},base:{contain:"width",maxLines:2,...f.typography.body2,color:f.color.textNeutralSecondary},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverseSecondary,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutralSecondary,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:yr};$(Pl);$(Ol);$(Dl);const{ProgressBar:{defaultTone:Md,...li}={styles:{}}}=(no=f)==null?void 0:no.componentConfig,Wl={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:f.spacer.md,color:f.color.fillNeutralTertiary,borderRadius:f.radius.xs},tones:{inverse:{color:f.color.fillInverseTertiary}},themeStyles:li},Ul={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:f.radius.xs,color:f.color.fillNeutral},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:li};$(Wl);$(Ul);const{Row:{defaultTone:Yl,...$l}={styles:{}}}=(ro=f)==null?void 0:ro.componentConfig,Hl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"row",gap:f.layout.gutterX,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:$l},jl=$(Hl),Tt={tone:Yl,Container:jl},X=r=>{const n=yn("left"),e=yn("right");return l(N,Q(r,{get selected(){return r.selected||0},get onLeft(){return He(r.onLeft,n)},get onRight(){return He(r.onRight,e)},forwardFocus:oi,get onCreate(){return He(t=>{var o,i;return xn(r.x).call(t,t,t.children[(o=r.selected)!=null?o:0],(i=r.selected)!=null?i:0,void 0)},r.onCreate)},get onSelectedChanged(){return He(r.onSelectedChanged,r.scroll!=="none"?xn(r.x):void 0)},get tone(){var t;return(t=r.tone)!=null?t:Tt.tone},get style(){return[...[r.style].flat(),Tt.Container.tones[r.tone||Tt.tone],Tt.Container.base]},get states(){var t;return(t=r.tone)!=null?t:Tt.tone}}))},{Keyboard:{defaultTone:zd,...vr}={styles:{}}}=(oo=f)==null?void 0:oo.componentConfig,Ql={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:f.spacer.md,screenW:f.layout.screenW,marginX:f.layout.marginX,height:100},themeStyles:vr},Xl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:f.color.fillNeutral,padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:vr},Kl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:vr};$(Ql);$(Xl);$(Kl);const{Key:{defaultTone:Pd,...ci}={styles:{}}}=(io=f)==null?void 0:io.componentConfig,Vl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,contentColor:f.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[f.spacer.md],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:ci},Gl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:ci};$(Vl);$(Gl);const{Input:{defaultTone:Dd,...wr}={styles:{}}}=(so=f)==null?void 0:so.componentConfig,ql={themeKeys:{justifyContent:"justifyContent"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"column",width:100,height:100,actualTitle:""},themeStyles:wr},Zl={themeKeys:{borderRadius:"borderRadius",color:"backgroundColor"},base:{width:ll(f,4),height:100,display:"flex",flexDirection:"column",padding:[f.spacer.xxxl,f.spacer.xl],color:f.color.interactiveNeutral,contentColor:f.color.fillInverse,borderRadius:f.radius.sm,marginX:f.spacer.xxxl},modes:{focus:{color:f.color.interactiveNeutralFocus},disabled:{color:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse},brand:{color:f.color.interactiveBrand,focus:{color:f.color.fillNeutral}}},themeStyles:wr},Jl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.button1},themeStyles:wr};$(ql);$(Zl);$(Jl);const{Tile:{defaultTone:Od,...Rn}={styles:{}}}=(ao=f)==null?void 0:ao.componentConfig,{Surface:{defaultSurfaceTone:Wd,...ec}={styles:{}}}=(lo=f)==null?void 0:lo.componentConfig,tc={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:f.spacer.xl,paddingYBetweenContent:f.spacer.md,borderRadius:f.radius.md,alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:{...ec,...Rn}},nc={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Rn},rc={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Rn},oc={themeKeys:{},base:{width:f.spacer.lg*5,height:f.spacer.xxl+f.spacer.md},themeStyles:Rn};$(tc);$(nc);$(rc);$(oc);const ic={color:255,height:150,width:330,x:1910,y:10,mountX:1,alpha:.8,zIndex:100},Te={x:10,fontSize:22,textColor:M("#f6f6f6")},rn={fontSize:22,textColor:M("#f6f6f6")},[sc,ac]=W(0),[lc,cc]=W(0),[dc,uc]=W(99),[hc,fc]=W(0),[gc,pc]=W(0),[mc,xc]=W(0),[yc,vc]=W(0);let uo=0,ho=0;const wc=r=>{r&&(ac(r),uc(n=>Math.min(r,n)),fc(n=>Math.max(r,n)),ho+=r,uo++,cc(Math.round(ho/uo)))},bc=r=>{let n=0,e=0,t=0;r.txManager.textureIdCache.forEach((o,i,s)=>{o.state==="loaded"&&n++,o.state==="loading"&&e++,o.state==="failed"&&t++}),pc(n),xc(e),vc(t)};function Sc(r){r.renderer.on("fpsUpdate",(n,e)=>{const t=typeof e=="number"?e:e.fps;t>5&&(wc(t),bc(n.root.stage))})}const Ac=r=>l(N,Q(r,{style:ic,get children(){return[l(N,{get children(){return[l(E,{style:Te,children:"FPS:"}),l(E,{style:rn,x:90,get children(){return sc()}})]}}),l(N,{x:160,get children(){return[l(E,{style:Te,children:"AVG:"}),l(E,{style:rn,x:100,get children(){return lc()}})]}}),l(N,{x:0,y:20,get children(){return[l(E,{style:Te,children:"MIN:"}),l(E,{style:rn,x:90,get children(){return dc()}})]}}),l(N,{x:160,y:20,get children(){return[l(E,{style:Te,children:"MAX:"}),l(E,{style:rn,x:100,get children(){return hc()}})]}}),l(N,{x:0,y:50,get children(){return[l(E,{style:Te,children:"Loaded Textures Cnt:"}),l(E,{style:Te,x:270,get children(){return gc()}})]}}),l(N,{x:0,y:80,get children(){return[l(E,{style:Te,children:"Loading Textures Cnt:"}),l(E,{style:Te,x:270,get children(){return mc()}})]}}),l(N,{x:0,y:110,get children(){return[l(E,{style:Te,children:"Failed Textures Cnt:"}),l(E,{style:Te,x:270,get children(){return yc()}})]}})]}})),er={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:f.layout.marginX}},Gradient:{zIndex:99,color:M("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:M("#424242")},active:{width:328,height:70}}},Cc="/solid-demo-app/",Tc=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function _c(r){const n=nl(Cc+"assets/icons_white.png",Tc);return l(N,Q(r,{get texture(){return n[r.name]},get width(){return n[r.name].props.width},get height(){return n[r.name].props.height},get x(){return(100-(n[r.name].props.width||0))/2},get y(){return(100-(n[r.name].props.height||0))/2}}))}function on(r){return l(N,Q(r,{forwardStates:!0,get style(){return er.NavButton},get children(){return[l(N,{y:-16,get children(){return l(_c,{scale:.5,get name(){return r.icon}})}}),l(E,{style:{fontSize:38,x:116,y:18,height:50,alpha:0,active:{alpha:1}},get children(){return r.children}})]}}))}function Rc(r){let n;const e=vt();function t(){n.states.add("focus"),this.children.forEach(s=>s.states.add("active")),this.children.selected.setFocus()}function o(){n.states.remove("focus"),this.selected=0,this.children.forEach(s=>s.states.remove("active"))}function i(s){if(Aa(()=>s)())return r.focusPage();e(s)}return[l(N,{flexItem:!1,x:40,y:30,zIndex:105,get alpha(){return r.showWidgets?1:0},get children(){return[l(E,{x:80,fontSize:28,color:4143380036,children:"Built With:"}),l(N,{y:22,src:"./assets/solidWord.png",width:280,height:52})]}}),l(te,Q(r,{onFocus:t,onBlur:o,get style(){return er.Column},scroll:"none",get children(){return[l(on,{onEnter:()=>i("/browse/all"),icon:"trending",children:"Trending"}),l(on,{icon:"movie",onEnter:()=>i("/browse/movie"),children:"Movies"}),l(on,{icon:"tv",onEnter:()=>i("/browse/tv"),children:"TV"}),l(on,{icon:"experiment",onEnter:()=>i("/examples"),children:"Examples"})]}})),l(N,{ref(s){var a=n;typeof a=="function"?a(s):n=s},get style(){return er.Gradient}})]}const Ic=r=>{Ka({Announcer:["a"],Menu:["m"],Escape:["Escape",27],Backspace:["Backspace",8],Left:["ArrowLeft",37],Right:["ArrowRight",39],Up:["ArrowUp",38],Down:["ArrowDown",40],Enter:["Enter",13]});const n=tl();n.enabled=!1;const e=vt();let t,o;Sc({renderer:Le});function i(){return t.states.has("focus")?!1:(o=sr(),t.setFocus())}const[s,a]=W(!0),c=ei(),d=["/browse","/entity"];return je(()=>{const u=c.pathname;let g=d.some(w=>u.startsWith(w));u==="/"&&(g=!0),a(g)}),l(N,{onAnnouncer:()=>n.enabled=!n.enabled,onLast:()=>history.back(),onMenu:()=>e("/"),style:{width:1920,height:1080},onBackspace:i,onLeft:i,onRight:()=>t.states.has("focus")&&o.setFocus(),get children(){return[l(ol,{}),l(Ac,{mountX:1,x:1910,y:10,get alpha(){return s()?1:0}}),xt(()=>r.children),l(Rc,{ref(u){var g=t;typeof g=="function"?g(u):t=u},focusPage:()=>o.setFocus(),get showWidgets(){return s()}})]}})},ge={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:f.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:M("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:M("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:M("#000000")},RowTitle:{height:60,width:300,marginBottom:-40,fontSize:36,color:M("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:64,width:f.layout.screenW-2*f.layout.marginX,x:f.layout.marginX+f.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:M("#0000ff")},peopleBio:{...f.typography.body1,fontFamily:"Ubuntu",fontWeight:"normal",contain:"both",width:780,height:340}},vn={width:120,height:40,color:M("#000000"),borderRadius:8,border:{width:2,color:M("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:M("#333333")}},transition:{scale:!0,color:!0}},Bc={color:M("#00A699"),height:8,y:2,x:-4,width:vn.width+8},kc={fontSize:12,y:12,contain:"width",textAlign:"center",color:M("#F6F6F9"),height:vn.height,width:vn.width},fo={container:vn,topBar:Bc,text:kc},go={width:386,height:136,color:M("#715cab"),focus:{color:M("#5a39a2")},disabled:{color:M("#291d43")}},Ec={fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:M("#FFFFFF"),height:go.height,width:go.width,focus:{fontSize:40},disabled:{color:M("#909090")}};function Fc(r){return l(N,Q(r,{get style(){return ge.Thumbnail}}))}function wn(r){const[n,e]=Vi(r,["items"]);return l(X,Q(e,{get style(){return ge.Row},get children(){return l(Tn,{get each(){return n.items},children:t=>l(Fc,t)})}}))}const Nc="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA",Lc="https://api.themoviedb.org/3";let di,ui;const Mc="w185",zc={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Nc}};function Nt(r,n=Mc){return ui+n+r}function Pc(r,n={}){return di?tr(r,n):hi().then(()=>tr(r,n))}function tr(r,n={}){return fetch(Lc+r,{...zc,...n}).then(e=>e.json())}function hi(){return tr("/configuration").then(r=>{var n;return di=r,ui=(n=r.images)==null?void 0:n.secure_base_url,r})}const rt={get:Pc,loadConfig:hi};function Dc(r,n){return r.length>n?r.substring(0,n-3)+"...":r}function Oc(r,n=7){let e=[];for(let t=0,o=r.length;t({src:Nt(n.poster_path||n.profile_path),tileSrc:Nt(n.backdrop_path||n.profile_path,"w300"),backdrop:Nt(n.backdrop_path,"w1280"),href:"/entity/".concat(n.media_type||"people","/").concat(n.id),shortTitle:Dc(n.title||n.name,30),title:n.title||n.name,data:n,entityInfo:{type:n.media_type||"people",id:n.id},heroContent:{title:n.title||n.name,description:n.overview}}))}let Pn=new Map;const sn=new Map;function Wc(r){return n=>{const e="/trending/".concat(r,"/week?page=").concat(n);if(Pn.has(e))return Pn.get(e);let t=rt.get(e).then(o=>{let i=o.results.filter(c=>!c.adult),s=(sn.has(r)?sn.get(r):[]).concat(zt(i)),a=Oc(s);return a[a.length-1].length<7?sn.set(r,a.pop()):sn.delete(r),a});return Pn.set(e,t),t}}function Uc(r){const[n,e]=W([]),[t,o]=W(1),[i,s]=W(!1),[a]=tt(t,r);return Dn(()=>{const c=a();c&&Di(()=>{c.length===0&&s(!0),e(d=>[...d,...c])})}),{pages:n,page:t,setPage:o,setPages:e,end:i,setEnd:s}}const In=900,Yc={...f.typography.display2,fontFamily:"Ubuntu",fontWeight:700,maxLines:1,width:In,contain:"width"},$c=r=>l(E,Q(r,{style:Yc})),Hc={...f.typography.body1,fontFamily:"Ubuntu",fontWeight:400,lineHeight:32,width:In,maxLines:3,contain:"width"},jc={fontSize:16,lineHeight:20},Qc=r=>l(E,Q(r,{style:Hc,get children(){return r.children}})),Xc=r=>(()=>{var n=Ot("node");return Qo(ri,n,()=>[8,13,11,13]),_n(n,Q(r,{style:{color:"0x00000099",borderRadius:8,border:{width:2,color:"0xffffffff"}}}),!0),jo(n,l(E,{style:jc,get children(){return r.children}})),n})(),po={...f.typography.body2,fontFamily:"Ubuntu",fontWeight:400},Kc=r=>l(N,{style:{display:"flex",flexDirection:"row",gap:18,width:In,height:48},get children(){return[l(N,{y:-4,src:"./assets/stars.png",width:188,height:31}),l(N,{y:-4,flexItem:!1,clipping:!0,get width(){return 188*r.voteAverage/10},height:31,get children(){return l(N,{src:"./assets/stars-full.png",width:188,height:31})}}),l(E,{style:po,get children(){return[xt(()=>r.voteCount)," reviews"]}}),l(E,{style:po,get children(){return r.metaText}}),l(Tn,{get each(){return r.badges},children:n=>l(Xc,{y:-5,children:n})})]}}),fi=r=>l(N,Q(r,{style:{display:"flex",flexDirection:"column",width:In,height:220,gap:16},get children(){return[l($c,{get children(){return r.title}}),l(Qc,{get children(){return r.description}}),l(ze,{get when(){return r.voteCount},get children(){return l(Kc,{get metaText(){return r.metaText},get badges(){return r.badges},get voteCount(){return r.voteCount},get voteAverage(){return r.voteAverage}})}})]}}));function Vc(r){const n=Math.floor(r/60),e=r%60;return n+"h "+(e<10?"0":"")+e+"min"}function Gc(r){const n=r.split("-");return n[1]+"/"+n[2]+"/"+n[0]}function mo(r){return r.split("-")[0]}function qc({type:r,id:n}){return rt.get("/".concat(r,"/").concat(n,"/recommendations")).then(({results:e})=>e.length?zt(e.slice(0,7)):rt.get("/trending/".concat(r,"/week?page=1")).then(({results:t})=>zt(t.slice(0,7))))}function Zc({type:r,id:n}){return rt.get("/".concat(r,"/").concat(n,"/credits")).then(({cast:e})=>zt(e.slice(0,7)))}function gi({type:r,id:n}){let e=r==="movie"?{rtCrit:86,rtFan:92}:{};return rt.get("/".concat(r,"/").concat(n)).then(t=>({backgroundImage:Nt(t.backdrop_path,"w1280"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD","CC"],voteAverage:t.vote_average,voteCount:t.vote_count,metaText:r==="movie"?Vc(t.runtime)+" "+Gc(t.release_date):"".concat(mo(t.first_air_date)," - ").concat(mo(t.last_air_date)),reviews:e},...t}))}const xo=()=>{const r=fr(),[n,e]=W(0),[t,o]=W();tt(t,gi);const[i,s]=W({}),a=vt(),c=To(()=>0),d=q(()=>Uc(Wc(r.filter||"all"))),u=qn(p=>Ee(p),400),g=qn(p=>s(p),200);je(it(sr,p=>{p.backdrop&&u(p.backdrop),p.heroContent&&g(p.heroContent)},{defer:!0}));function w(){var y;(y=this.children.selected)==null||y.setFocus(),e((this.y||0)*-1+24);let p=d().pages().length;(p===0||this.parent.selected&&this.parent.selected>=p-2)&&d().setPage(S=>S+1)}function A(){let p=this.children.selected;return L(p&&p.href),a(p.href),!0}return l(ze,{get when(){return d().pages().length},get children(){return[l(fi,Q({y:360,x:162},i)),l(N,{clipping:!0,get style(){return ge.itemsContainer},get children(){return l(te,{plinko:!0,announce:"All Trending - Week",get y(){return n()},get style(){return ge.Column},get children(){return l(Tn,{get each(){return d().pages()},children:(p,y)=>l(wn,{get autofocus(){return c(y())},items:p,width:1620,onFocus:w,onEnter:A})})}})}})]}})},Jc=()=>{const r=vt(),n=To(()=>0);function e(){let c=this.children.selected;L(c&&c.id),r("/"+c.id)}const t=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(c){const d={width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},[u,g]=W(4294967295);return l(N,Q(c,{onFocus:()=>g(255),onBlur:()=>g(4294967295),style:d,get children(){return l(N,{x:30,get children(){return[l(E,{y:30,fontSize:84,get color(){return u()},get children(){return c.index}}),l(E,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return u()},get children(){return c.title}}),l(E,{y:200,fontSize:28,width:330,contain:"width",get color(){return u()},get children(){return c.description}})]}})}}))}const[i,s]=W(140);function a(c){s(c.selected*-400+140)}return l(N,{colorTop:1147903743,colorBottom:743406847,get children(){return[l(N,{x:120,get children(){return[l(N,{src:"./assets/solidjs.png",width:101,height:90,y:40}),l(E,{fontSize:90,x:110,y:40,children:"Examples"}),l(N,{y:140,height:1,width:1800,color:3906468351})]}}),l(X,{onSelectedChanged:a,onEnter:e,transition:{x:{delay:20,duration:300}},get x(){return i()},y:300,width:4400,get style(){return ge.Row},justifyContent:"flexStart",gap:40,get children(){return l(Tn,{each:t,children:(c,d)=>l(o,Q({get autofocus(){return n(d())},get index(){return d()}},c))})}})]}})},ed=()=>{const r={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:M("00000000")},e={fontSize:42},t={width:r.width,fontSize:26,contain:"width"},o={fontSize:26};return Qe(()=>{Ee("#000000")}),l(N,{autofocus:!0,style:r,get children(){return[l(E,{style:e,children:"Title of the Page"}),l(E,{style:t,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),l(N,{style:n,get children(){return[l(E,{style:o,children:"Subline Text"}),l(N,{width:28,height:28,src:"./assets/rt-popcorn.png"}),l(E,{style:o,children:"More Text"})]}})]}})},td=()=>{const r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:M("00000000")},e={fontSize:42},t={fontSize:26};let o,i;Qe(()=>{Ee("#000000"),o.animate({x:100},{duration:2e3}).start()});const[s,a]=W(),[c,d]=W();setTimeout(()=>{var b;a("- Inserted -"),(b=i.getChildById("child1"))==null||b.animate({x:600},{duration:2e3}).start()},2e3);const u={width:400,height:300,color:M("#0000ff")},g={color:M("#f54242"),focus:{color:M("#4287f5")}};function w(b){const v=An(()=>b.children);return l(N,Q(b,{get style(){return[g,b.style,[u]]},get children(){return[l(N,{id:"child1",width:100,height:100,get color(){return M("#ff0000")},y:25,get children(){return[xt(()=>v()),l(N,{id:"subChild",x:150,width:100,height:100,get color(){return M("#00ff00")}}),l(E,{get children(){return b.title}})]}}),l(N,{width:100,height:100,get color(){return M("#ffff00")},y:175,get children(){return v()}})]}}))}const A={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},p={color:M("#cccccc"),focus:{color:M("#000000")}},y={color:M("#ffffff"),focus:{color:M("#f6f6cc")}};function S(b){return b.states.has("focus")}return l(N,{style:r,get children(){return[l(E,{style:e,children:"Title of the Page"}),l(N,{style:n,get children(){return[l(E,{get children(){return c()}}),l(E,{style:t,get children(){return["Sub ",xt(()=>s())," Text"]}}),l(ze,{get when(){return s()},get children(){return l(N,{width:28,height:28,src:"./assets/rt-popcorn.png"})}}),l(E,{style:t,children:"More Text"})]}}),l(w,{autofocus:!0,ref(b){var v=i;typeof v=="function"?v(b):i=b},style:[y,p],get children(){return l(E,{children:"Child Test"})}}),l(N,{ref(b){var v=o;typeof v=="function"?v(b):o=b},style:A,width:100,height:100,get color(){return M("#00ff00")},x:900,y:400,get alpha(){return S(o)?1:.2}})]}})},nd=()=>{let r,n;const[e,t]=W([]),o={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:M("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},i={fontSize:32,x:960,y:540,mount:.5,lineheight:52},s=(c,d)=>Math.floor(Math.random()*(d-c+1)+c);Qe(()=>{Ee("#000000"),r.x=1820/2,r.y=980/2,n=setInterval(()=>{r.rotation=s(-90,90),r.x=s(-300,2220),r.y=s(-300,1380)},2500)});function a(c,d){t(u=>[...u,c].slice(-4)),console.log(c)}return Me(()=>{clearInterval(n)}),l(N,{get children(){return[l(E,{style:i,get children(){return e().join("\n")}}),l(N,{autofocus:!0,style:o,ref(c){var d=r;typeof d=="function"?d(c):r=c},onEvents:[["inBounds",c=>a("inBounds")],["outOfBounds",c=>a("outOfBounds")],["inViewport",c=>a("inViewport")],["outOfViewport",c=>a("outOfViewport")]]})]}})},rd=()=>{function r(o,i){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:M("00000000"),gap:26,y:400};function e(o){return l(N,Q(o,{forwardStates:!0,get style(){return fo.container},get children(){return l(E,{get style(){return fo.text},get children(){return o.children}})}}))}const t=o=>(()=>{var i=Ot("node");return Qo(ri,i,()=>[10,15]),_n(i,Q(o,{get style(){return{color:M("#000000be"),borderRadius:8,border:{width:2,color:M("#ffffff")}}}}),!0),jo(i,l(E,{style:{fontSize:20},get children(){return o.children}})),i})();return[l(X,{x:100,y:200,gap:5,style:n,get children(){return[l(t,{children:"HD"}),l(t,{children:"PG13"}),l(t,{children:"NC17"}),l(E,{fontSize:30,children:"I like bananas"}),l(t,{children:"DOLBY"})]}}),l(X,{x:100,gap:40,style:n,get children(){return[l(e,{autofocus:!0,onEnter:r,children:"TV Shows"}),l(e,{states:{active:!0,disabled:!1},children:"Movies"}),l(e,{states:"active",children:"Sports"}),l(e,{states:"disabled",children:"News"})]}})]},od=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:M("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(a){return l(N,Q(a,{style:{width:200,height:100,y:5,color:392801023}}))}const[t,o]=W(50);function i(){var a;(a=this.children.selected)==null||a.setFocus(),o(150+(this.y||0)*-1)}Qe(()=>{Ee("#333333")});const s=50;return l(te,{x:160,get y(){return t()},gap:30,height:850,get width(){return r.width},get style(){return ge.Column},get children(){return[l(E,{style:n,children:"Flex Start"}),l(X,{gap:s,style:r,onFocus:i,get children(){return[l(e,{autofocus:!0}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(E,{style:n,children:"Flex Start - Margin Left"}),l(X,{gap:s,style:r,onFocus:i,get children(){return[l(e,{marginLeft:100}),l(e,{}),l(e,{marginLeft:100}),l(e,{}),l(e,{})]}}),l(E,{style:n,children:"Flex End"}),l(X,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(E,{style:n,children:"Flex End - Margin Right"}),l(X,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{marginRight:100}),l(e,{}),l(e,{}),l(e,{marginRight:100})]}}),l(E,{style:n,children:"Center - No Margin Support"}),l(X,{gap:s,justifyContent:"center",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(E,{style:n,children:"Space Between - No Margin Support"}),l(X,{gap:s,justifyContent:"spaceBetween",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(E,{style:n,children:"Space Evenly - No Margin Support"}),l(X,{gap:s,justifyContent:"spaceEvenly",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}})]}})},id=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:M("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(c){return l(N,Q(c,{style:{width:200,height:100,y:5,color:392801023}}))}function t(){return Math.floor(Math.random()*91)+10}const[o,i]=W(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}Qe(()=>{Ee("#333333")});const a=50;return l(te,{x:160,get y(){return o()},gap:30,height:850,get width(){return r.width},get style(){return ge.Column},get children(){return[l(E,{style:n,children:"Flex Start - AlignItems: center"}),l(X,{alignItems:"center",gap:a,style:r,onFocus:s,get children(){return[l(e,{autofocus:!0,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:n,children:"Flex Start - Margin Left - AlignItems: flexStart"}),l(X,{gap:a,alignItems:"flexStart",style:r,onFocus:s,get children(){return[l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:n,children:"Flex End - AlignItems: flexEnd"}),l(X,{gap:a,justifyContent:"flexEnd",alignItems:"flexEnd",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:n,children:"Flex End - Margin Right"}),l(X,{gap:a,justifyContent:"flexEnd",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}})]}}),l(E,{style:n,children:"Center - No Margin Support"}),l(X,{gap:a,justifyContent:"center",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:n,children:"Space Between - No Margin Support"}),l(X,{gap:a,justifyContent:"spaceBetween",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(E,{style:n,children:"Space Evenly - No Margin Support"}),l(X,{gap:a,justifyContent:"spaceEvenly",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}})]}})},sd=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:M("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("#4dabf5"),height:850,width:80},e={fontSize:44,y:20,x:150};function t(d){const u={width:o(),height:80,x:5,color:M("#1769aa")};return l(N,Q(d,{style:u}))}function o(){return Math.floor(Math.random()*61)+10}const[i,s]=W(50);function a(){var d;(d=this.children.selected)==null||d.setFocus(),s(150+(this.y||0)*-1)}Qe(()=>{Ee("#333333")});const c=50;return[l(E,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(X,{gap:c,style:r,onFocus:a,get children(){return[l(te,{gap:30,style:n,alignItems:"center",get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,style:n,onFocus:a,alignItems:"flexStart",get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(te,{gap:c,alignItems:"flexEnd",justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(te,{gap:c,justifyContent:"center",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"spaceBetween",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:c,justifyContent:"spaceEvenly",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},ad=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:M("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("#4dabf5"),height:850,width:60},e={fontSize:44,y:20,x:150};function t(c){const d={width:50,height:80,x:5,color:M("#1769aa")};return l(N,Q(c,{style:d}))}const[o,i]=W(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}Qe(()=>{Ee("#333333")});const a=50;return[l(E,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(X,{gap:a,style:r,onFocus:s,get children(){return[l(te,{gap:30,style:n,get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,style:n,onFocus:s,get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(te,{gap:a,justifyContent:"center",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"spaceBetween",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(te,{gap:a,justifyContent:"spaceEvenly",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},ld=()=>{function r(i,s){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:M("00000000"),gap:26,y:400,x:100},e={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},t=["RoundedRectangle",{radius:65}];function o(i){return l(N,Q(i,{forwardStates:!0,style:e,shader:t,get children(){return l(E,{style:Ec,get children(){return i.children}})}}))}return l(X,{style:n,get children(){return[l(o,{autofocus:!0,onEnter:r,children:"Focused"}),l(o,{states:{active:!0,disabled:!1},children:"Normal"}),l(o,{states:"disabled",children:"Disabled"})]}})},cd="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function dd(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?ud():console.error("Browser not supported!")}async function ud(){const r=document.getElementById("video"),n=new shaka.Player;await n.attach(r),window.player=n,n.addEventListener("error",hd);try{await n.load(cd),console.log("The video has now been loaded!")}catch(e){pi(e)}}function hd(r){pi(r.detail)}function pi(r){console.error("Error code",r.code,"object",r)}function fd(){const r=document.getElementById("video");return r.hidden=!1,setTimeout(()=>r.play(),50),r.focus(),r}function gd(){const r=document.getElementById("video");return r.hidden=!0,r.pause(),r}document.addEventListener("DOMContentLoaded",dd);const pd=()=>{const r=fr(),n=vt(),[e]=tt(()=>({...r}),gi),[t]=tt(()=>({...r}),Zc),[o]=tt(()=>({...r}),qc),[i,s]=W(0);je(it(e,b=>{Ee(b.backgroundImage)},{defer:!0}));const a=640,c={color:M("#000000"),alpha:0,width:1900,height:890,x:-160,y:a,borderRadius:30};function d(){var b;(b=this.children.selected)==null||b.setFocus(),p.y=a,y.y=a,y.alpha=0}function u(){var b;(b=this.children.selected)==null||b.setFocus(),p.y=200,y.y=160,y.alpha=.9}function g(){let b=this.children.selected;L(b&&b.href),n(b.href)}function w(){gd(),document.getElementsByTagName("canvas")[0].focus(),S.setFocus(),s(0)}function A(){const b=fd();Mo(b),s(.9)}let p,y,S;return l(ze,{get when(){return e()},keyed:!0,get children(){return[l(N,{x:170,onUp:()=>S.setFocus(),onEscape:w,get children(){return[l(fi,Q({y:260},()=>e().heroContent)),l(X,{ref(b){var v=S;typeof v=="function"?v(b):S=b},y:500,scroll:"none",height:90,width:640,gap:40,onDown:()=>p.setFocus(),onEnter:A,get children(){return[l(co,{width:300,autofocus:!0,children:"Play"}),l(co,{width:300,children:"Resume"})]}}),l(te,{ref(b){var v=p;typeof v=="function"?v(b):p=b},x:0,y:a,get style(){return ge.Column},zIndex:5,get children(){return l(ze,{get when(){return xt(()=>!!o())()&&t()},get children(){return[l(E,{skipFocus:!0,get style(){return ge.RowTitle},children:"Recommendations"}),l(wn,{onFocus:d,onEnter:g,get items(){return o()},width:1620}),l(E,{skipFocus:!0,get style(){return ge.RowTitle},children:"Cast and Crew"}),l(wn,{onFocus:u,onEnter:g,get items(){return t()},width:1620})]}})}}),l(N,{ref(b){var v=y;typeof v=="function"?v(b):y=b},style:c,transition:{alpha:!0,y:!0}})]}}),l(N,{get alpha(){return i()},get color(){return M("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function md({id:r}){return rt.get("/person/".concat(r,"/combined_credits")).then(({cast:n})=>zt(n.slice(0,7)))}function xd({id:r}){return rt.get("/person/".concat(r)).then(n=>({backgroundImage:Nt(n.profile_path,"original"),heroContent:{title:n.title||n.name,description:n.biography},...n}))}const yd=()=>{const r=fr(),n=vt(),[e]=tt(()=>({...r}),xd),[t]=tt(()=>({...r}),md),o={color:M("#000000"),alpha:.8,width:800,height:440,x:130,y:180,borderRadius:30};function i(){let s=this.children.selected;L(s&&s.href),n(s.href)}return Qe(()=>{Ee("#333333")}),l(ze,{get when(){return e()},keyed:!0,get children(){return[l(N,{get src(){return e().backgroundImage},width:400,autosize:!0,y:0,x:1800,mountX:1}),l(N,{x:150,y:200,width:800,gap:24,get style(){return ge.Column},zIndex:3,get children(){return[l(E,{contain:"width",fontFamily:"Ubuntu",get style(){return f.typography.display2},get children(){return e().name}}),l(E,{contain:"both",get style(){return ge.peopleBio},get children(){return e().biography}})]}}),l(N,{style:o}),l(te,{y:670,x:140,get style(){return ge.Column},scroll:"none",get children(){return l(ze,{get when(){return t()},get children(){return[l(E,{skipFocus:!0,get style(){return ge.RowTitle},children:"Credits"}),l(wn,{autofocus:!0,onEnter:i,get items(){return t()}})]}})}})]}})},vd=()=>(()=>{var r=Ot("node");return ua(r,"style",{width:1920,height:1080,color:868483072}),r})(),wd=new URL("AppCoreExtensions-CJpWn59E.js",import.meta.url).href;pe.debug=!1;pe.animationsEnabled=!0;pe.fontSettings.fontFamily="Ubuntu";pe.fontSettings.color=M("#f6f6f6");pe.fontSettings.fontSize=32;pe.rendererOptions={coreExtensionModule:wd,fpsUpdateInterval:200,enableInspector:!0};da(()=>l(Wa,{root:r=>l(Ic,r),get children(){return[l(he,{path:"",component:xo}),l(he,{path:"examples",component:Jc}),l(he,{path:"browse/:filter",component:xo}),l(he,{path:"text",component:ed}),l(he,{path:"buttons",component:rd}),l(he,{path:"flex",component:od}),l(he,{path:"create",component:td}),l(he,{path:"viewport",component:nd}),l(he,{path:"flexsize",component:id}),l(he,{path:"flexcolumnsize",component:sd}),l(he,{path:"flexcolumn",component:ad}),l(he,{path:"buttonsmaterial",component:ld}),l(he,{path:"entity/people/:id",component:yd}),l(he,{path:"entity/:type/:id",component:pd}),l(he,{path:"*all",component:vd})]}}));export{Sd as __vite_legacy_guard}; -//# sourceMappingURL=index-PC-bZnEO.js.map diff --git a/assets/index-PC-bZnEO.js.map b/assets/index-PC-bZnEO.js.map deleted file mode 100644 index eda8281..0000000 --- a/assets/index-PC-bZnEO.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"mappings":"8tCAqIA,MAAMA,GAAU,CAACC,EAAGC,IAAMD,IAAMC,EAC1BC,GAAS,OAAO,aAAa,EAC7BC,GAAS,OAAO,aAAa,EAC7BC,GAAW,OAAO,qBAAqB,EACvCC,GAAgB,CACpB,OAAQN,EACV,EAEA,IAAIO,GAAaC,GACjB,MAAMC,GAAQ,EACRC,GAAU,EACVC,GAAU,CACd,MAAO,KACP,SAAU,KACV,QAAS,KACT,MAAO,IACT,EACMC,GAAU,GAChB,IAAIC,EAAQ,KACZ,IAAIC,GAAa,KAEbC,GAAuB,KACvBC,EAA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IACP,KAAM,KACN,OAAQ,IACR,KAAM,KACN,MAAO,GACR,EACD,WAAY,CACV,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,mBAAoB,CAClB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,eAAgB,CACd,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,SAAU,CACR,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,iBAAkB,CAChB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,aAAc,CACZ,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,QAAS,CACP,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,gBAAiB,CACf,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,YAAa,CACX,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,CACF,EACD,MAAO,CACL,UACE,6ZACF,WACE,iZACF,iBACE,ylHACF,MACE,gZACH,EACD,MAAO,CACL,QAAS,CACP,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,YACZ,EACD,MAAO,aACP,MAAO,aACP,KAAM,aACN,IAAK,aACL,OAAQ,aACR,OAAQ,aACR,MAAO,aACP,KAAM,aACN,OAAQ,aACR,SAAU,aACV,cAAe,aACf,QAAS,aACT,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAAc,aACd,SAAU,aACV,YAAa,aACb,gBAAiB,YACjB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aA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oBiD,UAAWomB,GAAM3iB,IAC/CgB,GAAK,CAAC1H,KAAI,OAAQiD,UAAWunB,EAAQ,MAEzC","names":["equalFn","a","b","$PROXY","$TRACK","$DEVCOMP","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","DevHooks","createRoot","fn","detachedOwner","listener","owner","unowned","current","root","updateFn","untrack","cleanNode","runUpdates","createSignal","value","options","s","registerGraph","setter","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","v","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","error","setError","track","trigger","state","setState","loadEnd","p","key","completeLoad","err","read","SuspenseContext","load","refetching","lookup","e","castError","createSelector","subs","node","val","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","i","result","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","devComponent","Comp","props","createContext","defaultValue","id","createProvider","useContext","context","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","res","completeUpdates","queue","userLength","ignore","index","obs","n","results","FALLBACK","dispose","d","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","j","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","start","end","newEnd","item","disposer","mapper","set","createComponent","trueFn","propTraps","_","property","receiver","resolveSource","resolveSources","length","mergeProps","sources","proxy","keys","sourcesMap","defined","sourceKeys","desc","target","definedKeys","splitProps","blocked","k","otherObject","objects","propName","isDefaultDesc","objectIndex","narrowedError","name","For","fallback","Show","keyed","condition","child","DEV","activeElement","setActiveElement","TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","x","y","w","h","convertColorToRgba","color","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","properties","div","driver","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","uni","trPropSetterDefaults","TextRenderer","stage","propSetters","status","renderable","eventName","WebTrFontFace","TrFontFace","fontFamily","descriptors","fontUrl","fontUrlWithoutParentheses","determinedDescriptors","cssDescriptors","fontFace","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","ff","ffs","fontSetting","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","m","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","drawLines","hlHeight","offset","hlPaddingLeft","hlPaddingRight","getRgbaString","drawLine","prevShadowSettings","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","truncWordWidth","text","indent","allLines","realNewlines","resultLines","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","EventEmitter","cssString","maxLines","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","scrollY","contain","visibleWindow","renderWindow","canvasPages","elementBounds","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","pageInfo","transform","clippingRect","textW","textH","elementRect","intersectRect","pageSize","zIndex","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","_h","_g","_j","_i","_l","_k","DefaultShader","WebGlCoreShader","renderer","textures","glw","DefaultShaderBatched","t","samplers","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","effect","_DynamicShader","shader","memize","regEffects","eff","fxClass","uniInfo","fxProp","propInfo","propsA","propsB","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","fxProps","remap","cm","fxMethod","onShaderMask","onColorize","onEffectMask","reg","methodParameters","pm","sharedMethods","currentMask","drawEffects","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","isCompressedTextureContainer","url","loadCompressedTexture","arrayBuffer","loadKTXData","loadPVRData","buffer","view","littleEndian","mipmaps","data","imageSize","header","dataOffset","pvrtcData","level","_ImageTexture","Texture","txManager","mimeType","src","premultiplyAlpha","blob","hasAlphaChannel","img","resolve","reject","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","codePoint","measureText","shaperProps","shaper","glyphs","glyph","layoutText","curLineIndex","startX","startY","textAlign","vertexBuffer","rwSdf","trFontFace","forceFullLayoutCalc","scrollable","overflowSuffix","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","startingMaxX","startingMaxY","maxX","maxY","curX","curY","bufferOffset","lastWord","glyphResult","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","moreLines","nextLineWillFit","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","charEndX","quadX","quadY","atlasEntry","uvWidth","uvHeight","vertexTextW","line","xOffset","roundUpToMultiple","multiple","roundDownToMultiple","setRenderWindow","outRenderWindow","bufferMargin","screen","sdf","isBoundPositive","x1","x2","y1Base","y1","y2","weightConversions","fontWeightToNumber","weight","rawResolveFontToUse","familyMapsByPriority","family","weightIn","style","stretch","fontFamiles","fontFaces","weightMap","fontFamilyWeight","msg","resolveFontToUse","TrFontManager","textRenderers","font","trId","tr","tmpRect","SdfTextRenderer","boundsOverlap","SdfTrFontFace","familyName","faceSet","debugData","neededLength","rwScreen","out2","parentHasRenderTexture","framebufferDimensions","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","validTypes","valueType","RendererMain","resolvedSettings","appWidth","appHeight","deviceLogicalPixelRatio","devicePhysicalPixelRatio","enableInspector","useFinalizationRegistryTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","fpsData","frameTickData","_m","_n","_o","_p","_q","_r","_s","colorTl","colorTr","colorBl","colorBr","_t","_u","_v","_w","_x","_y","_z","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_L","_K","_N","_M","_O","_Q","_P","_S","_R","_T","_V","_U","_X","_W","_Y","_Z","textureType","shaderType","CoreAnimation","getTimingFunction","startValue","endValue","dt","easing","stopMethod","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","promise","m0","m1","m2","m3","m4","m5","m6","m7","m8","Matrix3d","entries","tempMatrix","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","sx","sy","angle","cos","sin","dst","transpose","other","rx1","rx2","rx3","rx4","ry1","ry2","ry3","ry4","RenderCoords","x3","y3","x4","y4","CoreNodeRenderState","CoreNodeRenderStateMap","UpdateType","CoreNode","dimensions","shManager","type","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","delta","parentClippingRect","childUpdateType","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","rtt","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","worldAlpha","newParent","oldParent","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","payload","imageUrl","startLoop","isIdle","runLoop","getTimeStamp","AnimationManager","ImageWorkerManager","numImageWorkers","worker","numWorkers","workerCode","blobURL","workers","absoluteSrcUrl","_NoiseTexture","size","pixelData8","NoiseTexture","CoreTextureManager","ColorTexture","SubTexture","RenderTexture","textureClass","TextureClass","descId","textureDescId","textureIdCache","textureRefCountMap","refCountObj","textureSource","TextureMemoryManager","byteThreshold","byteSize","bufferMemory","Stage","clearColor","rootId","boundsMargin","enableContextSpy","txMemByteThreshold","bm","debugInfo","WebGlCoreRenderer","rootNode","animationManager","renderRequested","fpsUpdateInterval","fps","trProps","textRendererOverride","rendererId","overrideFallback","possibleRenderer","resolvedTextRenderer","CoreTextNode","setWidth","setHeight","calcWidth","textRendererState","MainOnlyTextNode","MainCoreDriver","rendererSettings","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","_key","stateIndexToRemove","calculateFlex","hasOrder","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","changedLayout","stylesToUndo","styleKey","newStyles","styles","handler","inode","radius","Text","_el$","_$createElement","View","createRenderer$1","createElement","createTextNode","isTextNode","replaceText","insertNode","removeNode","setProperty","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","normalized","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","arg","createRenderer","universalLightning","anchor","solidRenderer","render","spread","setProp","use","hexColor","$$EVENTS","delegateEvents","eventNames","document","eventHandler","isServer","createBeforeLeave","listeners","subscribe","confirm","to","force","depth","saveCurrentDepth","keepDepth","notifyIfNotBlocked","notify","block","prevDepth","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","from","basePath","fromPath","invariant","message","joinPaths","extractSearchParams","params","createMatcher","partial","matchFilters","pattern","splat","segments","location","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","filter","isEqual","scoreRoute","route","score","createMemoObject","expandOptionals","prefix","prefixes","expansion","MAX_REDIRECTS","RouterContextObj","RouteContextObj","useRouter","useNavigate","useLocation","useMatch","matchers","matcher","useParams","createRoutes","routeDef","component","info","isLeaf","shared","asArray","originalPath","createBranch","routes","matches","createBranches","stack","branches","routeDefs","def","isEmptyArray","branch","getRouteMatches","createLocation","origin","path_","pathname","search","hash","intent","createRouterContext","integration","getContext","setSource","utils","parsePath","renderPath","beforeLeave","isRouting","setIsRouting","reference","setReference","referrers","submissions","baseRoute","navigatorFactory","preloadRoute","navigateFromRoute","replace","scroll","nextState","resolvedTo","navigateEnd","first","preloadData","prevIntent","createRouteContext","router","outlet","createRouterComponent","routerState","singleFlight","create","_$createComponent","Provider","Root","rootLoad","_$memo","Routes","when","routeStates","nextMatches","prevMatches","equal","prevMatch","nextMatch","createOutlet","splice","forEach","Route","childRoutes","intercept","get","querySelector","selector","createRouter","wrap","signal","bindEvent","scrollToHash","fallbackTop","actions","setupNativeEvents","preload","explicitLinks","actionBase","preloadTimeout","isSvg","handleAnchor","evt","svg","href","rel","handleAnchorClick","handleAnchorPreload","handleAnchorIn","handleAnchorOut","handleFormSubmit","actionRef","hashParser","str","HashRouter","getSource","hashIndex","tryOnCleanup","makeEventListener","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","setEvent","keyMapEntries","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","elm","mappedKeyEvent","finalFocusElm","onKeyHandler","withPadding","padding","pad","right","bottom","firstChild","maxHeight","flattenStrings","series","flattenedSeries","pause","speak","phrase","utterances","lang","synth","utterance","speakSeries","remainingPhrases","nestedSeriesResults","active","retriesLeft","seriesResult","toSpeak","currentSeries","SpeechEngine","debounce","timeoutId","clear","resetFocusPathTimer","currentlySpeaking","voiceOutDisabled","fiveMinutes","debounceWithFlush","scopedValue","debounced","newValue","getElmName","onFocusChangeCore","Announcer","loaded","focusDiff","toAnnounceText","toAnnounce","textToSpeech","append","notification","focusDebounce","focusChangeTimeout","useAnnouncer","createSpriteMap","subTextures","spriteMapTexture","globalBackground","setGlobalBackground","theme","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","startsWith","r$","_ref$","_ref$2","_ref$3","materialBrand","objectFromEntries","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles2","modeKeys","toneKeys","makeToneStyles","tones2","themeComponentStyles","modeStyles","toneStyles","tone","styles2","_a2","_b2","mode","makeModeStyles","modes2","makeBaseStyles","base2","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","convertComponentConfig","themeStyles3","variantName","convertedStyles","styleName","modeName","baseStyles","withScrolling","adjustment","componentRef","selectedElement","selected","lastSelected","axis","lastItem","updateLastIndex","rootPosition","selectedPosition","selectedSize","direct","currentChildIndex","currentChild","currentChildSize","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","_c2","num","getWidthByUpCount$1","theme2","upCount","screenW","columnCount","marginX","gutterX","columnWidth","columnGapTotal","defaultTone$f","themeStyles$e","container$f","defaultTone$e","themeStyles$d","container$e","text$7","icon$2","defaultTone$d","themeStyles$c","surfaceDefaultTone","surfaceThemeStyles$1","container$d","content","text$6","Container$c","Content","Text$5","styles$c","Button","Text$7","defaultTone$c","themeStyles$b","strokeWidth","container$c","icon$1","defaultTone$b","themeStyles$a","container$b","defaultTone$a","themeStyles$9","container$a","Container$9","styles$9","Column","onUp","onDown","defaultTone$9","themeStyles$8","container$9","text$5","themeStyles$7","defaultTone$8","container$8","text$4","icon","defaultTone$7","themeStyles$6","container$7","text$3","defaultTone$6","themeStyles$5","container$6","titleText","descriptionText","defaultTone$5","themeStyles$4","container$5","progress","defaultTone$4","themeStyles$3","container$4","Container$3","styles$3","Row","onLeft","onRight","defaultTone$3","themeStyles$2","container$3","text$2","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","isLoadedCount","setIsLoadedCount","isLoadingCount","setIsLoadingCount","isFailedCount","setIsFailedCount","count","totalFps","calcFps","fps2","calcPerformanceMetrics","isLoadedCount2","isLoadingCount2","isFailedCount2","setupFPS","FPSCounter","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","handleNavigate","page","focusPage","flexItem","showWidgets","onEnter","Gradient","App","Menu","Escape","Backspace","Left","Right","Up","Down","Enter","announcer","enabled","navDrawer","lastFocused","focusNavDrawer","has","setShowWidgets","showOnPaths","currentPath","matchesPartial","some","onAnnouncer","onLast","history","back","onMenu","onBackspace","mountX","TopBar","ButtonText","buttonStyles","MaterialButton","MaterialButtonText","Thumbnail","TileRow","local","others","each","API_KEY_V4","API_BASE","tmdbConfig","baseImageUrl","basePosterSize","defaultFetchParams","getImageUrl","posterSize","_get","loadConfig","api","truncateString","maxLength","chunkArray","convertItemsToTiles","cache","leftoverTiles","browseProvider","pageIndex","trending","tiles","chunks","createInfiniteScroll","pages","setPages","setPage","setEnd","contents","blockWidth","HeadlineStyles","typography","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","Badge","borderRadius","border","MetaTextStyle","body2","Metadata","display","flexDirection","voteAverage","voteCount","metaText","badges","ContentBlock","title","description","minutesToHMM","minutes","hours","remainingMinutes","formatDate","dateString","parts","justYear","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","delayedBackgrounds","delayedHero","onRowFocus","numPages","entity","itemsContainer","plinko","announce","autofocus","Portal","demos","DemoTile","Container","transition","focus","setColor","rowX","setRowX","moveRow","row","colorTop","colorBottom","onSelectedChanged","justifyContent","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","insertTest","setInsertTest","emptyTest","setEmptyTest","setTimeout","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","borderLeft","borderTop","borderRight","borderBottom","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","ballStatus","setBallStatus","styleBall","mount","lineheight","randomIntBetween","Math","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","marginRight","FlexSizePage","randSize","alignItems","FlexColumnPage","ColumnStyles","MaterialButtonsPage","manifestUri","initApp","initPlayer","video","player","onErrorEvent","onError","playVideo","closeVideo","Entity","credits","recommendations","backdropAlpha","setBackdropAlpha","backgroundImage","Backdrop","columnRef","backdropRef","onRowFocusAnimate","onEscape","getElementsByTagName","entityActions","onEnterTrailer","RowTitle","People","autosize","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[0,1,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,96,98],"sources":["../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/dev.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/activeElement.ts","../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/lightningInit.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/children.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/config.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/utils.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/states.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/flex.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/index.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/components/Text.tsx","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/dev.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/solidUniversal.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/render.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/dev.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.1_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_l6qk66ywnsrdb5zvon2uxgrjiy/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nconst DevHooks = {\n afterUpdate: null,\n afterCreateOwner: null,\n afterCreateSignal: null\n};\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n }\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned\n ? () =>\n fn(() => {\n throw new Error(\"Dispose method must be an explicit argument to createRoot function\");\n })\n : () => fn(() => untrack(() => cleanNode(root)));\n DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n {\n if (options.name) s.name = options.name;\n if (DevHooks.afterCreateSignal) DevHooks.afterCreateSignal(s);\n if (!options.internal) registerGraph(s);\n }\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE, options);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE, options);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE, options),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0,\n options\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0, options);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE,\n options\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n console.warn(\"cleanups created outside a `createRoot` or `render` will never be run\");\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction devComponent(Comp, props) {\n const c = createComputation(\n () =>\n untrack(() => {\n Object.assign(Comp, {\n [$DEVCOMP]: true\n });\n return Comp(props);\n }),\n undefined,\n true,\n 0\n );\n c.props = props;\n c.observers = null;\n c.observerSlots = null;\n c.name = Comp.name;\n c.component = Comp;\n updateComputation(c);\n return c.tValue !== undefined ? c.tValue : c.value;\n}\nfunction registerGraph(value) {\n if (!Owner) return;\n if (Owner.sourceMap) Owner.sourceMap.push(value);\n else Owner.sourceMap = [value];\n value.graph = Owner;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id, options),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()), undefined, {\n name: \"children\"\n });\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (true) throw new Error(\"Potential Infinite Loop Detected.\");\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null)\n console.warn(\"computations created outside a `createRoot` or `render` will never be disposed\");\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (options && options.name) c.name = options.name;\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(c);\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n else DevHooks.afterUpdate && DevHooks.afterUpdate();\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n delete node.sourceMap;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined,\n options\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null)\n console.warn(\"error handlers created outside a `createRoot` or `render` will never be run\");\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j, {\n name: \"index\"\n });\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i], {\n name: \"value\"\n });\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = devComponent(Comp, props || {});\n setHydrateContext(c);\n return r;\n }\n }\n return devComponent(Comp, props || {});\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (true)\n Object.assign(Comp, {\n [$DEVCOMP]: true\n });\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name =>\n `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(\n mapArray(() => props.each, props.children, fallback || undefined),\n undefined,\n {\n name: \"value\"\n }\n );\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(\n indexArray(() => props.each, props.children, fallback || undefined),\n undefined,\n {\n name: \"value\"\n }\n );\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b),\n name: \"condition\"\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n {\n name: \"value\"\n }\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals,\n name: \"eval conditions\"\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n {\n name: \"value\"\n }\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, {\n name: \"errored\"\n });\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n if (typeof f !== \"function\" || f.length == 0) console.error(e);\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n {\n name: \"value\"\n }\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = {\n hooks: DevHooks,\n writeSignal,\n registerGraph\n};\nif (globalThis) {\n if (!globalThis.Solid$$) globalThis.Solid$$ = true;\n else\n console.warn(\n \"You appear to have multiple instances of Solid. This can lead to unexpected behavior.\"\n );\n}\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n if (!(src.substr(0, 5) == \"data:\")) {\n // Base64.\n img.crossOrigin = \"Anonymous\";\n }\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha, parentHasRenderTexture, framebufferDimensions) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex, false, parentHasRenderTexture, framebufferDimensions);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n const parentHasRenderTexture = props.parent?.rtt ?? props.parent?.parentHasRenderTexture ?? false;\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n rtt: props.rtt ?? false,\n parentHasRenderTexture,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n hasRTTupdates = false;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n // Assign a default value to parentHasRenderTexture\n parentHasRenderTexture: false,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n // Allow for Render Texture to be processed appropriately\n this.rtt = props.rtt;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // If parent has a render texture, flag that we need to update\n // @todo: Reserve type for RTT updates\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(1);\n }\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n queueMicrotask(() => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n // If node is part of RTT texture\n // Flag that we need to update\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(type);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n }\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children &&\n this.children.length &&\n !this.rtt) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps, rtt, parentHasRenderTexture, } = this.props;\n // Prevent quad rendering if parent has a render texture\n // and renderer is not currently rendering to a texture\n if (parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n rtt,\n parentHasRenderTexture,\n framebufferDimensions: this.framebufferDimensions,\n });\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n if (newParent.rtt || newParent.parentHasRenderTexture) {\n this.setRTTUpdates(UpdateType.All);\n }\n }\n this.parentHasRenderTexture =\n newParent?.rtt || newParent?.parentHasRenderTexture;\n this.updateScaleRotateTransform();\n }\n get rtt() {\n return this.props.rtt;\n }\n set rtt(value) {\n if (!value) {\n return;\n }\n this.props.rtt = true;\n this.hasRTTupdates = true;\n // Store RTT nodes in a separate list\n this.stage.renderer?.renderToTexture(this);\n }\n set parentHasRenderTexture(value) {\n this.props.parentHasRenderTexture = !!value;\n }\n get parentHasRenderTexture() {\n return this.props.parentHasRenderTexture;\n }\n /**\n * Returns the framebuffer dimensions of the node.\n * If the node has a render texture, the dimensions are the same as the node's dimensions.\n * If the node does not have a render texture, the dimensions are inherited from the parent.\n * If the node parent has a render texture and the node is a render texture, the nodes dimensions are used.\n */\n get framebufferDimensions() {\n if (this.parentHasRenderTexture && !this.rtt) {\n return this.parent?.framebufferDimensions;\n }\n return { width: this.width, height: this.height };\n }\n /**\n * Returns the parent render texture node if it exists.\n */\n get parentRenderTexture() {\n let parent = this.parent;\n while (parent) {\n if (parent.rtt) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n get texture() {\n return this.props.texture;\n }\n setRTTUpdates(type) {\n this.hasRTTupdates = true;\n this.parent?.setRTTUpdates(type);\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n rtt: props.rtt,\n parentHasRenderTexture: props.parentHasRenderTexture,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this.rtt = props.rtt;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n get rtt() {\n return this.coreNode.rtt;\n }\n set rtt(value) {\n if (value) {\n this.texture = this.rendererMain.createTexture('RenderTexture', {\n width: this.width,\n height: this.height,\n }, { preload: true, flipY: true });\n }\n this.coreNode.rtt = value;\n }\n get parentHasRenderTexture() {\n return this.coreNode.parentHasRenderTexture;\n }\n set parentHasRenderTexture(value) {\n this.coreNode.parentHasRenderTexture = value;\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n this.registerTextureType('RenderTexture', RenderTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // Reset render operations and clear the canvas\n renderer?.reset();\n // If we have RTT nodes draw them first\n // So we can use them as textures in the main scene\n if (renderer.rttNodes.length > 0) {\n renderer.renderRTTNodes();\n }\n // Fill quads buffer\n this.addQuads(this.root);\n // Perform render pass\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n // Prevent quad rendering if parent has a render texture\n // and this node is not the render texture\n if (this.parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n this.globalTransform.multiply(this.localTransform ?? Matrix3d.identity());\n }\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha, this.parentHasRenderTexture, this.framebufferDimensions);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n parentHasRenderTexture: false,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n let changedLayout = false;\n if (isFunc(this.onBeforeLayout)) {\n changedLayout = this.onBeforeLayout.call(\n this,\n child,\n dimensions,\n ) as boolean;\n }\n\n if (this.display === 'flex') {\n if (calculateFlex(this) || changedLayout) {\n this.parent?.updateLayout();\n }\n } else if (changedLayout) {\n this.parent?.updateLayout();\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n $DEVCOMP\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n if (!element) {\n throw new Error(\n \"The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.\"\n );\n }\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n if (sharedConfig.context)\n throw new Error(\n \"Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.\"\n );\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n if (sharedConfig.context)\n throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}`);\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else console.warn(`Unrecognized value. Skipped inserting`, value);\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = true;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n Object.assign(component, {\n [$DEVCOMP]: true\n });\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n // let flex know we need to re-layout\n return true;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAA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},\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr8lMAx5P8s9N+Y8wk2cTjfQDu66z080h+zml7yKwpgCSdCOByZyX+BuBRJH/otN84M0kWN/s0gOc4Kv8Nko922B1m0gxAkh4I4AcVwcL9JA/UVnjT7CXdHYD9yEzfVUkAjib5uxqNmgCoB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uinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For, hexColor } from \"@lightningjs/solid\";\nimport { createMemo, For as For$1, createSignal } from \"solid-js\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For$1, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For$1, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: (string | number)[];\n Menu: (string | number)[];\n Escape: (string | number)[];\n Backspace: (string | number)[];\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: [\"a\"],\n Menu: [\"m\"],\n Escape: [\"Escape\", 27],\n Backspace: [\"Backspace\", 8],\n Left: [\"ArrowLeft\", 37],\n Right: [\"ArrowRight\", 39],\n Up: [\"ArrowUp\", 38],\n Down: [\"ArrowDown\", 40],\n Enter: [\"Enter\", 13],\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n setupFPS({ renderer });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: \"normal\",\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n fontFamily: \"Ubuntu\",\n fontWeight: 700,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = {\n ...theme.typography.body2,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n};\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"file":"assets/index-PC-bZnEO.js"} \ No newline at end of file diff --git a/assets/index-legacy-C5yJNjTC.js b/assets/index-legacy-C5yJNjTC.js new file mode 100644 index 0000000..4ba6b1f --- /dev/null +++ b/assets/index-legacy-C5yJNjTC.js @@ -0,0 +1,2 @@ +!function(){var e=["defaultTone"],t=["defaultTone"],r=["defaultTone"],n=["surfaceDefaultTone"],o=["defaultTone"],i=["defaultTone"],a=["defaultTone"],s=["defaultTone"],l=["defaultTone"],d=["defaultTone"],u=["defaultTone"],h=["defaultTone"],c=["defaultTone"],f=["defaultTone"],p=["defaultTone"],v=["defaultTone"],g=["defaultSurfaceTone"];function m(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function x(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */x=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),s=new E(n||[]);return o(a,"_invoke",{value:R(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var c="suspendedStart",f="suspendedYield",p="executing",v="completed",g={};function m(){}function y(){}function b(){}var w={};d(w,a,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(N([])));A&&A!==r&&n.call(A,a)&&(w=A);var C=b.prototype=m.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,i,a,s){var l=h(e[o],e,i);if("throw"!==l.type){var d=l.arg,u=d.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(u).then((function(e){d.value=e,a(d)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function R(t,r,n){var o=c;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var l=k(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===c)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var d=h(t,r,n);if("normal"===d.type){if(o=n.done?v:f,d.arg===g)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=v,n.method="throw",n.arg=d.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),d=n.call(a,"finallyLoc");if(l&&d){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),B(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;B(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function y(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(d){return void r(d)}s.done?t(l):Promise.resolve(l).then(n,o)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){y(i,n,o,a,s,"next",e)}function s(e){y(i,n,o,a,s,"throw",e)}a(void 0)}))}}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _(e,t){if(e){if("string"==typeof e)return R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{_=e.a,R=e.i,k=e.T,I=e.g,B=e.c,E=e.E,N=e.b,F=e.d,L=e.e,z=e.f,M=e.m,P=e.W,D=e.h,O=e.j,U=e.k,W=e.l,Y=e.S,H=e.B,j=e.n,Q=e.o,K=e.p,$=e.q,X=e.C,G=e.r,V=e.s,Z=e.t,q=e.u,J=e.v,ee=e.R,te=e.w}],execute:function(){var y,re,ne,oe=x().mark(sr),ie=document.createElement("style");ie.textContent="html,body,*{padding:0;margin:0}video{position:absolute;top:0;left:0;z-index:2;outline:none}.center-element{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n",document.head.appendChild(ie);var ae,se=(e,t)=>e===t,le=Symbol("solid-proxy"),de=Symbol("solid-track"),ue={equals:se},he=Ke,ce=1,fe=2,pe={owned:null,cleanups:null,context:null,owner:null},ve={},ge=null,me=null,xe=null,ye=null,be=null,we=0;function Se(e,t){var r=xe,n=ge,o=0===e.length,i=void 0===t?n:t,a=o?pe:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e((()=>Be((()=>Ve(a)))));ge=a,xe=null;try{return Qe(s,!0)}finally{xe=r,ge=n}}function Ae(e,t){var r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},ue,t):ue).equals||void 0};return[Ue.bind(r),e=>("function"==typeof e&&(e=e(r.value)),We(r,e))]}function Ce(e,t,r){Ye(He(e,t,!0,ce))}function Te(e,t,r){Ye(He(e,t,!1,ce))}function _e(e,t,r){he=$e;var n=He(e,t,!1,ce);r&&r.render||(n.user=!0),be?be.push(n):Ye(n)}function Re(e,t,r){r=r?Object.assign({},ue,r):ue;var n=He(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Ye(n),Ue.bind(n)}function ke(e,t,r){var n,o,i;2===arguments.length&&"object"==typeof t||1===arguments.length?(n=!0,o=e,i=t||{}):(n=e,o=t,i=r||{});var a=null,s=ve,l=!1,d="initialValue"in i,u="function"==typeof n&&Re(n),h=new Set,c=C((i.storage||Ae)(i.initialValue),2),f=c[0],p=c[1],v=C(Ae(void 0),2),g=v[0],m=v[1],x=C(Ae(void 0,{equals:!1}),2),y=x[0],b=x[1],w=C(Ae(d?"ready":"unresolved"),2),S=w[0],A=w[1];function _(e,t,r,n){return a===e&&(a=null,void 0!==n&&(d=!0),e!==s&&t!==s||!i.onHydrated||queueMicrotask((()=>i.onHydrated(n,{value:t}))),s=ve,function(e,t){Qe((()=>{void 0===t&&p((()=>e)),A(void 0!==t?"errored":d?"ready":"unresolved"),m(t);var r,n=T(h.keys());try{for(n.s();!(r=n.n()).done;){r.value.decrement()}}catch(t){n.e(t)}finally{n.f()}h.clear()}),!1)}(t,r)),t}function R(){var e=ae,t=f(),r=g();if(void 0!==r&&!a)throw r;return xe&&!xe.user&&e&&Ce((()=>{y(),a&&(e.resolved||h.has(e)||(e.increment(),h.add(e)))})),t}function k(e=!0){if(!1===e||!l){l=!1;var t=u?u():n;if(null!=t&&!1!==t){var r,i=s!==ve?s:Be((()=>o(t,{value:f(),refetching:e})));return(r=i)&&"object"==typeof r&&"then"in r?(a=i,"value"in i?("success"===i.status?_(a,i.value,void 0,t):_(a,void 0,void 0,t),i):(l=!0,queueMicrotask((()=>l=!1)),Qe((()=>{A(d?"refreshing":"pending"),b()}),!1),i.then((e=>_(i,e,void 0,t)),(e=>_(i,void 0,Ze(e),t))))):(_(a,i,void 0,t),i)}_(a,Be(f))}}return Object.defineProperties(R,{state:{get:()=>S()},error:{get:()=>g()},loading:{get(){var e=S();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return R();var e=g();if(e&&!a)throw e;return f()}}}),u?Ce((()=>k(!1))):k(!1),[R,{refetch:k,mutate:p}]}function Ie(e,t=se,r){var n=new Map,o=He((r=>{var o,i=e(),a=T(n.entries());try{for(a.s();!(o=a.n()).done;){var s=C(o.value,2),l=s[0],d=s[1];if(t(l,i)!==t(l,r)){var u,h=T(d.values());try{for(h.s();!(u=h.n()).done;){var c=u.value;c.state=ce,c.pure?ye.push(c):be.push(c)}}catch(f){h.e(f)}finally{h.f()}}}}catch(f){a.e(f)}finally{a.f()}return i}),void 0,!0,ce);return Ye(o),e=>{var r,i=xe;i&&((r=n.get(e))?r.add(i):n.set(e,r=new Set([i])),Fe((()=>{r.delete(i),!r.size&&n.delete(e)})));return t(e,o.value)}}function Be(e){if(null===xe)return e();var t=xe;xe=null;try{return e()}finally{xe=t}}function Ee(e,t,r){var n,o=Array.isArray(e),i=r&&r.defer;return r=>{var a;if(o){a=Array(e.length);for(var s=0;st(a,n,r)));return n=a,l}}function Ne(e){_e((()=>Be(e)))}function Fe(e){return null===ge||(null===ge.cleanups?ge.cleanups=[e]:ge.cleanups.push(e)),e}function Le(){return ge}function ze(e,t){var r=ge,n=xe;ge=e,xe=null;try{return Qe(t,!0)}catch(o){qe(o)}finally{ge=r,xe=n}}function Me(e){var t=xe,r=ge;return Promise.resolve().then((()=>{xe=t,ge=r,Qe(e,!1),xe=ge=null}))}function Pe(e,t){var r=Symbol("context");return{id:r,Provider:et(r),defaultValue:e}}function De(e){return ge&&ge.context&&void 0!==ge.context[e.id]?ge.context[e.id]:e.defaultValue}function Oe(e){var t=Re(e),r=Re((()=>Je(t())));return r.toArray=()=>{var e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function Ue(){if(this.sources&&this.state)if(this.state===ce)Ye(this);else{var e=ye;ye=null,Qe((()=>Xe(this)),!1),ye=e}if(xe){var t=this.observers?this.observers.length:0;xe.sources?(xe.sources.push(this),xe.sourceSlots.push(t)):(xe.sources=[this],xe.sourceSlots=[t]),this.observers?(this.observers.push(xe),this.observerSlots.push(xe.sources.length-1)):(this.observers=[xe],this.observerSlots=[xe.sources.length-1])}return this.value}function We(e,t,r){var n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&Qe((()=>{for(var t=0;t1e6)throw ye=[],new Error}),!1)),t}function Ye(e){if(e.fn){Ve(e);var t=we;!function(e,t,r){var n,o=ge,i=xe;xe=ge=e;try{n=e.fn(t)}catch(a){return e.pure&&(e.state=ce,e.owned&&e.owned.forEach(Ve),e.owned=null),e.updatedAt=r+1,qe(a)}finally{xe=i,ge=o}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?We(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}}function He(e,t,r,n=ce,o){var i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ge,context:ge?ge.context:null,pure:r};return null===ge||ge!==pe&&(ge.owned?ge.owned.push(i):ge.owned=[i]),i}function je(e){if(0!==e.state){if(e.state===fe)return Xe(e);if(e.suspense&&Be(e.suspense.inFallback))return e.suspense.effects.push(e);for(var t=[e];(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if((e=t[r]).state===ce)Ye(e);else if(e.state===fe){var n=ye;ye=null,Qe((()=>Xe(e,t[0])),!1),ye=n}}}function Qe(e,t){if(ye)return e();var r=!1;t||(ye=[]),be?r=!0:be=[],we++;try{var n=e();return function(e){ye&&(Ke(ye),ye=null);if(e)return;var t=be;be=null,t.length&&Qe((()=>he(t)),!1)}(r),n}catch(o){r||(be=null),ye=null,qe(o)}}function Ke(e){for(var t=0;t=0;t--)Ve(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Ze(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function qe(e,t=ge){throw Ze(e)}function Je(e){if("function"==typeof e&&!e.length)return Je(e());if(Array.isArray(e)){for(var t=[],r=0;rr=Be((()=>(ge.context=S(S({},ge.context),{},{[e]:t.value}),Oe((()=>t.children)))))),void 0),r}}var tt=Symbol("fallback");function rt(e){for(var t=0;te(t||{})))}function ot(){return!0}var it={get:(e,t,r)=>t===le?r:e.get(t),has:(e,t)=>t===le||e.has(t),set:ot,deleteProperty:ot,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:ot,deleteProperty:ot}),ownKeys:e=>e.keys()};function at(e){return(e="function"==typeof e?e():e)?e:{}}function st(){for(var e=0,t=this.length;e=0;r--){var n=at(e[r])[t];if(void 0!==n)return n}},has(t){for(var r=e.length-1;r>=0;r--)if(t in at(e[r]))return!0;return!1},keys(){for(var t=[],r=0;r=0;a--){var s=e[a];if(s)for(var l=Object.getOwnPropertyNames(s),d=function(){var e=l[u];if("__proto__"===e||"constructor"===e)return 1;var t=Object.getOwnPropertyDescriptor(s,e);if(i[e]){var r=o[e];r&&(t.get?r.push(t.get.bind(s)):void 0!==t.value&&r.push((()=>t.value)))}else i[e]=t.get?{enumerable:!0,configurable:!0,get:st.bind(o[e]=[t.get.bind(s)])}:void 0!==t.value?t:void 0},u=l.length-1;u>=0;u--)d()}for(var h={},c=Object.keys(i),f=c.length-1;f>=0;f--){var p=c[f],v=i[p];v&&v.get?Object.defineProperty(h,p,v):h[p]=v?v.value:void 0}return h}var dt=e=>`Stale read from <${e}>.`;function ut(e){var t="fallback"in e&&{fallback:()=>e.fallback};return Re(function(e,t,r={}){var n=[],o=[],i=[],a=0,s=t.length>1?[]:null;return Fe((()=>rt(i))),()=>{var l,d,u=e()||[];return u[de],Be((()=>{var e,t,c,f,p,v,g,m,x,y=u.length;if(0===y)0!==a&&(rt(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[tt],o[0]=Se((e=>(i[0]=e,r.fallback()))),a=1);else if(0===a){for(o=new Array(y),d=0;d=v&&m>=v&&n[g]===u[m];g--,m--)c[m]=o[g],f[m]=i[g],s&&(p[m]=s[g]);for(e=new Map,t=new Array(m+1),d=m;d>=v;d--)x=u[d],l=e.get(x),t[d]=void 0===l?-1:l,e.set(x,d);for(l=v;l<=g;l++)x=n[l],void 0!==(d=e.get(x))&&-1!==d?(c[d]=o[l],f[d]=i[l],s&&(p[d]=s[l]),d=t[d],e.set(x,d)):i[l]();for(d=v;de.each),e.children,t||void 0))}function ht(e){var t=e.keyed,r=Re((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return Re((()=>{var n=r();if(n){var o=e.children;return"function"==typeof o&&o.length>0?Be((()=>o(t?n:()=>{if(!Be(r))throw dt("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}var ct=C(Ae(void 0),2),ft=ct[0],pt=ct[1];class vt{constructor(e){A(this,"releaseCallback",void 0),this.releaseCallback=e}}class gt extends vt{constructor(e,t){var r,n;super(e),A(this,"textureMap",new Map),A(this,"zeroReferenceTextureSet",new Set),A(this,"options",void 0),this.options={textureCleanupIntervalMs:null!==(r=t.textureCleanupIntervalMs)&&void 0!==r?r:1e4,textureCleanupAgeThreadholdMs:null!==(n=t.textureCleanupAgeThreadholdMs)&&void 0!==n?n:6e4},setInterval((()=>{var e,t=Date.now(),r=this.options.textureCleanupAgeThreadholdMs,n=T(this.zeroReferenceTextureSet);try{for(n.s();!(e=n.n()).done;){var o=e.value;t-o.lastUpdate>r&&(this.releaseCallback(o.id),this.textureMap.delete(o.id),this.zeroReferenceTextureSet.delete(o))}}catch(i){n.e(i)}finally{n.f()}}),this.options.textureCleanupIntervalMs)}registerTexture(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;if(_(r,"Texture must have an id to be registered"),!this.textureMap.has(r)){var n={id:r,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(r,n),this.zeroReferenceTextureSet.add(n)}}incrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;_(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);n||(this.registerTexture(e),n=this.textureMap.get(r)),_(n,"Texture must have been registered"),"SubTexture"===e.txType&&this.incrementTextureRefCount(e.props.texture),n.nodeRefCount++,n.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(n)&&this.zeroReferenceTextureSet.delete(n)}decrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;_(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);_(n,"Texture must have been registered"),n.nodeRefCount--,n.lastUpdate=Date.now(),0===n.nodeRefCount&&this.zeroReferenceTextureSet.add(n),"SubTexture"===e.txType&&this.decrementTextureRefCount(e.props.texture)}}class mt extends vt{constructor(e){super(e),A(this,"registry",void 0),this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,r;_(null===(t=e.options)||void 0===t?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,null===(r=e.options)||void 0===r?void 0:r.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}var xt={alpha:e=>1===e?null:{prop:"opacity",value:`${e}`},x:e=>({prop:"left",value:`${e}px`}),y:e=>({prop:"top",value:`${e}px`}),width:e=>0===e?null:{prop:"width",value:`${e}px`},height:e=>0===e?null:{prop:"height",value:`${e}px`},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:e=>!1===e?null:{prop:"overflow",value:e?"hidden":"visible"},rotation:e=>0===e?null:{prop:"transform",value:`rotate(${e}rad)`},scale:e=>1===e?null:{prop:"transform",value:`scale(${e})`},scaleX:e=>1===e?null:{prop:"transform",value:`scaleX(${e})`},scaleY:e=>1===e?null:{prop:"transform",value:`scaleY(${e})`},color:e=>0===e?null:{prop:"color",value:yt(e)}},yt=e=>`rgba(${e>>24&255},${e>>16&255},${e>>8&255},${(255&e)/255})`,bt={id:"id"};class wt{constructor(e,t){var r,n,o,i,a,s;if(A(this,"root",null),A(this,"canvas",null),A(this,"height",1080),A(this,"width",1920),A(this,"scaleX",1),A(this,"scaleY",1),!R()){if(!t)throw new Error("settings is required");this.height=Math.ceil(null!==(r=t.appHeight)&&void 0!==r?r:1080/(null!==(n=t.deviceLogicalPixelRatio)&&void 0!==n?n:1)),this.width=Math.ceil(null!==(o=t.appWidth)&&void 0!==o?o:1900/(null!==(i=t.deviceLogicalPixelRatio)&&void 0!==i?i:1)),this.scaleX=null!==(a=t.deviceLogicalPixelRatio)&&void 0!==a?a:1,this.scaleY=null!==(s=t.deviceLogicalPixelRatio)&&void 0!==s?s:1,this.canvas=e,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(e,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(e),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}}setRootPosition(){if(null!==this.root&&null!==this.canvas){var e=this.canvas.getBoundingClientRect(),t=document.documentElement.scrollTop+e.top,r=document.documentElement.scrollLeft+e.left;this.root.id="root",this.root.style.left=`${r}px`,this.root.style.top=`${t}px`,this.root.style.width=`${this.width}px`,this.root.style.height=`${this.height}px`,this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform=`scale(${this.scaleX}, ${this.scaleY})`,this.root.style.overflow="hidden",this.root.style.zIndex="65534"}}createDiv(e,t){var r=document.createElement("div");for(var n in r.style.position="absolute",r.id=e.id.toString(),t)this.updateNodeProperty(r,n,t[n]);return r}createNode(e,t){var r=e.createNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createTextNode(e,t){var r=e.createTextNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createProxy(e,t){return new Proxy(e,{set:(e,r,n)=>(this.updateNodeProperty(t,r,n),Reflect.set(e,r,n)),get:(r,n,o)=>("destroy"===n&&this.destroyNode(r),"animate"===n?(n,o)=>{var i=r.animate(n,o);return new Proxy(i,{get:(r,i,a)=>("start"===i&&this.animateNode(t,e,n,o),Reflect.get(r,i,a))})}:Reflect.get(r,n,o))})}destroyNode(e){var t=document.getElementById(e.id.toString());null==t||t.remove()}updateNodeProperty(e,t,r){if(null!==this.root&&null!=r)if("parent"!==t){if("text"===t)return e.innerHTML=String(r),void(e.style.visibility="hidden");if("src"===t&&r)e.setAttribute("data-src",String(r));else{if(xt[t]){var n,o=null===(n=xt[t])||void 0===n?void 0:n.call(xt,r);if(null===o)return;return"string"==typeof o?void e.style.setProperty(o,String(r)):void("object"==typeof o&&e.style.setProperty(o.prop,o.value))}if(bt[t])e.setAttribute(String(xt[t]),String(r));else if("data"!==t);else for(var i in r)e.setAttribute(`data-${i}`,String(r[i]))}}else{var a=r.id;if(1===a)return void this.root.appendChild(e);var s=document.getElementById(a.toString());null==s||s.appendChild(e)}}animateNode(e,t,r,n){var o=n.duration,i=void 0===o?1e3:o,a=n.delay,s=void 0===a?0:a,l=r.x,d=r.y,u=r.width,h=r.height,c=r.alpha,f=void 0===c?1:c,p=r.rotation,v=void 0===p?0:p,g=r.scale,m=void 0===g?1:g,x=r.color;setTimeout((function(){setTimeout((()=>{e.style.top=`${d}px`,e.style.left=`${l}px`,e.style.width=`${u}px`,e.style.height=`${h}px`,e.style.opacity=`${f}`,e.style.rotate=`${v}rad`,e.style.scale=`${m}`,e.style.color=yt(x)}),i)}),s)}}var St=function(e,t,r){var n=Promise.resolve();return n.then((()=>e())).catch((e=>{var t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}))};class At{static getEffectKey(e){return""}static getMethodParameters(e,t){var r=[];for(var n in e){var o=e[n],i="";o.size&&(i=`[${o.size(t)}]`),r.push(`${o.type} ${n}${i}`)}return r.join(",")}constructor(e){A(this,"priority",1),A(this,"name",""),A(this,"ref",void 0),A(this,"target",void 0),A(this,"passParameters",""),A(this,"declaredUniforms",""),A(this,"uniformInfo",{});var t=e.ref,r=e.target,n=e.props,o=void 0===n?{}:n;this.ref=t,this.target=r;var i={},a=[],s="",l=this.constructor.uniforms||{};for(var d in l){var u=l[d],h=u.type,c=`${t}_${d}`,f="";u.size&&(f=`[${u.size(o)}]`),a.push(c),s+=`uniform ${h} ${c}${f};`,i[d]={name:c,uniform:l[d].method}}this.passParameters=a.join(","),this.declaredUniforms=s,this.uniformInfo=i}static resolveDefaults(e){return{}}static makeEffectKey(e){return!1}}A(At,"uniforms",{}),A(At,"methods",void 0),A(At,"onShaderMask",void 0),A(At,"onColorize",void 0),A(At,"onEffectMask",void 0);var Ct={x:(e,t)=>{e.props.x=t},y:(e,t)=>{e.props.y=t},width:(e,t)=>{e.props.width=t},height:(e,t)=>{e.props.height=t},color:(e,t)=>{e.props.color=t},zIndex:(e,t)=>{e.props.zIndex=t},fontFamily:(e,t)=>{e.props.fontFamily=t},fontWeight:(e,t)=>{e.props.fontWeight=t},fontStyle:(e,t)=>{e.props.fontStyle=t},fontStretch:(e,t)=>{e.props.fontStretch=t},fontSize:(e,t)=>{e.props.fontSize=t},text:(e,t)=>{e.props.text=t},textAlign:(e,t)=>{e.props.textAlign=t},contain:(e,t)=>{e.props.contain=t},offsetY:(e,t)=>{e.props.offsetY=t},scrollable:(e,t)=>{e.props.scrollable=t},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t},lineHeight:(e,t)=>{e.props.lineHeight=t},maxLines:(e,t)=>{e.props.maxLines=t},textBaseline:(e,t)=>{e.props.textBaseline=t},verticalAlign:(e,t)=>{e.props.verticalAlign=t},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t},debug:(e,t)=>{e.props.debug=t}};class Tt{constructor(e){A(this,"stage",void 0),A(this,"set",void 0),this.stage=e;var t=S(S({},Ct),this.getPropertySetters());this.set=Object.freeze(Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(r,n)=>{r.props[e]!==n&&(t(r,n),this.stage.requestRender())}]))))}setStatus(e,t,r){e.status!==t&&(e.status=t,e.emitter.emit(t,r))}setIsRenderable(e,t){e.isRenderable=t}destroyState(e){["loading","loaded","failed"].forEach((t=>{e.emitter.off(t)}))}scheduleUpdateState(e){e.updateScheduled||(e.updateScheduled=!0,queueMicrotask((()=>{e.updateScheduled=!1,this.updateState(e)})))}}class _t extends k{constructor(e,t,r){super(e,t),A(this,"fontFace",void 0),A(this,"fontUrl",void 0);var n=r.replace(/\(|\)/g,""),o=this.descriptors,i={style:o.style,weight:"number"==typeof o.weight?`${o.weight}`:o.weight,stretch:o.stretch,unicodeRange:o.unicodeRange,variant:o.variant,featureSettings:o.featureSettings,display:o.display},a=new FontFace(e,`url(${n})`,i);a.load().then((()=>{this.loaded=!0,this.emit("loaded")})).catch(console.error),this.fontFace=a,this.fontUrl=r}}function Rt(e,t,r,n,o){return r*(n-1)+("bottom"!==e?.5*t:0)+Math.max(r,t)+(o||0)}class kt{constructor(e,t){A(this,"_canvas",void 0),A(this,"_context",void 0),A(this,"_settings",void 0),A(this,"renderInfo",void 0),this._canvas=e,this._context=t,this._settings=this.mergeDefaults({})}set settings(e){this._settings=this.mergeDefaults(e)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){for(var e=[this._settings.fontFace],t=[],r=0,n=e.length;r{console.warn("[Lightning] Font load error",t,e)})).then((()=>{document.fonts.check(e,this._settings.text)||console.warn("[Lightning] Font not found",e)}))}catch(t){console.warn("[Lightning] Can't check font loading for "+e)}}}calculateRenderInfo(){var e={},t=this.getPrecision(),r=this._settings.paddingLeft*t,n=this._settings.paddingRight*t,o=this._settings.fontSize*t,i=null===this._settings.offsetY?null:this._settings.offsetY*t,a=(this._settings.lineHeight||o)*t,s=this._settings.w*t,l=this._settings.h*t,d=this._settings.wordWrapWidth*t,u=this._settings.cutSx*t,h=this._settings.cutEx*t,c=this._settings.cutSy*t,f=this._settings.cutEy*t,p=(this._settings.letterSpacing||0)*t,v=this._settings.textIndent*t;this.setFontProperties();var g,m=s||2048/this.getPrecision(),x=m-r;if(x<10&&(m+=10-x,x=10),d||(d=x),this._settings.textOverflow&&!this._settings.wordWrap){var y;switch(this._settings.textOverflow){case"clip":y="";break;case"ellipsis":y=this._settings.overflowSuffix;break;default:y=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,d-v,y)}if(this._settings.wordWrap)g=this.wrapText(this._settings.text,d,p,v);else for(var b=(g={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]}).l.length,w=0;wthis._settings.maxLines){var A,C=S.slice(0,this._settings.maxLines),T=null;if(this._settings.overflowSuffix){var _=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,R=this.wrapText(C[C.length-1],d-_,p,v);C[C.length-1]=`${R.l[0]}${this._settings.overflowSuffix}`,T=[R.l.length>1?R.l[1]:""]}else T=[""];var k=S.length,I=0,B=g.n.length;for(A=this._settings.maxLines;A=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(e.cutSx||e.cutSy)&&this._context.translate(-e.cutSx,-e.cutSy);for(var l=[],d=0,u=i.length;dt)for(;a>0&&(s=this._context.measureText(e.substring(0,a)).width+n)>t;)a-=1;else for(;a=n?r:"")}wrapText(e,t,r,n=0){for(var o=e.split(/\r?\n/g),i=[],a=[],s=0;su?(c>0&&(l.push(d),d=""),d+=h[c],u=t-f-(0===c?n:0)):(u-=p,d+=` ${h[c]}`)}l.push(d),d="",i=i.concat(l),se+this._context.measureText(r).width+t),0):this._context.measureText(e).width}mergeDefaults(e){return S({text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0},e)}}var It="undefined"==typeof self?globalThis:self,Bt=(null===(y=It.document)||void 0===y?void 0:y.fonts)||It.fonts;var Et=B(0,0,0,0);class Nt extends Tt{constructor(e){super(e),A(this,"canvas",void 0),A(this,"context",void 0),A(this,"rendererBounds",void 0),"undefined"!=typeof OffscreenCanvas?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");var t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),_(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof _t}addFontFace(e){_(e instanceof _t),Bt.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new E,canvasPages:void 0,lightning2TextRenderer:new kt(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){if("initialState"===e.status&&this.setStatus(e,"loading"),!e.fontInfo){var t=(r=e.props,n=r.fontFamily,[r.fontStyle,r.fontWeight,r.fontStretch,`${r.fontSize}px`,n].join(" "));if(e.fontInfo={cssString:t,loaded:!1},!e.fontInfo.loaded)return void Bt.load(t).then(this.onFontLoaded.bind(this,e,t)).catch(this.onFontLoadError.bind(this,e,t))}var r,n;if(e.fontInfo.loaded){if(!e.renderInfo){var o=e.props.maxLines,i="both"===e.props.contain?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,a=i>0&&o>0?Math.min(i,o):Math.max(i,o);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:N(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:"none"!==e.props.contain,wordWrapWidth:"none"===e.props.contain?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:a,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}var s=e.props,l=s.x,d=s.y,u=s.width,h=s.height,c=s.scrollY,f=s.contain,p=e.visibleWindow,v=e.renderWindow,g=e.canvasPages;if(!p.valid){var m=B(l,d,"none"!==f?l+u:1/0,"both"===f?d+h:1/0,Et);F(this.rendererBounds,m,p),p.valid=!0}var x=p.y2-p.y1,y=Math.ceil(x/e.renderInfo.lineHeight);if(0===x)return g=void 0,v=void 0,void this.setStatus(e,"loaded");if(v&&g){var b=l+v.x1,w=d-c+v.y1,S=l+v.x2,A=d-c+v.y2;if(b<=p.x1&&S>=p.x2&&w<=p.y1&&A>=p.y2)return void this.setStatus(e,"loaded");Ap.y1&&(v.y1-=y*e.renderInfo.lineHeight,v.y2-=y*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-y,g[0].lineNumEnd=g[0].lineNumStart+y,g[0].valid=!1)}else{var C,_,R,k=e.renderInfo.lineHeight*y,I=Math.ceil(c/k),E=I*y,L=E-y,z=E+y;g=[{texture:null===(C=g)||void 0===C?void 0:C[0].texture,lineNumStart:L,lineNumEnd:L+y,valid:!1},{texture:null===(_=g)||void 0===_?void 0:_[1].texture,lineNumStart:E,lineNumEnd:E+y,valid:!1},{texture:null===(R=g)||void 0===R?void 0:R[2].texture,lineNumStart:z,lineNumEnd:z+y,valid:!1}],e.canvasPages=g;var M=I*k;v={x1:0,y1:M-k,x2:u,y2:M+2*k}}e.renderWindow=v,performance.now();var P,D=T(g);try{for(D.s();!(P=D.n()).done;){var O=P.value;if(!O.valid)if(O.lineNumStart<0){var U;null===(U=O.texture)||void 0===U||U.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),O.texture.setRenderableOwner(e,e.isRenderable),O.valid=!0}else{var W;if(e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(O.lineNumStart,O.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(O.lineNumStart,O.lineNumEnd)}),0!==this.canvas.width&&0!==this.canvas.height)null===(W=O.texture)||void 0===W||W.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),O.texture.setRenderableOwner(e,e.isRenderable);O.valid=!0}}}catch(Y){D.e(Y)}finally{D.f()}this.setStatus(e,"loaded")}}renderQuads(e,t,r,n){var o=this.stage,i=e.canvasPages,a=e.textW,s=void 0===a?0:a,l=e.textH,d=void 0===l?0:l,u=e.renderWindow;if(i&&u){var h=e.props,c=h.x,f=h.y,p=h.scrollY,v=h.contain,g=h.width,m=h.height,x={x:c,y:f,width:"none"!==v?g:s,height:"both"===v?m:d};L({x:0,y:0,width:o.options.appWidth,height:o.options.appHeight},x),_(i,"canvasPages is not defined"),_(u,"renderWindow is not defined");var y,b,w,S,A,C,T=(u.y2-u.y1)/3,R=e.props,k=R.zIndex,I=R.color,B=n*z(I),E=M(4294967295,B);if(i[0].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(y=i[0].texture)||void 0===y||null===(y=y.dimensions)||void 0===y?void 0:y.width)||0,height:(null===(b=i[0].texture)||void 0===b||null===(b=b.dimensions)||void 0===b?void 0:b.height)||0,texture:i[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:k,tx:t.tx,ty:t.ty-p+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[1].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(w=i[1].texture)||void 0===w||null===(w=w.dimensions)||void 0===w?void 0:w.width)||0,height:(null===(S=i[1].texture)||void 0===S||null===(S=S.dimensions)||void 0===S?void 0:S.height)||0,texture:i[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:k,tx:t.tx,ty:t.ty-p+u.y1+T,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[2].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(A=i[2].texture)||void 0===A||null===(A=A.dimensions)||void 0===A?void 0:A.width)||0,height:(null===(C=i[2].texture)||void 0===C||null===(C=C.dimensions)||void 0===C?void 0:C.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:k,tx:t.tx,ty:t.ty-p+u.y1+T+T,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.canvasPages)||void 0===r||r.forEach((r=>{var n;null===(n=r.texture)||void 0===n||n.setRenderableOwner(e,t)}))}destroyState(e){var t;null===(t=e.canvasPages)||void 0===t||t.forEach((t=>{var r;null===(r=t.texture)||void 0===r||r.setRenderableOwner(e,!1)}))}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var r;t===(null===(r=e.fontInfo)||void 0===r?void 0:r.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,r){var n;t===(null===(n=e.fontInfo)||void 0===n?void 0:n.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,console.error(`CanvasTextRenderer: Error loading font '${e.fontInfo.cssString}'`,r),this.scheduleUpdateState(e))}}class Ft extends P{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}}A(Ft,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class Lt extends P{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]}),A(this,"supportsIndexedTextures",!0)}bindTextures(e){var t=this.renderer,r=this.glw;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error(`DefaultShaderBatched: Cannot bind more than ${t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);e.forEach(((e,t)=>{r.activeTexture(t),r.bindTexture(e.ctxTexture)}));var n=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",n)}}A(Lt,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>`\n #define txUnits ${e}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${e}], int idx, vec2 uv) {\n ${Array.from(Array(e).keys()).map((e=>`\n ${0!==e?"else ":""}if (idx == ${e}) {\n return texture2D(textures[${e}], uv);\n }\n `)).join("")}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `});var zt=new Map,Mt=(e,t)=>{var r=JSON.stringify(e);if(zt.has(r))return zt.get(r);var n=(null!=e?e:[]).map((e=>({type:e.type,props:t[e.type].resolveDefaults(e.props||{})})));return zt.set(r,n),n};class Pt extends P{constructor(e,t,r){var n=Pt.createShader(t,r);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...n.uniforms],shaderSources:{vertex:n.vertex,fragment:n.fragment}}),A(this,"effects",[]),this.effects=n.effects,this.calculateProps=D(this.calculateProps.bind(this))}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){var t=this.renderer.shManager.getRegisteredEffects(),r=[];return null==e||e.forEach(((e,n)=>{var o,i=this.effects[n],a=t[i.name],s=null!==(o=e.props)&&void 0!==o?o:{},l=i.uniformInfo;Object.keys(s).forEach((e=>{var t=a.uniforms[e],n=l[e],o=t.validator?t.validator(s[e],s):s[e];Array.isArray(o)&&(o=new Float32Array(o)),r.push({name:n.name,value:o})}))})),r}bindProps(e){this.calculateProps(e.effects).forEach((e=>{this.setUniform(e.name,e.value)}))}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;for(var r=e.effects.length,n=0;n{var n=t[e.type],s=n.getEffectKey(e.props||{});r[s]=r[s]?++r[s]:1;var l=r[s];1===l&&a.push({key:s,type:e.type,props:e.props});var d=new n({ref:`${s}${1===l?"":l}`,target:s,props:e.props});return o+=d.declaredUniforms,i.push(...Object.values(d.uniformInfo)),d})),l="";null==a||a.forEach((e=>{var r,o=t[e.type],i=o.resolveDefaults(null!==(r=e.props)&&void 0!==r?r:{}),a=[];for(var s in o.methods){var d=s,u=o.methods[s];n[s]&&n[s]!==u&&(d=Pt.resolveMethodDuplicate(s,u,n)),n[d]=u.replace("function",d),a.push({m:s,cm:d})}var h=o.onShaderMask instanceof Function?o.onShaderMask(i):o.onShaderMask,c=o.onColorize instanceof Function?o.onColorize(i):o.onColorize,f=o.onEffectMask instanceof Function?o.onEffectMask(i):o.onEffectMask;a.forEach((e=>{var t=e.m,r=e.cm,n=new RegExp(`\\$${t}`,"g");h&&(h=h.replace(n,r)),c&&(c=c.replace(n,r)),f&&(f=f.replace(n,r))}));var p=o.getMethodParameters(o.uniforms,i),v=p.length>0?`, ${p}`:"";h&&(l+=`\n float fx_${e.key}_onShaderMask(float shaderMask ${v}) {\n ${h}\n }\n `),c&&(l+=`\n vec4 fx_${e.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${c}\n }\n `),f&&(l+=`\n vec4 fx_${e.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${f}\n }\n `)}));var d="";for(var u in n)d+=n[u];for(var h="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",c="\n\n ",f=0;f0?`, ${p.passParameters}`:"",g=t[p.name];g.onShaderMask&&(c+=`\n shaderMask = fx_${p.target}_onShaderMask(shaderMask ${v});\n `),g.onColorize&&(c+=`\n maskColor = fx_${p.target}_onColorize(shaderMask, maskColor, shaderColor${v});\n `),g.onEffectMask&&(h=`fx_${p.target}_onEffectMask(shaderMask, maskColor, shaderColor${v})`);var m=s[f+1];(void 0===m||t[m.name].onEffectMask)&&(c+=`\n shaderColor = ${h};\n `)}return{effects:s,uniforms:i,fragment:Pt.fragment(o,d,l,c),vertex:Pt.vertex()}}static resolveMethodDuplicate(e,t,r,n=0){var o=e+(n>0?n:"");return r[o]&&r[o]!==t?this.resolveMethodDuplicate(e,t,r,++n):o}static resolveDefaults(e,t){return{effects:Mt(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var r,n="";return null===(r=e.effects)||void 0===r||r.forEach((e=>{var r=t[e.type].getEffectKey(e.props||{});n+=`,${r}`})),`DynamicShader${n}`}}A(Pt,"z$__type__Props",void 0),A(Pt,"vertex",(()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ")),A(Pt,"fragment",((e,t,r,n)=>`\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${e}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${t}\n\n ${r}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${n}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `));class Dt extends P{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(e){return{radius:e.radius||10,$dimensions:{width:0,height:0}}}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){this.setUniform("u_radius",e.radius)}canBatchShaderProps(e,t){return e.radius===t.radius&&e.$dimensions.width===t.$dimensions.width&&e.$dimensions.height===t.$dimensions.height}}A(Dt,"z$__type__Props",void 0),A(Dt,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});var Ot=new Float32Array([1,0,0,0,1,0,0,0,1]);class Ut extends P{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){var t=Ut.resolveDefaults(e);for(var r in t)if("transform"===r)this.setUniform("u_transform",!1,t[r]);else if("scrollY"===r)this.setUniform("u_scrollY",t[r]);else if("color"===r){var n=N(t.color);this.setUniform("u_color",n)}else"size"===r?this.setUniform("u_size",t[r]):"distanceRange"===r?this.setUniform("u_distanceRange",t[r]):"debug"===r&&this.setUniform("u_debug",t[r]?1:0)}static resolveDefaults(e={}){var t,r,n,o,i,a;return{transform:null!==(t=e.transform)&&void 0!==t?t:Ot,scrollY:null!==(r=e.scrollY)&&void 0!==r?r:0,color:null!==(n=e.color)&&void 0!==n?n:4294967295,size:null!==(o=e.size)&&void 0!==o?o:16,distanceRange:null!==(i=e.distanceRange)&&void 0!==i?i:1,debug:null!==(a=e.debug)&&void 0!==a&&a}}}A(Ut,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});class Wt extends At{constructor(...e){super(...e),A(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:null!==(t=e.radius)&&void 0!==t?t:10}}}A(Wt,"z$__type__Props",void 0),A(Wt,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),A(Wt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),A(Wt,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),A(Wt,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Yt extends At{constructor(...e){super(...e),A(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Yt,"z$__type__Props",void 0),A(Yt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Yt,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),A(Yt,"onColorize","\n return color;\n ");class Ht extends At{constructor(...e){super(...e),A(this,"name","linearGradient")}static getEffectKey(e){return`linearGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],o=e.stops||[];if(0===o.length||o.length!==n.length){for(var i=n.length,a=0,s=o;ae.map((e=>N(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),A(Ht,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),A(Ht,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${re.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class jt extends At{constructor(...e){super(...e),A(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:null!==(t=e.amount)&&void 0!==t?t:1}}}A(jt,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),A(jt,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class Qt extends At{constructor(...e){super(...e),A(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Qt,"z$__type__Props",void 0),A(Qt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Qt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),A(Qt,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),A(Qt,"onColorize","\n return color;\n ");class Kt extends At{constructor(...e){super(...e),A(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Kt,"z$__type__Props",void 0),A(Kt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Kt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),A(Kt,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),A(Kt,"onColorize","\n return color;\n ");class $t extends At{constructor(...e){super(...e),A(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A($t,"z$__type__Props",void 0),A($t,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A($t,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),A($t,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),A($t,"onColorize","\n return color;\n ");class Xt extends At{constructor(...e){super(...e),A(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Xt,"z$__type__Props",void 0),A(Xt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Xt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),A(Xt,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),A(Xt,"onColorize","\n return color;\n ");class Gt extends At{constructor(...e){super(...e),A(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,r,n,o,i;return{amplitude:null!==(t=e.amplitude)&&void 0!==t?t:.2,narrowness:null!==(r=e.narrowness)&&void 0!==r?r:4,blockiness:null!==(n=e.blockiness)&&void 0!==n?n:2,minimizer:null!==(o=e.minimizer)&&void 0!==o?o:8,time:null!==(i=e.time)&&void 0!==i?i:Date.now()}}}A(Gt,"z$__type__Props",void 0),A(Gt,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),A(Gt,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),A(Gt,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class Vt extends At{constructor(...e){super(...e),A(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:null!==(t=e.fade)&&void 0!==t?t:10}}}A(Vt,"z$__type__Props",void 0),A(Vt,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),A(Vt,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");class Zt extends At{constructor(...e){super(...e),A(this,"name","radialGradient")}static getEffectKey(e){return`radialGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n,o,i,a=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],s=e.stops||[];if(0===s.length||s.length!==a.length){for(var l=a.length,d=0,u=s;de.map((e=>N(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),A(Zt,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${ne.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class qt extends At{constructor(...e){super(...e),A(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,r,n,o,i,a,s;return{width:null!==(t=e.width)&&void 0!==t?t:10,progress:null!==(r=e.progress)&&void 0!==r?r:.5,offset:null!==(n=e.offset)&&void 0!==n?n:0,range:null!==(o=e.range)&&void 0!==o?o:2*Math.PI,rounded:null!==(i=e.rounded)&&void 0!==i&&i,radius:null!==(a=e.radius)&&void 0!==a?a:1,color:null!==(s=e.color)&&void 0!==s?s:4294967295}}}A(qt,"z$__type__Props",void 0),A(qt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(qt,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),A(qt,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),A(qt,"onColorize","\n return color;\n ");class Jt extends At{constructor(...e){super(...e),A(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:null!==(t=e.radius)&&void 0!==t?t:0}}}A(Jt,"z$__type__Props",void 0),A(Jt,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),A(Jt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),A(Jt,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),A(Jt,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class er{constructor(){A(this,"shCache",new Map),A(this,"shConstructors",{}),A(this,"attachedShader",null),A(this,"effectConstructors",{}),A(this,"renderer",void 0),this.registerShaderType("DefaultShader",Ft),this.registerShaderType("DefaultShaderBatched",Lt),this.registerShaderType("RoundedRectangle",Dt),this.registerShaderType("DynamicShader",Pt),this.registerShaderType("SdfShader",Ut),this.registerEffectType("border",Yt),this.registerEffectType("borderBottom",$t),this.registerEffectType("borderLeft",Xt),this.registerEffectType("borderRight",Qt),this.registerEffectType("borderTop",Kt),this.registerEffectType("fadeOut",Vt),this.registerEffectType("linearGradient",Ht),this.registerEffectType("radialGradient",Zt),this.registerEffectType("grayscale",jt),this.registerEffectType("glitch",Gt),this.registerEffectType("radius",Wt),this.registerEffectType("radialProgress",qt),this.registerEffectType("holePunch",Jt)}registerShaderType(e,t){this.shConstructors[e]=t}registerEffectType(e,t){this.effectConstructors[e]=t}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(e,t){if(!this.renderer)throw new Error("Renderer is not been defined");var r=this.shConstructors[e];if(!r)throw new Error(`Shader type "${e}" is not registered`);if("DynamicShader"===e)return this.loadDynamicShader(t);var n=r.resolveDefaults(t),o=r.makeCacheKey(n)||r.name;if(o&&this.shCache.has(o))return{shader:this.shCache.get(o),props:n};var i=new r(this.renderer,t);return o&&this.shCache.set(o,i),{shader:i,props:n}}loadDynamicShader(e){if(!this.renderer)throw new Error("Renderer is not been defined");var t=Pt.resolveDefaults(e,this.effectConstructors),r=Pt.makeCacheKey(t,this.effectConstructors);if(r&&this.shCache.has(r))return{shader:this.shCache.get(r),props:t};var n=new Pt(this.renderer,e,this.effectConstructors);return r&&this.shCache.set(r,n),{shader:n,props:t}}useShader(e){this.attachedShader!==e&&(this.attachedShader&&this.attachedShader.detach(),e.attach(),this.attachedShader=e)}}class tr{constructor(){A(this,"data",{})}reset(){this.data={}}increment(e){this.data[e]||(this.data[e]=0),this.data[e]++}getData(){return S({},this.data)}}var rr=function(){var e=b(x().mark((function e(t){var r,n;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:if(n=e.sent,-1===t.indexOf(".ktx")){e.next=8;break}return e.abrupt("return",nr(n));case 8:return e.abrupt("return",or(n));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),nr=function(){var e=b(x().mark((function e(t){var r,n,o,i,a,s,l;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=new DataView(t),n=16909060===r.getUint32(12),o=[],i={glInternalFormat:r.getUint32(28,n),pixelWidth:r.getUint32(36,n),pixelHeight:r.getUint32(40,n),numberOfMipmapLevels:r.getUint32(56,n),bytesOfKeyValueData:r.getUint32(60,n)},a=64,a+=i.bytesOfKeyValueData,s=0;s>2)*(u+3>>2)*8,f=new Uint8Array(r,i.byteOffset+l,c),a.push(f),l+=c,d>>=1,u>>=1;return e.abrupt("return",{data:{glInternalFormat:36196,mipmaps:a,width:s.pixelWidth||0,height:s.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();class ir extends O{constructor(e,t){super(e),A(this,"props",void 0),this.props=ir.resolveDefaults(t)}hasAlphaChannel(e){return-1!==e.indexOf("image/png")}getTextureData(){var e=this;return b(x().mark((function t(){var r,n,o,i,a,s,l;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props,n=r.src,o=r.premultiplyAlpha,n){t.next=3;break}return t.abrupt("return",{data:null});case 3:if(!(n instanceof ImageData)){t.next=5;break}return t.abrupt("return",{data:n,premultiplyAlpha:o});case 5:if(!/\.(ktx|pvr)$/.test(n)){t.next=7;break}return t.abrupt("return",rr(n));case 7:if(!e.txManager.imageWorkerManager){t.next=13;break}return t.next=10,e.txManager.imageWorkerManager.getImage(n,o);case 10:return t.abrupt("return",t.sent);case 13:if(!e.txManager.hasCreateImageBitmap){t.next=28;break}return t.next=16,fetch(n);case 16:return i=t.sent,t.next=19,i.blob();case 19:return a=t.sent,s=null!=o?o:e.hasAlphaChannel(a.type),t.next=23,createImageBitmap(a,{premultiplyAlpha:s?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"});case 23:return t.t0=t.sent,t.t1=s,t.abrupt("return",{data:t.t0,premultiplyAlpha:t.t1});case 28:return l=new Image,"data:"!=n.substr(0,5)&&(l.crossOrigin="Anonymous"),l.src=n,t.next=33,new Promise(((e,t)=>{l.onload=()=>e(),l.onerror=()=>t(new Error("Failed to load image"))})).catch((e=>{console.error(e)}));case 33:return t.abrupt("return",{data:l,premultiplyAlpha:null==o||o});case 34:case"end":return t.stop()}}),t)})))()}static makeCacheKey(e){var t=ir.resolveDefaults(e);return!(t.src instanceof ImageData)&&`ImageTexture,${t.src},${t.premultiplyAlpha}`}static resolveDefaults(e){var t,r;return{src:null!==(t=e.src)&&void 0!==t?t:"",premultiplyAlpha:null===(r=e.premultiplyAlpha)||void 0===r||r}}}A(ir,"z$__type__Props",void 0);class ar{constructor(e,t=0){A(this,"iterator",void 0),A(this,"peekBuffer",[]),A(this,"_lastIndex",void 0),this.iterator=e,this.iterator=e,this._lastIndex=t-1,this.peekBuffer=[]}next(){var e=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return e.done?this._lastIndex=-1:this._lastIndex++,e}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];var e=this.iterator.next();return this.peekBuffer.push(e),e}get lastIndex(){return this._lastIndex}}function sr(e,t=0){var r,n;return x().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:r=t;case 1:if(!(r=f.y1,K=E<=f.y2,$=Q&&K;(y=M.next())&&!y.done;){var X=y.value;if(e===c.length)c.push({codepointIndex:X.cluster,maxY:I,maxX:k});else if(e>c.length)throw new Error("Unexpected lineCache length");if(32===X.codepoint||10===X.codepoint?-1!==F.codepointIndex&&(F.codepointIndex=-1,j=B):-1===F.codepointIndex&&(F.codepointIndex=X.cluster,F.bufferOffset=N,F.xStart=j),X.mapped){var G=B+X.xOffset+X.width;if("none"!==h&&G>=H&&-1!==F.codepointIndex&&F.xStart>0){if(Y){M=L.shapeText(z,new ar(sr(n,F.codepointIndex),F.codepointIndex)),N=F.bufferOffset;break}M=L.shapeText(z,new ar(sr(m,0),0)),B=F.xStart,N=F.bufferOffset,h="none"}else{var V=B+X.xOffset,Z=E+X.yOffset;if($){-1===P&&(P=N);var q=p.getAtlasEntry(X.glyphId),J=q.x/p.data.common.scaleW,ee=q.y/p.data.common.scaleH,te=q.width/p.data.common.scaleW,re=q.height/p.data.common.scaleH;u[N++]=V,u[N++]=Z,u[N++]=J,u[N++]=ee,u[N++]=V+X.width,u[N++]=Z,u[N++]=J+te,u[N++]=ee,u[N++]=V,u[N++]=Z+X.height,u[N++]=J,u[N++]=ee+re,u[N++]=V+X.width,u[N++]=Z+X.height,u[N++]=J+te,u[N++]=ee+re}I=Math.max(I,Z+X.height),k=Math.max(k,V+X.width),B+=X.xAdvance}}else if(10===X.codepoint){if(Y)break;M=L.shapeText(z,new ar(sr(m,0),0)),h="none"}}-1!==P&&(D.push({bufferStart:P,bufferEnd:N}),P=-1),B=0,E+=w,e++,F.codepointIndex=-1,j=0,!v&&"both"===h&&E>f.y2||y&&y.done?W=!1:Y||(W=!1)}if("center"===o)for(var ne="none"===h?k:S,oe=0;oe"number"==typeof e?e:ur[e]||400;var cr=D((function(e,t,r,n,o){var i,a=hr(r),s=T(e);try{for(s.s();!(i=s.n()).done;){var l=i.value[t];if(l){if(1===l.size)return console.warn(`TrFontManager: Only one font face found for family: '${t}' - will be used for all weights and styles`),l.values().next().value;var d,u=new Map,h=T(l);try{for(h.s();!(d=h.n()).done;){var c=d.value,f=hr(c.descriptors.weight);if(f===a&&c.descriptors.style===n&&c.descriptors.stretch===o)return c;u.set(f,c)}}catch(v){h.e(v)}finally{h.f()}var p=`TrFontManager: No exact match: '${t} Weight: ${a} Style: ${n} Stretch: ${o}'`;if(console.error(p),400===a&&u.has(500))return u.get(500);if(500===a&&u.has(400))return u.get(400);if(a<400){for(;a>0;){if(u.has(a))return u.get(a);a-=100}a=600}for(;a<1e3;){if(u.has(a))return u.get(a);a+=100}for(a=500;a>0;){if(u.has(a))return u.get(a);a-=100}}}}catch(v){s.e(v)}finally{s.f()}}));class fr{constructor(e){A(this,"textRenderers",void 0),this.textRenderers=e}addFontFace(e){for(var t in this.textRenderers){var r=this.textRenderers[t];r&&r.isFontFaceSupported(e)&&r.addFontFace(e)}}static resolveFontFace(e,t){var r=t.fontFamily,n=t.fontWeight,o=t.fontStyle,i=t.fontStretch;return cr(e,r,n,o,i)}}var pr={x:0,y:0,width:0,height:0};class vr extends Tt{constructor(e){super(e),A(this,"ssdfFontFamilies",{}),A(this,"msdfFontFamilies",{}),A(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]),A(this,"sdfShader",void 0),A(this,"rendererBounds",void 0),this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&W(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&W(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){var t=e.fontFamily;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||"$$SDF_FAILURE_TEST$$"===t}isFontFaceSupported(e){return e instanceof Y}addFontFace(e){_(e instanceof Y);var t=e.fontFamily,r="ssdf"===e.type?this.ssdfFontFamilies:"msdf"===e.type?this.msdfFontFamilies:void 0;if(r){var n=r[t];n||(n=new Set,r[t]=n),n.add(e)}else console.warn(`Invalid font face type: ${e.type}`)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new E,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){var t=e.trFontFace,r=e.textH,n=e.lineCache,o=e.debugData,i=e.forceFullLayoutCalc;if(o.updateCount++,"initialState"===e.status&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){var a=`SdfTextRenderer: Could not resolve font face for family: '${e.props.fontFamily}'`;return console.error(a),void this.setStatus(e,"failed",new Error(a))}t.texture.setRenderableOwner(e,e.isRenderable)}if(t.loaded){_(t.data,"Font face data should be loaded");var s=e.props,l=s.text,d=s.fontSize,u=s.x,h=s.y,c=s.contain,f=s.width,p=s.height,v=s.lineHeight,g=s.verticalAlign,m=s.scrollable,x=s.overflowSuffix,y=s.maxLines,b="both"===c&&m?e.props.scrollY:0,w=e.renderWindow,S=t.data.info.size,A=d/S,C=v/A;e.distanceRange=A*t.data.distanceField.distanceRange;var T=24*l.length,R=e.vertexBuffer;(!R||R.length=k.x2&&h-b+I.y1<=k.y1&&h-b+I.y2>=k.y2)return void this.setStatus(e,"loaded");w.valid=!1,this.setStatus(e,"loading")}var B=e.props,E=B.offsetY,N=B.textAlign;if(!w.valid){if(!W(k,this.rendererBounds))return;dr(w,u,h,b,v,"both"===c?k.y2-k.y1:0,k,A)}var F=function(e,t,r,n,o,i,a,s,l){var d=Math.min(Math.max(a.firstLineIdx,0),s.length),u=0;"middle"===n?u=(t-e)/2:"bottom"===n&&(u=t-e);var h=o/i+d*t+u;if(!(l&&h>=l/i))return{sdfX:0,sdfY:h,lineIndex:d}}(S,C,0,g,E,A,w,n,r);if(F){var L=e.props.letterSpacing,z=lr(F.lineIndex,F.sdfX,F.sdfY,l,N,f,p,d,v,L,R,c,n,w.sdf,t,i,m,x,y);e.bufferUploaded=!1,e.bufferNumFloats=z.bufferNumFloats,e.bufferNumQuads=z.bufferNumQuads,e.vertexBuffer=R,e.renderWindow=w,o.lastLayoutNumCharacters=z.layoutNumCharacters,o.bufferSize=R.byteLength,z.fullyProcessed&&(e.textW=z.maxX*A,e.textH=z.maxY*A),this.setStatus(e,"loaded")}else this.setStatus(e,"loaded")}else t.once("loaded",(()=>{this.scheduleUpdateState(e)}))}renderQuads(e,t,r,n,o,i){var a,s;if(e.vertexBuffer){var l=this.stage.renderer,d=e.props,u=d.fontSize,h=d.color,c=d.contain,f=d.scrollable,p=d.zIndex,v=d.debug,g="both"===c&&f?e.props.scrollY:0,m=e.textW,x=void 0===m?0:m,y=e.textH,b=void 0===y?0:y,w=e.distanceRange,S=e.vertexBuffer,A=e.bufferUploaded,C=e.trFontFace,T=e.elementBounds,R=e.webGlBuffers;if(!R){var k=l.glw,I=4*Float32Array.BYTES_PER_ELEMENT,B=k.createBuffer();_(B),e.webGlBuffers=new H([{buffer:B,attributes:{a_position:{name:"a_position",size:2,type:k.FLOAT,normalized:!1,stride:I,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:k.FLOAT,normalized:!1,stride:I,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,_(e.webGlBuffers),R=e.webGlBuffers}if(!A){var E,N,F=l.glw,z=null!==(E=null===(N=R)||void 0===N?void 0:N.getBuffer("a_textureCoordinate"))&&void 0!==E?E:null;F.arrayBufferData(z,S,F.STATIC_DRAW),e.bufferUploaded=!0}if(_(C),f&&"both"===c){_(T.valid);var M=j(T,pr);r.valid?(e.clippingRect.valid=!0,r=L(r,M,e.clippingRect)):(e.clippingRect.valid=!0,r=Q(M,e.clippingRect))}var P=new K(l.glw,l.options,R,this.sdfShader,{transform:t.data,color:$(h,n),size:u/((null===(a=C.data)||void 0===a?void 0:a.info.size)||0),scrollY:g,distanceRange:w,debug:v.sdfShaderDebug},n,r,{height:b,width:x},0,p,!1,o,i),D=null===(s=e.trFontFace)||void 0===s?void 0:s.texture;_(D);var O=this.stage.txManager.getCtxTexture(D);P.addTexture(O),P.length=e.bufferNumFloats,P.numQuads=e.bufferNumQuads,l.addRenderOp(P)}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.trFontFace)||void 0===r||r.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),null===(t=e.trFontFace)||void 0===t||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return fr.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){var t=e.props,r=t.x,n=t.contain,o=t.width,i=e.elementBounds;i.x1=r,i.x2="none"!==n?r+o:1/0}setElementBoundsY(e){var t=e.props,r=t.y,n=t.contain,o=t.height,i=e.elementBounds;i.y1=r,i.y2="both"===n?r+o:1/0}}function gr(e,t){return mr.apply(this,arguments)}function mr(){return(mr=b(x().mark((function e(t,r){var n,o,i;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Loading core extension",t),e.next=4,St((()=>w.import(t)),void 0);case 4:n=e.sent,e.next=12;break;case 7:return e.prev=7,e.t0=e.catch(0),console.error(`The core extension module at '${t}' could not be loaded.`),console.error(e.t0),e.abrupt("return");case 12:if(n.default){e.next=15;break}return console.error(`The core extension module at '${t}' does not have a default export.`),e.abrupt("return");case 15:if(o=n.default,!(o.prototype instanceof X)){e.next=29;break}return i=new o,e.prev=18,e.next=21,i.run(r);case 21:e.next=27;break;case 23:e.prev=23,e.t1=e.catch(18),console.error(`The core extension at '${t}' threw an error.`),console.error(e.t1);case 27:e.next=30;break;case 29:console.error(`The core extension at '${t}' does not extend CoreExtension.`);case 30:case"end":return e.stop()}}),e,null,[[0,7],[18,23]])})))).apply(this,arguments)}function xr(e){for(var t={boolean:!0,string:!0,number:!0},r=Object.keys(e),n=0;n2048&&(console.warn(`Custom Data value for ${o} is too long, it will be truncated to 2048 characters`),e[o]=i.substring(0,2048)),t[a]||(console.warn(`Custom Data value for ${o} is not a boolean, string, or number, it will be ignored`),delete e[o])}}return e}class yr extends E{constructor(e,t,r){var n,o,i,a;super(),A(this,"root",null),A(this,"driver",void 0),A(this,"canvas",void 0),A(this,"settings",void 0),A(this,"inspector",null),A(this,"nodes",new Map),A(this,"nextTextureId",1),A(this,"textureTracker",void 0);var s={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:null!==(n=e.clearColor)&&void 0!==n?n:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:null!==(o=e.experimental_FinalizationRegistryTextureUsageTracker)&&void 0!==o&&o,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:void 0!==e.numImageWorkers?e.numImageWorkers:2,enableContextSpy:null!==(i=e.enableContextSpy)&&void 0!==i&&i,enableInspector:null!==(a=e.enableInspector)&&void 0!==a&&a};this.settings=s;var l=s.appWidth,d=s.appHeight,u=s.deviceLogicalPixelRatio,h=s.devicePhysicalPixelRatio,c=s.enableInspector,f=e=>{this.driver.releaseTexture(e)},p=s.experimental_FinalizationRegistryTextureUsageTracker&&"function"==typeof FinalizationRegistry;this.textureTracker=p?new mt(f):new gt(f,this.settings.textureCleanupOptions);var v=l*u,g=d*u;this.driver=r;var m,x=document.createElement("canvas");if(this.canvas=x,x.width=v*h,x.height=g*h,x.style.width=`${v}px`,x.style.height=`${g}px`,!(m="string"==typeof t?document.getElementById(t):t))throw new Error("Could not find target element");r.onCreateNode=e=>{this.nodes.set(e.id,e)},r.onBeforeDestroyNode=e=>{this.nodes.delete(e.id)},r.onFpsUpdate=e=>{this.emit("fpsUpdate",e)},r.onFrameTick=e=>{this.emit("frameTick",e)},r.onIdle=()=>{this.emit("idle")},m.appendChild(x),c&&!R()&&(this.inspector=new wt(x,s))}init(){var e=this;return b(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.driver.init(e,e.settings,e.canvas);case 2:e.root=e.driver.getRootNode();case 3:case"end":return t.stop()}}),t)})))()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var t,r,n,o,i,a,s,l,d,u,h,c,f,p,v,g,m,x,y,b=null!==(t=e.fontSize)&&void 0!==t?t:16,w=S(S({},this.resolveNodeDefaults(e)),{},{text:null!==(r=e.text)&&void 0!==r?r:"",textRendererOverride:null!==(n=e.textRendererOverride)&&void 0!==n?n:null,fontSize:b,fontFamily:null!==(o=e.fontFamily)&&void 0!==o?o:"sans-serif",fontStyle:null!==(i=e.fontStyle)&&void 0!==i?i:"normal",fontWeight:null!==(a=e.fontWeight)&&void 0!==a?a:"normal",fontStretch:null!==(s=e.fontStretch)&&void 0!==s?s:"normal",textAlign:null!==(l=e.textAlign)&&void 0!==l?l:"left",contain:null!==(d=e.contain)&&void 0!==d?d:"none",scrollable:null!==(u=e.scrollable)&&void 0!==u&&u,scrollY:null!==(h=e.scrollY)&&void 0!==h?h:0,offsetY:null!==(c=e.offsetY)&&void 0!==c?c:0,letterSpacing:null!==(f=e.letterSpacing)&&void 0!==f?f:0,lineHeight:null!==(p=e.lineHeight)&&void 0!==p?p:b,maxLines:null!==(v=e.maxLines)&&void 0!==v?v:0,textBaseline:null!==(g=e.textBaseline)&&void 0!==g?g:"alphabetic",verticalAlign:null!==(m=e.verticalAlign)&&void 0!==m?m:"top",overflowSuffix:null!==(x=e.overflowSuffix)&&void 0!==x?x:"...",debug:null!==(y=e.debug)&&void 0!==y?y:{}});return this.inspector?this.inspector.createTextNode(this.driver,w):this.driver.createTextNode(w)}resolveNodeDefaults(e){var t,r,n,o,i,a,s,l,d,u,h,c,f,p,v,g,m,x,y,b,w,S,A,C,T,_,R,k,I,B,E,N,F,L,z,M,P,D,O,U,W,Y,H,j,Q,K,$,X,G,V,Z,q,J=null!==(t=e.color)&&void 0!==t?t:4294967295,ee=null!==(r=null!==(n=null!==(o=e.colorTl)&&void 0!==o?o:e.colorTop)&&void 0!==n?n:e.colorLeft)&&void 0!==r?r:J,te=null!==(i=null!==(a=null!==(s=e.colorTr)&&void 0!==s?s:e.colorTop)&&void 0!==a?a:e.colorRight)&&void 0!==i?i:J,re=null!==(l=null!==(d=null!==(u=e.colorBl)&&void 0!==u?u:e.colorBottom)&&void 0!==d?d:e.colorLeft)&&void 0!==l?l:J,ne=null!==(h=null!==(c=null!==(f=e.colorBr)&&void 0!==f?f:e.colorBottom)&&void 0!==c?c:e.colorRight)&&void 0!==h?h:J,oe=xr(null!==(p=e.data)&&void 0!==p?p:{}),ie=null!==(v=null!==(g=null===(m=e.parent)||void 0===m?void 0:m.rtt)&&void 0!==g?g:null===(x=e.parent)||void 0===x?void 0:x.parentHasRenderTexture)&&void 0!==v&&v;return{x:null!==(y=e.x)&&void 0!==y?y:0,y:null!==(b=e.y)&&void 0!==b?b:0,width:null!==(w=e.width)&&void 0!==w?w:0,height:null!==(S=e.height)&&void 0!==S?S:0,alpha:null!==(A=e.alpha)&&void 0!==A?A:1,autosize:null!==(C=e.autosize)&&void 0!==C&&C,clipping:null!==(T=e.clipping)&&void 0!==T&&T,color:J,colorTop:null!==(_=e.colorTop)&&void 0!==_?_:J,colorBottom:null!==(R=e.colorBottom)&&void 0!==R?R:J,colorLeft:null!==(k=e.colorLeft)&&void 0!==k?k:J,colorRight:null!==(I=e.colorRight)&&void 0!==I?I:J,colorBl:re,colorBr:ne,colorTl:ee,colorTr:te,zIndex:null!==(B=e.zIndex)&&void 0!==B?B:0,zIndexLocked:null!==(E=e.zIndexLocked)&&void 0!==E?E:0,parent:null!==(N=e.parent)&&void 0!==N?N:null,texture:null!==(F=e.texture)&&void 0!==F?F:null,shader:null!==(L=e.shader)&&void 0!==L?L:null,src:null!==(z=e.src)&&void 0!==z?z:"",scale:null!==(M=e.scale)&&void 0!==M?M:null,scaleX:null!==(P=null!==(D=e.scaleX)&&void 0!==D?D:e.scale)&&void 0!==P?P:1,scaleY:null!==(O=null!==(U=e.scaleY)&&void 0!==U?U:e.scale)&&void 0!==O?O:1,mount:null!==(W=e.mount)&&void 0!==W?W:0,mountX:null!==(Y=null!==(H=e.mountX)&&void 0!==H?H:e.mount)&&void 0!==Y?Y:0,mountY:null!==(j=null!==(Q=e.mountY)&&void 0!==Q?Q:e.mount)&&void 0!==j?j:0,pivot:null!==(K=e.pivot)&&void 0!==K?K:.5,pivotX:null!==($=null!==(X=e.pivotX)&&void 0!==X?X:e.pivot)&&void 0!==$?$:.5,pivotY:null!==(G=null!==(V=e.pivotY)&&void 0!==V?V:e.pivot)&&void 0!==G?G:.5,rotation:null!==(Z=e.rotation)&&void 0!==Z?Z:0,rtt:null!==(q=e.rtt)&&void 0!==q&&q,parentHasRenderTexture:ie,data:oe}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,r){var n=this.nextTextureId++,o={descType:"texture",txType:e,props:t,options:S(S({},r),{},{id:n})};return this.textureTracker.registerTexture(o),o}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class br extends E{constructor(e,t,r){super(),A(this,"node",void 0),A(this,"props",void 0),A(this,"settings",void 0),A(this,"propStartValues",{}),A(this,"restoreValues",{}),A(this,"progress",0),A(this,"delayFor",0),A(this,"timingFunction",void 0),A(this,"propsList",void 0),this.node=e,this.props=t,this.settings=r,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach((t=>{this.propStartValues[t]=e[t]})),this.timingFunction=e=>e,r.easing&&"string"==typeof r.easing&&(this.timingFunction=G(r.easing)),this.delayFor=r.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach((e=>{this.node[e]=this.propStartValues[e]}))}reverse(){this.progress=0,Object.keys(this.props).forEach((e=>{var t=this.props[e],r=this.propStartValues[e];this.props[e]=r,this.propStartValues[e]=t})),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,r){return(this.timingFunction(e)||e)*(r-t)+t}update(e){var t=this.settings,r=t.duration,n=t.loop,o=t.easing,i=t.stopMethod;if(r)if(this.delayFor>0)this.delayFor-=e;else if(this.delayFor<=0&&0===this.progress&&this.emit("start",{}),this.progress+=e/r,this.progress>1&&(this.progress=n?0:1,i))this.emit("finished",{});else{for(var a=0;a{this.startedResolve=e})))}makeStoppedPromise(){null===this.stoppedResolve&&(this.stoppedPromise=new Promise((e=>{this.stoppedResolve=e})))}started(){_(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){_(this.stoppedResolve);var e=this.animation.settings,t=e.loop;if("reverse"===e.stopMethod)return this.animation.reverse(),void this.start();this.stoppedResolve(),this.stoppedResolve=null,t||this.manager.unregisterAnimation(this.animation)}}class Sr{constructor(e){A(this,"data",void 0),e?(this.data=new Float32Array(9),this.data[0]=e[0],this.data[3]=e[3],this.data[6]=e[6],this.data[1]=e[1],this.data[4]=e[4],this.data[7]=e[7],this.data[2]=e[2],this.data[5]=e[5],this.data[8]=e[8]):this.data=new Float32Array(9)}static get temp(){return Cr}static multiply(e,t,r){var n=e.data[0]*t.data[0]+e.data[3]*t.data[1]+e.data[6]*t.data[2],o=e.data[0]*t.data[3]+e.data[3]*t.data[4]+e.data[6]*t.data[5],i=e.data[0]*t.data[6]+e.data[3]*t.data[7]+e.data[6]*t.data[8],a=e.data[1]*t.data[0]+e.data[4]*t.data[1]+e.data[7]*t.data[2],s=e.data[1]*t.data[3]+e.data[4]*t.data[4]+e.data[7]*t.data[5],l=e.data[1]*t.data[6]+e.data[4]*t.data[7]+e.data[7]*t.data[8],d=e.data[2]*t.data[0]+e.data[5]*t.data[1]+e.data[8]*t.data[2],u=e.data[2]*t.data[3]+e.data[5]*t.data[4]+e.data[8]*t.data[5],h=e.data[2]*t.data[6]+e.data[5]*t.data[7]+e.data[8]*t.data[8];return r||(r=new Sr),r.data[0]=n,r.data[3]=o,r.data[6]=i,r.data[1]=a,r.data[4]=s,r.data[7]=l,r.data[2]=d,r.data[5]=u,r.data[8]=h,r}static identity(e){return e||(e=new Sr),e.data[0]=1,e.data[3]=0,e.data[6]=0,e.data[1]=0,e.data[4]=1,e.data[7]=0,e.data[2]=0,e.data[5]=0,e.data[8]=1,e}static translate(e,t,r){return r||(r=new Sr),r.data[0]=1,r.data[3]=0,r.data[6]=e,r.data[1]=0,r.data[4]=1,r.data[7]=t,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static scale(e,t,r){return r||(r=new Sr),r.data[0]=e,r.data[3]=0,r.data[6]=0,r.data[1]=0,r.data[4]=t,r.data[7]=0,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static rotate(e,t){var r=Math.cos(e),n=Math.sin(e);return t||(t=new Sr),t.data[0]=r,t.data[3]=-n,t.data[6]=0,t.data[1]=n,t.data[4]=r,t.data[7]=0,t.data[2]=0,t.data[5]=0,t.data[8]=1,t}static copy(e,t,r){return t||(t=new Sr),t.data[0]=e.data[0],t.data[1]=e.data[1],t.data[2]=e.data[2],t.data[3]=e.data[3],t.data[4]=e.data[4],t.data[5]=e.data[5],t.data[6]=e.data[6],t.data[7]=e.data[7],t.data[8]=e.data[8],t}translate(e,t){return this.data[6]=this.data[0]*e+this.data[3]*t+this.data[6],this.data[7]=this.data[1]*e+this.data[4]*t+this.data[7],this}scale(e,t){return this.data[0]=this.data[0]*e,this.data[3]=this.data[3]*t,this.data[1]=this.data[1]*e,this.data[4]=this.data[4]*t,this}rotate(e){if(0===e||!(e%Math.PI*2))return this;var t=Math.cos(e),r=Math.sin(e),n=this.data[0]*t+this.data[3]*r,o=this.data[3]*t-this.data[0]*r,i=this.data[1]*t+this.data[4]*r,a=this.data[4]*t-this.data[1]*r;return this.data[0]=n,this.data[3]=o,this.data[1]=i,this.data[4]=a,this}multiply(e){return Sr.multiply(this,e,this)}get tx(){return this.data[6]}get ty(){return this.data[7]}get ta(){return this.data[0]}get tb(){return this.data[3]}get tc(){return this.data[1]}get td(){return this.data[4]}transformPoint(e,t){return[this.data[0]*e+this.data[3]*t+this.data[6],this.data[1]*e+this.data[4]*t+this.data[1]]}}var Ar,Cr=new Sr;class Tr{constructor(e){A(this,"data",void 0),this.data=new Float32Array(8),e&&(this.data[0]=e[0],this.data[2]=e[2],this.data[4]=e[4],this.data[6]=e[6],this.data[1]=e[1],this.data[3]=e[3],this.data[5]=e[5],this.data[7]=e[7])}static translate(e,t,r,n,o,i,a,s,l){return l||(l=new Tr),l.data[0]=e,l.data[2]=r,l.data[4]=o,l.data[6]=a,l.data[1]=t,l.data[3]=n,l.data[5]=i,l.data[7]=s,l}get x1(){return this.data[0]}get x2(){return this.data[2]}get x3(){return this.data[4]}get x4(){return this.data[6]}get y1(){return this.data[1]}get y2(){return this.data[3]}get y3(){return this.data[5]}get y4(){return this.data[7]}}!function(e){e[e.Init=0]="Init",e[e.OutOfBounds=2]="OutOfBounds",e[e.InBounds=4]="InBounds",e[e.InViewport=8]="InViewport"}(Ar||(Ar={}));var _r,Rr=new Map;Rr.set(Ar.Init,"init"),Rr.set(Ar.OutOfBounds,"outOfBounds"),Rr.set(Ar.InBounds,"inBounds"),Rr.set(Ar.InViewport,"inViewport"),function(e){e[e.Children=1]="Children",e[e.ScaleRotate=2]="ScaleRotate",e[e.Local=4]="Local",e[e.Global=8]="Global",e[e.Clipping=16]="Clipping",e[e.CalculatedZIndex=32]="CalculatedZIndex",e[e.ZIndexSortedChildren=64]="ZIndexSortedChildren",e[e.PremultipliedColors=128]="PremultipliedColors",e[e.WorldAlpha=256]="WorldAlpha",e[e.RenderState=512]="RenderState",e[e.IsRenderable=1024]="IsRenderable",e[e.None=0]="None",e[e.All=2047]="All"}(_r||(_r={}));class kr extends E{constructor(e,t){super(),A(this,"stage",void 0),A(this,"children",[]),A(this,"props",void 0),A(this,"updateType",_r.All),A(this,"globalTransform",void 0),A(this,"scaleRotateTransform",void 0),A(this,"localTransform",void 0),A(this,"renderCoords",void 0),A(this,"renderBound",void 0),A(this,"strictBound",void 0),A(this,"preloadBound",void 0),A(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1}),A(this,"isRenderable",!1),A(this,"renderState",Ar.Init),A(this,"worldAlpha",1),A(this,"premultipliedColorTl",0),A(this,"premultipliedColorTr",0),A(this,"premultipliedColorBl",0),A(this,"premultipliedColorBr",0),A(this,"calcZIndex",0),A(this,"hasRTTupdates",!1),A(this,"onTextureLoaded",((e,t)=>{this.autosizeNode(t),this.parentHasRenderTexture&&this.setRTTUpdates(1),this.emit("loaded",{type:"texture",dimensions:t}),queueMicrotask((()=>{this.stage.requestRender()}))})),A(this,"onTextureFailed",((e,t)=>{this.emit("failed",{type:"texture",error:t})})),A(this,"onTextureFreed",(e=>{this.emit("freed",{type:"texture"})})),this.stage=e,this.props=S(S({},t),{},{parent:null,parentHasRenderTexture:!1}),this.parent=t.parent,this.rtt=t.rtt,this.updateScaleRotateTransform()}loadTexture(e,t,r=null){this.props.texture&&this.unloadTexture();var n=this.stage.txManager.loadTexture(e,t,r);this.props.texture=n,this.props.textureOptions=r,this.setUpdateType(_r.IsRenderable),queueMicrotask((()=>{"loaded"===n.state?this.onTextureLoaded(n,n.dimensions):"failed"===n.state?this.onTextureFailed(n,n.error):"freed"===n.state&&this.onTextureFreed(n),n.on("loaded",this.onTextureLoaded),n.on("failed",this.onTextureFailed),n.on("freed",this.onTextureFreed)}))}unloadTexture(){if(this.props.texture){var e=this.props.texture;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(_r.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){var r=this.stage.renderer.getShaderManager();_(r);var n=r.loadShader(e,t),o=n.shader,i=n.props;this.props.shader=o,this.props.shaderProps=i,this.setUpdateType(_r.IsRenderable)}setUpdateType(e){this.updateType|=e;var t=this.props.parent;!t||t.updateType&_r.Children||t.setUpdateType(_r.Children),this.parentHasRenderTexture&&this.setRTTUpdates(e)}sortChildren(){this.children.sort(((e,t)=>e.calcZIndex-t.calcZIndex))}updateScaleRotateTransform(){this.scaleRotateTransform=Sr.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){_(this.scaleRotateTransform);var e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,r=this.props.mountX*this.props.width,n=this.props.mountY*this.props.height;this.localTransform=Sr.translate(e-r+this.props.x,t-n+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(_r.Global)}update(e,t){this.updateType&_r.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(_r.Local)),this.updateType&_r.Local&&(this.updateLocalTransform(),this.setUpdateType(_r.Global));var r,n=this.props.parent,o=_r.None;this.updateType&_r.Global&&(_(this.localTransform),this.globalTransform=Sr.copy((null==n?void 0:n.globalTransform)||this.localTransform,this.globalTransform),this.parentHasRenderTexture&&null!==(r=this.props.parent)&&void 0!==r&&r.rtt&&(this.globalTransform=Sr.identity()),n&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(_r.Clipping|_r.RenderState|_r.Children),o|=_r.Global);this.updateType&_r.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(_r.Children),o|=_r.Clipping),this.updateType&_r.WorldAlpha&&(this.worldAlpha=n?n.worldAlpha*this.props.alpha:this.props.alpha,this.setUpdateType(_r.Children|_r.PremultipliedColors|_r.IsRenderable),o|=_r.WorldAlpha),this.updateType&_r.PremultipliedColors&&(this.premultipliedColorTl=M(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=M(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=M(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=M(this.props.colorBr,this.worldAlpha,!0))),this.updateType&_r.RenderState&&(this.updateRenderState(t),this.setUpdateType(_r.IsRenderable)),this.updateType&_r.IsRenderable&&this.updateIsRenderable(),n&&this.updateType&_r.CalculatedZIndex&&(this.calculateZIndex(),n.setUpdateType(_r.ZIndexSortedChildren)),this.updateType&_r.Children&&this.children.length&&!this.rtt&&this.children.forEach((t=>{t.setUpdateType(o),0!==t.updateType&&t.update(e,this.clippingRect)})),this.updateType&_r.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return!!this.props.texture||!(!this.props.width||!this.props.height)&&(!!this.props.shader||(!!this.props.clipping||(0!==this.props.color||(0!==this.props.colorTop||(0!==this.props.colorBottom||(0!==this.props.colorLeft||(0!==this.props.colorRight||(0!==this.props.colorTl||(0!==this.props.colorTr||(0!==this.props.colorBl||0!==this.props.colorBr))))))))))}checkRenderBounds(e){_(this.renderBound);var t=e.width||this.stage.root.width,r=e.height||this.stage.root.height;this.strictBound=B(e.x,e.y,e.x+t,e.y+r,this.strictBound);var n=this.stage.boundsMargin;return this.preloadBound=B(e.x-n[3],e.y-n[0],e.x+t+n[1],e.y+r+n[2],this.preloadBound),Z(this.renderBound,this.strictBound)?Ar.InViewport:Z(this.renderBound,this.preloadBound)?Ar.InBounds:Ar.OutOfBounds}updateRenderState(e){var t=this.checkRenderBounds(e);if(t!==this.renderState){var r=this.renderState;this.renderState=t,r===Ar.InViewport&&this.emit("outOfViewport",{previous:r,current:t}),(rAr.InBounds&&t===Ar.OutOfBounds)&&(this.emit(Rr.get(Ar.InBounds),{previous:r,current:t}),r=Ar.InBounds);var n=Rr.get(t);_(n),this.emit(n,{previous:r,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(Ar[e]))}updateIsRenderable(){var e;e=!(0===this.worldAlpha||!this.checkRenderProps())&&this.renderState>Ar.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;null===(t=this.props.texture)||void 0===t||t.setRenderableOwner(this,e)}calculateRenderCoords(){var e=this.width,t=this.height,r=this.globalTransform;_(r);var n=r.tx,o=r.ty,i=r.ta,a=r.tb,s=r.tc,l=r.td;if(0===a&&0===s){var d=n,u=n+e*i,h=o,c=o+t*l;this.renderCoords=Tr.translate(d,h,u,h,u,c,d,c,this.renderCoords)}else this.renderCoords=Tr.translate(n,o,n+e*i,o+e*s,n+e*i+t*a,o+e*s+t*l,n+t*a,o+t*l,this.renderCoords)}updateBoundingRect(){var e=this.renderCoords,t=this.globalTransform;_(t),_(e);var r=t.tb,n=t.tc,o=e.x1,i=e.y1,a=e.x3,s=e.y3;if(0===r||0===n)this.renderBound=B(o,i,a,s,this.renderBound);else{var l=e.x2,d=e.x4,u=e.y2,h=e.y4;this.renderBound=B(Math.min(o,l,a,d),Math.min(i,u,s,h),Math.max(o,l,a,d),Math.max(i,u,s,h),this.renderBound)}}calculateClippingRect(e){_(this.globalTransform);var t=this.clippingRect,r=this.props,n=this.globalTransform,o=r.clipping,i=0!==n.tb||0!==n.tc;o&&!i?(t.x=n.tx,t.y=n.ty,t.width=this.width*n.ta,t.height=this.height*n.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?L(e,t,t):e.valid&&(Q(e,t),t.valid=!0)}calculateZIndex(){var e,t,r=this.props,n=r.zIndex||0,o=(null===(e=r.parent)||void 0===e?void 0:e.zIndex)||0,i=n;null!==(t=r.parent)&&void 0!==t&&t.zIndexLocked&&(i=n{e.setUpdateType(_r.CalculatedZIndex)}))}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(_r.CalculatedZIndex|_r.Children),this.children.forEach((e=>{e.setUpdateType(_r.CalculatedZIndex)}))}get parent(){return this.props.parent}set parent(e){var t=this.props.parent;if(t!==e){if(this.props.parent=e,t){var r=t.children.indexOf(this);_(-1!==r,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(r,1),t.setUpdateType(_r.Children|_r.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(_r.All),e.setUpdateType(_r.Children|_r.ZIndexSortedChildren),(e.rtt||e.parentHasRenderTexture)&&this.setRTTUpdates(_r.All)),this.parentHasRenderTexture=(null==e?void 0:e.rtt)||(null==e?void 0:e.parentHasRenderTexture),this.updateScaleRotateTransform()}}get rtt(){return this.props.rtt}set rtt(e){var t;e&&(this.props.rtt=!0,this.hasRTTupdates=!0,null===(t=this.stage.renderer)||void 0===t||t.renderToTexture(this))}set parentHasRenderTexture(e){this.props.parentHasRenderTexture=!!e}get parentHasRenderTexture(){return this.props.parentHasRenderTexture}get framebufferDimensions(){var e;return this.parentHasRenderTexture&&!this.rtt?null===(e=this.parent)||void 0===e?void 0:e.framebufferDimensions:{width:this.width,height:this.height}}get parentRenderTexture(){for(var e=this.parent;e;){if(e.rtt)return e;e=e.parent}return null}get texture(){return this.props.texture}setRTTUpdates(e){var t;this.hasRTTupdates=!0,null===(t=this.parent)||void 0===t||t.setRTTUpdates(e)}}var Ir=1;function Br(){return Ir++}class Er extends E{constructor(e,t,r,n){var o;super(),A(this,"rendererMain",void 0),A(this,"stage",void 0),A(this,"id",void 0),A(this,"coreNode",void 0),A(this,"_children",[]),A(this,"_src",""),A(this,"_parent",null),A(this,"_texture",null),A(this,"_shader",null),A(this,"_data",{}),A(this,"onTextureLoaded",((e,t)=>{this.emit("loaded",t)})),A(this,"onTextureFailed",((e,t)=>{this.emit("failed",t)})),A(this,"onTextureFreed",((e,t)=>{this.emit("freed",t)})),A(this,"onOutOfBounds",((e,t)=>{this.emit("outOfBounds",t)})),A(this,"onInBounds",((e,t)=>{this.emit("inBounds",t)})),A(this,"onOutOfViewport",((e,t)=>{this.emit("outOfViewport",t)})),A(this,"onInViewport",((e,t)=>{this.emit("inViewport",t)})),this.rendererMain=t,this.stage=r,this.id=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:Br(),this.coreNode=n||new kr(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null,rtt:e.rtt,parentHasRenderTexture:e.parentHasRenderTexture}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this.rtt=e.rtt,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){null!==e&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var t,r=this._parent;if(this._parent=e,this.coreNode.parent=null!==(t=null==e?void 0:e.coreNode)&&void 0!==t?t:null,r){var n=r.children.indexOf(this);_(-1!==n,"MainOnlyNode.parent: Node not found in old parent's children!"),r.children.splice(n,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.texture=e?this.rendererMain.createTexture("ImageTexture",{src:e}):null)}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get rtt(){return this.coreNode.rtt}set rtt(e){e&&(this.texture=this.rendererMain.createTexture("RenderTexture",{width:this.width,height:this.height},{preload:!0,flipY:!0})),this.coreNode.rtt=e}get parentHasRenderTexture(){return this.coreNode.parentHasRenderTexture}set parentHasRenderTexture(e){this.coreNode.parentHasRenderTexture=e}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=xr(e)}destroy(){this.emit("beforeDestroy",{});for(var e=this.children[0];e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){var r=new br(this.coreNode,e,t);return new wr(this.stage.animationManager,r)}}class Nr{constructor(){A(this,"activeAnimations",new Set)}registerAnimation(e){this.activeAnimations.add(e)}unregisterAnimation(e){this.activeAnimations.delete(e)}update(e){this.activeAnimations.forEach((t=>{t.update(e)}))}}class Fr{constructor(e){A(this,"imageWorkersEnabled",!0),A(this,"messageManager",{}),A(this,"workers",[]),A(this,"workerIndex",0),this.workers=this.createWorkers(e),this.workers.forEach((e=>{e.onmessage=this.handleMessage.bind(this)}))}handleMessage(e){var t=e.data,r=t.src,n=t.data,o=t.error,i=this.messageManager[r];if(i){var a=C(i,2),s=a[0],l=a[1];delete this.messageManager[r],o?l(new Error(o)):s(n)}}createWorkers(e=1){for(var t=new Blob(["\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ".replace('"use strict";',"")],{type:"application/javascript"}),r=(self.URL?URL:webkitURL).createObjectURL(t),n=[],o=0;o{try{if(this.workers){var o=this.convertUrlToAbsolute(e);this.messageManager[o]=[r,n],this.getNextWorker().postMessage({src:o,premultiplyAlpha:t})}}catch(i){n(i)}}))}}class Lr extends O{constructor(e,t){super(e),A(this,"props",void 0),this.props=Lr.resolveDefaults(t)}getTextureData(){var e=this;return b(x().mark((function t(){var r,n,o,i,a,s,l;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=e.props,n=r.width,o=r.height,i=n*o*4,a=new Uint8ClampedArray(i),s=0;s{})}setTextureMemUse(e,t){this.textures.has(e)&&(this.memUsed-=this.textures.get(e)),0!==t?(this.memUsed+=t,this.textures.set(e,t),this.memUsed>this.threshold&&this.gc()):this.textures.delete(e)}gc(){this.textures.forEach(((e,t)=>{t.renderable||t.free()}))}}var Pr,Dr;class Or extends E{constructor(e){super(),A(this,"options",void 0),A(this,"animationManager",void 0),A(this,"txManager",void 0),A(this,"txMemManager",void 0),A(this,"fontManager",void 0),A(this,"textRenderers",void 0),A(this,"shManager",void 0),A(this,"renderer",void 0),A(this,"root",void 0),A(this,"boundsMargin",void 0),A(this,"deltaTime",0),A(this,"lastFrameTime",0),A(this,"currentFrameTime",0),A(this,"fpsNumFrames",0),A(this,"fpsElapsedTime",0),A(this,"renderRequested",!1),A(this,"contextSpy",null),this.options=e;var t=e.canvas,r=e.clearColor,n=e.rootId,o=e.debug,i=e.appWidth,a=e.appHeight,s=e.boundsMargin,l=e.enableContextSpy,d=e.numImageWorkers,u=e.txMemByteThreshold;this.txManager=new zr(d),this.txMemManager=new Mr(u),this.shManager=new er,this.animationManager=new Nr,this.contextSpy=l?new tr:null;var h=[0,0,0,0];s&&(h=Array.isArray(s)?s:[s,s,s,s]),this.boundsMargin=h,null!=o&&o.monitorTextureCache&&setInterval((()=>{_(this.txManager);var e=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",e.idCacheSize),console.log("Texture Key Cache Size: ",e.keyCacheSize)}),1e3),this.renderer=new te({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:null!=r?r:4278190080,bufferMemory:2e6,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new Nt(this),sdf:new vr(this)},this.fontManager=new fr(this.textRenderers);var c,f,p,v=new kr(this,{id:n,x:0,y:0,width:i,height:a,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null,rtt:!1});this.root=v,c=this,f=!1,p=()=>{if(c.updateAnimations(),!c.hasSceneUpdates())return c.calculateFps(),setTimeout(p,16.666666666666668),void(f||(c.emit("idle"),f=!0));f=!1,c.drawFrame(),requestAnimationFrame(p)},requestAnimationFrame(p)}updateAnimations(){var e=this.animationManager;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=performance?performance.now():Date.now(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){var e=this.renderer,t=this.renderRequested;0!==this.root.updateType&&this.root.update(this.deltaTime,this.root.clippingRect),null==e||e.reset(),e.rttNodes.length>0&&e.renderRTTNodes(),this.addQuads(this.root),null==e||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var e=this.options.fpsUpdateInterval;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){var t,r,n,o=Math.round(1e3*this.fpsNumFrames/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:o,contextSpyData:null!==(t=null===(r=this.contextSpy)||void 0===r?void 0:r.getData())&&void 0!==t?t:null}),null===(n=this.contextSpy)||void 0===n||n.reset()}}addQuads(e){_(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(var t=0;t{var e=this.contain,t=this.trState.props.width,r=this.trState.props.height,n=this.trState.textW||0,o=this.trState.textH||0;"both"===e?(this.props.width=t,this.props.height=r):"width"===e?(this.props.width=t,this.props.height=o):"none"===e&&(this.props.width=n,this.props.height=o),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})})),A(this,"onTextFailed",((e,t)=>{this.emit("failed",{type:"text",error:t})})),this._textRendererOverride=t.textRendererOverride;var r=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix}),n=r.resolvedTextRenderer,o=r.textRendererState;this.textRenderer=n,this.trState=o}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),"none"===this.contain&&this.setUpdateType(_r.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),"both"!==this.contain&&this.setUpdateType(_r.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);var t=this.resolveTextRendererAndState(this.trState.props),r=t.resolvedTextRenderer,n=t.textRendererState;this.textRenderer=r,this.trState=n}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),_(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return""!==this.trState.props.text||super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){var t,r;if(_(this.globalTransform),this.parentHasRenderTexture){if(!e.renderToTextureActive)return;if(this.parentRenderTexture!==e.activeRttNode)return}this.parentHasRenderTexture&&null!==(t=this.props.parent)&&void 0!==t&&t.rtt&&(this.globalTransform=Sr.identity(),this.globalTransform.multiply(null!==(r=this.localTransform)&&void 0!==r?r:Sr.identity()));_(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha,this.parentHasRenderTexture,this.framebufferDimensions)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){var t=this.stage.resolveTextRenderer(e,this._textRendererOverride),r=t.createState(e);return r.emitter.on("loaded",this.onTextLoaded),r.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(r),{resolvedTextRenderer:t,textRendererState:r}}}class Wr extends Er{constructor(e,t,r){super(e,t,r,new Ur(r,{id:Br(),x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStretch:e.fontStretch,fontStyle:e.fontStyle,contain:e.contain,scrollable:e.scrollable,letterSpacing:e.letterSpacing,textAlign:e.textAlign,scrollY:e.scrollY,offsetY:e.offsetY,textRendererOverride:e.textRendererOverride,lineHeight:e.lineHeight,maxLines:e.maxLines,textBaseline:e.textBaseline,verticalAlign:e.verticalAlign,overflowSuffix:e.overflowSuffix,debug:e.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null,rtt:!1,parentHasRenderTexture:!1}))}get text(){return this.coreNode.text}set text(e){this.coreNode.text=e}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(e){this.coreNode.textRendererOverride=e}get fontSize(){return this.coreNode.fontSize}set fontSize(e){this.coreNode.fontSize=e}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(e){this.coreNode.fontFamily=e}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(e){this.coreNode.fontWeight=e}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(e){this.coreNode.fontStretch=e}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(e){this.coreNode.fontStyle=e}get textAlign(){return this.coreNode.textAlign}set textAlign(e){this.coreNode.textAlign=e}get contain(){return this.coreNode.contain}set contain(e){this.coreNode.contain=e}get scrollable(){return this.coreNode.scrollable}set scrollable(e){this.coreNode.scrollable=e}get scrollY(){return this.coreNode.scrollY}set scrollY(e){this.coreNode.scrollY=e}get offsetY(){return this.coreNode.offsetY}set offsetY(e){this.coreNode.offsetY=e}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(e){this.coreNode.letterSpacing=e}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(e){e&&(this.coreNode.lineHeight=e)}get maxLines(){return this.coreNode.maxLines}set maxLines(e){e&&(this.coreNode.maxLines=e)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(e){e&&(this.coreNode.textBaseline=e)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(e){e&&(this.coreNode.verticalAlign=e)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(e){e&&(this.coreNode.overflowSuffix=e)}get debug(){return this.coreNode.debug}set debug(e){this.coreNode.debug=e}}class Yr{constructor(){A(this,"root",null),A(this,"stage",null),A(this,"rendererMain",null)}init(e,t,r){var n=this;return b(x().mark((function o(){var i;return x().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n.stage=new Or({rootId:Br(),appWidth:t.appWidth,appHeight:t.appHeight,txMemByteThreshold:t.txMemByteThreshold,boundsMargin:t.boundsMargin,deviceLogicalPixelRatio:t.deviceLogicalPixelRatio,devicePhysicalPixelRatio:t.devicePhysicalPixelRatio,clearColor:t.clearColor,canvas:r,fpsUpdateInterval:t.fpsUpdateInterval,enableContextSpy:t.enableContextSpy,numImageWorkers:t.numImageWorkers,debug:{monitorTextureCache:!1}}),n.rendererMain=e,_(n.stage.root),i=new Er(e.resolveNodeDefaults({}),n.rendererMain,n.stage,n.stage.root),n.root=i,i.once("beforeDestroy",n.onBeforeDestroyNode.bind(n,i)),n.onCreateNode(i),!t.coreExtensionModule){o.next=10;break}return o.next=10,gr(t.coreExtensionModule,n.stage);case 10:n.stage.on("fpsUpdate",((e,t)=>{n.onFpsUpdate(t)})),n.stage.on("frameTick",((e,t)=>{n.onFrameTick(t)})),n.stage.on("idle",(()=>{n.onIdle()}));case 13:case"end":return o.stop()}}),o)})))()}createNode(e){_(this.rendererMain),_(this.stage);var t=new Er(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}createTextNode(e){_(this.rendererMain),_(this.stage);var t=new Wr(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}destroyNode(e){e.destroy()}releaseTexture(e){var t=this.stage;_(t),t.txManager.removeTextureIdFromCache(e)}getRootNode(){return _(this.root),this.root}onCreateNode(e){throw new Error("Method not implemented.")}onBeforeDestroyNode(e){throw new Error("Method not implemented.")}onFpsUpdate(e){throw new Error("Method not implemented.")}onFrameTick(e){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}function Hr(e={},t="app"){var r=new Yr;return Pr=new yr(e,t,r),Dr=Pr.createShader.bind(Pr),Pr}class jr extends Array{constructor(e){super(),this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){var r=this.indexOf(t);this.splice(r,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){var t=this.indexOf(e);t>=0&&this.splice(t,1)}}var Qr={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Kr(e,t,...r){false}function $r(e){return"function"==typeof e}function Xr(e){return Array.isArray(e)}function Gr(e,t={}){if(Xr(e))e.forEach((e=>{Gr(e,t)}));else if(e)for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t}class Vr extends Array{constructor(e,t={}){return Xr(t)?super(...t):"string"==typeof t?super(t):super(...Object.entries(t).filter((([e,t])=>t)).map((([e])=>e))),this.onChange=e,this}has(e){return this.indexOf(e)>=0}is(e){return this.indexOf(e)>=0}add(e){this.push(e),this.onChange()}toggle(e){this.has(e)?this.remove(e):this.add(e)}remove(e){var t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}var Zr=Qr.animationSettings;function qr(e){for(var t=[],r=0,n=Object.entries(e);rpt(this)))}else this.autofocus=!0}isTextNode(){return"text"===this.name}_resizeOnTextLoad(){this.lng.on("loaded",((e,t)=>{if("text"===t.type){var r=t.dimensions;this.parent.updateLayout(this,r)}}))}getText(){return this.children.map((e=>e.text)).join("")}destroy(){var e;this._queueDelete&&(null===(e=this.lng)||void 0===e||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){for(var t in Xr(e)?this._style=Gr(e):this._style=e,this._style)void 0===this[t]&&(this[t]=this._style[t])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(e){return this.children.find((t=>t.id===e))}searchChildrenById(e){var t,r=T(this.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.id===e)return n;if(n instanceof en){var o=n.searchChildrenById(e);if(o)return o}}}catch(i){r.e(i)}finally{r.f()}}set states(e){this._states=new Vr(this._stateChanged.bind(this),e),this.lng&&this._stateChanged()}get states(){return this._states=this._states||new Vr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||Zr}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){if(this.hasChildren){Kr();var r,n=!1;if($r(this.onBeforeLayout)&&(n=this.onBeforeLayout.call(this,e,t)),"flex"===this.display){if(function(e){for(var t=[],r=!1,n=0;n(e.flexOrder||0)-(t.flexOrder||0)));var i=t.length,a="row"===(e.flexDirection||"row"),s=a?"width":"height",l=a?"height":"width",d=a?"marginLeft":"marginTop",u=a?"marginRight":"marginBottom",h=a?"x":"y",c=a?"y":"x",f=e[s]||0,p=e[l]||0,v=e.gap||0,g=e.justifyContent||"flexStart",m=e.alignItems,x=0;["center","spaceBetween","spaceEvenly"].includes(g)&&(x=t.reduce(((e,t)=>e+(t[s]||0)),0));var y=p&&m?e=>{"flexStart"===m?e[c]=0:"center"===m?e[c]=(p-(e[l]||0))/2:"flexEnd"===m&&(e[c]=p-(e[l]||0))}:e=>e;if("flexStart"===g){var b=0;if(t.forEach((e=>{e[h]=b+(e[d]||0),b+=(e[s]||0)+v+(e[d]||0)+(e[u]||0),y(e)})),"fixed"!==e.flexBoundary){var w=b-v;if(w!==e[s])return e[s]=w,!0}}else if("flexEnd"===g)for(var S=f,A=i-1;A>=0;A--){var C=t[A];_(C),C[h]=S-(C[s]||0)-(C[u]||0),S-=(C[s]||0)+v+(C[d]||0)+(C[u]||0),y(C)}else if("center"===g){var T=(f-(x+v*(i-1)))/2;t.forEach((e=>{e[h]=T,T+=(e[s]||0)+v,y(e)}))}else if("spaceBetween"===g){var R=(f-x)/(i-1),k=0;t.forEach((e=>{e[h]=k,k+=(e[s]||0)+R,y(e)}))}else if("spaceEvenly"===g){var I=(f-x)/(i+1),B=I;t.forEach((e=>{e[h]=B,B+=(e[s]||0)+I,y(e)}))}return!1}(this)||n)null===(r=this.parent)||void 0===r||r.updateLayout()}else if(n){var o;null===(o=this.parent)||void 0===o||o.updateLayout()}$r(this.onLayout)&&this.onLayout.call(this,e,t)}}_stateChanged(){if(Kr(0,0,this.states),this.forwardStates){var e=this.states.slice();this.children.forEach((t=>t.states=e))}var t=this.states;if(this._undoStyles||this.style&&function(e,t){var r,n=T(t);try{for(n.s();!(r=n.n()).done;)if(r.value in e)return!0}catch(o){n.e(o)}finally{n.f()}return!1}(this.style,t)){this._undoStyles=this._undoStyles||[];var r={};this._undoStyles.forEach((e=>{r[e]=this.style[e]}));var n=t.reduce(((e,t)=>{var r=this.style[t];return r&&(e=S(S({},e),r)),e}),{});this._undoStyles=Object.keys(n),void 0!==n.transition&&(this.transition=n.transition),Object.assign(this,r,n)}}render(){var e=this,t=this.parent;if(t)if(t.lng)if(this.lng)console.warn("Node already rendered: ",this);else{t._isDirty&&(t.updateLayout(),t._isDirty=!1),this.states.length&&this._stateChanged();var r=e._renderProps;if(r.x=r.x||0,r.y=r.y||0,t.lng&&(r.parent=t.lng),e._effects&&(this.shader=qr(e._effects)),e.isTextNode()){if(Qr.fontSettings)for(var n in Qr.fontSettings)void 0===r[n]&&(r[n]=Qr.fontSettings[n]);r.text=e.getText(),r.contain&&(r.width||(r.width=(t.width||0)-r.x-(r.marginRight||0),e._autosized=!0),"both"!==r.contain||r.height||r.maxLines||(r.height=(t.height||0)-r.y-(r.marginBottom||0),e._autosized=!0)),Kr(0,0),e.lng=Pr.createTextNode(r),r.width&&r.height||(e._autosized=!0,e._resizeOnTextLoad())}else r.texture||(isNaN(r.width)&&(r.width=(t.width||0)-r.x,e._autosized=!0),isNaN(r.height)&&(r.height=(t.height||0)-r.y,e._autosized=!0),r.color||r.src||(r.color=0)),Kr(0,0),e.lng=Pr.createNode(r);e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad),$r(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach((([t,r])=>{var n;null===(n=e.lng)||void 0===n||n.on(t,((t,n)=>r(e,n)))})),e.lng.div&&(e.lng.div.solid=e),"text"!==e.name&&e.children.forEach((e=>{e.render?e.render():""!==e.text&&console.warn("TextNode outside of : ",e)})),e.autofocus&&e.setFocus(),delete this._renderProps}else console.warn("Parent not rendered yet: ",this);else console.warn("Parent not set - no node created for: ",this)}}for(var tn=function(){var e=nn[rn];Object.defineProperty(en.prototype,e,{get(){return this.lng?this.lng[e]:this._renderProps[e]},set(t){this._sendToLightningAnimatable(e,t)}})},rn=0,nn=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"];rn{return t=gn("text"),xn(t,e,!1),t;var t},dn=e=>{return t=gn("node"),xn(t,e,!1),t;var t};function un({createElement:e,createTextNode:t,isTextNode:r,replaceText:n,insertNode:o,removeNode:i,setProperty:a,getParentNode:s,getFirstChild:l,getNextSibling:d}){function u(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return h(e,t,n,r);Te((n=>h(e,t(),n,r)),n)}function h(e,i,a,s,d){for(;"function"==typeof a;)a=a();if(i===a)return a;var u=typeof i,m=void 0!==s;if("string"===u||"number"===u)if("number"===u&&(i=i.toString()),m){var x=a[0];x&&r(x)?n(x,i):x=t(i),a=p(e,a,s,x)}else""!==a&&"string"==typeof a?n(l(e),a=i):(p(e,a,s,t(i)),a=i);else if(null==i||"boolean"===u)a=p(e,a,s);else{if("function"===u)return Te((()=>{for(var t=i();"function"==typeof t;)t=t();a=h(e,t,a,s)})),()=>a;if(Array.isArray(i)){var y=[];if(c(y,i,d))return Te((()=>a=h(e,y,a,s,!0))),()=>a;if(0===y.length){var b=p(e,a,s);if(m)return a=b}else Array.isArray(a)?0===a.length?v(e,y,s):f(e,a,y):null==a||""===a?v(e,y):f(e,m&&a||[l(e)],y);a=y}else{if(Array.isArray(a)){if(m)return a=p(e,a,s,i);p(e,a,null,i)}else null!=a&&""!==a&&l(e)?g(e,i,l(e)):o(e,i);a=i}}return a}function c(e,r,n){for(var o=!1,i=0,a=r.length;im-u)for(var w=t[l];u=0;c--){var f=r[c];if(u!==f){var p=s(f)===e;h||c?p&&i(e,f):p?g(e,u,f):o(e,u,n)}else h=!0}else o(e,u,n);return[u]}function v(e,t,r){for(var n=0,i=t.length;nr.children=h(e,t.children,r.children))),Te((()=>t.ref&&t.ref(e))),Te((()=>{for(var n in t)if("children"!==n&&"ref"!==n){var o=t[n];o!==r[n]&&(a(e,n,o,r[n]),r[n]=o)}})),r}return{render(e,t){var r;return Se((n=>{r=n,u(t,e())})),r},insert:u,spread(e,t,r){"function"==typeof t?Te((n=>m(e,t(),n,r))):m(e,t,void 0,r)},createElement:e,createTextNode:t,insertNode:o,setProp:(e,t,r,n)=>(a(e,t,r,n),r),mergeProps:lt,effect:Te,memo:Re,createComponent:nt,use:(e,t,r)=>Be((()=>e(t,r)))}}var hn={createElement:e=>new en(e),createTextNode:e=>({name:"TextNode",text:e,parent:void 0}),replaceText(e,t){Kr(0,0),e.text=t;var r=e.parent;_(r),r.text=r.getText()},setProperty(e,t,r=!0){e[t]=r},insertNode(e,t,r){Kr(0,0),e.children.insert(t,r),t._queueDelete=!1,t instanceof en?e.lng&&t.render():e.isTextNode()&&(e.text=e.getText())},isTextNode:e=>e.isTextNode(),removeNode(e,t){Kr(0,0),e.children.remove(t),t._queueDelete=!0,t instanceof en&&queueMicrotask((()=>t.destroy()))},getParentNode:e=>e.parent,getFirstChild:e=>e.children[0],getNextSibling(e){var t=e.parent.children||[],r=t.indexOf(e)+1;if(rr||document});r;){var n=r[t];if(n&&!r.disabled){var o=r[`${t}Data`];if(void 0!==o?n.call(r,o,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}var Tn;function _n(){var e=new Set;var t=!1;return{subscribe:function(t){return e.add(t),()=>e.delete(t)},confirm:function(r,n){if(t)return!(t=!1);var o,i={to:r,options:n,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0},a=T(e);try{var s=function(){var e=o.value;e.listener(S(S({},i),{},{from:e.location,retry:o=>{o&&(t=!0),e.navigate(r,S(S({},n),{},{resolve:!1}))}}))};for(a.s();!(o=a.n()).done;)s()}catch(l){a.e(l)}finally{a.f()}return!i.defaultPrevented}}}function Rn(){window.history.state&&null!=window.history.state._depth||window.history.replaceState(S(S({},window.history.state),{},{_depth:window.history.length-1}),""),Tn=window.history.state._depth}Rn();var kn=/^(?:[a-z0-9]+:)?\/\//i,In=/^\/+|(\/)\/+$/g,Bn="http://sr";function En(e,t=!1){var r=e.replace(In,"$1");return r?t||/^[?#]/.test(r)?r:"/"+r:""}function Nn(e,t,r){if(!kn.test(t)){var n=En(e),o=r&&En(r),i="";return((i=!o||t.startsWith("/")?n:0!==o.toLowerCase().indexOf(n.toLowerCase())?n+o:o)||"/")+En(t,!i)}}function Fn(e){var t={};return e.searchParams.forEach(((e,r)=>{t[r]=e})),t}function Ln(e,t,r){var n=C(e.split("/*",2),2),o=n[0],i=n[1],a=o.split("/").filter(Boolean),s=a.length;return e=>{var n=e.split("/").filter(Boolean),o=n.length-s;if(o<0||o>0&&void 0===i&&!t)return null;for(var l={path:s?"":"/",params:{}},d=e=>void 0===r?void 0:r[e],u=0;u0===t.localeCompare(e,void 0,{sensitivity:"base"});return void 0===t||("string"==typeof t?r(t):"function"==typeof t?t(e):Array.isArray(t)?t.some(r):t instanceof RegExp&&t.test(e))}function Mn(e){var t=new Map,r=Le();return new Proxy({},{get:(n,o)=>(t.has(o)||ze(r,(()=>t.set(o,Re((()=>e()[o]))))),t.get(o)()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),ownKeys:()=>Reflect.ownKeys(e())})}function Pn(e){var t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];for(var r=e.slice(0,t.index),n=e.slice(t.index+t[0].length),o=[r,r+=t[1]];t=/^(\/\:[^\/]+)\?/.exec(n);)o.push(r+=t[1]),n=n.slice(t[0].length);return Pn(n).reduce(((e,t)=>[...e,...o.map((e=>e+t))]),[])}var Dn,On=Pe(),Un=Pe(),Wn=()=>function(e,t){if(null==e)throw new Error(t);return e}(De(On)," and 'use' router primitives can be only used inside a Route."),Yn=()=>Wn().navigatorFactory(),Hn=()=>Wn().location,jn=()=>Wn().params;function Qn(e,t=""){var r=e.component,n=e.load,o=e.children,i=e.info,a=!o||Array.isArray(o)&&!o.length,s={key:e,component:r,load:n,info:i};return $n(e.path).reduce(((r,n)=>{var o,i,l=T(Pn(n));try{for(l.s();!(o=l.n()).done;){var d=o.value,u=(i=d,En(t).replace(/\/*(\*.*)?$/g,"")+En(i)),h=a?u:u.split("/*",1)[0];h=h.split("/").map((e=>e.startsWith(":")||e.startsWith("*")?e:encodeURIComponent(e))).join("/"),r.push(S(S({},s),{},{originalPath:d,pattern:h,matcher:Ln(h,!a,e.matchFilters)}))}}catch(c){l.e(c)}finally{l.f()}return r}),[])}function Kn(e,t=0){return{routes:e,score:1e4*(r=e[e.length-1],n=C(r.pattern.split("/*",2),2),o=n[0],i=n[1],a=o.split("/").filter(Boolean),a.reduce(((e,t)=>e+(t.startsWith(":")?2:3)),a.length-(void 0===i?0:1)))-t,matcher(t){for(var r=[],n=e.length-1;n>=0;n--){var o=e[n],i=o.matcher(t);if(!i)return null;r.unshift(S(S({},i),{},{route:o}))}return r}};var r,n,o,i,a}function $n(e){return Array.isArray(e)?e:[e]}function Xn(e,t="",r=[],n=[]){for(var o=$n(e),i=0,a=o.length;it.score-e.score))}function Gn(e,t){for(var r=0,n=e.length;re),u=l.renderPath||(e=>e),h=l.beforeLeave||_n(),c=Nn("",n.base||"");if(void 0===c)throw new Error(`${c} is not a valid base path`);c&&!i().value&&a({value:c,replace:!0,scroll:!1});var f=C(Ae(!1),2),p=f[0],v=f[1],g=function(){var e=b(x().mark((function e(t){return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,Me(t);case 4:return e.prev=4,v(!1),e.finish(4);case 7:case"end":return e.stop()}}),e,null,[[1,,4,7]])})));return function(t){return e.apply(this,arguments)}}(),m=C(Ae(i().value),2),y=m[0],w=m[1],A=C(Ae(i().state),2),T=A[0],_=A[1],R=function(e,t){var r=new URL(Bn),n=Re((t=>{var n=e();try{return new URL(n,r)}catch(o){return console.error(`Invalid path ${n}`),t}}),r,{equals:(e,t)=>e.href===t.href}),o=Re((()=>n().pathname)),i=Re((()=>n().search),!0),a=Re((()=>n().hash));return{get pathname(){return o()},get search(){return i()},get hash(){return a()},get state(){return t()},get key(){return""},query:Mn(Ee(i,(()=>Fn(n()))))}}(y,T),k=[],I=Ae([]),B=Re((()=>Gn(t(),R.pathname))),E=Mn((()=>{for(var e=B(),t={},r=0;rc,outlet:()=>null,resolvePath:e=>Nn(c,e)};return Te((()=>{var e=i(),t=e.value,r=e.state;Be((()=>{t!==y()&&g((()=>{Dn="native",w(t),_(r),I[1]([])})).then((()=>{Dn=void 0}))}))})),{base:N,location:R,params:E,isRouting:p,renderPath:u,parsePath:d,navigatorFactory:function(e){return e=e||De(Un)||N,(t,r)=>function(e,t,r){Be((()=>{if("number"!=typeof t){var n=S({replace:!1,resolve:!0,scroll:!0},r),o=n.replace,i=n.resolve,s=n.scroll,d=n.state,u=i?e.resolvePath(t):Nn("",t);if(void 0===u)throw new Error(`Path '${t}' is not a routable path`);if(k.length>=100)throw new Error("Too many redirects");var c=y();if((u!==c||d!==T())&&h.confirm(u,r)){var f=k.push({value:c,replace:o,scroll:s,state:T()});g((()=>{Dn="navigate",w(u),_(d),I[1]([])})).then((()=>{var e,t;k.length===f&&(Dn=void 0,e={value:u,state:d},(t=k[0])&&(e.value===t.value&&e.state===t.state||a(S(S({},e),{},{replace:t.replace,scroll:t.scroll})),k.length=0))}))}}else t&&(l.go?l.go(t):console.warn("Router integration does not support relative routing"))}))}(e,t,r)},matches:B,beforeLeave:h,preloadRoute:function(e,n){var o=Gn(t(),e.pathname),i=Dn;Dn="preload";var a=function(){var t=o[s],i=t.route,a=t.params;i.component&&i.component.preload&&i.component.preload();var l=i.load;n&&l&&ze(r(),(()=>l({params:a,location:{pathname:e.pathname,search:e.search,hash:e.hash,query:Fn(e),state:null,key:""},intent:"preload"})))};for(var s in o)a();Dn=i},singleFlight:void 0===n.singleFlight||n.singleFlight,submissions:I}}var Zn=e=>t=>{var r,n=t.base,o=Oe((()=>t.children)),i=Re((()=>Xn(o(),t.base||""))),a=Vn(e,i,(()=>r),{base:n,singleFlight:t.singleFlight});return e.create&&e.create(a),vn(On.Provider,{value:a,get children(){return vn(qn,{routerState:a,get root(){return t.root},get load(){return t.rootLoad},get children(){return[pn((()=>(r=Le())&&null)),vn(Jn,{routerState:a,get branches(){return i()}})]}})}})};function qn(e){var t=e.routerState.location,r=e.routerState.params,n=Re((()=>e.load&&Be((()=>e.load({params:r,location:t,intent:"preload"})))));return vn(ht,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>vn(o,{params:r,location:t,get data(){return n()},get children(){return e.children}})})}function Jn(e){var t,r=[],n=Re(Ee(e.routerState.matches,((o,i,a)=>{for(var s=i&&o.length===i.length,l=[],d=function(t){var d=i&&i[t],u=o[t];a&&d&&u.route.key===d.route.key?l[t]=a[t]:(s=!1,r[t]&&r[t](),Se((o=>{r[t]=o,l[t]=function(e,t,r,n){var o=e.base,i=e.location,a=e.params,s=n().route,l=s.pattern,d=s.component,u=s.load,h=Re((()=>n().path));d&&d.preload&&d.preload();var c=u?u({params:a,location:i,intent:Dn||"initial"}):void 0;return{parent:t,pattern:l,path:h,outlet:()=>d?nt(d,{params:a,location:i,data:c,get children(){return r()}}):r(),resolvePath:e=>Nn(o.path(),e,h())}}(e.routerState,l[t-1]||e.routerState.base,eo((()=>n()[t+1])),(()=>e.routerState.matches()[t]))})))},u=0,h=o.length;ue())),a&&s?a:(t=l[0],l)})));return eo((()=>n()&&t))()}var eo=e=>()=>vn(ht,{get when(){return e()},keyed:!0,children:e=>vn(Un.Provider,{value:e,get children(){return e.outlet()}})}),to=e=>{var t=Oe((()=>e.children));return lt(e,{get children(){return t()}})};function ro(e,t){var r=function(e){if("#"===e)return null;try{return document.querySelector(e)}catch(t){return null}}(`#${e}`);r?r.scrollIntoView():t&&window.scrollTo(0,0)}var no=new Map;function oo(e=!0,t=!1,r="/_server"){return n=>{var o=n.base.path(),i=n.navigatorFactory(n.base),a={};function s(e){if(!(e.defaultPrevented||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)){var r=e.composedPath().find((e=>e instanceof Node&&"A"===e.nodeName.toUpperCase()));if(r&&(!t||r.hasAttribute("link"))){var n="http://www.w3.org/2000/svg"===r.namespaceURI,i=n?r.href.baseVal:r.href;if(!(n?r.target.baseVal:r.target)&&(i||r.hasAttribute("state"))){var a=(r.getAttribute("rel")||"").split(/\s+/);if(!(r.hasAttribute("download")||a&&a.includes("external"))){var s=n?new URL(i,document.baseURI):new URL(i);if(!(s.origin!==window.location.origin||o&&s.pathname&&!s.pathname.toLowerCase().startsWith(o.toLowerCase())))return[r,s]}}}}}function l(e){var t=s(e);if(t){var r=C(t,2),o=r[0],a=r[1],l=n.parsePath(a.pathname+a.search+a.hash),d=o.getAttribute("state");e.preventDefault(),i(l,{resolve:!1,replace:o.hasAttribute("replace"),scroll:!o.hasAttribute("noscroll"),state:d&&JSON.parse(d)})}}function d(e){var t=s(e);if(t){var r=C(t,2),o=r[0],i=r[1];a[i.pathname]||n.preloadRoute(i,"false"!==o.getAttribute("preload"))}}function u(e){var t=s(e);if(t){var r=C(t,2),o=r[0],i=r[1];a[i.pathname]||(a[i.pathname]=setTimeout((()=>{n.preloadRoute(i,"false"!==o.getAttribute("preload")),delete a[i.pathname]}),200))}}function h(e){var t=s(e);if(t){var r=C(t,2)[1];a[r.pathname]&&(clearTimeout(a[r.pathname]),delete a[r.pathname])}}function c(e){var t=e.submitter&&e.submitter.hasAttribute("formaction")?e.submitter.getAttribute("formaction"):e.target.getAttribute("action");if(t){if(!t.startsWith("https://action/")){var o=new URL(t,Bn);if(!(t=n.parsePath(o.pathname+o.search)).startsWith(r))return}if("POST"!==e.target.method.toUpperCase())throw new Error("Only POST forms are supported for Actions");var i=no.get(t);if(i){e.preventDefault();var a=new FormData(e.target);e.submitter&&e.submitter.name&&a.append(e.submitter.name,e.submitter.value),i.call({r:n,f:e.target},a)}}}!function(e,t=window.document){for(var r=t[An]||(t[An]=new Set),n=0,o=e.length;n{document.removeEventListener("click",l),e&&(document.removeEventListener("mouseover",u),document.removeEventListener("mouseout",h),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",c)}))}}function io(e){var t=e.replace(/^.*?#/,"");if(!t.startsWith("/")){var r=C(window.location.hash.split("#",2),2)[1];return`${void 0===r?"/":r}#${t}`}return t}function ao(e){var t=()=>window.location.hash.slice(1),r=_n();return function(e){var t=!1,r=e=>"string"==typeof e?{value:e}:e,n=function([e,t],r,n){return[r?()=>r(e()):e,n?e=>t(n(e)):t]}(Ae(r(e.get()),{equals:(e,t)=>e.value===t.value}),void 0,(r=>(!t&&e.set(r),r)));return e.init&&Fe(e.init(((o=e.get())=>{t=!0,n[1](r(o)),t=!1}))),Zn({signal:n,create:e.create,utils:e.utils})}({get:t,set({value:e,replace:t,scroll:r,state:n}){t?window.history.replaceState(function(e){return S(S({},e),{},{_depth:window.history.state&&window.history.state._depth})}(n),"","#"+e):window.location.hash=e;var o=e.indexOf("#");ro(o>=0?e.slice(o+1):"",r),Rn()},init:e=>{return n=window,o="hashchange",i=function(e,t){var r=!1;return()=>{var n=Tn;Rn();var o=null==n?null:Tn-n;r?r=!1:o&&t(o)?(r=!0,window.history.go(-o)):e()}}(e,(e=>!r.confirm(e&&e<0?e:t()))),n.addEventListener(o,i),()=>n.removeEventListener(o,i);var n,o,i},create:oo(e.preload,e.explicitLinks,e.actionBase),utils:{go:e=>window.history.go(e),renderPath:e=>`#${e}`,parsePath:io,beforeLeave:r}})(e)}var so=Fe;function lo(e,t=Le()){var r,n,o=0;return()=>(o++,Fe((()=>{o--,queueMicrotask((()=>{!o&&n&&(n(),n=r=void 0)}))})),n||Se((t=>r=e(n=t)),t),r)}var uo=lo((()=>{var e,t,r,n,o=C(Ae(null),2),i=o[0],a=o[1];return e=window,t="keydown",r=e=>{a(e),setTimeout((()=>a(null)))},e.addEventListener(t,r,n),so(e.removeEventListener.bind(e,t,r,n)),i}));function ho(e){return"function"==typeof e}var co,fo={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},po=C(Ae([]),2),vo=po[0],go=po[1],mo=e=>{var t=uo();if(e)for(var r=function(){var e,t=C(o[n],2),r=t[0],i=t[1];e=i,Array.isArray(e)?i.forEach((e=>{fo[e]=r})):fo[i]=r},n=0,o=Object.entries(e);n{for(var n=e,o=[];n;)n.states.has("focus")||(n.states.add("focus"),ho(n.onFocus)&&n.onFocus.call(n,e,t)),o.push(n),n=n.parent;return r.forEach((r=>{o.includes(r)||(r.states.remove("focus"),ho(r.onBlur)&&r.onBlur.call(r,e,t))})),go(o),o}),{defer:!0})),_e((()=>{var e=t();if(e){var r=fo[e.key]||fo[e.keyCode];Be((()=>{var t,n=void 0,o=T(vo());try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n=n||i,r){var a=i[`on${r}`];if(ho(a)&&!0===a.call(i,e,i,n))break}else console.log(`Unhandled key event: ${e.key}`);if(ho(i.onKeyPress)&&!0===i.onKeyPress.call(i,e,r,i,n))break}}catch(s){o.e(s)}finally{o.f()}return!1}))}})),vo};function xo(e,t){var r,n,o,i,a=t();if(Array.isArray(a))if(2===a.length)r=i=a[0],n=o=a[1];else if(3===a.length)r=a[0],n=o=a[1],i=a[2];else{var s=C(a,4);r=s[0],o=s[1],i=s[2],n=s[3]}else r=o=i=n=a;e.onBeforeLayout=(t,a)=>{if(a){e.width=e.children.reduce(((e,t)=>e+(t.width||0)),0)+n+o;var s=e.children[0];s&&(s.x=n,s.marginLeft=n);var l=0;return e.children.forEach((e=>{e.y=r,e.marginTop=r,l=Math.max(l,e.height||0)})),e.height=l+r+i,!0}}}function yo(e){return new Promise((t=>{setTimeout(t,e)}))}function bo(e,t,r="en-US"){var n=window.speechSynthesis;return new Promise(((o,i)=>{var a=new SpeechSynthesisUtterance(e);a.lang=r,a.onend=()=>{o()},a.onerror=e=>{i(e)},t.push(a),n.speak(a)}))}function wo(e,t,r=!0){var n=window.speechSynthesis,o=function(e=[]){var t,r=[];for(t=0;t0)){e.next=46;break}return e.prev=20,e.next=23,bo(r,a,t);case 23:d=0,e.next=44;break;case 26:if(e.prev=26,e.t0=e.catch(20),!(e.t0 instanceof SpeechSynthesisErrorEvent)){e.next=43;break}if("network"!==e.t0.error){e.next=36;break}return d--,console.warn(`Speech synthesis network error. Retries left: ${d}`),e.next=34,yo(500*(l-d));case 34:e.next=41;break;case 36:if("canceled"!==e.t0.error&&"interrupted"!==e.t0.error){e.next=40;break}d=0,e.next=41;break;case 40:throw new Error(`SpeechSynthesisErrorEvent: ${e.t0.error}`);case 41:e.next=44;break;case 43:throw e.t0;case 44:e.next=19;break;case 46:e.next=60;break;case 48:if("function"!=typeof r){e.next=55;break}return u=wo(r(),t,!1),i.push(u),e.next=53,u.series;case 53:e.next=60;break;case 55:if(!Array.isArray(r)){e.next=60;break}return h=wo(r,t,!1),i.push(h),e.next=60,h.series;case 60:e.next=1;break;case 62:return e.prev=62,s=!1,e.finish(62);case 65:case"end":return e.stop()}}),e,null,[[0,,62,65],[20,26]])})))(),get active(){return s},append:e=>{o.push(e)},cancel:()=>{s&&(r&&n.cancel(),i.forEach((e=>{e.cancel()})),s=!1)}}}function So(e,t="en-US"){return co&&co.cancel(),co=wo(e,t)}var Ao,Co,To=(e,t)=>{var r,n=()=>clearTimeout(r);Le()&&Fe(n);return Object.assign(((...o)=>{void 0!==r&&n(),r=setTimeout((()=>e(...o)),t)}),{clear:n})},_o=[],Ro=!1;function ko(e,t){var r,n=To(e,t),o=e=>{r=e,n(e)};return o.flush=()=>{n.clear(),e(r)},o.clear=n.clear,o}function Io(e){return e.id||e.name}function Bo(e=[]){if(Eo.onFocusChange&&Eo.enabled){var t=e.every((e=>!e.loading)),r=e.filter((e=>!_o.includes(e)));if(Ao(),t||!Eo.onFocusChange){_o=e.slice(0);var n=[],o=r.reduce(((e,t)=>(t.announce?(e.push([Io(t),"Announce",t.announce]),n.push(t.announce)):t.title?(e.push([Io(t),"Title",t.title]),n.push(t.title)):e.push([Io(t),"No Announce",""]),e)),[]);return r.reverse().reduce(((e,t)=>(t.announceContext?(e.push([Io(t),"Context",t.announceContext]),n.push(t.announceContext)):e.push([Io(t),"No Context",""]),e)),o),Eo.debug&&console.table(o),n.length?Eo.speak(n.reduce(((e,t)=>e.concat(t)),[])):void 0}Eo.onFocusChange([])}}var Eo={debug:!1,enabled:!0,cancel:function(){Co&&Co.cancel()},clearPrevFocus:function(e=0){_o=_o.slice(0,e),Ao()},speak:function(e,{append:t=!1,notification:r=!1}={}){var n;Eo.onFocusChange&&Eo.enabled&&(Eo.onFocusChange.flush(),t&&Co&&Co.active?Co.append(e):(Eo.cancel(),function(e){if(!Ro)Co=So(e)}(e)),r&&(Ro=!0,null===(n=Co)||void 0===n||n.series.finally((()=>{Ro=!1,Eo.refresh()})).catch(console.error)));return Co},refresh:function(e=0){Eo.clearPrevFocus(e),Eo.onFocusChange&&Eo.onFocusChange(Be((()=>vo())))},setupTimers:function({focusDebounce:e=400,focusChangeTimeout:t=3e5}={}){Eo.onFocusChange=ko(Bo,e),Ao=ko((()=>{_o=[]}),t)}};var No,Fo,Lo,zo,Mo,Po,Do,Oo,Uo,Wo,Yo,Ho,jo,Qo,Ko,$o,Xo,Go,Vo=C(Ae(""),2),Zo=Vo[0],qo=Vo[1],Jo={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRI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AAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4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4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function ei(){var e,t,r,n=0,o={duration:750,easing:"ease-in-out"},i={alpha:1,color:4294967295};return _e(Ee(Zo,(i=>{!function(i){i.startsWith("#")?(e.color=Sn(i),e.src="",e.alpha=1,n=1,t.alpha=0,r.alpha=0):(e.color=4294967295,r.alpha=1,0===n?(e.src=i,n=1):1===n?(t.src=i,n=2,t.alpha=0,t.animate({alpha:1},o).start(),e.animate({alpha:0},o).start()):2===n&&(e.src=i,n=1,e.alpha=0,e.animate({alpha:1},o).start(),t.animate({alpha:0},o).start()))}(i)}),{defer:!0})),vn(dn,{width:1920,height:1080,zIndex:-5,get children(){return[vn(dn,{ref(t){"function"==typeof e?e(t):e=t},style:i}),vn(dn,{ref(e){"function"==typeof t?t(e):t=e},style:i,alpha:0}),vn(dn,{ref(e){"function"==typeof r?r(e):r=e},src:"./assets/hero-mask-inverted.png",get color(){return Sn(Jo.color.materialBrand)},width:1920,height:1080})]}})}function ti(e){if(!e||!e[Symbol.iterator])throw new Error("objectFromEntries requires a single iterable argument");var t,r={},n=T(e);try{for(n.s();!(t=n.n()).done;){var o=C(t.value,2),i=o[0],a=o[1];r[i]=a}}catch(s){n.e(s)}finally{n.f()}return r}var ri=["focus","disabled"],ni=["brand","inverse","neutral"];function oi({themeKeys:e,base:t,modes:r,tones:n,themeStyles:o,modeKeys:i=ri,toneKeys:a=ni},s=!1){var l=t=>ti(Object.entries(e).filter((([e,r])=>t[r])).map((([e,r])=>[e,t[r]])));return((e,t,r)=>{var n,d=(n=o,ti(Object.entries(n).map((([e,t])=>{var r=l(t);return Object.entries(t).filter((([e,t])=>i.includes(e))).forEach((([e,t])=>{r[e]=l(t)})),[e,r]}))));s&&console.log(d);var u=((e,t)=>S(S({},e),t.base))(e,d);s&&console.log(u);var h=((e,t)=>ti(i.map((r=>[r,S(S({},null==e?void 0:e[r]),null==t?void 0:t[r])]))))(t,d);s&&console.log(h);var c=((e,t,r)=>ti(a.map((n=>{var o,a,s={};return new Set([].concat.apply([],[null!==(o=null==e?void 0:e[n])&&void 0!==o?o:{},null!==(a=null==t?void 0:t[n])&&void 0!==a?a:{}].map(Object.keys))).forEach((r=>{var o,a,l;i.includes(r)||(s[r]=null!==(l=null==(o=null==t?void 0:t[n])?void 0:o[r])&&void 0!==l?l:null==(a=null==e?void 0:e[n])?void 0:a[r])})),i.forEach((o=>{var i,a;s[o]=S(S(S({},r[o]),null==(i=null==e?void 0:e[n])?void 0:i[o]),null==(a=null==t?void 0:t[n])?void 0:a[o])})),[n,s]}))))(r,d,h);return s&&console.log(c),{base:S(S({},u),h),tones:c}})(t,r,n)}function ii(e=0){return(t,r,n=0,o)=>{var i,a,s;if(0!==t.children.length){var l="row"===t.flexDirection?"width":"height",d="row"===t.flexDirection?"x":"y",u=t.gap||0,h=t.scroll||"auto",c=function(e){var t,r;"row"===e.flexDirection?(t={position:e.children[e.children.length-1].x,size:e.children[e.children.length-1].width},r=e.width):(t={position:e.children[e.children.length-1].y,size:e.children[e.children.length-1].height},r=e.height);return[t,r]}(t),f=C(c,2),p=f[0],v=f[1],g=null!==(i=t[d])&&void 0!==i?i:0,m=null!==(a=null==r?void 0:r[d])&&void 0!==a?a:0,x=null!==(s=null==r?void 0:r[l])&&void 0!==s?s:0,y=void 0===o?"none":n>o?"positive":"negative",b=g;if("auto"===h)null!=t.scrollIndex&&t.scrollIndex>=0?t.selected>=t.scrollIndex&&(b="positive"===y?g-x-u:g+x+u):(Math.abs(g)+vm)b=-m+e;else if("edge"===h&&"positive"===y&&Math.abs(g)+v{var t=e.filter((e=>"function"==typeof e));if(0!==t.length)return 1===t.length?t[0]:function(...e){var r,n,o=T(t);try{for(o.s();!(n=o.n()).done;){if(!0===(r=n.value.apply(this,e)))return r}}catch(i){o.e(i)}finally{o.f()}return r}};function si(){if(!this||void 0===this.selected||0===this.children.length)return!1;for(var e=this.children[this.selected];null==e?void 0:e.skipFocus;)this.selected++,e=this.children[this.selected];return e instanceof en&&(e.setFocus(),!0)}function li(e){return function(){var t,r,n,o=this.children.length,i=this.wrap,a=this.selected||0;if(0===o)return!1;if("right"===e||"down"===e){do{if(this.selected=(this.selected||0)%o+1,this.selected>=o){if(!i){this.selected=void 0;break}this.selected=0}}while(null==(t=this.children[this.selected])?void 0:t.skipFocus)}else if("left"===e||"up"===e)do{if(this.selected=(this.selected||0)%o-1,this.selected<0){if(!i){this.selected=void 0;break}this.selected=o-1}}while(null==(r=this.children[this.selected])?void 0:r.skipFocus);if(void 0===this.selected&&(this.selected=a,null==(n=this.children[this.selected])?void 0:n.states.has("focus")))return!1;var s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,a),this.plinko&&void 0!==a){var l=this.children[a].selected||0;s.selected=lvn(dn,bn(e,{get style(){var t,r;return[...[e.style].flat(),null==(r=Ii.Container.tones)?void 0:r[null!==(t=e.tone)&&void 0!==t?t:Ii.tone],Ii.Container.base]},forwardStates:!0,get children(){return vn(ln,{get style(){var t,r;return[...[null==(r=e.style)?void 0:r.Text].flat(),Ii.Text.tones[null!==(t=e.tone)&&void 0!==t?t:Ii.tone],Ii.Text.base]},get children(){return e.children}})}})),Ei=(null==(Mo=Jo)?void 0:Mo.componentConfig).Checkbox,Ni=void 0===Ei?{styles:{}}:Ei,Fi=(Ni.defaultTone,m(Ni,o)),Li=Jo.stroke.sm,zi=Jo.spacer.xxl,Mi={themeKeys:{color:"color",borderRadius:"borderRadius",border:"border",justifyContent:"justifyContent"},base:{width:zi,height:zi,display:"flex",justifyContent:"center",color:Jo.color.fillNeutral,alignItems:"center",borderRadius:zi/4,border:{color:Jo.color.strokeInverse,width:Li}},modes:{disabled:{alpha:Jo.alpha.inactive}},tones:{brand:{borderRadius:zi/4,border:{color:Jo.color.strokeNeutralSecondary,width:Li},color:Jo.color.fillNeutralSecondary,checked:{borderRadius:zi/4,border:{color:Jo.color.strokeNeutralSecondary,width:Li},color:Jo.color.fillBrand}},neutral:{borderRadius:zi/4,border:{color:Jo.color.strokeNeutralSecondary,width:Li},color:Jo.color.fillInverseSecondary,checked:{borderRadius:zi/4,border:{color:Jo.color.strokeNeutralSecondary,width:Li},color:Jo.color.fillNeutral}},inverse:{borderRadius:zi/4,border:{color:Jo.color.strokeInverseSecondary,width:Li},color:Jo.color.fillNeutralSecondary,checked:{borderRadius:zi/4,border:{color:Jo.color.strokeInverseSecondary,width:Li},color:Jo.color.fillInverse}}},modeKeys:["focus","disabled","checked"],themeStyles:Fi},Pi={themeKeys:{color:"color"},base:{width:Jo.spacer.lg,height:Jo.spacer.lg,src:Jo.asset.check},tones:{neutral:{color:Jo.color.fillInverse},inverse:{color:Jo.color.fillNeutral},brand:{color:Jo.color.fillInverse}},themeStyles:Fi};oi(Mi),oi(Pi);var Di=(null==(Po=Jo)?void 0:Po.componentConfig).Icon,Oi=void 0===Di?{styles:{}}:Di,Ui=(Oi.defaultTone,m(Oi,i));oi({themeKeys:{color:"color"},base:{width:100,height:100,color:Jo.color.fillInverse},tones:{inverse:{color:Jo.color.fillInverse},brand:{color:Jo.color.fillBrand}},themeStyles:Ui});var Wi=(null==(Do=Jo)?void 0:Do.componentConfig).Column,Yi=void 0===Wi?{styles:{}}:Wi,Hi=Yi.defaultTone,ji=m(Yi,a),Qi={tone:Hi||"neutral",Container:oi({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"column",gap:Jo.layout.gutterY,itemTransition:S(S({},Jo.animation.standardEntrance),{},{duration:Jo.animation.duration.fast})},themeStyles:ji})},Ki=e=>{var t=li("up"),r=li("down");return vn(dn,bn(e,{get onUp(){return ai(e.onUp,t)},get onDown(){return ai(e.onDown,r)},get selected(){return e.selected||0},forwardFocus:si,get onCreate(){return ai((t=>{var r,n;return ii(e.y).call(t,t,t.children[null!==(r=e.selected)&&void 0!==r?r:0],null!==(n=e.selected)&&void 0!==n?n:0,void 0)}),e.onCreate)},get onSelectedChanged(){return ai(e.onSelectedChanged,"none"!==e.scroll?ii(e.y):void 0)},get style(){var t;return[...[e.style].flat(),Qi.Container.tones[null!==(t=e.tone)&&void 0!==t?t:Qi.tone],Qi.Container.base]}}))},$i=(null==(Oo=Jo)?void 0:Oo.componentConfig).Label,Xi=void 0===$i?{styles:{}}:$i,Gi=(Xi.defaultTone,m(Xi,s)),Vi={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:Jo.color.textNeutral,padding:[Jo.spacer.md,Jo.spacer.lg],borderRadius:[Jo.radius.md,Jo.radius.md,Jo.radius.md,Jo.radius.none],height:Jo.typography.caption1.lineHeight+Jo.spacer.md,neutral:{backgroundColor:Jo.color.fillNeutral}},tones:{inverse:{color:Jo.color.fillInverse},brand:{color:Jo.color.fillBrand,focus:{color:Jo.color.orange}}},themeStyles:Gi},Zi={themeKeys:{color:"textColor"},base:S(S({},Jo.typography.caption1),{},{color:Jo.color.textInverse}),tones:{inverse:{color:Jo.color.textNeutral},brand:{color:Jo.color.textNeutral}},themeStyles:Gi};oi(Vi),oi(Zi);var qi=(null==(Uo=Jo)?void 0:Uo.componentConfig).Rating,Ji=void 0===qi?{styles:{},defaultTone:"neutral"}:qi,ea=Ji.styles,ta=(Ji.defaultTone,{themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:Jo.spacer.sm},toneModes:{},themeStyles:ea}),ra={themeKeys:{color:"textColor"},base:S({color:Jo.color.textNeutral},Jo.typography.body2),toneModes:{},themeStyles:ea},na={themeKeys:{color:"color"},base:{height:Jo.typography.body2.lineHeight,width:Jo.typography.body2.lineHeight,color:Jo.color.fillNeutral,marginRight:Jo.spacer.sm},toneModes:{},themeStyles:ea};oi(ta),oi(na),oi(ra);var oa=(null==(Wo=Jo)?void 0:Wo.componentConfig).Details,ia=void 0===oa?{styles:{}}:oa,aa=(ia.defaultTone,m(ia,l)),sa={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:Jo.spacer.lg,badgeContentSpacing:Jo.spacer.sm,ratingContentSpacing:Jo.spacer.lg},themeStyles:aa},la={themeKeys:{color:"textColor"},base:S(S({},Jo.typography.body2),{},{marginRight:Jo.spacer.lg,color:Jo.color.textNeutral}),tones:{neutral:{disabled:{color:Jo.color.textNeutralDisabled}},inverse:{color:Jo.color.textInverse,disabled:{color:Jo.color.textNeutralDisabled}},brand:{color:Jo.color.textNeutral,disabled:{color:Jo.color.textNeutralDisabled}}},themeStyles:aa};oi(sa),oi(la);var da=(null==(Yo=Jo)?void 0:Yo.componentConfig).Metadata,ua=void 0===da?{styles:{}}:da,ha=(ua.defaultTone,m(ua,d)),ca={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:Jo.alpha.primary},modes:{disabled:{alpha:Jo.alpha.inactive}},themeStyles:ha},fa={themeKeys:{color:"textColor"},base:S(S({maxLines:1,contain:"width"},Jo.typography.headline3),{},{color:Jo.color.textNeutral}),tones:{neutral:{disabled:{color:Jo.color.textNeutralDisabled}},inverse:{color:Jo.color.textInverse,disabled:{color:Jo.color.textNeutralDisabled}},brand:{color:Jo.color.textNeutral,disabled:{color:Jo.color.textNeutralDisabled}}},themeStyles:ha},pa={themeKeys:{color:"textColor"},base:S(S({contain:"width",maxLines:2},Jo.typography.body2),{},{color:Jo.color.textNeutralSecondary}),tones:{neutral:{disabled:{color:Jo.color.textNeutralDisabled}},inverse:{color:Jo.color.textInverseSecondary,disabled:{color:Jo.color.textNeutralDisabled}},brand:{color:Jo.color.textNeutralSecondary,disabled:{color:Jo.color.textNeutralDisabled}}},themeStyles:ha};oi(ca),oi(pa),oi(fa);var va=(null==(Ho=Jo)?void 0:Ho.componentConfig).ProgressBar,ga=void 0===va?{styles:{}}:va,ma=(ga.defaultTone,m(ga,u)),xa={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:Jo.spacer.md,color:Jo.color.fillNeutralTertiary,borderRadius:Jo.radius.xs},tones:{inverse:{color:Jo.color.fillInverseTertiary}},themeStyles:ma},ya={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:Jo.radius.xs,color:Jo.color.fillNeutral},tones:{inverse:{color:Jo.color.fillInverse},brand:{color:Jo.color.fillBrand}},themeStyles:ma};oi(xa),oi(ya);var ba=(null==(jo=Jo)?void 0:jo.componentConfig).Row,wa=void 0===ba?{styles:{}}:ba,Sa=wa.defaultTone,Aa=m(wa,h),Ca={tone:Sa,Container:oi({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"row",gap:Jo.layout.gutterX,itemTransition:S(S({},Jo.animation.standardEntrance),{},{duration:Jo.animation.duration.fast})},themeStyles:Aa})},Ta=e=>{var t=li("left"),r=li("right");return vn(dn,bn(e,{get selected(){return e.selected||0},get onLeft(){return ai(e.onLeft,t)},get onRight(){return ai(e.onRight,r)},forwardFocus:si,get onCreate(){return ai((t=>{var r,n;return ii(e.x).call(t,t,t.children[null!==(r=e.selected)&&void 0!==r?r:0],null!==(n=e.selected)&&void 0!==n?n:0,void 0)}),e.onCreate)},get onSelectedChanged(){return ai(e.onSelectedChanged,"none"!==e.scroll?ii(e.x):void 0)},get tone(){var t;return null!==(t=e.tone)&&void 0!==t?t:Ca.tone},get style(){return[...[e.style].flat(),Ca.Container.tones[e.tone||Ca.tone],Ca.Container.base]},get states(){var t;return null!==(t=e.tone)&&void 0!==t?t:Ca.tone}}))},_a=(null==(Qo=Jo)?void 0:Qo.componentConfig).Keyboard,Ra=void 0===_a?{styles:{}}:_a,ka=(Ra.defaultTone,m(Ra,c)),Ia={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:Jo.spacer.md,screenW:Jo.layout.screenW,marginX:Jo.layout.marginX,height:100},themeStyles:ka},Ba={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Jo.spacer.md,height:9*Jo.spacer.md,paddingX:Jo.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:Jo.color.fillNeutral,padding:[Jo.spacer.xxxl,Jo.spacer.xl],baseWidth:7*Jo.spacer.md,color:Jo.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Jo.radius.sm},modes:{focus:{color:Jo.color.interactiveNeutralFocus,contentColor:Jo.color.fillInverse},disabled:{color:Jo.color.fillNeutralDisabled,contentColor:Jo.color.fillNeutralDisabled}},tones:{inverse:{color:Jo.color.interactiveInverse,focus:{color:Jo.color.interactiveInverseFocus,contentColor:Jo.color.fillNeutral}},brand:{focus:{contentColor:Jo.color.fillNeutral}}},themeStyles:ka},Ea={themeKeys:{color:"textColor"},base:S({textAlign:"left",color:Jo.color.textNeutral},Jo.typography.headline2),modes:{focus:{color:Jo.color.textInverse},disabled:{color:Jo.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Jo.color.textNeutral}}},themeStyles:ka};oi(Ia),oi(Ba),oi(Ea);var Na=(null==(Ko=Jo)?void 0:Ko.componentConfig).Key,Fa=void 0===Na?{styles:{}}:Na,La=(Fa.defaultTone,m(Fa,f)),za={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Jo.spacer.md,height:9*Jo.spacer.md,paddingX:Jo.spacer.md,contentColor:Jo.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[Jo.spacer.md],baseWidth:7*Jo.spacer.md,color:Jo.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Jo.radius.sm},modes:{focus:{color:Jo.color.interactiveNeutralFocus,contentColor:Jo.color.fillInverse},disabled:{color:Jo.color.fillNeutralDisabled,contentColor:Jo.color.fillNeutralDisabled}},tones:{inverse:{color:Jo.color.interactiveInverse,focus:{color:Jo.color.interactiveInverseFocus,contentColor:Jo.color.fillNeutral}},brand:{focus:{contentColor:Jo.color.fillNeutral}}},themeStyles:La},Ma={themeKeys:{color:"textColor"},base:S({textAlign:"left",color:Jo.color.textNeutral},Jo.typography.headline2),modes:{focus:{color:Jo.color.textInverse},disabled:{color:Jo.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Jo.color.textNeutral}}},themeStyles:La};oi(za),oi(Ma);var Pa=(null==($o=Jo)?void 0:$o.componentConfig).Input,Da=void 0===Pa?{styles:{}}:Pa,Oa=(Da.defaultTone,m(Da,p)),Ua={themeKeys:{justifyContent:"justifyContent"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"column",width:100,height:100,actualTitle:""},themeStyles:Oa},Wa={themeKeys:{borderRadius:"borderRadius",color:"backgroundColor"},base:{width:function(e,t=1){var r=e.layout.screenW,n=e.layout.columnCount,o=e.layout.marginX,i=e.layout.gutterX;if(!(t<1||t>n))return(r-2*o-(t-1)*i)/t;console.error(`Column expects a number between 1 & ${n}. Received ${t}`)}(Jo,4),height:100,display:"flex",flexDirection:"column",padding:[Jo.spacer.xxxl,Jo.spacer.xl],color:Jo.color.interactiveNeutral,contentColor:Jo.color.fillInverse,borderRadius:Jo.radius.sm,marginX:Jo.spacer.xxxl},modes:{focus:{color:Jo.color.interactiveNeutralFocus},disabled:{color:Jo.color.fillNeutralDisabled}},tones:{inverse:{color:Jo.color.interactiveInverse},brand:{color:Jo.color.interactiveBrand,focus:{color:Jo.color.fillNeutral}}},themeStyles:Oa},Ya={themeKeys:{color:"textColor"},base:S({textAlign:"left",color:Jo.color.textNeutral},Jo.typography.button1),themeStyles:Oa};oi(Ua),oi(Wa),oi(Ya);var Ha=(null==(Xo=Jo)?void 0:Xo.componentConfig).Tile,ja=void 0===Ha?{styles:{}}:Ha,Qa=(ja.defaultTone,m(ja,v)),Ka=(null==(Go=Jo)?void 0:Go.componentConfig).Surface,$a=void 0===Ka?{styles:{}}:Ka,Xa=($a.defaultSurfaceTone,m($a,g)),Ga={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:Jo.spacer.xl,paddingYBetweenContent:Jo.spacer.md,borderRadius:Jo.radius.md,alpha:Jo.alpha.primary},modes:{disabled:{alpha:Jo.alpha.inactive}},themeStyles:S(S({},Xa),Qa)},Va={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Qa},Za={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Qa},qa={themeKeys:{},base:{width:5*Jo.spacer.lg,height:Jo.spacer.xxl+Jo.spacer.md},themeStyles:Qa};oi(Ga),oi(Va),oi(Za),oi(qa);var Ja={color:255,height:150,width:330,x:1910,y:10,mountX:1,alpha:.8,zIndex:100},es={x:10,fontSize:22,textColor:Sn("#f6f6f6")},ts={fontSize:22,textColor:Sn("#f6f6f6")},rs=C(Ae(0),2),ns=rs[0],os=rs[1],is=C(Ae(0),2),as=is[0],ss=is[1],ls=C(Ae(99),2),ds=ls[0],us=ls[1],hs=C(Ae(0),2),cs=hs[0],fs=hs[1],ps=C(Ae(0),2),vs=ps[0],gs=ps[1],ms=C(Ae(0),2),xs=ms[0],ys=ms[1],bs=C(Ae(0),2),ws=bs[0],Ss=bs[1],As=0,Cs=0;function Ts(e){e.renderer.on("fpsUpdate",((e,t)=>{var r,n,o,i,a="number"==typeof t?t:t.fps;a>5&&((e=>{e&&(os(e),us((t=>Math.min(e,t))),fs((t=>Math.max(e,t))),Cs+=e,As++,ss(Math.round(Cs/As)))})(a),r=e.root.stage,n=0,o=0,i=0,r.txManager.textureIdCache.forEach(((e,t,r)=>{"loaded"===e.state&&n++,"loading"===e.state&&o++,"failed"===e.state&&i++})),gs(n),ys(o),Ss(i))}))}var _s=e=>vn(dn,bn(e,{style:Ja,get children(){return[vn(dn,{get children(){return[vn(ln,{style:es,children:"FPS:"}),vn(ln,{style:ts,x:90,get children(){return ns()}})]}}),vn(dn,{x:160,get children(){return[vn(ln,{style:es,children:"AVG:"}),vn(ln,{style:ts,x:100,get children(){return as()}})]}}),vn(dn,{x:0,y:20,get children(){return[vn(ln,{style:es,children:"MIN:"}),vn(ln,{style:ts,x:90,get children(){return ds()}})]}}),vn(dn,{x:160,y:20,get children(){return[vn(ln,{style:es,children:"MAX:"}),vn(ln,{style:ts,x:100,get children(){return cs()}})]}}),vn(dn,{x:0,y:50,get children(){return[vn(ln,{style:es,children:"Loaded Textures Cnt:"}),vn(ln,{style:es,x:270,get children(){return vs()}})]}}),vn(dn,{x:0,y:80,get children(){return[vn(ln,{style:es,children:"Loading Textures Cnt:"}),vn(ln,{style:es,x:270,get children(){return xs()}})]}}),vn(dn,{x:0,y:110,get children(){return[vn(ln,{style:es,children:"Failed Textures Cnt:"}),vn(ln,{style:es,x:270,get children(){return ws()}})]}})]}})),Rs={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:Jo.layout.marginX}},Gradient:{zIndex:99,color:Sn("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:Sn("#424242")},active:{width:328,height:70}}},ks="/solid-demo-app/",Is=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function Bs(e){var t,r,n,o=(t=ks+"assets/icons_white.png",r=Is,n=Pr.createTexture("ImageTexture",{src:t}),r.reduce(((e,t)=>{var r=t.x,o=t.y,i=t.width,a=t.height;return e[t.name]=Pr.createTexture("SubTexture",{texture:n,x:r,y:o,width:i,height:a}),e}),{}));return vn(dn,bn(e,{get texture(){return o[e.name]},get width(){return o[e.name].props.width},get height(){return o[e.name].props.height},get x(){return(100-(o[e.name].props.width||0))/2},get y(){return(100-(o[e.name].props.height||0))/2}}))}function Es(e){return vn(dn,bn(e,{forwardStates:!0,get style(){return Rs.NavButton},get children(){return[vn(dn,{y:-16,get children(){return vn(Bs,{scale:.5,get name(){return e.icon}})}}),vn(ln,{style:{fontSize:38,x:116,y:18,height:50,alpha:0,active:{alpha:1}},get children(){return e.children}})]}}))}function Ns(e){var t,r=Yn();function n(t){var n,o,i,a;if((n=()=>t,i=Hn(),a=Re((()=>Pn(n()).map((e=>Ln(e,void 0,o))))),Re((()=>{var e,t=T(a());try{for(t.s();!(e=t.n()).done;){var r=(0,e.value)(i.pathname);if(r)return r}}catch(n){t.e(n)}finally{t.f()}})))())return e.focusPage();r(t)}return[vn(dn,{flexItem:!1,x:40,y:30,zIndex:105,get alpha(){return e.showWidgets?1:0},get children(){return[vn(ln,{x:80,fontSize:28,color:4143380036,children:"Built With:"}),vn(dn,{y:22,src:"./assets/solidWord.png",width:280,height:52})]}}),vn(Ki,bn(e,{onFocus:function(){t.states.add("focus"),this.children.forEach((e=>e.states.add("active"))),this.children.selected.setFocus()},onBlur:function(){t.states.remove("focus"),this.selected=0,this.children.forEach((e=>e.states.remove("active")))},get style(){return Rs.Column},scroll:"none",get children(){return[vn(Es,{onEnter:()=>n("/browse/all"),icon:"trending",children:"Trending"}),vn(Es,{icon:"movie",onEnter:()=>n("/browse/movie"),children:"Movies"}),vn(Es,{icon:"tv",onEnter:()=>n("/browse/tv"),children:"TV"}),vn(Es,{icon:"experiment",onEnter:()=>n("/examples"),children:"Examples"})]}})),vn(dn,{ref(e){"function"==typeof t?t(e):t=e},get style(){return Rs.Gradient}})]}var Fs=e=>{mo({Announcer:["a"],Menu:["m"],Escape:["Escape",27],Backspace:["Backspace",8],Left:["ArrowLeft",37],Right:["ArrowRight",39],Up:["ArrowUp",38],Down:["ArrowDown",40],Enter:["Enter",13]});var t=(Eo.setupTimers(),_e(Ee(vo,Eo.onFocusChange,{defer:!0})),Eo);t.enabled=!1;var r,n,o=Yn();function i(){return!r.states.has("focus")&&(n=ft(),r.setFocus())}Ts({renderer:Pr});var a=C(Ae(!0),2),s=a[0],l=a[1],d=Hn(),u=["/browse","/entity"];return _e((()=>{var e=d.pathname,t=u.some((t=>e.startsWith(t)));"/"===e&&(t=!0),l(t)})),vn(dn,{ref(e){var t=window.APP;"function"==typeof t?t(e):window.APP=e},onAnnouncer:()=>t.enabled=!t.enabled,onLast:()=>history.back(),onMenu:()=>o("/"),style:{width:1920,height:1080},onBackspace:i,onLeft:i,onRight:()=>r.states.has("focus")&&n.setFocus(),get children(){return[vn(ei,{}),vn(_s,{mountX:1,x:1910,y:10,get alpha(){return s()?1:0}}),pn((()=>e.children)),vn(Ns,{ref(e){"function"==typeof r?r(e):r=e},focusPage:()=>n.setFocus(),get showWidgets(){return s()}})]}})},Ls={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:Jo.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:Sn("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:Sn("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:Sn("#000000")},RowTitle:{height:60,width:300,marginBottom:-40,fontSize:36,color:Sn("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:64,width:Jo.layout.screenW-2*Jo.layout.marginX,x:Jo.layout.marginX+Jo.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:Sn("#0000ff")},peopleBio:S(S({},Jo.typography.body1),{},{fontFamily:"Ubuntu",fontWeight:"normal",contain:"both",width:780,height:340})},zs={width:120,height:40,color:Sn("#000000"),borderRadius:8,border:{width:2,color:Sn("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:Sn("#333333")}},transition:{scale:!0,color:!0}},Ms={container:zs,topBar:{color:Sn("#00A699"),height:8,y:2,x:-4,width:zs.width+8},text:{fontSize:12,y:12,contain:"width",textAlign:"center",color:Sn("#F6F6F9"),height:zs.height,width:zs.width}},Ps=386,Ds=136,Os=(Sn("#715cab"),Sn("#5a39a2"),Sn("#291d43"),{fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:Sn("#FFFFFF"),height:Ds,width:Ps,focus:{fontSize:40},disabled:{color:Sn("#909090")}});function Us(e){return vn(dn,bn(e,{get style(){return Ls.Thumbnail}}))}function Ws(e){var t=function(e,...t){if(le in e){var r=new Set(t.length>1?t.flat():t[0]),n=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},it)));return n.push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},it)),n}var o,i={},a=t.map((()=>({}))),s=T(Object.getOwnPropertyNames(e));try{for(s.s();!(o=s.n()).done;){var l,d=o.value,u=Object.getOwnPropertyDescriptor(e,d),h=!u.get&&!u.set&&u.enumerable&&u.writable&&u.configurable,c=!1,f=0,p=T(t);try{for(p.s();!(l=p.n()).done;)l.value.includes(d)&&(c=!0,h?a[f][d]=u.value:Object.defineProperty(a[f],d,u)),++f}catch(v){p.e(v)}finally{p.f()}c||(h?i[d]=u.value:Object.defineProperty(i,d,u))}}catch(v){s.e(v)}finally{s.f()}return[...a,i]}(e,["items"]),r=C(t,2),n=r[0],o=r[1];return vn(Ta,bn(o,{get style(){return Ls.Row},get children(){return vn(ut,{get each(){return n.items},children:e=>vn(Us,e)})}}))}var Ys,Hs,js="https://api.themoviedb.org/3",Qs="w185",Ks={headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA"}};function $s(e,t=Qs){return Hs+t+e}function Xs(e,t={}){return fetch(js+e,S(S({},Ks),t)).then((e=>e.json()))}function Gs(){return Xs("/configuration").then((e=>{var t;return Ys=e,Hs=null===(t=e.images)||void 0===t?void 0:t.secure_base_url,e}))}var Vs={get:function(e,t={}){return Ys?Xs(e,t):Gs().then((()=>Xs(e,t)))},loadConfig:Gs};function Zs(e=[]){return e.map((e=>{return{src:$s(e.poster_path||e.profile_path),tileSrc:$s(e.backdrop_path||e.profile_path,"w300"),backdrop:$s(e.backdrop_path,"w1280"),href:`/entity/${e.media_type||"people"}/${e.id}`,shortTitle:(t=e.title||e.name,r=30,t.length>r?t.substring(0,r-3)+"...":t),title:e.title||e.name,data:e,entityInfo:{type:e.media_type||"people",id:e.id},heroContent:{title:e.title||e.name,description:e.overview}};var t,r}))}var qs=new Map,Js=new Map;function el(e){var t=C(Ae([]),2),r=t[0],n=t[1],o=C(Ae(1),2),i=o[0],a=o[1],s=C(Ae(!1),2),l=s[0],d=s[1],u=C(ke(i,e),1)[0];return Ce((()=>{var e=u();e&&Qe((()=>{0===e.length&&d(!0),n((t=>[...t,...e]))}),!1)})),{pages:r,page:i,setPage:a,setPages:n,end:l,setEnd:d}}var tl=900,rl=S(S({},Jo.typography.display2),{},{fontFamily:"Ubuntu",fontWeight:700,maxLines:1,width:tl,contain:"width"}),nl=e=>vn(ln,bn(e,{style:rl})),ol=S(S({},Jo.typography.body1),{},{fontFamily:"Ubuntu",fontWeight:400,lineHeight:32,width:tl,maxLines:3,contain:"width"}),il={fontSize:16,lineHeight:20},al=e=>vn(ln,bn(e,{style:ol,get children(){return e.children}})),sl=e=>{return t=gn("node"),wn(xo,t,(()=>[8,13,11,13])),xn(t,bn(e,{style:{color:"0x00000099",borderRadius:8,border:{width:2,color:"0xffffffff"}}}),!0),mn(t,vn(ln,{style:il,get children(){return e.children}})),t;var t},ll=S(S({},Jo.typography.body2),{},{fontFamily:"Ubuntu",fontWeight:400}),dl=e=>vn(dn,{style:{display:"flex",flexDirection:"row",gap:18,width:tl,height:48},get children(){return[vn(dn,{y:-4,src:"./assets/stars.png",width:188,height:31}),vn(dn,{y:-4,flexItem:!1,clipping:!0,get width(){return 188*e.voteAverage/10},height:31,get children(){return vn(dn,{src:"./assets/stars-full.png",width:188,height:31})}}),vn(ln,{style:ll,get children(){return[pn((()=>e.voteCount))," reviews"]}}),vn(ln,{style:ll,get children(){return e.metaText}}),vn(ut,{get each(){return e.badges},children:e=>vn(sl,{y:-5,children:e})})]}}),ul=e=>vn(dn,bn(e,{style:{display:"flex",flexDirection:"column",width:tl,height:220,gap:16},get children(){return[vn(nl,{get children(){return e.title}}),vn(al,{get children(){return e.description}}),vn(ht,{get when(){return e.voteCount},get children(){return vn(dl,{get metaText(){return e.metaText},get badges(){return e.badges},get voteCount(){return e.voteCount},get voteAverage(){return e.voteAverage}})}})]}}));function hl(e){return e.split("-")[0]}function cl({type:e,id:t}){return Vs.get(`/${e}/${t}/recommendations`).then((({results:t})=>t.length?Zs(t.slice(0,7)):Vs.get(`/trending/${e}/week?page=1`).then((({results:e})=>Zs(e.slice(0,7))))))}function fl({type:e,id:t}){return Vs.get(`/${e}/${t}/credits`).then((({cast:e})=>Zs(e.slice(0,7))))}function pl({type:e,id:t}){var r="movie"===e?{rtCrit:86,rtFan:92}:{};return Vs.get(`/${e}/${t}`).then((t=>{return S({backgroundImage:$s(t.backdrop_path,"w1280"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD","CC"],voteAverage:t.vote_average,voteCount:t.vote_count,metaText:"movie"===e?(i=t.runtime,a=i%60,Math.floor(i/60)+"h "+(a<10?"0":"")+a+"min "+(n=t.release_date,o=n.split("-"),o[1]+"/"+o[2]+"/"+o[0])):`${hl(t.first_air_date)} - ${hl(t.last_air_date)}`,reviews:r}},t);var n,o,i,a}))}var vl=()=>{var e=jn(),t=C(Ae(0),2),r=t[0],n=t[1],o=C(Ae(),2),i=o[0];o[1];ke(i,pl);var a=C(Ae({}),2),s=a[0],l=a[1],d=Yn(),u=Ie((()=>0)),h=Re((()=>{return el((t=e.filter||"all",e=>{var r=`/trending/${t}/week?page=${e}`;if(qs.has(r))return qs.get(r);var n=Vs.get(r).then((e=>{var r=e.results.filter((e=>!e.adult)),n=function(e,t=7){for(var r=[],n=0,o=e.length;nqo(e)),400),f=To((e=>l(e)),200);function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),n(-1*(this.y||0)+24);var t=h().pages().length;(0===t||this.parent.selected&&this.parent.selected>=t-2)&&h().setPage((e=>e+1))}function v(){var e=this.children.selected;return _(e&&e.href),d(e.href),!0}return _e(Ee(ft,(e=>{e.backdrop&&c(e.backdrop),e.heroContent&&f(e.heroContent)}),{defer:!0})),vn(ht,{get when(){return h().pages().length},get children(){return[vn(ul,bn({y:360,x:162},s)),vn(dn,{clipping:!0,get style(){return Ls.itemsContainer},get children(){return vn(Ki,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return Ls.Column},get children(){return vn(ut,{get each(){return h().pages()},children:(e,t)=>vn(Ws,{get autofocus(){return u(t())},items:e,width:1620,onFocus:p,onEnter:v})})}})}})]}})},gl=()=>{var e=Yn(),t=Ie((()=>0));function r(){var t=this.children.selected;_(t&&t.id),e("/"+t.id)}var n=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(e){var t=C(Ae(4294967295),2),r=t[0],n=t[1];return vn(dn,bn(e,{onFocus:()=>n(255),onBlur:()=>n(4294967295),style:{width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},get children(){return vn(dn,{x:30,get children(){return[vn(ln,{y:30,fontSize:84,get color(){return r()},get children(){return e.index}}),vn(ln,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return r()},get children(){return e.title}}),vn(ln,{y:200,fontSize:28,width:330,contain:"width",get color(){return r()},get children(){return e.description}})]}})}}))}var i=C(Ae(140),2),a=i[0],s=i[1];function l(e){s(-400*e.selected+140)}return vn(dn,{colorTop:1147903743,colorBottom:743406847,get children(){return[vn(dn,{x:120,get children(){return[vn(dn,{src:"./assets/solidjs.png",width:101,height:90,y:40}),vn(ln,{fontSize:90,x:110,y:40,children:"Examples"}),vn(dn,{y:140,height:1,width:1800,color:3906468351})]}}),vn(Ta,{onSelectedChanged:l,onEnter:r,transition:{x:{delay:20,duration:300}},get x(){return a()},y:300,width:4400,get style(){return Ls.Row},justifyContent:"flexStart",gap:40,get children(){return vn(ut,{each:n,children:(e,r)=>vn(o,bn({get autofocus(){return t(r())},get index(){return r()}},e))})}})]}})},ml=()=>{var e={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:Sn("00000000")},t={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:Sn("00000000")},r={fontSize:42},n={width:e.width,fontSize:26,contain:"width"},o={fontSize:26};return Ne((()=>{qo("#000000")})),vn(dn,{autofocus:!0,style:e,get children(){return[vn(ln,{style:r,children:"Title of the Page"}),vn(ln,{style:n,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),vn(dn,{style:t,get children(){return[vn(ln,{style:o,children:"Subline Text"}),vn(dn,{width:28,height:28,src:"./assets/rt-popcorn.png"}),vn(ln,{style:o,children:"More Text"})]}})]}})},xl=()=>{var e,t,r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:Sn("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:Sn("00000000")},o={fontSize:42},i={fontSize:26};Ne((()=>{qo("#000000"),e.animate({x:100},{duration:2e3}).start()}));var a=C(Ae(),2),s=a[0],l=a[1],d=C(Ae(),2),u=d[0];d[1];setTimeout((()=>{var e;l("- Inserted -"),null===(e=t.getChildById("child1"))||void 0===e||e.animate({x:600},{duration:2e3}).start()}),2e3);var h={width:400,height:300,color:Sn("#0000ff")},c={color:Sn("#f54242"),focus:{color:Sn("#4287f5")}};function f(e){var t=Oe((()=>e.children));return vn(dn,bn(e,{get style(){return[c,e.style,[h]]},get children(){return[vn(dn,{id:"child1",width:100,height:100,get color(){return Sn("#ff0000")},y:25,get children(){return[pn((()=>t())),vn(dn,{id:"subChild",x:150,width:100,height:100,get color(){return Sn("#00ff00")}}),vn(ln,{get children(){return e.title}})]}}),vn(dn,{width:100,height:100,get color(){return Sn("#ffff00")},y:175,get children(){return t()}})]}}))}var p={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},v={color:Sn("#cccccc"),focus:{color:Sn("#000000")}},g={color:Sn("#ffffff"),focus:{color:Sn("#f6f6cc")}};return vn(dn,{style:r,get children(){return[vn(ln,{style:o,children:"Title of the Page"}),vn(dn,{style:n,get children(){return[vn(ln,{get children(){return u()}}),vn(ln,{style:i,get children(){return["Sub ",pn((()=>s()))," Text"]}}),vn(ht,{get when(){return s()},get children(){return vn(dn,{width:28,height:28,src:"./assets/rt-popcorn.png"})}}),vn(ln,{style:i,children:"More Text"})]}}),vn(f,{autofocus:!0,ref(e){"function"==typeof t?t(e):t=e},style:[g,v],get children(){return vn(ln,{children:"Child Test"})}}),vn(dn,{ref(t){"function"==typeof e?e(t):e=t},style:p,width:100,height:100,get color(){return Sn("#00ff00")},x:900,y:400,get alpha(){return e.states.has("focus")?1:.2}})]}})},yl=()=>{var e,t,r=C(Ae([]),2),n=r[0],o=r[1],i={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:Sn("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},a={fontSize:32,x:960,y:540,mount:.5,lineheight:52},s=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function l(e,t){o((t=>[...t,e].slice(-4))),console.log(e)}return Ne((()=>{qo("#000000"),e.x=910,e.y=490,t=setInterval((()=>{e.rotation=s(-90,90),e.x=s(-300,2220),e.y=s(-300,1380)}),2500)})),Fe((()=>{clearInterval(t)})),vn(dn,{get children(){return[vn(ln,{style:a,get children(){return n().join("\n")}}),vn(dn,{autofocus:!0,style:i,ref(t){"function"==typeof e?e(t):e=t},onEvents:[["inBounds",e=>l("inBounds")],["outOfBounds",e=>l("outOfBounds")],["inViewport",e=>l("inViewport")],["outOfViewport",e=>l("outOfViewport")]]})]}})},bl=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:Sn("00000000"),gap:26,y:400};function r(e){return vn(dn,bn(e,{forwardStates:!0,get style(){return Ms.container},get children(){return vn(ln,{get style(){return Ms.text},get children(){return e.children}})}}))}var n=e=>{return t=gn("node"),wn(xo,t,(()=>[10,15])),xn(t,bn(e,{get style(){return{color:Sn("#000000be"),borderRadius:8,border:{width:2,color:Sn("#ffffff")}}}}),!0),mn(t,vn(ln,{style:{fontSize:20},get children(){return e.children}})),t;var t};return[vn(Ta,{x:100,y:200,gap:5,style:t,get children(){return[vn(n,{children:"HD"}),vn(n,{children:"PG13"}),vn(n,{children:"NC17"}),vn(ln,{fontSize:30,children:"I like bananas"}),vn(n,{children:"DOLBY"})]}}),vn(Ta,{x:100,gap:40,style:t,get children(){return[vn(r,{autofocus:!0,onEnter:e,children:"TV Shows"}),vn(r,{states:{active:!0,disabled:!1},children:"Movies"}),vn(r,{states:"active",children:"Sports"}),vn(r,{states:"disabled",children:"News"})]}})]},wl=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:Sn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return vn(dn,bn(e,{style:{width:200,height:100,y:5,color:392801023}}))}var n=C(Ae(50),2),o=n[0],i=n[1];function a(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),i(150+-1*(this.y||0))}Ne((()=>{qo("#333333")}));var s=50;return vn(Ki,{x:160,get y(){return o()},gap:30,height:850,get width(){return e.width},get style(){return Ls.Column},get children(){return[vn(ln,{style:t,children:"Flex Start"}),vn(Ta,{gap:s,style:e,onFocus:a,get children(){return[vn(r,{autofocus:!0}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(ln,{style:t,children:"Flex Start - Margin Left"}),vn(Ta,{gap:s,style:e,onFocus:a,get children(){return[vn(r,{marginLeft:100}),vn(r,{}),vn(r,{marginLeft:100}),vn(r,{}),vn(r,{})]}}),vn(ln,{style:t,children:"Flex End"}),vn(Ta,{gap:s,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(ln,{style:t,children:"Flex End - Margin Right"}),vn(Ta,{gap:s,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[vn(r,{}),vn(r,{marginRight:100}),vn(r,{}),vn(r,{}),vn(r,{marginRight:100})]}}),vn(ln,{style:t,children:"Center - No Margin Support"}),vn(Ta,{gap:s,justifyContent:"center",style:e,onFocus:a,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(ln,{style:t,children:"Space Between - No Margin Support"}),vn(Ta,{gap:s,justifyContent:"spaceBetween",style:e,onFocus:a,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(ln,{style:t,children:"Space Evenly - No Margin Support"}),vn(Ta,{gap:s,justifyContent:"spaceEvenly",style:e,onFocus:a,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}})]}})},Sl=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:Sn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return vn(dn,bn(e,{style:{width:200,height:100,y:5,color:392801023}}))}function n(){return Math.floor(91*Math.random())+10}var o=C(Ae(50),2),i=o[0],a=o[1];function s(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),a(150+-1*(this.y||0))}Ne((()=>{qo("#333333")}));var l=50;return vn(Ki,{x:160,get y(){return i()},gap:30,height:850,get width(){return e.width},get style(){return Ls.Column},get children(){return[vn(ln,{style:t,children:"Flex Start - AlignItems: center"}),vn(Ta,{alignItems:"center",gap:l,style:e,onFocus:s,get children(){return[vn(r,{autofocus:!0,get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}})]}}),vn(ln,{style:t,children:"Flex Start - Margin Left - AlignItems: flexStart"}),vn(Ta,{gap:l,alignItems:"flexStart",style:e,onFocus:s,get children(){return[vn(r,{marginLeft:100,get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{marginLeft:100,get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}})]}}),vn(ln,{style:t,children:"Flex End - AlignItems: flexEnd"}),vn(Ta,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:e,onFocus:s,get children(){return[vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}})]}}),vn(ln,{style:t,children:"Flex End - Margin Right"}),vn(Ta,{gap:l,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[vn(r,{get height(){return n()}}),vn(r,{marginRight:100,get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{marginRight:100,get height(){return n()}})]}}),vn(ln,{style:t,children:"Center - No Margin Support"}),vn(Ta,{gap:l,justifyContent:"center",style:e,onFocus:s,get children(){return[vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}})]}}),vn(ln,{style:t,children:"Space Between - No Margin Support"}),vn(Ta,{gap:l,justifyContent:"spaceBetween",style:e,onFocus:s,get children(){return[vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}})]}}),vn(ln,{style:t,children:"Space Evenly - No Margin Support"}),vn(Ta,{gap:l,justifyContent:"spaceEvenly",style:e,onFocus:s,get children(){return[vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}}),vn(r,{get height(){return n()}})]}})]}})},Al=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:Sn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:Sn("#4dabf5"),height:850,width:80};function r(e){var t={width:Math.floor(61*Math.random())+10,height:80,x:5,color:Sn("#1769aa")};return vn(dn,bn(e,{style:t}))}var n=C(Ae(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}Ne((()=>{qo("#333333")}));var a=50;return[vn(ln,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),vn(Ta,{gap:a,style:e,onFocus:i,get children(){return[vn(Ki,{gap:30,style:t,alignItems:"center",get children(){return[vn(r,{autofocus:!0}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,style:t,onFocus:i,alignItems:"flexStart",get children(){return[vn(r,{marginTop:100}),vn(r,{}),vn(r,{marginTop:100}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,alignItems:"flexEnd",justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{marginBottom:100}),vn(r,{}),vn(r,{}),vn(r,{marginBottom:100})]}}),vn(Ki,{gap:a,justifyContent:"center",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}})]}})]},Cl=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:Sn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:Sn("#4dabf5"),height:850,width:60};function r(e){var t={width:50,height:80,x:5,color:Sn("#1769aa")};return vn(dn,bn(e,{style:t}))}var n=C(Ae(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}Ne((()=>{qo("#333333")}));var a=50;return[vn(ln,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),vn(Ta,{gap:a,style:e,onFocus:i,get children(){return[vn(Ki,{gap:30,style:t,get children(){return[vn(r,{autofocus:!0}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,style:t,onFocus:i,get children(){return[vn(r,{marginTop:100}),vn(r,{}),vn(r,{marginTop:100}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{marginBottom:100}),vn(r,{}),vn(r,{}),vn(r,{marginBottom:100})]}}),vn(Ki,{gap:a,justifyContent:"center",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}}),vn(Ki,{gap:a,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{}),vn(r,{})]}})]}})]},Tl=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:Sn("00000000"),gap:26,y:400,x:100},r={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},n=["RoundedRectangle",{radius:65}];function o(e){return vn(dn,bn(e,{forwardStates:!0,style:r,shader:n,get children(){return vn(ln,{style:Os,get children(){return e.children}})}}))}return vn(Ta,{style:t,get children(){return[vn(o,{autofocus:!0,onEnter:e,children:"Focused"}),vn(o,{states:{active:!0,disabled:!1},children:"Normal"}),vn(o,{states:"disabled",children:"Disabled"})]}})},_l="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function Rl(){return(Rl=b(x().mark((function e(){var t,r;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.getElementById("video"),r=new shaka.Player,e.next=4,r.attach(t);case 4:return window.player=r,r.addEventListener("error",kl),e.prev=6,e.next=9,r.load(_l);case 9:console.log("The video has now been loaded!"),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),Il(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function kl(e){Il(e.detail)}function Il(e){console.error("Error code",e.code,"object",e)}document.addEventListener("DOMContentLoaded",(function(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?function(){Rl.apply(this,arguments)}():console.error("Browser not supported!")}));var Bl=()=>{var e=jn(),t=Yn(),r=C(ke((()=>S({},e)),pl),1)[0],n=C(ke((()=>S({},e)),fl),1)[0],o=C(ke((()=>S({},e)),cl),1)[0],i=C(Ae(0),2),a=i[0],s=i[1];_e(Ee(r,(e=>{qo(e.backgroundImage)}),{defer:!0}));var l,d,u,h=640,c={color:Sn("#000000"),alpha:0,width:1900,height:890,x:-160,y:h,borderRadius:30};function f(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=h,d.y=h,d.alpha=0}function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=200,d.y=160,d.alpha=.9}function v(){var e=this.children.selected;_(e&&e.href),t(e.href)}function g(){var e;(e=document.getElementById("video")).hidden=!0,e.pause(),document.getElementsByTagName("canvas")[0].focus(),u.setFocus(),s(0)}function m(){var e=function(){var e=document.getElementById("video");return e.hidden=!1,setTimeout((()=>e.play()),50),e.focus(),e}();pt(e),s(.9)}return vn(ht,{get when(){return r()},keyed:!0,get children(){return[vn(dn,{x:170,onUp:()=>u.setFocus(),onEscape:g,get children(){return[vn(ul,bn({y:260},(()=>r().heroContent))),vn(Ta,{ref(e){"function"==typeof u?u(e):u=e},y:500,scroll:"none",height:90,width:640,gap:40,onDown:()=>l.setFocus(),onEnter:m,get children(){return[vn(Bi,{width:300,autofocus:!0,children:"Play"}),vn(Bi,{width:300,children:"Resume"})]}}),vn(Ki,{ref(e){"function"==typeof l?l(e):l=e},x:0,y:h,get style(){return Ls.Column},zIndex:5,get children(){return vn(ht,{get when(){return pn((()=>!!o()))()&&n()},get children(){return[vn(ln,{skipFocus:!0,get style(){return Ls.RowTitle},children:"Recommendations"}),vn(Ws,{onFocus:f,onEnter:v,get items(){return o()},width:1620}),vn(ln,{skipFocus:!0,get style(){return Ls.RowTitle},children:"Cast and Crew"}),vn(Ws,{onFocus:p,onEnter:v,get items(){return n()},width:1620})]}})}}),vn(dn,{ref(e){"function"==typeof d?d(e):d=e},style:c,transition:{alpha:!0,y:!0}})]}}),vn(dn,{get alpha(){return a()},get color(){return Sn("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function El({id:e}){return Vs.get(`/person/${e}/combined_credits`).then((({cast:e})=>Zs(e.slice(0,7))))}function Nl({id:e}){return Vs.get(`/person/${e}`).then((e=>S({backgroundImage:$s(e.profile_path,"original"),heroContent:{title:e.title||e.name,description:e.biography}},e)))}var Fl=()=>{var e=jn(),t=Yn(),r=C(ke((()=>S({},e)),Nl),1)[0],n=C(ke((()=>S({},e)),El),1)[0],o={color:Sn("#000000"),alpha:.8,width:800,height:440,x:130,y:180,borderRadius:30};function i(){var e=this.children.selected;_(e&&e.href),t(e.href)}return Ne((()=>{qo("#333333")})),vn(ht,{get when(){return r()},keyed:!0,get children(){return[vn(dn,{get src(){return r().backgroundImage},width:400,autosize:!0,y:0,x:1800,mountX:1}),vn(dn,{x:150,y:200,width:800,gap:24,get style(){return Ls.Column},zIndex:3,get children(){return[vn(ln,{contain:"width",fontFamily:"Ubuntu",get style(){return Jo.typography.display2},get children(){return r().name}}),vn(ln,{contain:"both",get style(){return Ls.peopleBio},get children(){return r().biography}})]}}),vn(dn,{style:o}),vn(Ki,{y:670,x:140,get style(){return Ls.Column},scroll:"none",get children(){return vn(ht,{get when(){return n()},get children(){return[vn(ln,{skipFocus:!0,get style(){return Ls.RowTitle},children:"Credits"}),vn(Ws,{autofocus:!0,onEnter:i,get items(){return n()}})]}})}})]}})},Ll=()=>{return e=gn("node"),yn(e,"style",{width:1920,height:1080,color:868483072}),e;var e},zl=new URL("AppCoreExtensions-legacy-KeSumw-d.js",w.meta.url).href;Qr.debug=!1,Qr.animationsEnabled=!0,Qr.fontSettings.fontFamily="Ubuntu",Qr.fontSettings.color=Sn("#f6f6f6"),Qr.fontSettings.fontSize=32,Qr.rendererOptions={coreExtensionModule:zl,fpsUpdateInterval:200,enableInspector:!0},fn((()=>vn(ao,{root:e=>vn(Fs,e),get children(){return[vn(to,{path:"",component:vl}),vn(to,{path:"examples",component:gl}),vn(to,{path:"browse/:filter",component:vl}),vn(to,{path:"text",component:ml}),vn(to,{path:"buttons",component:bl}),vn(to,{path:"flex",component:wl}),vn(to,{path:"create",component:xl}),vn(to,{path:"viewport",component:yl}),vn(to,{path:"flexsize",component:Sl}),vn(to,{path:"flexcolumnsize",component:Al}),vn(to,{path:"flexcolumn",component:Cl}),vn(to,{path:"buttonsmaterial",component:Tl}),vn(to,{path:"entity/people/:id",component:Fl}),vn(to,{path:"entity/:type/:id",component:Bl}),vn(to,{path:"*all",component:Ll})]}})))}}}))}(); +//# sourceMappingURL=index-legacy-C5yJNjTC.js.map diff --git a/assets/index-legacy-C5yJNjTC.js.map b/assets/index-legacy-C5yJNjTC.js.map new file mode 100644 index 0000000..af6e400 --- /dev/null +++ b/assets/index-legacy-C5yJNjTC.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-legacy-C5yJNjTC.js","sources":["../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/activeElement.ts","../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/lightningInit.ts","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/children.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/config.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/utils.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/states.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/index.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/flex.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/components/Text.tsx","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/solidUniversal.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/render.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.1_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_l6qk66ywnsrdb5zvon2uxgrjiy/node_modules/@lightningjs/solid-ui/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n if (!(src.substr(0, 5) == \"data:\")) {\n // Base64.\n img.crossOrigin = \"Anonymous\";\n }\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha, parentHasRenderTexture, framebufferDimensions) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex, false, parentHasRenderTexture, framebufferDimensions);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n const parentHasRenderTexture = props.parent?.rtt ?? props.parent?.parentHasRenderTexture ?? false;\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n rtt: props.rtt ?? false,\n parentHasRenderTexture,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n hasRTTupdates = false;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n // Assign a default value to parentHasRenderTexture\n parentHasRenderTexture: false,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n // Allow for Render Texture to be processed appropriately\n this.rtt = props.rtt;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // If parent has a render texture, flag that we need to update\n // @todo: Reserve type for RTT updates\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(1);\n }\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n queueMicrotask(() => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n // If node is part of RTT texture\n // Flag that we need to update\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(type);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n }\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children &&\n this.children.length &&\n !this.rtt) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps, rtt, parentHasRenderTexture, } = this.props;\n // Prevent quad rendering if parent has a render texture\n // and renderer is not currently rendering to a texture\n if (parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n rtt,\n parentHasRenderTexture,\n framebufferDimensions: this.framebufferDimensions,\n });\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n if (newParent.rtt || newParent.parentHasRenderTexture) {\n this.setRTTUpdates(UpdateType.All);\n }\n }\n this.parentHasRenderTexture =\n newParent?.rtt || newParent?.parentHasRenderTexture;\n this.updateScaleRotateTransform();\n }\n get rtt() {\n return this.props.rtt;\n }\n set rtt(value) {\n if (!value) {\n return;\n }\n this.props.rtt = true;\n this.hasRTTupdates = true;\n // Store RTT nodes in a separate list\n this.stage.renderer?.renderToTexture(this);\n }\n set parentHasRenderTexture(value) {\n this.props.parentHasRenderTexture = !!value;\n }\n get parentHasRenderTexture() {\n return this.props.parentHasRenderTexture;\n }\n /**\n * Returns the framebuffer dimensions of the node.\n * If the node has a render texture, the dimensions are the same as the node's dimensions.\n * If the node does not have a render texture, the dimensions are inherited from the parent.\n * If the node parent has a render texture and the node is a render texture, the nodes dimensions are used.\n */\n get framebufferDimensions() {\n if (this.parentHasRenderTexture && !this.rtt) {\n return this.parent?.framebufferDimensions;\n }\n return { width: this.width, height: this.height };\n }\n /**\n * Returns the parent render texture node if it exists.\n */\n get parentRenderTexture() {\n let parent = this.parent;\n while (parent) {\n if (parent.rtt) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n get texture() {\n return this.props.texture;\n }\n setRTTUpdates(type) {\n this.hasRTTupdates = true;\n this.parent?.setRTTUpdates(type);\n }\n}\n//# sourceMappingURL=CoreNode.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n rtt: props.rtt,\n parentHasRenderTexture: props.parentHasRenderTexture,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this.rtt = props.rtt;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n get rtt() {\n return this.coreNode.rtt;\n }\n set rtt(value) {\n if (value) {\n this.texture = this.rendererMain.createTexture('RenderTexture', {\n width: this.width,\n height: this.height,\n }, { preload: true, flipY: true });\n }\n this.coreNode.rtt = value;\n }\n get parentHasRenderTexture() {\n return this.coreNode.parentHasRenderTexture;\n }\n set parentHasRenderTexture(value) {\n this.coreNode.parentHasRenderTexture = value;\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n this.registerTextureType('RenderTexture', RenderTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // Reset render operations and clear the canvas\n renderer?.reset();\n // If we have RTT nodes draw them first\n // So we can use them as textures in the main scene\n if (renderer.rttNodes.length > 0) {\n renderer.renderRTTNodes();\n }\n // Fill quads buffer\n this.addQuads(this.root);\n // Perform render pass\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n // Prevent quad rendering if parent has a render texture\n // and this node is not the render texture\n if (this.parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n this.globalTransform.multiply(this.localTransform ?? Matrix3d.identity());\n }\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha, this.parentHasRenderTexture, this.framebufferDimensions);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n parentHasRenderTexture: false,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n let changedLayout = false;\n if (isFunc(this.onBeforeLayout)) {\n changedLayout = this.onBeforeLayout.call(\n this,\n child,\n dimensions,\n ) as boolean;\n }\n\n if (this.display === 'flex') {\n if (calculateFlex(this) || changedLayout) {\n this.parent?.updateLayout();\n }\n } else if (changedLayout) {\n this.parent?.updateLayout();\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n // let flex know we need to re-layout\n return true;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For, hexColor } from \"@lightningjs/solid\";\nimport { createMemo, For as For$1, createSignal } from \"solid-js\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For$1, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For$1, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAX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iJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69Oz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KFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: (string | number)[];\n Menu: (string | number)[];\n Escape: (string | number)[];\n Backspace: (string | number)[];\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: [\"a\"],\n Menu: [\"m\"],\n Escape: [\"Escape\", 27],\n Backspace: [\"Backspace\", 8],\n Left: [\"ArrowLeft\", 37],\n Right: [\"ArrowRight\", 39],\n Up: [\"ArrowUp\", 38],\n Down: [\"ArrowDown\", 40],\n Enter: [\"Enter\", 13],\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n setupFPS({ renderer });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: \"normal\",\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n fontFamily: \"Ubuntu\",\n fontWeight: 700,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = {\n ...theme.typography.body2,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n};\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"names":["getUnicodeCodepoints","SuspenseContext","equalFn","a","b","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","context","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","length","current","undefined","root","updateFn","untrack","cleanNode","runUpdates","createSignal","value","options","s","observers","observerSlots","comparator","Object","assign","readSignal","bind","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","render","user","push","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","arguments","pr","initP","scheduled","resolved","dynamic","contexts","Set","_ref2","_slicedToArray","storage","initialValue","setValue","_createSignal2","error","setError","_createSignal4","track","trigger","_createSignal6","state","setState","loadEnd","p","v","key","onHydrated","queueMicrotask","err","_step4","_iterator4","_createForOfIteratorHelper","keys","n","done","decrement","e","f","clear","completeLoad","read","has","increment","add","load","refetching","lookup","status","then","castError","defineProperties","get","loading","latest","refetch","mutate","createSelector","subs","Map","node","_step5","_iterator5","entries","_step5$value","val","_iterator6","_step6","values","pure","l","set","onCleanup","delete","size","on","deps","prevInput","isArray","Array","defer","prevValue","input","i","result","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","Promise","resolve","createContext","defaultValue","id","Provider","createProvider","useContext","children","memo","resolveChildren","toArray","this","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","Error","time","nextValue","forEach","updatedAt","runComputation","init","runTop","suspense","inFallback","effects","ancestors","wait","res","completeUpdates","queue","userLength","ignore","pop","index","obs","cause","results","apply","props","_objectSpread","FALLBACK","dispose","d","createComponent","Comp","trueFn","propTraps","_","property","receiver","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","Proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","desc","target","definedKeys","defineProperty","narrowedError","name","For","fallback","list","mapFn","items","mapped","disposers","len","indexes","j","newItems","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","start","end","newEnd","item","newLen","disposer","mapper","Math","min","slice","_createSignal8","mapArray","each","Show","keyed","condition","when","child","_createSignal10","activeElement","setActiveElement","TextureUsageTracker","constructor","releaseCallback","_defineProperty","ManualCountTextureUsageTracker","_options$textureClean","_options$textureClean2","super","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step9","now","Date","thresholdMs","_iterator9","zeroReferenceTextureSet","textureRefInfo","lastUpdate","textureMap","registerTexture","texture","_texture$options","textureId","assertTruthy","nodeRefCount","incrementTextureRefCount","_texture$options2","txType","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","prop","x","y","width","w","height","h","zIndex","fontFamily","fontSize","fontStyle","fontWeight","fontStretch","lineHeight","letterSpacing","textAlign","overflowSuffix","maxLines","contain","verticalAlign","clipping","rotation","scale","scaleX","scaleY","color","convertColorToRgba","domPropertyMap","Inspector","canvas","settings","_settings$appHeight","_settings$deviceLogic","_settings$appWidth","_settings$deviceLogic2","_settings$deviceLogic3","_settings$deviceLogic4","isProductionEnvironment","ceil","appHeight","deviceLogicalPixelRatio","appWidth","document","createElement","setRootPosition","body","appendChild","MutationObserver","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","properties","div","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Reflect","destroyNode","anim","animate","animateNode","getElementById","remove","innerHTML","String","visibility","setAttribute","_stylePropertyMap$pro","mappedStyleResponse","call","setProperty","parentId","parent","_settings$duration","duration","_settings$delay","delay","_props$alpha","_props$rotation","_props$scale","setTimeout","opacity","rotate","ShaderEffect","getEffectKey","getMethodParameters","uniforms","u","uni","define","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","getPropertySetters","freeze","fromEntries","map","setter","requestRender","setStatus","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","eventName","off","scheduleUpdateState","updateScheduled","updateState","WebTrFontFace","TrFontFace","descriptors","fontUrl","fontUrlWithoutParentheses","replace","determinedDescriptors","cssDescriptors","weight","stretch","unicodeRange","variant","featureSettings","display","fontFace","FontFace","loaded","catch","calcHeight","numLines","max","LightningTextTextureRenderer","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","ffs","_load","fonts","fontSetting","check","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","split","lines","usedLines","otherLines","measureText","al","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","draw","linesOverride","linePositionX","linePositionY","textRenderIssueMargin","globalAlpha","fillRect","translate","drawLines","highlight","highlightColor","hlHeight","highlightHeight","offset","highlightOffset","hlPaddingLeft","highlightPaddingLeft","hlPaddingRight","highlightPaddingRight","fillStyle","getRgbaString","drawLine","prevShadowSettings","shadow","shadowColor","shadowOffsetX","shadowOffsetY","shadowBlur","textColor","fillText","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","floor","truncWordWidth","substring","indent","allLines","realNewlines","resultLines","spaceLeft","words","wordWidthWithSpace","concat","space","reduce","acc","char","wordBreak","advancedRenderer","fontBaselineRatio","resolvedGlobal","self","globalThis","globalFontSet","_resolvedGlobal$docum","tmpElementBounds","createBound","CanvasTextRenderer","OffscreenCanvas","getContext","rendererBounds","x1","y1","x2","y2","fontInfo","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step10","_iterator10","pageInfo","_pageInfo$texture","setRenderableOwner","txManager","loadTexture","src","_pageInfo$texture2","getImageData","preload","renderQuads","clippingRect","_state$textW","_state$textH","_state$props2","elementRect","intersectRect","_canvasPages$0$textur","_canvasPages$0$textur2","_canvasPages$1$textur","_canvasPages$1$textur2","_canvasPages$2$textur","_canvasPages$2$textur2","pageSize","_state$props3","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","renderer","addQuad","colorBl","colorBr","colorTl","colorTr","dimensions","textureOptions","shader","shaderProps","tx","ty","ta","tb","tc","td","_state$canvasPages","_pageInfo$texture3","_state$canvasPages2","_pageInfo$texture4","_state$fontInfo","_state$fontInfo2","DefaultShader","WebGlCoreShader","bindTextures","textures","glw","activeTexture","bindTexture","ctxTexture","vertex","fragment","DefaultShaderBatched","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","t","samplers","from","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","eff","_eff$props","fxClass","uniInfo","fxProp","propInfo","validator","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","currentClass","next","effectMethod","methodCollection","$alpha","makeCacheKey","_props$effects","RoundedRectangle","radius","IDENTITY_MATRIX_3x3","SdfShader","resolvedProps","components","_props$transform","_props$scrollY","_props$color","_props$size","_props$distanceRange","_props$debug","distanceRange","RadiusEffect","args","_props$radius","fillMask","boxDist","BorderEffect","_props$width","_props$color2","rgba","LinearGradientEffect","colors","_props$colors","_props$angle","stops","colorsL","tmp","angle","_LinearGradientEffect","rgbas","fromLinear","toLinear","calcPoint","amount","loop","ColorLoop","GrayscaleEffect","_props$amount","BorderRightEffect","_props$width2","_props$color3","rectDist","BorderTopEffect","_props$width3","_props$color4","BorderBottomEffect","_props$width4","_props$color5","BorderLeftEffect","_props$width5","_props$color6","GlitchEffect","_props$amplitude","_props$narrowness","_props$blockiness","_props$minimizer","_props$time","amplitude","narrowness","blockiness","minimizer","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref3","_props$height","_props$pivot","pivot","_RadialGradientEffect","RadialProgressEffect","_props$width7","_props$progress","_props$offset","_props$range","_props$rounded","_props$radius2","_props$color7","progress","range","PI","rounded","rotateUV","drawDot","HolePunchEffect","_props$radius3","CoreShaderManager","registerShaderType","registerEffectType","shType","shClass","shConstructors","effectType","effectClass","effectConstructors","getRegisteredShaders","loadShader","ShaderClass","loadDynamicShader","cacheKey","shCache","useShader","attachedShader","detach","attach","ContextSpy","reset","data","getData","loadCompressedTexture","_ref4","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","_ref5","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref6","_callee3","pvrHeaderLength","header","dataOffset","pvrtcData","level","_context3","Int32Array","Uint8Array","byteOffset","_x4","ImageTexture","Texture","hasAlphaChannel","mimeType","getTextureData","_this","_callee4","_this$props","blob","img","_callee4$","_context4","ImageData","test","imageWorkerManager","getImage","hasCreateImageBitmap","createImageBitmap","colorSpaceConversion","imageOrientation","t0","t1","Image","substr","crossOrigin","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","codePoint","getUnicodeCodepoints$","_context5","codePointAt","_marked","layoutText","curLineIndex","startX","startY","vertexBuffer","lineCache","rwSdf","trFontFace","shaper","glyphResult","fontSizeRatio","info","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","codepointIndex","maxX","maxY","curX","curY","bufferOffset","lastWord","xStart","shaperProps","glyphs","shapeText","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","_step11","_iterator11","glyph","xAdvance","moreLines","nextLineWillFit","maxCharHeight","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","cluster","codepoint","charEndX","xOffset","quadX","quadY","yOffset","atlasEntry","getAtlasEntry","glyphId","common","scaleW","scaleH","uvWidth","uvHeight","bufferStart","bufferEnd","vertexTextW","line","bufferNumFloats","bufferNumQuads","layoutNumCharacters","fullyProcessed","setRenderWindow","outRenderWindow","bufferMargin","multiple","screen","sdf","isBoundPositive","y1Base","roundUpToMultiple","firstLineIdx","weightConversions","normal","bold","bolder","lighter","fontWeightToNumber","resolveFontToUse","familyMapsByPriority","family","weightIn","_step12","_iterator12","fontFaces","_step13","weightMap","_iterator13","fontFamilyWeight","msg","TrFontManager","textRenderers","trId","tr","resolveFontFace","tmpRect","SdfTextRenderer","ssdfFontFamilies","msdfFontFamilies","sdfShader","releaseFontFace","setElementBoundsX","boundsOverlap","setElementBoundsY","SdfTrFontFace","familyName","fontFamiles","faceSet","webGlBuffers","bufferUploaded","_state$props4","sdfFontSize","sdfLineHeight","distanceField","neededLength","rwScreen","_state$props5","startLineIndex","sdfVerticalAlignYOffset","sdfStartY","sdfX","sdfY","lineIndex","getStartConditions","out2","byteLength","once","parentHasRenderTexture","framebufferDimensions","_trFontFace$data","_state$trFontFace","_state$props6","_state$textW2","_state$textH2","stride","BYTES_PER_ELEMENT","webGlBuffer","createBuffer","BufferCollection","a_position","FLOAT","normalized","a_textureCoordinate","_webGlBuffers$getBuff","_webGlBuffers","getBuffer","arrayBufferData","STATIC_DRAW","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","sdfShaderDebug","getCtxTexture","addTexture","numQuads","addRenderOp","_state$trFontFace2","_state$trFontFace3","fontFamilyArray","_state$props7","_state$props8","loadCoreExtension","_x5","_x6","_loadCoreExtension","_callee12","coreExtensionModule","module$1","ExtensionClass","coreExtension","_callee12$","_context13","log","__vitePreload","module","default","classExtendsCoreExtension","prototype","CoreExtension","run","santizeCustomDataMap","validTypes","boolean","string","number","valueType","RendererMain","_settings$clearColor","_settings$experimenta","_settings$enableConte","_settings$enableInspe","resolvedSettings","txMemByteThreshold","boundsMargin","devicePhysicalPixelRatio","devicePixelRatio","clearColor","experimental_FinalizationRegistryTextureUsageTracker","textureCleanupOptions","fpsUpdateInterval","numImageWorkers","enableContextSpy","enableInspector","releaseTexture","useFinalizationRegistryTracker","textureTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","onCreateNode","nodes","onBeforeDestroyNode","onFpsUpdate","fpsData","onFrameTick","frameTickData","onIdle","inspector","_this2","_callee5","_context6","getRootNode","resolveNodeDefaults","_props$fontSize","_props$text","_props$textRendererOv","_props$fontFamily","_props$fontStyle","_props$fontWeight","_props$fontStretch","_props$textAlign","_props$contain","_props$scrollable","_props$scrollY2","_props$offsetY","_props$letterSpacing","_props$lineHeight","_props$maxLines","_props$textBaseline","_props$verticalAlign","_props$overflowSuffix","_props$debug2","textRendererOverride","_props$color8","_ref7","_ref8","_props$colorTl","_ref9","_ref10","_props$colorTr","_ref11","_ref12","_props$colorBl","_ref13","_ref14","_props$colorBr","_props$data","_ref15","_props$parent$rtt","_props$parent","_props$parent2","_props$x","_props$y","_props$width8","_props$height2","_props$alpha2","_props$autosize","_props$clipping","_props$colorTop","_props$colorBottom","_props$colorLeft","_props$colorRight","_props$zIndex","_props$zIndexLocked","_props$parent3","_props$texture","_props$shader","_props$src2","_props$scale2","_ref16","_props$scaleX","_ref17","_props$scaleY","_props$mount","_ref18","_props$mountX","_ref19","_props$mountY","_props$pivot2","_ref20","_props$pivotX","_ref21","_props$pivotY","_props$rotation2","_props$rtt","colorTop","colorLeft","colorRight","colorBottom","rtt","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","descType","shaderType","getNodeById","toggleFreeze","advanceFrame","rerender","CoreAnimation","propStartValues","propsList","propName","timingFunction","easing","getTimingFunction","delayFor","update","restore","reverse","startValue","endValue","stopMethod","applyEasing","dt","_this$settings","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","makeStartedPromise","started","makeStoppedPromise","finished","activeAnimations","registerAnimation","unregisterAnimation","stoppedResolve","pause","waitUntilStarted","promise","startedPromise","waitUntilStopped","stoppedPromise","startedResolve","_this$animation$setti","Matrix3d","tempMatrix","multiply","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","identity","sx","sy","cos","sin","copy","dst","transpose","other","transformPoint","CoreNodeRenderState","RenderCoords","x3","y3","x4","y4","UpdateType","CoreNodeRenderStateMap","Init","OutOfBounds","InBounds","InViewport","CoreNode","All","autosizeNode","setRTTUpdates","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","_this$props$parent","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent4","_props$parent5","z","destroy","removeAllListeners","_this$props2","renderToTextureActive","parentRenderTexture","activeRttNode","absX","_this$props$parent2","_this$props$parent3","absY","_this$props$parent$ab","_this$props$parent4","newParent","oldParent","splice","_this$stage$renderer","hasRTTupdates","renderToTexture","_this$parent","_this$parent2","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","flipY","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","numWorkers","Blob","blobURL","URL","webkitURL","createObjectURL","Worker","getNextWorker","workerIndex","convertUrlToAbsolute","location","href","absoluteSrcUrl","postMessage","NoiseTexture","_this3","_callee6","_this3$props","pixelData8","_context7","Uint8ClampedArray","random","cacheId","_props$width9","_props$height3","_props$cacheId","CoreTextureManager","WeakMap","hasWorker","registerTextureType","ColorTexture","SubTexture","RenderTexture","textureClass","txConstructors","TextureClass","textureIdCache","_options$cacheKey","descId","textureKeyCache","addTextureIdToCache","textureDescId","textureRefCountMap","count","removeTextureIdFromCache","_this$ctxTextureCache","refCountObj","ctxTextureCache","free","getDebugInfo","keyCacheSize","idCacheSize","textureSource","createCtxTexture","TextureMemoryManager","byteThreshold","threshold","setTextureMemUse","byteSize","memUsed","gc","Stage","rootId","txMemManager","contextSpy","bm","monitorTextureCache","debugInfo","WebGlCoreRenderer","pixelRatio","bufferMemory","fontManager","isIdle","runLoop","rootNode","updateAnimations","hasSceneUpdates","calculateFps","drawFrame","requestAnimationFrame","lastFrameTime","currentFrameTime","deltaTime","renderRequested","rttNodes","renderRTTNodes","addQuads","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i14","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","_this$props$parent5","_this$localTransform","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","_animationQueue","_animationRunning","_renderProps","_effects","lng","_p$lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationQueueSettings","_this5","_callee8","_callee8$","_context9","setFocus","forwardFocus","focusedIndex","autofocus","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","_step15","_iterator15","found","states","_states","_stateChanged","_animationSettings","_this$parent3","changedLayout","onBeforeLayout","hasOrder","flexItem","flexOrder","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","flexBoundary","calculatedSize","toPad","calculateFlex","_this$parent4","onLayout","forwardStates","_undoStyles","_step14","_iterator14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_autosized","marginBottom","isNaN","onFail","onLoad","onCreate","handler","_node$lng","inode","solid","_loop2","_i17","_LightningRendererNum","_loop3","_i18","_LightningRendererNon","borderRadius","_borderRadius","border","borderLeft","borderRight","borderTop","borderBottom","linearGradient","_linearGradient","Text","_el$","_$createElement","View","createRenderer$1","replaceText","insertNode","removeNode","getParentNode","getFirstChild","getNextSibling","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","spread","setProp","use","arg","universalLightning","anchor","solidRenderer","createRenderer","_ref22","_callee9","_callee9$","_context10","rendererOptions","_x7","_x8","hexColor","Number","isInteger","startsWith","$$EVENTS","eventHandler","composedPath","disabled","cancelBubble","_$host","host","depth","createBeforeLeave","listeners","subscribe","confirm","to","_step16","defaultPrevented","preventDefault","_iterator16","_loop4","retry","force","navigate","saveCurrentDepth","history","_depth","replaceState","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","basePath","fromPath","toLowerCase","extractSearchParams","params","searchParams","createMatcher","partial","matchFilters","_path$split2","pattern","splat","segments","Boolean","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","isEqual","localeCompare","sensitivity","some","createMemoObject","expandOptionals","exec","prefix","prefixes","expansion","intent","RouterContextObj","RouteContextObj","useRouter","message","invariant","useNavigate","navigatorFactory","useLocation","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_step18","_iterator18","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step19","_iterator19","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref23","_callee10","_context11","finish","_x9","_createSignal14","reference","setReference","_createSignal16","origin","path_","pathname","search","hash","query","createLocation","referrers","submissions","baseRoute","outlet","_source","_replace$resolve$scro","nextState","resolvedTo","first","go","navigateFromRoute","preloadRoute","preloadData","prevIntent","_loop5","_matches$match","singleFlight","createRouterComponent","routerState","router","_$createComponent","Root","rootLoad","_$memo","Routes","routeStates","nextMatches","prevMatches","equal","_loop6","prevMatch","nextMatch","_match$route","createRouteContext","createOutlet","Route","childRoutes","scrollToHash","fallbackTop","selector","querySelector","scrollIntoView","scrollTo","actions","setupNativeEvents","explicitLinks","actionBase","preloadTimeout","handleAnchor","evt","button","metaKey","altKey","ctrlKey","shiftKey","Node","nodeName","toUpperCase","hasAttribute","svg","namespaceURI","baseVal","rel","getAttribute","baseURI","handleAnchorClick","_res","parse","handleAnchorPreload","_res2","handleAnchorIn","_res3","handleAnchorOut","clearTimeout","handleFormSubmit","actionRef","submitter","FormData","append","eventNames","delegateEvents","removeEventListener","hashParser","str","_window$location$hash3","HashRouter","getSource","intercept","createRouter","keepDepth","hashIndex","notify","bindEvent","block","prevDepth","notifyIfNotBlocked","tryOnCleanup","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","_createSignal18","setEvent","makeEventListener","currentSeries","keyMapEntries","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Backspace","Escape","_createSignal20","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","_loop7","_Object$entries3$_i","_Object$entries3","_i20","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","onFocus","elm","onBlur","mappedKeyEvent","keyCode","_step20","finalFocusElm","_iterator20","onKeyHandler","onKeyPress","withPadding","padding","right","bottom","pad","_pad","marginLeft","maxHeight","marginTop","speak","phrase","utterances","lang","synth","speechSynthesis","utterance","SpeechSynthesisUtterance","onend","speakSeries","series","remainingPhrases","flattenedSeries","flattenStrings","nestedSeriesResults","active","_callee11","totalRetries","retriesLeft","seriesResult","_seriesResult","_callee11$","_context12","SpeechSynthesisErrorEvent","toSpeak","cancel","SpeechEngine","resetFocusPathTimer","currentlySpeaking","debounce","timeoutId","debounced","voiceOutDisabled","debounceWithFlush","scopedValue","newValue","getElmName","onFocusChangeCore","Announcer","onFocusChange","enabled","every","focusDiff","toAnnounceText","toAnnounce","announce","title","announceContext","table","clearPrevFocus","notification","_currentlySpeaking","textToSpeech","finally","refresh","setupTimers","focusDebounce","focusChangeTimeout","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","_p","_q","_r","_createSignal22","globalBackground","setGlobalBackground","theme","primary","secondary","tertiary","inactive","full","none","alpha1","alpha2","alpha3","alpha4","alpha5","xfast","fast","slow","xslow","expressive","expressiveEntrance","expressiveExit","standard","standardEntrance","standardExit","utility","utilityEntrance","utilityExit","asset","arrowLeft","arrowRight","backspaceOutline","palette","white","black","grey","red","orange","yellow","green","blue","purple","material","materialBrand","overlay","textNeutral","textNeutralSecondary","textNeutralTertiary","textNeutralDisabled","textInverse","textInverseSecondary","textInverseTertiary","textInverseDisabled","textBrand","textBrandSecondary","textBrandTertiary","textBrandDisabled","textPositive","textNegative","textInfo","textCaution","fillTransparent","fillNeutral","fillNeutralSecondary","fillNeutralTertiary","fillNeutralDisabled","fillInverse","fillInverseSecondary","fillInverseTertiary","fillInverseDisabled","fillBrand","fillBrandSecondary","fillBrandTertiary","fillBrandDisabled","fillPositive","fillNegative","fillInfo","fillCaution","strokeNeutral","strokeNeutralSecondary","strokeNeutralTertiary","strokeNeutralDisabled","strokeInverse","strokeInverseSecondary","strokeInverseTertiary","strokeInverseDisabled","strokeBrand","strokeBrandSecondary","strokeBrandTertiary","strokeBrandDisabled","strokePositive","strokeNegative","strokeInfo","strokeCaution","interactiveNeutral","interactiveNeutralFocus","interactiveNeutralFocusSoft","interactiveInverse","interactiveInverseFocus","interactiveInverseFocusSoft","interactiveBrand","interactiveBrandFocus","interactiveBrandFocusSoft","shadowNeutral","shadowNeutralFocus","shadowNeutralFocusSoft","shadowNeutralText","shadowInverse","shadowInverseFocus","shadowInverseFocusSoft","shadowInverseText","shadowBrand","shadowBrandFocus","shadowBrandFocusSoft","shadowBrandText","layout","columnCount","focusScale","gutterX","gutterY","marginX","marginY","safe","screenW","screenH","xs","sm","md","lg","xl","spacer","xxs","xxl","xxxl","stroke","typography","display1","display2","headline1","headline2","headline3","body1","body2","body3","button1","button2","callout1","caption1","tag1","footnote1","componentConfig","Keyboard","keyProps","icon","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","r$","objectFromEntries","_step21","_iterator21","_step21$value","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles","themeStyles2","modeKeys","toneKeys","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","generateSolidStylesFromLookupObject","base2","modes2","tones2","themeStyles3","themeComponentStyles","variantName","styles2","convertedStyles","styleName","modeName","modeStyles","baseStyles","makeBaseStyles","makeModeStyles","mode","toneStyles","makeToneStyles","tone","_ref25","_ref26","_a2","_b2","_ref27","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_componentRef$axis","_ref28","_ref29","axis","_updateLastIndex","lastItem","updateLastIndex","_updateLastIndex2","rootPosition","selectedPosition","selectedSize","direct","scrollIndex","abs","currentChildIndex","_currentChild$dimensi","chainFunctions","onlyFunctions","func","innerArgs","_step22","_iterator22","onGridFocus","skipFocus","handleNavigation","_c2","onSelectedChanged","plinko","num","_ref30$Artwork","Artwork","_ref30$Artwork2","themeStyles$e","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref31$Badge","Badge","_ref31$Badge2","themeStyles$d","_excluded2","container$e","inverse","brand","text$7","icon$2","_ref32$Button","Button","_ref32$Button2","defaultTone$d","themeStyles$c","_excluded3","_ref33$Surface","Surface","_ref33$Surface2","surfaceDefaultTone","surfaceThemeStyles$1","_excluded4","container$d","contentColor","focus","content","text$6","styles$c","Container","Content","_props$tone","flat","Text$7","_props$tone2","_ref34$Checkbox","Checkbox","_ref34$Checkbox2","themeStyles$b","_excluded5","strokeWidth","container$c","checked","neutral","icon$1","_ref35$Icon","Icon","_ref35$Icon2","themeStyles$a","_excluded6","_ref36$Column","Column","_ref36$Column2","defaultTone$a","themeStyles$9","_excluded7","styles$9","itemTransition","onUp","onDown","_props$selected","_props$selected2","_props$tone3","_ref37$Label","Label","_ref37$Label2","themeStyles$8","_excluded8","container$9","backgroundColor","text$5","_ref38$Rating","Rating","_ref38$Rating2","themeStyles$7","container$8","itemSpacing","toneModes","text$4","_ref39$Details","Details","_ref39$Details2","themeStyles$6","_excluded9","container$7","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$3","_ref40$Metadata","Metadata","_ref40$Metadata2","themeStyles$5","_excluded10","container$6","titleText","descriptionText","_ref41$ProgressBar","ProgressBar","_ref41$ProgressBar2","themeStyles$4","_excluded11","container$5","_ref42$Row","Row","_ref42$Row2","defaultTone$4","themeStyles$3","_excluded12","styles$3","onLeft","onRight","_props$selected3","_props$selected4","_props$tone4","_props$tone5","_ref43$Keyboard","_ref43$Keyboard2","themeStyles$2","_excluded13","container$3","keySpacing","baseWidth","sizes","paddingX","text$2","_ref44$Key","Key","_ref44$Key2","themeStyles$1","_excluded14","container$2","text$1","_ref45$Input","Input","_ref45$Input2","_excluded15","container$1","actualTitle","theme2","upCount","getWidthByUpCount$1","_ref46$Tile","Tile","_ref46$Tile2","tileThemeStyles","_excluded16","_ref47$Surface","_ref47$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded17","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","_createSignal32","isLoadedCount","setIsLoadedCount","_createSignal34","isLoadingCount","setIsLoadingCount","_createSignal36","isFailedCount","setIsFailedCount","totalFps","setupFPS","isLoadedCount2","isLoadingCount2","isFailedCount2","fps2","calcFps","FPSCounter","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","handleNavigate","page","isOnPage","matchers","_step17","_iterator17","focusPage","showWidgets","onEnter","App","Menu","Left","Right","Up","Down","announcer","navDrawer","lastFocused","focusNavDrawer","_createSignal38","setShowWidgets","showOnPaths","currentPath","matchesPartial","_ref$","APP","onAnnouncer","onLast","back","onMenu","onBackspace","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step7","otherObject","objects","_iterator7","_step8","isDefaultDesc","writable","objectIndex","_iterator8","splitProps","_splitProps2","local","others","tmdbConfig","baseImageUrl","API_BASE","basePosterSize","defaultFetchParams","headers","Authorization","getImageUrl","posterSize","_get","json","loadConfig","_data$images","images","secure_base_url","api","convertItemsToTiles","poster_path","profile_path","tileSrc","backdrop_path","media_type","shortTitle","maxLength","entityInfo","heroContent","description","overview","cache","leftoverTiles","createInfiniteScroll","_createSignal40","pages","setPages","_createSignal42","setPage","_createSignal44","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","voteAverage","voteCount","metaText","badges","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","rtCrit","rtFan","backgroundImage","vote_average","vote_count","minutes","runtime","remainingMinutes","minutesToHMM","release_date","parts","first_air_date","last_air_date","reviews","Browse","_createSignal46","columnY","setcolumnY","_createSignal48","setEntityInfo","entityProvider","_createSignal50","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","delayedBackgrounds","delayedHero","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal52","setColor","_createSignal54","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal56","insertTest","setInsertTest","_createSignal58","emptyTest","setEmptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal60","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal62","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal64","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal66","_this$children$select4","_createSignal68","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal70","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","entityActions","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"ihVAsBiBA,sQC+GjB,IAgeIC,GAheEC,GAAUA,CAACC,EAAGC,IAAMD,IAAMC,EAC1BC,GAASC,OAAO,eAChBC,GAASD,OAAO,eAEhBE,GAAgB,CACpBC,OAAQP,IAGNQ,GAAaC,GACXC,GAAQ,EACRC,GAAU,EACVC,GAAU,CACdC,MAAO,KACPC,SAAU,KACVC,QAAS,KACTC,MAAO,MAEHC,GAAU,CAAA,EACZC,GAAQ,KACRC,GAAa,KAGbC,GAAW,KACXC,GAAU,KACVC,GAAU,KACVC,GAAY,EAChB,SAASC,GAAWC,EAAIC,GACtB,IAAMC,EAAWP,GACfJ,EAAQE,GACRU,EAAwB,IAAdH,EAAGI,OACbC,OAA4BC,IAAlBL,EAA8BV,EAAQU,EAChDM,EAAOJ,EACHhB,GACA,CACEC,MAAO,KACPC,SAAU,KACVC,QAASe,EAAUA,EAAQf,QAAU,KACrCC,MAAOc,GAEbG,EAAWL,EAAUH,EAAK,IAAMA,GAAG,IAAMS,IAAQ,IAAMC,GAAUH,OACnEd,GAAQc,EACRZ,GAAW,KACX,IACE,OAAOgB,GAAWH,GAAU,EAChC,CAAG,QACCb,GAAWO,EACXT,GAAQF,CACT,CACH,CACA,SAASqB,GAAaC,EAAOC,GAE3B,IAAMC,EAAI,CACRF,QACAG,UAAW,KACXC,cAAe,KACfC,YALFJ,EAAUA,EAAUK,OAAOC,OAAO,CAAE,EAAEvC,GAAeiC,GAAWjC,IAK1CC,aAAUwB,GAShC,MAAO,CAACe,GAAWC,KAAKP,GAPTF,IACQ,mBAAVA,IAEJA,EAAQA,EAAME,EAAEF,QAEhBU,GAAY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W,MAAG7H,GACpB21B,EAAK31B,CAAAA,GAAAA,GACL21B,EAAK,CAAA,GAAA,IAAA31B,GAGPof,GAAM,CACL7vB,MACAE,eAAgB,UAChBn1C,MAAO87E,EACPzvB,UAAgB,YAAA35D,GAAA,MAAA,CAAAgzD,GAEf21B,MAAK31B,GACL21B,EAAK31B,CAAAA,GAAAA,GACL21B,MAAK31B,GACL21B,EAAK31B,CAAAA,GAAAA,GACL21B,EAAK,CAAA,GAAA,IAAA31B,GAGPof,GAAM,CACL7vB,MACAE,eAAgB,UAChBn1C,MAAO87E,EACPzvB,UAAgB,YAAA35D,GAAA,MAAA,CAAAgzD,GAEf21B,EAAK31B,CAAAA,GAAAA,GACL21B,EAAK,CAAC3kC,aAAc,MAAGgP,GACvB21B,EAAK31B,IAAAA,GACL21B,EAAK,CAAA,GAAA31B,GACL21B,EAAK,CAAC3kC,aAAc,MAAG,IAAAgP,GAGzBof,GAAM,CACL7vB,MACAE,eAAgB,SAChBn1C,MAAO87E,EACPzvB,UAAgB,YAAA35D,GAAA,MAAA,CAAAgzD,GAEf21B,MAAK31B,GACL21B,EAAK31B,CAAAA,GAAAA,GACL21B,MAAK31B,GACL21B,EAAK31B,CAAAA,GAAAA,GACL21B,EAAK,CAAA,GAAA,IAAA31B,GAGPof,GAAM,CACL7vB,MACAE,eAAgB,eAChBn1C,MAAO87E,EACPzvB,UAAgB,YAAA35D,GAAA,MAAA,CAAAgzD,GAEf21B,MAAK31B,GACL21B,EAAK31B,CAAAA,GAAAA,GACL21B,MAAK31B,GACL21B,EAAK31B,CAAAA,GAAAA,GACL21B,EAAK,CAAA,GAAA,IAAA31B,GAGPof,GAAM,CACL7vB,MACAE,eAAgB,cAChBn1C,MAAO87E,EACPzvB,UAAgB,YAAA35D,GAAA,MAAA,CAAAgzD,GAEf21B,MAAK31B,GACL21B,EAAK31B,CAAAA,GAAAA,GACL21B,MAAK31B,GACL21B,EAAK31B,CAAAA,GAAAA,GACL21B,EAAK,CAAA,GAAA,I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AAK,CAAC3I,KAAI,oBAAqBgD,UAAW09B,KAAM94B,GAChDe,GAAK,CAAC3I,KAAI,mBAAoBgD,UAAWs8B,KAAM13B,GAC/Ce,GAAK,CAAC3I,KAAI,OAAQgD,UAAW29B,KAAQ","x_google_ignoreList":[1,2,57,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,99,102]} \ No newline at end of file diff --git a/assets/index-legacy-DV4tWBPR.js b/assets/index-legacy-DV4tWBPR.js deleted file mode 100644 index 6a4acaa..0000000 --- a/assets/index-legacy-DV4tWBPR.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){var e=["defaultTone"],t=["defaultTone"],r=["defaultTone"],n=["surfaceDefaultTone"],o=["defaultTone"],i=["defaultTone"],a=["defaultTone"],s=["defaultTone"],l=["defaultTone"],d=["defaultTone"],u=["defaultTone"],h=["defaultTone"],c=["defaultTone"],f=["defaultTone"],p=["defaultTone"],v=["defaultTone"],g=["defaultSurfaceTone"];function m(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function x(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */x=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),s=new E(n||[]);return o(a,"_invoke",{value:R(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var c="suspendedStart",f="suspendedYield",p="executing",v="completed",g={};function m(){}function y(){}function b(){}var w={};d(w,a,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(N([])));A&&A!==r&&n.call(A,a)&&(w=A);var C=b.prototype=m.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,i,a,s){var l=h(e[o],e,i);if("throw"!==l.type){var d=l.arg,u=d.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(u).then((function(e){d.value=e,a(d)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function R(t,r,n){var o=c;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var l=k(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===c)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var d=h(t,r,n);if("normal"===d.type){if(o=n.done?v:f,d.arg===g)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=v,n.method="throw",n.arg=d.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),d=n.call(a,"finallyLoc");if(l&&d){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),B(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;B(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function y(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(d){return void r(d)}s.done?t(l):Promise.resolve(l).then(n,o)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){y(i,n,o,a,s,"next",e)}function s(e){y(i,n,o,a,s,"throw",e)}a(void 0)}))}}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _(e,t){if(e){if("string"==typeof e)return R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{_=e.a,R=e.i,k=e.T,I=e.g,B=e.c,E=e.E,N=e.b,F=e.d,L=e.e,z=e.f,M=e.m,D=e.W,P=e.h,O=e.j,U=e.k,W=e.l,Y=e.S,H=e.B,j=e.n,Q=e.o,K=e.p,$=e.q,X=e.C,G=e.r,V=e.s,Z=e.t,q=e.u,J=e.v,ee=e.R,te=e.w}],execute:function(){var y,re,ne,oe=x().mark(ur),ie=document.createElement("style");ie.textContent="html,body,*{padding:0;margin:0}video{position:absolute;top:0;left:0;z-index:2;outline:none}.center-element{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n",document.head.appendChild(ie);var ae,se=(e,t)=>e===t,le=Symbol("solid-proxy"),de=Symbol("solid-track"),ue=Symbol("solid-dev-component"),he={equals:se},ce=Xe,fe=1,pe=2,ve={owned:null,cleanups:null,context:null,owner:null},ge={},me=null,xe=null,ye=null,be=null,we=null,Se=0;function Ae(e,t){var r=ye,n=me,o=0===e.length,i=void 0===t?n:t,a=o?{owned:null,cleanups:null,context:null,owner:null}:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?()=>e((()=>{throw new Error("Dispose method must be an explicit argument to createRoot function")})):()=>e((()=>Ee((()=>qe(a)))));me=a,ye=null;try{return $e(s,!0)}finally{ye=r,me=n}}function Ce(e,t){var r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},he,t):he).equals||void 0};t.name&&(r.name=t.name),t.internal||Pe(r);return[Ye.bind(r),e=>("function"==typeof e&&(e=e(r.value)),He(r,e))]}function Te(e,t,r){je(Qe(e,t,!0,fe,r))}function _e(e,t,r){je(Qe(e,t,!1,fe,r))}function Re(e,t,r){ce=Ge;var n=Qe(e,t,!1,fe,r);r&&r.render||(n.user=!0),we?we.push(n):je(n)}function ke(e,t,r){var n=Qe(e,t,!0,0,r=r?Object.assign({},he,r):he);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,je(n),Ye.bind(n)}function Ie(e,t,r){var n,o,i;2===arguments.length&&"object"==typeof t||1===arguments.length?(n=!0,o=e,i=t||{}):(n=e,o=t,i=r||{});var a=null,s=ge,l=!1,d="initialValue"in i,u="function"==typeof n&&ke(n),h=new Set,c=C((i.storage||Ce)(i.initialValue),2),f=c[0],p=c[1],v=C(Ce(void 0),2),g=v[0],m=v[1],x=C(Ce(void 0,{equals:!1}),2),y=x[0],b=x[1],w=C(Ce(d?"ready":"unresolved"),2),S=w[0],A=w[1];function _(e,t,r,n){return a===e&&(a=null,void 0!==n&&(d=!0),e!==s&&t!==s||!i.onHydrated||queueMicrotask((()=>i.onHydrated(n,{value:t}))),s=ge,function(e,t){$e((()=>{void 0===t&&p((()=>e)),A(void 0!==t?"errored":d?"ready":"unresolved"),m(t);var r,n=T(h.keys());try{for(n.s();!(r=n.n()).done;){r.value.decrement()}}catch(t){n.e(t)}finally{n.f()}h.clear()}),!1)}(t,r)),t}function R(){var e=ae,t=f(),r=g();if(void 0!==r&&!a)throw r;return ye&&!ye.user&&e&&Te((()=>{y(),a&&(e.resolved||h.has(e)||(e.increment(),h.add(e)))})),t}function k(e=!0){if(!1===e||!l){l=!1;var t=u?u():n;if(null!=t&&!1!==t){var r,i=s!==ge?s:Ee((()=>o(t,{value:f(),refetching:e})));return(r=i)&&"object"==typeof r&&"then"in r?(a=i,"value"in i?("success"===i.status?_(a,i.value,void 0,t):_(a,void 0,void 0,t),i):(l=!0,queueMicrotask((()=>l=!1)),$e((()=>{A(d?"refreshing":"pending"),b()}),!1),i.then((e=>_(i,e,void 0,t)),(e=>_(i,void 0,Je(e),t))))):(_(a,i,void 0,t),i)}_(a,Ee(f))}}return Object.defineProperties(R,{state:{get:()=>S()},error:{get:()=>g()},loading:{get(){var e=S();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return R();var e=g();if(e&&!a)throw e;return f()}}}),u?Te((()=>k(!1))):k(!1),[R,{refetch:k,mutate:p}]}function Be(e,t=se,r){var n=new Map,o=Qe((r=>{var o,i=e(),a=T(n.entries());try{for(a.s();!(o=a.n()).done;){var s=C(o.value,2),l=s[0],d=s[1];if(t(l,i)!==t(l,r)){var u,h=T(d.values());try{for(h.s();!(u=h.n()).done;){var c=u.value;c.state=fe,c.pure?be.push(c):we.push(c)}}catch(f){h.e(f)}finally{h.f()}}}}catch(f){a.e(f)}finally{a.f()}return i}),void 0,!0,fe,r);return je(o),e=>{var r,i=ye;i&&((r=n.get(e))?r.add(i):n.set(e,r=new Set([i])),Le((()=>{r.delete(i),!r.size&&n.delete(e)})));return t(e,o.value)}}function Ee(e){if(null===ye)return e();var t=ye;ye=null;try{return e()}finally{ye=t}}function Ne(e,t,r){var n,o=Array.isArray(e),i=r&&r.defer;return r=>{var a;if(o){a=Array(e.length);for(var s=0;st(a,n,r)));return n=a,l}}function Fe(e){Re((()=>Ee(e)))}function Le(e){return null===me?console.warn("cleanups created outside a `createRoot` or `render` will never be run"):null===me.cleanups?me.cleanups=[e]:me.cleanups.push(e),e}function ze(){return me}function Me(e,t){var r=me,n=ye;me=e,ye=null;try{return $e(t,!0)}catch(o){et(o)}finally{me=r,ye=n}}function De(e){var t=ye,r=me;return Promise.resolve().then((()=>{ye=t,me=r,$e(e,!1),ye=me=null}))}function Pe(e){me&&(me.sourceMap?me.sourceMap.push(e):me.sourceMap=[e],e.graph=me)}function Oe(e,t){var r=Symbol("context");return{id:r,Provider:rt(r,t),defaultValue:e}}function Ue(e){return me&&me.context&&void 0!==me.context[e.id]?me.context[e.id]:e.defaultValue}function We(e){var t=ke(e),r=ke((()=>tt(t())),void 0,{name:"children"});return r.toArray=()=>{var e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function Ye(){if(this.sources&&this.state)if(this.state===fe)je(this);else{var e=be;be=null,$e((()=>Ve(this)),!1),be=e}if(ye){var t=this.observers?this.observers.length:0;ye.sources?(ye.sources.push(this),ye.sourceSlots.push(t)):(ye.sources=[this],ye.sourceSlots=[t]),this.observers?(this.observers.push(ye),this.observerSlots.push(ye.sources.length-1)):(this.observers=[ye],this.observerSlots=[ye.sources.length-1])}return this.value}function He(e,t,r){var n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&$e((()=>{for(var t=0;t1e6)throw be=[],new Error("Potential Infinite Loop Detected.")}),!1)),t}function je(e){if(e.fn){qe(e);var t=Se;!function(e,t,r){var n,o=me,i=ye;ye=me=e;try{n=e.fn(t)}catch(a){return e.pure&&(e.state=fe,e.owned&&e.owned.forEach(qe),e.owned=null),e.updatedAt=r+1,et(a)}finally{ye=i,me=o}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?He(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}}function Qe(e,t,r,n=fe,o){var i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:me,context:me?me.context:null,pure:r};return null===me?console.warn("computations created outside a `createRoot` or `render` will never be disposed"):me!==ve&&(me.owned?me.owned.push(i):me.owned=[i]),o&&o.name&&(i.name=o.name),i}function Ke(e){if(0!==e.state){if(e.state===pe)return Ve(e);if(e.suspense&&Ee(e.suspense.inFallback))return e.suspense.effects.push(e);for(var t=[e];(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if((e=t[r]).state===fe)je(e);else if(e.state===pe){var n=be;be=null,$e((()=>Ve(e,t[0])),!1),be=n}}}function $e(e,t){if(be)return e();var r=!1;t||(be=[]),we?r=!0:we=[],Se++;try{var n=e();return function(e){be&&(Xe(be),be=null);if(e)return;var t=we;we=null,t.length&&$e((()=>ce(t)),!1)}(r),n}catch(o){r||(we=null),be=null,et(o)}}function Xe(e){for(var t=0;t=0;t--)qe(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,delete e.sourceMap}function Je(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function et(e,t=me){throw Je(e)}function tt(e){if("function"==typeof e&&!e.length)return tt(e());if(Array.isArray(e)){for(var t=[],r=0;rn=Ee((()=>(me.context=S(S({},me.context),{},{[e]:r.value}),We((()=>r.children)))))),void 0,t),n}}var nt=Symbol("fallback");function ot(e){for(var t=0;tEe((()=>(Object.assign(e,{[ue]:!0}),e(t))))),void 0,!0,0);return r.props=t,r.observers=null,r.observerSlots=null,r.name=e.name,r.component=e,je(r),void 0!==r.tValue?r.tValue:r.value}(e,t||{})}function at(){return!0}var st={get:(e,t,r)=>t===le?r:e.get(t),has:(e,t)=>t===le||e.has(t),set:at,deleteProperty:at,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:at,deleteProperty:at}),ownKeys:e=>e.keys()};function lt(e){return(e="function"==typeof e?e():e)?e:{}}function dt(){for(var e=0,t=this.length;e=0;r--){var n=lt(e[r])[t];if(void 0!==n)return n}},has(t){for(var r=e.length-1;r>=0;r--)if(t in lt(e[r]))return!0;return!1},keys(){for(var t=[],r=0;r=0;a--){var s=e[a];if(s)for(var l=Object.getOwnPropertyNames(s),d=function(){var e=l[u];if("__proto__"===e||"constructor"===e)return 1;var t=Object.getOwnPropertyDescriptor(s,e);if(i[e]){var r=o[e];r&&(t.get?r.push(t.get.bind(s)):void 0!==t.value&&r.push((()=>t.value)))}else i[e]=t.get?{enumerable:!0,configurable:!0,get:dt.bind(o[e]=[t.get.bind(s)])}:void 0!==t.value?t:void 0},u=l.length-1;u>=0;u--)d()}for(var h={},c=Object.keys(i),f=c.length-1;f>=0;f--){var p=c[f],v=i[p];v&&v.get?Object.defineProperty(h,p,v):h[p]=v?v.value:void 0}return h}var ht=e=>`Attempting to access a stale value from <${e}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.`;function ct(e){var t="fallback"in e&&{fallback:()=>e.fallback};return ke(function(e,t,r={}){var n=[],o=[],i=[],a=0,s=t.length>1?[]:null;return Le((()=>ot(i))),()=>{var l,d,u=e()||[];return u[de],Ee((()=>{var e,t,c,f,p,v,g,m,x,y=u.length;if(0===y)0!==a&&(ot(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[nt],o[0]=Ae((e=>(i[0]=e,r.fallback()))),a=1);else if(0===a){for(o=new Array(y),d=0;d=v&&m>=v&&n[g]===u[m];g--,m--)c[m]=o[g],f[m]=i[g],s&&(p[m]=s[g]);for(e=new Map,t=new Array(m+1),d=m;d>=v;d--)x=u[d],l=e.get(x),t[d]=void 0===l?-1:l,e.set(x,d);for(l=v;l<=g;l++)x=n[l],void 0!==(d=e.get(x))&&-1!==d?(c[d]=o[l],f[d]=i[l],s&&(p[d]=s[l]),d=t[d],e.set(x,d)):i[l]();for(d=v;de.each),e.children,t||void 0),void 0,{name:"value"})}function ft(e){var t=e.keyed,r=ke((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r,name:"condition"});return ke((()=>{var n=r();if(n){var o=e.children;return"function"==typeof o&&o.length>0?Ee((()=>o(t?n:()=>{if(!Ee(r))throw ht("Show");return e.when}))):o}return e.fallback}),void 0,{name:"value"})}var pt={hooks:{afterUpdate:null,afterCreateOwner:null,afterCreateSignal:null},writeSignal:He,registerGraph:Pe};globalThis&&(globalThis.Solid$$?console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior."):globalThis.Solid$$=!0);var vt=C(Ce(void 0),2),gt=vt[0],mt=vt[1];class xt{constructor(e){A(this,"releaseCallback",void 0),this.releaseCallback=e}}class yt extends xt{constructor(e,t){var r,n;super(e),A(this,"textureMap",new Map),A(this,"zeroReferenceTextureSet",new Set),A(this,"options",void 0),this.options={textureCleanupIntervalMs:null!==(r=t.textureCleanupIntervalMs)&&void 0!==r?r:1e4,textureCleanupAgeThreadholdMs:null!==(n=t.textureCleanupAgeThreadholdMs)&&void 0!==n?n:6e4},setInterval((()=>{var e,t=Date.now(),r=this.options.textureCleanupAgeThreadholdMs,n=T(this.zeroReferenceTextureSet);try{for(n.s();!(e=n.n()).done;){var o=e.value;t-o.lastUpdate>r&&(this.releaseCallback(o.id),this.textureMap.delete(o.id),this.zeroReferenceTextureSet.delete(o))}}catch(i){n.e(i)}finally{n.f()}}),this.options.textureCleanupIntervalMs)}registerTexture(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;if(_(r,"Texture must have an id to be registered"),!this.textureMap.has(r)){var n={id:r,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(r,n),this.zeroReferenceTextureSet.add(n)}}incrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;_(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);n||(this.registerTexture(e),n=this.textureMap.get(r)),_(n,"Texture must have been registered"),"SubTexture"===e.txType&&this.incrementTextureRefCount(e.props.texture),n.nodeRefCount++,n.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(n)&&this.zeroReferenceTextureSet.delete(n)}decrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;_(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);_(n,"Texture must have been registered"),n.nodeRefCount--,n.lastUpdate=Date.now(),0===n.nodeRefCount&&this.zeroReferenceTextureSet.add(n),"SubTexture"===e.txType&&this.decrementTextureRefCount(e.props.texture)}}class bt extends xt{constructor(e){super(e),A(this,"registry",void 0),this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,r;_(null===(t=e.options)||void 0===t?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,null===(r=e.options)||void 0===r?void 0:r.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}var wt={alpha:e=>1===e?null:{prop:"opacity",value:`${e}`},x:e=>({prop:"left",value:`${e}px`}),y:e=>({prop:"top",value:`${e}px`}),width:e=>0===e?null:{prop:"width",value:`${e}px`},height:e=>0===e?null:{prop:"height",value:`${e}px`},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:e=>!1===e?null:{prop:"overflow",value:e?"hidden":"visible"},rotation:e=>0===e?null:{prop:"transform",value:`rotate(${e}rad)`},scale:e=>1===e?null:{prop:"transform",value:`scale(${e})`},scaleX:e=>1===e?null:{prop:"transform",value:`scaleX(${e})`},scaleY:e=>1===e?null:{prop:"transform",value:`scaleY(${e})`},color:e=>0===e?null:{prop:"color",value:St(e)}},St=e=>`rgba(${e>>24&255},${e>>16&255},${e>>8&255},${(255&e)/255})`,At={id:"id"};class Ct{constructor(e,t){var r,n,o,i,a,s;if(A(this,"root",null),A(this,"canvas",null),A(this,"height",1080),A(this,"width",1920),A(this,"scaleX",1),A(this,"scaleY",1),!R()){if(!t)throw new Error("settings is required");this.height=Math.ceil(null!==(r=t.appHeight)&&void 0!==r?r:1080/(null!==(n=t.deviceLogicalPixelRatio)&&void 0!==n?n:1)),this.width=Math.ceil(null!==(o=t.appWidth)&&void 0!==o?o:1900/(null!==(i=t.deviceLogicalPixelRatio)&&void 0!==i?i:1)),this.scaleX=null!==(a=t.deviceLogicalPixelRatio)&&void 0!==a?a:1,this.scaleY=null!==(s=t.deviceLogicalPixelRatio)&&void 0!==s?s:1,this.canvas=e,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(e,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(e),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}}setRootPosition(){if(null!==this.root&&null!==this.canvas){var e=this.canvas.getBoundingClientRect(),t=document.documentElement.scrollTop+e.top,r=document.documentElement.scrollLeft+e.left;this.root.id="root",this.root.style.left=`${r}px`,this.root.style.top=`${t}px`,this.root.style.width=`${this.width}px`,this.root.style.height=`${this.height}px`,this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform=`scale(${this.scaleX}, ${this.scaleY})`,this.root.style.overflow="hidden",this.root.style.zIndex="65534"}}createDiv(e,t){var r=document.createElement("div");for(var n in r.style.position="absolute",r.id=e.id.toString(),t)this.updateNodeProperty(r,n,t[n]);return r}createNode(e,t){var r=e.createNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createTextNode(e,t){var r=e.createTextNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createProxy(e,t){return new Proxy(e,{set:(e,r,n)=>(this.updateNodeProperty(t,r,n),Reflect.set(e,r,n)),get:(r,n,o)=>("destroy"===n&&this.destroyNode(r),"animate"===n?(n,o)=>{var i=r.animate(n,o);return new Proxy(i,{get:(r,i,a)=>("start"===i&&this.animateNode(t,e,n,o),Reflect.get(r,i,a))})}:Reflect.get(r,n,o))})}destroyNode(e){var t=document.getElementById(e.id.toString());null==t||t.remove()}updateNodeProperty(e,t,r){if(null!==this.root&&null!=r)if("parent"!==t){if("text"===t)return e.innerHTML=String(r),void(e.style.visibility="hidden");if("src"===t&&r)e.setAttribute("data-src",String(r));else{if(wt[t]){var n,o=null===(n=wt[t])||void 0===n?void 0:n.call(wt,r);if(null===o)return;return"string"==typeof o?void e.style.setProperty(o,String(r)):void("object"==typeof o&&e.style.setProperty(o.prop,o.value))}if(At[t])e.setAttribute(String(wt[t]),String(r));else if("data"!==t);else for(var i in r)e.setAttribute(`data-${i}`,String(r[i]))}}else{var a=r.id;if(1===a)return void this.root.appendChild(e);var s=document.getElementById(a.toString());null==s||s.appendChild(e)}}animateNode(e,t,r,n){var o=n.duration,i=void 0===o?1e3:o,a=n.delay,s=void 0===a?0:a,l=r.x,d=r.y,u=r.width,h=r.height,c=r.alpha,f=void 0===c?1:c,p=r.rotation,v=void 0===p?0:p,g=r.scale,m=void 0===g?1:g,x=r.color;setTimeout((function(){setTimeout((()=>{e.style.top=`${d}px`,e.style.left=`${l}px`,e.style.width=`${u}px`,e.style.height=`${h}px`,e.style.opacity=`${f}`,e.style.rotate=`${v}rad`,e.style.scale=`${m}`,e.style.color=St(x)}),i)}),s)}}var Tt=function(e,t,r){var n=Promise.resolve();return n.then((()=>e())).catch((e=>{var t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}))};class _t{static getEffectKey(e){return""}static getMethodParameters(e,t){var r=[];for(var n in e){var o=e[n],i="";o.size&&(i=`[${o.size(t)}]`),r.push(`${o.type} ${n}${i}`)}return r.join(",")}constructor(e){A(this,"priority",1),A(this,"name",""),A(this,"ref",void 0),A(this,"target",void 0),A(this,"passParameters",""),A(this,"declaredUniforms",""),A(this,"uniformInfo",{});var t=e.ref,r=e.target,n=e.props,o=void 0===n?{}:n;this.ref=t,this.target=r;var i={},a=[],s="",l=this.constructor.uniforms||{};for(var d in l){var u=l[d],h=u.type,c=`${t}_${d}`,f="";u.size&&(f=`[${u.size(o)}]`),a.push(c),s+=`uniform ${h} ${c}${f};`,i[d]={name:c,uniform:l[d].method}}this.passParameters=a.join(","),this.declaredUniforms=s,this.uniformInfo=i}static resolveDefaults(e){return{}}static makeEffectKey(e){return!1}}A(_t,"uniforms",{}),A(_t,"methods",void 0),A(_t,"onShaderMask",void 0),A(_t,"onColorize",void 0),A(_t,"onEffectMask",void 0);var Rt={x:(e,t)=>{e.props.x=t},y:(e,t)=>{e.props.y=t},width:(e,t)=>{e.props.width=t},height:(e,t)=>{e.props.height=t},color:(e,t)=>{e.props.color=t},zIndex:(e,t)=>{e.props.zIndex=t},fontFamily:(e,t)=>{e.props.fontFamily=t},fontWeight:(e,t)=>{e.props.fontWeight=t},fontStyle:(e,t)=>{e.props.fontStyle=t},fontStretch:(e,t)=>{e.props.fontStretch=t},fontSize:(e,t)=>{e.props.fontSize=t},text:(e,t)=>{e.props.text=t},textAlign:(e,t)=>{e.props.textAlign=t},contain:(e,t)=>{e.props.contain=t},offsetY:(e,t)=>{e.props.offsetY=t},scrollable:(e,t)=>{e.props.scrollable=t},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t},lineHeight:(e,t)=>{e.props.lineHeight=t},maxLines:(e,t)=>{e.props.maxLines=t},textBaseline:(e,t)=>{e.props.textBaseline=t},verticalAlign:(e,t)=>{e.props.verticalAlign=t},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t},debug:(e,t)=>{e.props.debug=t}};class kt{constructor(e){A(this,"stage",void 0),A(this,"set",void 0),this.stage=e;var t=S(S({},Rt),this.getPropertySetters());this.set=Object.freeze(Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(r,n)=>{r.props[e]!==n&&(t(r,n),this.stage.requestRender())}]))))}setStatus(e,t,r){e.status!==t&&(e.status=t,e.emitter.emit(t,r))}setIsRenderable(e,t){e.isRenderable=t}destroyState(e){["loading","loaded","failed"].forEach((t=>{e.emitter.off(t)}))}scheduleUpdateState(e){e.updateScheduled||(e.updateScheduled=!0,queueMicrotask((()=>{e.updateScheduled=!1,this.updateState(e)})))}}class It extends k{constructor(e,t,r){super(e,t),A(this,"fontFace",void 0),A(this,"fontUrl",void 0);var n=r.replace(/\(|\)/g,""),o=this.descriptors,i={style:o.style,weight:"number"==typeof o.weight?`${o.weight}`:o.weight,stretch:o.stretch,unicodeRange:o.unicodeRange,variant:o.variant,featureSettings:o.featureSettings,display:o.display},a=new FontFace(e,`url(${n})`,i);a.load().then((()=>{this.loaded=!0,this.emit("loaded")})).catch(console.error),this.fontFace=a,this.fontUrl=r}}function Bt(e,t,r,n,o){return r*(n-1)+("bottom"!==e?.5*t:0)+Math.max(r,t)+(o||0)}class Et{constructor(e,t){A(this,"_canvas",void 0),A(this,"_context",void 0),A(this,"_settings",void 0),A(this,"renderInfo",void 0),this._canvas=e,this._context=t,this._settings=this.mergeDefaults({})}set settings(e){this._settings=this.mergeDefaults(e)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){for(var e=[this._settings.fontFace],t=[],r=0,n=e.length;r{console.warn("[Lightning] Font load error",t,e)})).then((()=>{document.fonts.check(e,this._settings.text)||console.warn("[Lightning] Font not found",e)}))}catch(t){console.warn("[Lightning] Can't check font loading for "+e)}}}calculateRenderInfo(){var e={},t=this.getPrecision(),r=this._settings.paddingLeft*t,n=this._settings.paddingRight*t,o=this._settings.fontSize*t,i=null===this._settings.offsetY?null:this._settings.offsetY*t,a=(this._settings.lineHeight||o)*t,s=this._settings.w*t,l=this._settings.h*t,d=this._settings.wordWrapWidth*t,u=this._settings.cutSx*t,h=this._settings.cutEx*t,c=this._settings.cutSy*t,f=this._settings.cutEy*t,p=(this._settings.letterSpacing||0)*t,v=this._settings.textIndent*t;this.setFontProperties();var g,m=s||2048/this.getPrecision(),x=m-r;if(x<10&&(m+=10-x,x=10),d||(d=x),this._settings.textOverflow&&!this._settings.wordWrap){var y;switch(this._settings.textOverflow){case"clip":y="";break;case"ellipsis":y=this._settings.overflowSuffix;break;default:y=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,d-v,y)}if(this._settings.wordWrap)g=this.wrapText(this._settings.text,d,p,v);else for(var b=(g={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]}).l.length,w=0;wthis._settings.maxLines){var A,C=S.slice(0,this._settings.maxLines),T=null;if(this._settings.overflowSuffix){var _=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,R=this.wrapText(C[C.length-1],d-_,p,v);C[C.length-1]=`${R.l[0]}${this._settings.overflowSuffix}`,T=[R.l.length>1?R.l[1]:""]}else T=[""];var k=S.length,I=0,B=g.n.length;for(A=this._settings.maxLines;A=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(e.cutSx||e.cutSy)&&this._context.translate(-e.cutSx,-e.cutSy);for(var l=[],d=0,u=i.length;dt)for(;a>0&&(s=this._context.measureText(e.substring(0,a)).width+n)>t;)a-=1;else for(;a=n?r:"")}wrapText(e,t,r,n=0){for(var o=e.split(/\r?\n/g),i=[],a=[],s=0;su?(c>0&&(l.push(d),d=""),d+=h[c],u=t-f-(0===c?n:0)):(u-=p,d+=` ${h[c]}`)}l.push(d),d="",i=i.concat(l),se+this._context.measureText(r).width+t),0):this._context.measureText(e).width}mergeDefaults(e){return S({text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0},e)}}var Nt="undefined"==typeof self?globalThis:self,Ft=(null===(y=Nt.document)||void 0===y?void 0:y.fonts)||Nt.fonts;var Lt=B(0,0,0,0);class zt extends kt{constructor(e){super(e),A(this,"canvas",void 0),A(this,"context",void 0),A(this,"rendererBounds",void 0),"undefined"!=typeof OffscreenCanvas?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");var t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),_(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof It}addFontFace(e){_(e instanceof It),Ft.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new E,canvasPages:void 0,lightning2TextRenderer:new Et(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){if("initialState"===e.status&&this.setStatus(e,"loading"),!e.fontInfo){var t=(r=e.props,n=r.fontFamily,[r.fontStyle,r.fontWeight,r.fontStretch,`${r.fontSize}px`,n].join(" "));if(e.fontInfo={cssString:t,loaded:!1},!e.fontInfo.loaded)return void Ft.load(t).then(this.onFontLoaded.bind(this,e,t)).catch(this.onFontLoadError.bind(this,e,t))}var r,n;if(e.fontInfo.loaded){if(!e.renderInfo){var o=e.props.maxLines,i="both"===e.props.contain?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,a=i>0&&o>0?Math.min(i,o):Math.max(i,o);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:N(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:"none"!==e.props.contain,wordWrapWidth:"none"===e.props.contain?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:a,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}var s=e.props,l=s.x,d=s.y,u=s.width,h=s.height,c=s.scrollY,f=s.contain,p=e.visibleWindow,v=e.renderWindow,g=e.canvasPages;if(!p.valid){var m=B(l,d,"none"!==f?l+u:1/0,"both"===f?d+h:1/0,Lt);F(this.rendererBounds,m,p),p.valid=!0}var x=p.y2-p.y1,y=Math.ceil(x/e.renderInfo.lineHeight);if(0===x)return g=void 0,v=void 0,void this.setStatus(e,"loaded");if(v&&g){var b=l+v.x1,w=d-c+v.y1,S=l+v.x2,A=d-c+v.y2;if(b<=p.x1&&S>=p.x2&&w<=p.y1&&A>=p.y2)return void this.setStatus(e,"loaded");Ap.y1&&(v.y1-=y*e.renderInfo.lineHeight,v.y2-=y*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-y,g[0].lineNumEnd=g[0].lineNumStart+y,g[0].valid=!1)}else{var C,_,R,k=e.renderInfo.lineHeight*y,I=Math.ceil(c/k),E=I*y,L=E-y,z=E+y;g=[{texture:null===(C=g)||void 0===C?void 0:C[0].texture,lineNumStart:L,lineNumEnd:L+y,valid:!1},{texture:null===(_=g)||void 0===_?void 0:_[1].texture,lineNumStart:E,lineNumEnd:E+y,valid:!1},{texture:null===(R=g)||void 0===R?void 0:R[2].texture,lineNumStart:z,lineNumEnd:z+y,valid:!1}],e.canvasPages=g;var M=I*k;v={x1:0,y1:M-k,x2:u,y2:M+2*k}}e.renderWindow=v,performance.now();var D,P=T(g);try{for(P.s();!(D=P.n()).done;){var O=D.value;if(!O.valid)if(O.lineNumStart<0){var U;null===(U=O.texture)||void 0===U||U.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),O.texture.setRenderableOwner(e,e.isRenderable),O.valid=!0}else{var W;if(e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(O.lineNumStart,O.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(O.lineNumStart,O.lineNumEnd)}),0!==this.canvas.width&&0!==this.canvas.height)null===(W=O.texture)||void 0===W||W.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),O.texture.setRenderableOwner(e,e.isRenderable);O.valid=!0}}}catch(Y){P.e(Y)}finally{P.f()}this.setStatus(e,"loaded")}}renderQuads(e,t,r,n){var o=this.stage,i=e.canvasPages,a=e.textW,s=void 0===a?0:a,l=e.textH,d=void 0===l?0:l,u=e.renderWindow;if(i&&u){var h=e.props,c=h.x,f=h.y,p=h.scrollY,v=h.contain,g=h.width,m=h.height,x={x:c,y:f,width:"none"!==v?g:s,height:"both"===v?m:d};L({x:0,y:0,width:o.options.appWidth,height:o.options.appHeight},x),_(i,"canvasPages is not defined"),_(u,"renderWindow is not defined");var y,b,w,S,A,C,T=(u.y2-u.y1)/3,R=e.props,k=R.zIndex,I=R.color,B=n*z(I),E=M(4294967295,B);if(i[0].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(y=i[0].texture)||void 0===y||null===(y=y.dimensions)||void 0===y?void 0:y.width)||0,height:(null===(b=i[0].texture)||void 0===b||null===(b=b.dimensions)||void 0===b?void 0:b.height)||0,texture:i[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:k,tx:t.tx,ty:t.ty-p+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[1].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(w=i[1].texture)||void 0===w||null===(w=w.dimensions)||void 0===w?void 0:w.width)||0,height:(null===(S=i[1].texture)||void 0===S||null===(S=S.dimensions)||void 0===S?void 0:S.height)||0,texture:i[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:k,tx:t.tx,ty:t.ty-p+u.y1+T,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[2].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(A=i[2].texture)||void 0===A||null===(A=A.dimensions)||void 0===A?void 0:A.width)||0,height:(null===(C=i[2].texture)||void 0===C||null===(C=C.dimensions)||void 0===C?void 0:C.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:k,tx:t.tx,ty:t.ty-p+u.y1+T+T,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.canvasPages)||void 0===r||r.forEach((r=>{var n;null===(n=r.texture)||void 0===n||n.setRenderableOwner(e,t)}))}destroyState(e){var t;null===(t=e.canvasPages)||void 0===t||t.forEach((t=>{var r;null===(r=t.texture)||void 0===r||r.setRenderableOwner(e,!1)}))}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var r;t===(null===(r=e.fontInfo)||void 0===r?void 0:r.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,r){var n;t===(null===(n=e.fontInfo)||void 0===n?void 0:n.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,console.error(`CanvasTextRenderer: Error loading font '${e.fontInfo.cssString}'`,r),this.scheduleUpdateState(e))}}class Mt extends D{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}}A(Mt,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class Dt extends D{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]}),A(this,"supportsIndexedTextures",!0)}bindTextures(e){var t=this.renderer,r=this.glw;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error(`DefaultShaderBatched: Cannot bind more than ${t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);e.forEach(((e,t)=>{r.activeTexture(t),r.bindTexture(e.ctxTexture)}));var n=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",n)}}A(Dt,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>`\n #define txUnits ${e}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${e}], int idx, vec2 uv) {\n ${Array.from(Array(e).keys()).map((e=>`\n ${0!==e?"else ":""}if (idx == ${e}) {\n return texture2D(textures[${e}], uv);\n }\n `)).join("")}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `});var Pt=new Map,Ot=(e,t)=>{var r=JSON.stringify(e);if(Pt.has(r))return Pt.get(r);var n=(null!=e?e:[]).map((e=>({type:e.type,props:t[e.type].resolveDefaults(e.props||{})})));return Pt.set(r,n),n};class Ut extends D{constructor(e,t,r){var n=Ut.createShader(t,r);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...n.uniforms],shaderSources:{vertex:n.vertex,fragment:n.fragment}}),A(this,"effects",[]),this.effects=n.effects,this.calculateProps=P(this.calculateProps.bind(this))}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){var t=this.renderer.shManager.getRegisteredEffects(),r=[];return null==e||e.forEach(((e,n)=>{var o,i=this.effects[n],a=t[i.name],s=null!==(o=e.props)&&void 0!==o?o:{},l=i.uniformInfo;Object.keys(s).forEach((e=>{var t=a.uniforms[e],n=l[e],o=t.validator?t.validator(s[e],s):s[e];Array.isArray(o)&&(o=new Float32Array(o)),r.push({name:n.name,value:o})}))})),r}bindProps(e){this.calculateProps(e.effects).forEach((e=>{this.setUniform(e.name,e.value)}))}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;for(var r=e.effects.length,n=0;n{var n=t[e.type],s=n.getEffectKey(e.props||{});r[s]=r[s]?++r[s]:1;var l=r[s];1===l&&a.push({key:s,type:e.type,props:e.props});var d=new n({ref:`${s}${1===l?"":l}`,target:s,props:e.props});return o+=d.declaredUniforms,i.push(...Object.values(d.uniformInfo)),d})),l="";null==a||a.forEach((e=>{var r,o=t[e.type],i=o.resolveDefaults(null!==(r=e.props)&&void 0!==r?r:{}),a=[];for(var s in o.methods){var d=s,u=o.methods[s];n[s]&&n[s]!==u&&(d=Ut.resolveMethodDuplicate(s,u,n)),n[d]=u.replace("function",d),a.push({m:s,cm:d})}var h=o.onShaderMask instanceof Function?o.onShaderMask(i):o.onShaderMask,c=o.onColorize instanceof Function?o.onColorize(i):o.onColorize,f=o.onEffectMask instanceof Function?o.onEffectMask(i):o.onEffectMask;a.forEach((e=>{var t=e.m,r=e.cm,n=new RegExp(`\\$${t}`,"g");h&&(h=h.replace(n,r)),c&&(c=c.replace(n,r)),f&&(f=f.replace(n,r))}));var p=o.getMethodParameters(o.uniforms,i),v=p.length>0?`, ${p}`:"";h&&(l+=`\n float fx_${e.key}_onShaderMask(float shaderMask ${v}) {\n ${h}\n }\n `),c&&(l+=`\n vec4 fx_${e.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${c}\n }\n `),f&&(l+=`\n vec4 fx_${e.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${f}\n }\n `)}));var d="";for(var u in n)d+=n[u];for(var h="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",c="\n\n ",f=0;f0?`, ${p.passParameters}`:"",g=t[p.name];g.onShaderMask&&(c+=`\n shaderMask = fx_${p.target}_onShaderMask(shaderMask ${v});\n `),g.onColorize&&(c+=`\n maskColor = fx_${p.target}_onColorize(shaderMask, maskColor, shaderColor${v});\n `),g.onEffectMask&&(h=`fx_${p.target}_onEffectMask(shaderMask, maskColor, shaderColor${v})`);var m=s[f+1];(void 0===m||t[m.name].onEffectMask)&&(c+=`\n shaderColor = ${h};\n `)}return{effects:s,uniforms:i,fragment:Ut.fragment(o,d,l,c),vertex:Ut.vertex()}}static resolveMethodDuplicate(e,t,r,n=0){var o=e+(n>0?n:"");return r[o]&&r[o]!==t?this.resolveMethodDuplicate(e,t,r,++n):o}static resolveDefaults(e,t){return{effects:Ot(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var r,n="";return null===(r=e.effects)||void 0===r||r.forEach((e=>{var r=t[e.type].getEffectKey(e.props||{});n+=`,${r}`})),`DynamicShader${n}`}}A(Ut,"z$__type__Props",void 0),A(Ut,"vertex",(()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ")),A(Ut,"fragment",((e,t,r,n)=>`\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${e}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${t}\n\n ${r}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${n}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `));class Wt extends D{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(e){return{radius:e.radius||10,$dimensions:{width:0,height:0}}}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){this.setUniform("u_radius",e.radius)}canBatchShaderProps(e,t){return e.radius===t.radius&&e.$dimensions.width===t.$dimensions.width&&e.$dimensions.height===t.$dimensions.height}}A(Wt,"z$__type__Props",void 0),A(Wt,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});var Yt=new Float32Array([1,0,0,0,1,0,0,0,1]);class Ht extends D{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){var t=Ht.resolveDefaults(e);for(var r in t)if("transform"===r)this.setUniform("u_transform",!1,t[r]);else if("scrollY"===r)this.setUniform("u_scrollY",t[r]);else if("color"===r){var n=N(t.color);this.setUniform("u_color",n)}else"size"===r?this.setUniform("u_size",t[r]):"distanceRange"===r?this.setUniform("u_distanceRange",t[r]):"debug"===r&&this.setUniform("u_debug",t[r]?1:0)}static resolveDefaults(e={}){var t,r,n,o,i,a;return{transform:null!==(t=e.transform)&&void 0!==t?t:Yt,scrollY:null!==(r=e.scrollY)&&void 0!==r?r:0,color:null!==(n=e.color)&&void 0!==n?n:4294967295,size:null!==(o=e.size)&&void 0!==o?o:16,distanceRange:null!==(i=e.distanceRange)&&void 0!==i?i:1,debug:null!==(a=e.debug)&&void 0!==a&&a}}}A(Ht,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});class jt extends _t{constructor(...e){super(...e),A(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:null!==(t=e.radius)&&void 0!==t?t:10}}}A(jt,"z$__type__Props",void 0),A(jt,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),A(jt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),A(jt,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),A(jt,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Qt extends _t{constructor(...e){super(...e),A(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Qt,"z$__type__Props",void 0),A(Qt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Qt,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),A(Qt,"onColorize","\n return color;\n ");class Kt extends _t{constructor(...e){super(...e),A(this,"name","linearGradient")}static getEffectKey(e){return`linearGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],o=e.stops||[];if(0===o.length||o.length!==n.length){for(var i=n.length,a=0,s=o;ae.map((e=>N(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),A(Kt,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),A(Kt,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${re.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class $t extends _t{constructor(...e){super(...e),A(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:null!==(t=e.amount)&&void 0!==t?t:1}}}A($t,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),A($t,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class Xt extends _t{constructor(...e){super(...e),A(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Xt,"z$__type__Props",void 0),A(Xt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Xt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),A(Xt,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),A(Xt,"onColorize","\n return color;\n ");class Gt extends _t{constructor(...e){super(...e),A(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Gt,"z$__type__Props",void 0),A(Gt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Gt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),A(Gt,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),A(Gt,"onColorize","\n return color;\n ");class Vt extends _t{constructor(...e){super(...e),A(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Vt,"z$__type__Props",void 0),A(Vt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Vt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),A(Vt,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),A(Vt,"onColorize","\n return color;\n ");class Zt extends _t{constructor(...e){super(...e),A(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}A(Zt,"z$__type__Props",void 0),A(Zt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(Zt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),A(Zt,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),A(Zt,"onColorize","\n return color;\n ");class qt extends _t{constructor(...e){super(...e),A(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,r,n,o,i;return{amplitude:null!==(t=e.amplitude)&&void 0!==t?t:.2,narrowness:null!==(r=e.narrowness)&&void 0!==r?r:4,blockiness:null!==(n=e.blockiness)&&void 0!==n?n:2,minimizer:null!==(o=e.minimizer)&&void 0!==o?o:8,time:null!==(i=e.time)&&void 0!==i?i:Date.now()}}}A(qt,"z$__type__Props",void 0),A(qt,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),A(qt,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),A(qt,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class Jt extends _t{constructor(...e){super(...e),A(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:null!==(t=e.fade)&&void 0!==t?t:10}}}A(Jt,"z$__type__Props",void 0),A(Jt,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),A(Jt,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");class er extends _t{constructor(...e){super(...e),A(this,"name","radialGradient")}static getEffectKey(e){return`radialGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n,o,i,a=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],s=e.stops||[];if(0===s.length||s.length!==a.length){for(var l=a.length,d=0,u=s;de.map((e=>N(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),A(er,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${ne.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class tr extends _t{constructor(...e){super(...e),A(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,r,n,o,i,a,s;return{width:null!==(t=e.width)&&void 0!==t?t:10,progress:null!==(r=e.progress)&&void 0!==r?r:.5,offset:null!==(n=e.offset)&&void 0!==n?n:0,range:null!==(o=e.range)&&void 0!==o?o:2*Math.PI,rounded:null!==(i=e.rounded)&&void 0!==i&&i,radius:null!==(a=e.radius)&&void 0!==a?a:1,color:null!==(s=e.color)&&void 0!==s?s:4294967295}}}A(tr,"z$__type__Props",void 0),A(tr,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>N(e),method:"uniform4fv",type:"vec4"}}),A(tr,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),A(tr,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),A(tr,"onColorize","\n return color;\n ");class rr extends _t{constructor(...e){super(...e),A(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:null!==(t=e.radius)&&void 0!==t?t:0}}}A(rr,"z$__type__Props",void 0),A(rr,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),A(rr,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),A(rr,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),A(rr,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class nr{constructor(){A(this,"shCache",new Map),A(this,"shConstructors",{}),A(this,"attachedShader",null),A(this,"effectConstructors",{}),A(this,"renderer",void 0),this.registerShaderType("DefaultShader",Mt),this.registerShaderType("DefaultShaderBatched",Dt),this.registerShaderType("RoundedRectangle",Wt),this.registerShaderType("DynamicShader",Ut),this.registerShaderType("SdfShader",Ht),this.registerEffectType("border",Qt),this.registerEffectType("borderBottom",Vt),this.registerEffectType("borderLeft",Zt),this.registerEffectType("borderRight",Xt),this.registerEffectType("borderTop",Gt),this.registerEffectType("fadeOut",Jt),this.registerEffectType("linearGradient",Kt),this.registerEffectType("radialGradient",er),this.registerEffectType("grayscale",$t),this.registerEffectType("glitch",qt),this.registerEffectType("radius",jt),this.registerEffectType("radialProgress",tr),this.registerEffectType("holePunch",rr)}registerShaderType(e,t){this.shConstructors[e]=t}registerEffectType(e,t){this.effectConstructors[e]=t}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(e,t){if(!this.renderer)throw new Error("Renderer is not been defined");var r=this.shConstructors[e];if(!r)throw new Error(`Shader type "${e}" is not registered`);if("DynamicShader"===e)return this.loadDynamicShader(t);var n=r.resolveDefaults(t),o=r.makeCacheKey(n)||r.name;if(o&&this.shCache.has(o))return{shader:this.shCache.get(o),props:n};var i=new r(this.renderer,t);return o&&this.shCache.set(o,i),{shader:i,props:n}}loadDynamicShader(e){if(!this.renderer)throw new Error("Renderer is not been defined");var t=Ut.resolveDefaults(e,this.effectConstructors),r=Ut.makeCacheKey(t,this.effectConstructors);if(r&&this.shCache.has(r))return{shader:this.shCache.get(r),props:t};var n=new Ut(this.renderer,e,this.effectConstructors);return r&&this.shCache.set(r,n),{shader:n,props:t}}useShader(e){this.attachedShader!==e&&(this.attachedShader&&this.attachedShader.detach(),e.attach(),this.attachedShader=e)}}class or{constructor(){A(this,"data",{})}reset(){this.data={}}increment(e){this.data[e]||(this.data[e]=0),this.data[e]++}getData(){return S({},this.data)}}var ir=function(){var e=b(x().mark((function e(t){var r,n;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:if(n=e.sent,-1===t.indexOf(".ktx")){e.next=8;break}return e.abrupt("return",ar(n));case 8:return e.abrupt("return",sr(n));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ar=function(){var e=b(x().mark((function e(t){var r,n,o,i,a,s,l;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=new DataView(t),n=16909060===r.getUint32(12),o=[],i={glInternalFormat:r.getUint32(28,n),pixelWidth:r.getUint32(36,n),pixelHeight:r.getUint32(40,n),numberOfMipmapLevels:r.getUint32(56,n),bytesOfKeyValueData:r.getUint32(60,n)},a=64,a+=i.bytesOfKeyValueData,s=0;s>2)*(u+3>>2)*8,f=new Uint8Array(r,i.byteOffset+l,c),a.push(f),l+=c,d>>=1,u>>=1;return e.abrupt("return",{data:{glInternalFormat:36196,mipmaps:a,width:s.pixelWidth||0,height:s.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();class lr extends O{constructor(e,t){super(e),A(this,"props",void 0),this.props=lr.resolveDefaults(t)}hasAlphaChannel(e){return-1!==e.indexOf("image/png")}getTextureData(){var e=this;return b(x().mark((function t(){var r,n,o,i,a,s,l;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props,n=r.src,o=r.premultiplyAlpha,n){t.next=3;break}return t.abrupt("return",{data:null});case 3:if(!(n instanceof ImageData)){t.next=5;break}return t.abrupt("return",{data:n,premultiplyAlpha:o});case 5:if(!/\.(ktx|pvr)$/.test(n)){t.next=7;break}return t.abrupt("return",ir(n));case 7:if(!e.txManager.imageWorkerManager){t.next=13;break}return t.next=10,e.txManager.imageWorkerManager.getImage(n,o);case 10:return t.abrupt("return",t.sent);case 13:if(!e.txManager.hasCreateImageBitmap){t.next=28;break}return t.next=16,fetch(n);case 16:return i=t.sent,t.next=19,i.blob();case 19:return a=t.sent,s=null!=o?o:e.hasAlphaChannel(a.type),t.next=23,createImageBitmap(a,{premultiplyAlpha:s?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"});case 23:return t.t0=t.sent,t.t1=s,t.abrupt("return",{data:t.t0,premultiplyAlpha:t.t1});case 28:return l=new Image,"data:"!=n.substr(0,5)&&(l.crossOrigin="Anonymous"),l.src=n,t.next=33,new Promise(((e,t)=>{l.onload=()=>e(),l.onerror=()=>t(new Error("Failed to load image"))})).catch((e=>{console.error(e)}));case 33:return t.abrupt("return",{data:l,premultiplyAlpha:null==o||o});case 34:case"end":return t.stop()}}),t)})))()}static makeCacheKey(e){var t=lr.resolveDefaults(e);return!(t.src instanceof ImageData)&&`ImageTexture,${t.src},${t.premultiplyAlpha}`}static resolveDefaults(e){var t,r;return{src:null!==(t=e.src)&&void 0!==t?t:"",premultiplyAlpha:null===(r=e.premultiplyAlpha)||void 0===r||r}}}A(lr,"z$__type__Props",void 0);class dr{constructor(e,t=0){A(this,"iterator",void 0),A(this,"peekBuffer",[]),A(this,"_lastIndex",void 0),this.iterator=e,this.iterator=e,this._lastIndex=t-1,this.peekBuffer=[]}next(){var e=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return e.done?this._lastIndex=-1:this._lastIndex++,e}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];var e=this.iterator.next();return this.peekBuffer.push(e),e}get lastIndex(){return this._lastIndex}}function ur(e,t=0){var r,n;return x().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:r=t;case 1:if(!(r=f.y1,K=E<=f.y2,$=Q&&K;(y=M.next())&&!y.done;){var X=y.value;if(e===c.length)c.push({codepointIndex:X.cluster,maxY:I,maxX:k});else if(e>c.length)throw new Error("Unexpected lineCache length");if(32===X.codepoint||10===X.codepoint?-1!==F.codepointIndex&&(F.codepointIndex=-1,j=B):-1===F.codepointIndex&&(F.codepointIndex=X.cluster,F.bufferOffset=N,F.xStart=j),X.mapped){var G=B+X.xOffset+X.width;if("none"!==h&&G>=H&&-1!==F.codepointIndex&&F.xStart>0){if(Y){M=L.shapeText(z,new dr(ur(n,F.codepointIndex),F.codepointIndex)),N=F.bufferOffset;break}M=L.shapeText(z,new dr(ur(m,0),0)),B=F.xStart,N=F.bufferOffset,h="none"}else{var V=B+X.xOffset,Z=E+X.yOffset;if($){-1===D&&(D=N);var q=p.getAtlasEntry(X.glyphId),J=q.x/p.data.common.scaleW,ee=q.y/p.data.common.scaleH,te=q.width/p.data.common.scaleW,re=q.height/p.data.common.scaleH;u[N++]=V,u[N++]=Z,u[N++]=J,u[N++]=ee,u[N++]=V+X.width,u[N++]=Z,u[N++]=J+te,u[N++]=ee,u[N++]=V,u[N++]=Z+X.height,u[N++]=J,u[N++]=ee+re,u[N++]=V+X.width,u[N++]=Z+X.height,u[N++]=J+te,u[N++]=ee+re}I=Math.max(I,Z+X.height),k=Math.max(k,V+X.width),B+=X.xAdvance}}else if(10===X.codepoint){if(Y)break;M=L.shapeText(z,new dr(ur(m,0),0)),h="none"}}-1!==D&&(P.push({bufferStart:D,bufferEnd:N}),D=-1),B=0,E+=w,e++,F.codepointIndex=-1,j=0,!v&&"both"===h&&E>f.y2||y&&y.done?W=!1:Y||(W=!1)}if("center"===o)for(var ne="none"===h?k:S,oe=0;oe"number"==typeof e?e:fr[e]||400;var vr=P((function(e,t,r,n,o){var i,a=pr(r),s=T(e);try{for(s.s();!(i=s.n()).done;){var l=i.value[t];if(l){if(1===l.size)return console.warn(`TrFontManager: Only one font face found for family: '${t}' - will be used for all weights and styles`),l.values().next().value;var d,u=new Map,h=T(l);try{for(h.s();!(d=h.n()).done;){var c=d.value,f=pr(c.descriptors.weight);if(f===a&&c.descriptors.style===n&&c.descriptors.stretch===o)return c;u.set(f,c)}}catch(v){h.e(v)}finally{h.f()}var p=`TrFontManager: No exact match: '${t} Weight: ${a} Style: ${n} Stretch: ${o}'`;if(console.error(p),400===a&&u.has(500))return u.get(500);if(500===a&&u.has(400))return u.get(400);if(a<400){for(;a>0;){if(u.has(a))return u.get(a);a-=100}a=600}for(;a<1e3;){if(u.has(a))return u.get(a);a+=100}for(a=500;a>0;){if(u.has(a))return u.get(a);a-=100}}}}catch(v){s.e(v)}finally{s.f()}}));class gr{constructor(e){A(this,"textRenderers",void 0),this.textRenderers=e}addFontFace(e){for(var t in this.textRenderers){var r=this.textRenderers[t];r&&r.isFontFaceSupported(e)&&r.addFontFace(e)}}static resolveFontFace(e,t){var r=t.fontFamily,n=t.fontWeight,o=t.fontStyle,i=t.fontStretch;return vr(e,r,n,o,i)}}var mr={x:0,y:0,width:0,height:0};class xr extends kt{constructor(e){super(e),A(this,"ssdfFontFamilies",{}),A(this,"msdfFontFamilies",{}),A(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]),A(this,"sdfShader",void 0),A(this,"rendererBounds",void 0),this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&W(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&W(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){var t=e.fontFamily;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||"$$SDF_FAILURE_TEST$$"===t}isFontFaceSupported(e){return e instanceof Y}addFontFace(e){_(e instanceof Y);var t=e.fontFamily,r="ssdf"===e.type?this.ssdfFontFamilies:"msdf"===e.type?this.msdfFontFamilies:void 0;if(r){var n=r[t];n||(n=new Set,r[t]=n),n.add(e)}else console.warn(`Invalid font face type: ${e.type}`)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new E,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){var t=e.trFontFace,r=e.textH,n=e.lineCache,o=e.debugData,i=e.forceFullLayoutCalc;if(o.updateCount++,"initialState"===e.status&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){var a=`SdfTextRenderer: Could not resolve font face for family: '${e.props.fontFamily}'`;return console.error(a),void this.setStatus(e,"failed",new Error(a))}t.texture.setRenderableOwner(e,e.isRenderable)}if(t.loaded){_(t.data,"Font face data should be loaded");var s=e.props,l=s.text,d=s.fontSize,u=s.x,h=s.y,c=s.contain,f=s.width,p=s.height,v=s.lineHeight,g=s.verticalAlign,m=s.scrollable,x=s.overflowSuffix,y=s.maxLines,b="both"===c&&m?e.props.scrollY:0,w=e.renderWindow,S=t.data.info.size,A=d/S,C=v/A;e.distanceRange=A*t.data.distanceField.distanceRange;var T=24*l.length,R=e.vertexBuffer;(!R||R.length=k.x2&&h-b+I.y1<=k.y1&&h-b+I.y2>=k.y2)return void this.setStatus(e,"loaded");w.valid=!1,this.setStatus(e,"loading")}var B=e.props,E=B.offsetY,N=B.textAlign;if(!w.valid){if(!W(k,this.rendererBounds))return;cr(w,u,h,b,v,"both"===c?k.y2-k.y1:0,k,A)}var F=function(e,t,r,n,o,i,a,s,l){var d=Math.min(Math.max(a.firstLineIdx,0),s.length),u=0;"middle"===n?u=(t-e)/2:"bottom"===n&&(u=t-e);var h=o/i+d*t+u;if(!(l&&h>=l/i))return{sdfX:0,sdfY:h,lineIndex:d}}(S,C,0,g,E,A,w,n,r);if(F){var L=e.props.letterSpacing,z=hr(F.lineIndex,F.sdfX,F.sdfY,l,N,f,p,d,v,L,R,c,n,w.sdf,t,i,m,x,y);e.bufferUploaded=!1,e.bufferNumFloats=z.bufferNumFloats,e.bufferNumQuads=z.bufferNumQuads,e.vertexBuffer=R,e.renderWindow=w,o.lastLayoutNumCharacters=z.layoutNumCharacters,o.bufferSize=R.byteLength,z.fullyProcessed&&(e.textW=z.maxX*A,e.textH=z.maxY*A),this.setStatus(e,"loaded")}else this.setStatus(e,"loaded")}else t.once("loaded",(()=>{this.scheduleUpdateState(e)}))}renderQuads(e,t,r,n,o,i){var a,s;if(e.vertexBuffer){var l=this.stage.renderer,d=e.props,u=d.fontSize,h=d.color,c=d.contain,f=d.scrollable,p=d.zIndex,v=d.debug,g="both"===c&&f?e.props.scrollY:0,m=e.textW,x=void 0===m?0:m,y=e.textH,b=void 0===y?0:y,w=e.distanceRange,S=e.vertexBuffer,A=e.bufferUploaded,C=e.trFontFace,T=e.elementBounds,R=e.webGlBuffers;if(!R){var k=l.glw,I=4*Float32Array.BYTES_PER_ELEMENT,B=k.createBuffer();_(B),e.webGlBuffers=new H([{buffer:B,attributes:{a_position:{name:"a_position",size:2,type:k.FLOAT,normalized:!1,stride:I,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:k.FLOAT,normalized:!1,stride:I,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,_(e.webGlBuffers),R=e.webGlBuffers}if(!A){var E,N,F=l.glw,z=null!==(E=null===(N=R)||void 0===N?void 0:N.getBuffer("a_textureCoordinate"))&&void 0!==E?E:null;F.arrayBufferData(z,S,F.STATIC_DRAW),e.bufferUploaded=!0}if(_(C),f&&"both"===c){_(T.valid);var M=j(T,mr);r.valid?(e.clippingRect.valid=!0,r=L(r,M,e.clippingRect)):(e.clippingRect.valid=!0,r=Q(M,e.clippingRect))}var D=new K(l.glw,l.options,R,this.sdfShader,{transform:t.data,color:$(h,n),size:u/((null===(a=C.data)||void 0===a?void 0:a.info.size)||0),scrollY:g,distanceRange:w,debug:v.sdfShaderDebug},n,r,{height:b,width:x},0,p,!1,o,i),P=null===(s=e.trFontFace)||void 0===s?void 0:s.texture;_(P);var O=this.stage.txManager.getCtxTexture(P);D.addTexture(O),D.length=e.bufferNumFloats,D.numQuads=e.bufferNumQuads,l.addRenderOp(D)}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.trFontFace)||void 0===r||r.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),null===(t=e.trFontFace)||void 0===t||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return gr.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){var t=e.props,r=t.x,n=t.contain,o=t.width,i=e.elementBounds;i.x1=r,i.x2="none"!==n?r+o:1/0}setElementBoundsY(e){var t=e.props,r=t.y,n=t.contain,o=t.height,i=e.elementBounds;i.y1=r,i.y2="both"===n?r+o:1/0}}function yr(e,t){return br.apply(this,arguments)}function br(){return(br=b(x().mark((function e(t,r){var n,o,i;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Loading core extension",t),e.next=4,Tt((()=>w.import(t)),void 0);case 4:n=e.sent,e.next=12;break;case 7:return e.prev=7,e.t0=e.catch(0),console.error(`The core extension module at '${t}' could not be loaded.`),console.error(e.t0),e.abrupt("return");case 12:if(n.default){e.next=15;break}return console.error(`The core extension module at '${t}' does not have a default export.`),e.abrupt("return");case 15:if(o=n.default,!(o.prototype instanceof X)){e.next=29;break}return i=new o,e.prev=18,e.next=21,i.run(r);case 21:e.next=27;break;case 23:e.prev=23,e.t1=e.catch(18),console.error(`The core extension at '${t}' threw an error.`),console.error(e.t1);case 27:e.next=30;break;case 29:console.error(`The core extension at '${t}' does not extend CoreExtension.`);case 30:case"end":return e.stop()}}),e,null,[[0,7],[18,23]])})))).apply(this,arguments)}function wr(e){for(var t={boolean:!0,string:!0,number:!0},r=Object.keys(e),n=0;n2048&&(console.warn(`Custom Data value for ${o} is too long, it will be truncated to 2048 characters`),e[o]=i.substring(0,2048)),t[a]||(console.warn(`Custom Data value for ${o} is not a boolean, string, or number, it will be ignored`),delete e[o])}}return e}class Sr extends E{constructor(e,t,r){var n,o,i,a;super(),A(this,"root",null),A(this,"driver",void 0),A(this,"canvas",void 0),A(this,"settings",void 0),A(this,"inspector",null),A(this,"nodes",new Map),A(this,"nextTextureId",1),A(this,"textureTracker",void 0);var s={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:null!==(n=e.clearColor)&&void 0!==n?n:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:null!==(o=e.experimental_FinalizationRegistryTextureUsageTracker)&&void 0!==o&&o,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:void 0!==e.numImageWorkers?e.numImageWorkers:2,enableContextSpy:null!==(i=e.enableContextSpy)&&void 0!==i&&i,enableInspector:null!==(a=e.enableInspector)&&void 0!==a&&a};this.settings=s;var l=s.appWidth,d=s.appHeight,u=s.deviceLogicalPixelRatio,h=s.devicePhysicalPixelRatio,c=s.enableInspector,f=e=>{this.driver.releaseTexture(e)},p=s.experimental_FinalizationRegistryTextureUsageTracker&&"function"==typeof FinalizationRegistry;this.textureTracker=p?new bt(f):new yt(f,this.settings.textureCleanupOptions);var v=l*u,g=d*u;this.driver=r;var m,x=document.createElement("canvas");if(this.canvas=x,x.width=v*h,x.height=g*h,x.style.width=`${v}px`,x.style.height=`${g}px`,!(m="string"==typeof t?document.getElementById(t):t))throw new Error("Could not find target element");r.onCreateNode=e=>{this.nodes.set(e.id,e)},r.onBeforeDestroyNode=e=>{this.nodes.delete(e.id)},r.onFpsUpdate=e=>{this.emit("fpsUpdate",e)},r.onFrameTick=e=>{this.emit("frameTick",e)},r.onIdle=()=>{this.emit("idle")},m.appendChild(x),c&&!R()&&(this.inspector=new Ct(x,s))}init(){var e=this;return b(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.driver.init(e,e.settings,e.canvas);case 2:e.root=e.driver.getRootNode();case 3:case"end":return t.stop()}}),t)})))()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var t,r,n,o,i,a,s,l,d,u,h,c,f,p,v,g,m,x,y,b=null!==(t=e.fontSize)&&void 0!==t?t:16,w=S(S({},this.resolveNodeDefaults(e)),{},{text:null!==(r=e.text)&&void 0!==r?r:"",textRendererOverride:null!==(n=e.textRendererOverride)&&void 0!==n?n:null,fontSize:b,fontFamily:null!==(o=e.fontFamily)&&void 0!==o?o:"sans-serif",fontStyle:null!==(i=e.fontStyle)&&void 0!==i?i:"normal",fontWeight:null!==(a=e.fontWeight)&&void 0!==a?a:"normal",fontStretch:null!==(s=e.fontStretch)&&void 0!==s?s:"normal",textAlign:null!==(l=e.textAlign)&&void 0!==l?l:"left",contain:null!==(d=e.contain)&&void 0!==d?d:"none",scrollable:null!==(u=e.scrollable)&&void 0!==u&&u,scrollY:null!==(h=e.scrollY)&&void 0!==h?h:0,offsetY:null!==(c=e.offsetY)&&void 0!==c?c:0,letterSpacing:null!==(f=e.letterSpacing)&&void 0!==f?f:0,lineHeight:null!==(p=e.lineHeight)&&void 0!==p?p:b,maxLines:null!==(v=e.maxLines)&&void 0!==v?v:0,textBaseline:null!==(g=e.textBaseline)&&void 0!==g?g:"alphabetic",verticalAlign:null!==(m=e.verticalAlign)&&void 0!==m?m:"top",overflowSuffix:null!==(x=e.overflowSuffix)&&void 0!==x?x:"...",debug:null!==(y=e.debug)&&void 0!==y?y:{}});return this.inspector?this.inspector.createTextNode(this.driver,w):this.driver.createTextNode(w)}resolveNodeDefaults(e){var t,r,n,o,i,a,s,l,d,u,h,c,f,p,v,g,m,x,y,b,w,S,A,C,T,_,R,k,I,B,E,N,F,L,z,M,D,P,O,U,W,Y,H,j,Q,K,$,X,G,V,Z,q,J=null!==(t=e.color)&&void 0!==t?t:4294967295,ee=null!==(r=null!==(n=null!==(o=e.colorTl)&&void 0!==o?o:e.colorTop)&&void 0!==n?n:e.colorLeft)&&void 0!==r?r:J,te=null!==(i=null!==(a=null!==(s=e.colorTr)&&void 0!==s?s:e.colorTop)&&void 0!==a?a:e.colorRight)&&void 0!==i?i:J,re=null!==(l=null!==(d=null!==(u=e.colorBl)&&void 0!==u?u:e.colorBottom)&&void 0!==d?d:e.colorLeft)&&void 0!==l?l:J,ne=null!==(h=null!==(c=null!==(f=e.colorBr)&&void 0!==f?f:e.colorBottom)&&void 0!==c?c:e.colorRight)&&void 0!==h?h:J,oe=wr(null!==(p=e.data)&&void 0!==p?p:{}),ie=null!==(v=null!==(g=null===(m=e.parent)||void 0===m?void 0:m.rtt)&&void 0!==g?g:null===(x=e.parent)||void 0===x?void 0:x.parentHasRenderTexture)&&void 0!==v&&v;return{x:null!==(y=e.x)&&void 0!==y?y:0,y:null!==(b=e.y)&&void 0!==b?b:0,width:null!==(w=e.width)&&void 0!==w?w:0,height:null!==(S=e.height)&&void 0!==S?S:0,alpha:null!==(A=e.alpha)&&void 0!==A?A:1,autosize:null!==(C=e.autosize)&&void 0!==C&&C,clipping:null!==(T=e.clipping)&&void 0!==T&&T,color:J,colorTop:null!==(_=e.colorTop)&&void 0!==_?_:J,colorBottom:null!==(R=e.colorBottom)&&void 0!==R?R:J,colorLeft:null!==(k=e.colorLeft)&&void 0!==k?k:J,colorRight:null!==(I=e.colorRight)&&void 0!==I?I:J,colorBl:re,colorBr:ne,colorTl:ee,colorTr:te,zIndex:null!==(B=e.zIndex)&&void 0!==B?B:0,zIndexLocked:null!==(E=e.zIndexLocked)&&void 0!==E?E:0,parent:null!==(N=e.parent)&&void 0!==N?N:null,texture:null!==(F=e.texture)&&void 0!==F?F:null,shader:null!==(L=e.shader)&&void 0!==L?L:null,src:null!==(z=e.src)&&void 0!==z?z:"",scale:null!==(M=e.scale)&&void 0!==M?M:null,scaleX:null!==(D=null!==(P=e.scaleX)&&void 0!==P?P:e.scale)&&void 0!==D?D:1,scaleY:null!==(O=null!==(U=e.scaleY)&&void 0!==U?U:e.scale)&&void 0!==O?O:1,mount:null!==(W=e.mount)&&void 0!==W?W:0,mountX:null!==(Y=null!==(H=e.mountX)&&void 0!==H?H:e.mount)&&void 0!==Y?Y:0,mountY:null!==(j=null!==(Q=e.mountY)&&void 0!==Q?Q:e.mount)&&void 0!==j?j:0,pivot:null!==(K=e.pivot)&&void 0!==K?K:.5,pivotX:null!==($=null!==(X=e.pivotX)&&void 0!==X?X:e.pivot)&&void 0!==$?$:.5,pivotY:null!==(G=null!==(V=e.pivotY)&&void 0!==V?V:e.pivot)&&void 0!==G?G:.5,rotation:null!==(Z=e.rotation)&&void 0!==Z?Z:0,rtt:null!==(q=e.rtt)&&void 0!==q&&q,parentHasRenderTexture:ie,data:oe}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,r){var n=this.nextTextureId++,o={descType:"texture",txType:e,props:t,options:S(S({},r),{},{id:n})};return this.textureTracker.registerTexture(o),o}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class Ar extends E{constructor(e,t,r){super(),A(this,"node",void 0),A(this,"props",void 0),A(this,"settings",void 0),A(this,"propStartValues",{}),A(this,"restoreValues",{}),A(this,"progress",0),A(this,"delayFor",0),A(this,"timingFunction",void 0),A(this,"propsList",void 0),this.node=e,this.props=t,this.settings=r,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach((t=>{this.propStartValues[t]=e[t]})),this.timingFunction=e=>e,r.easing&&"string"==typeof r.easing&&(this.timingFunction=G(r.easing)),this.delayFor=r.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach((e=>{this.node[e]=this.propStartValues[e]}))}reverse(){this.progress=0,Object.keys(this.props).forEach((e=>{var t=this.props[e],r=this.propStartValues[e];this.props[e]=r,this.propStartValues[e]=t})),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,r){return(this.timingFunction(e)||e)*(r-t)+t}update(e){var t=this.settings,r=t.duration,n=t.loop,o=t.easing,i=t.stopMethod;if(r)if(this.delayFor>0)this.delayFor-=e;else if(this.delayFor<=0&&0===this.progress&&this.emit("start",{}),this.progress+=e/r,this.progress>1&&(this.progress=n?0:1,i))this.emit("finished",{});else{for(var a=0;a{this.startedResolve=e})))}makeStoppedPromise(){null===this.stoppedResolve&&(this.stoppedPromise=new Promise((e=>{this.stoppedResolve=e})))}started(){_(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){_(this.stoppedResolve);var e=this.animation.settings,t=e.loop;if("reverse"===e.stopMethod)return this.animation.reverse(),void this.start();this.stoppedResolve(),this.stoppedResolve=null,t||this.manager.unregisterAnimation(this.animation)}}class Tr{constructor(e){A(this,"data",void 0),e?(this.data=new Float32Array(9),this.data[0]=e[0],this.data[3]=e[3],this.data[6]=e[6],this.data[1]=e[1],this.data[4]=e[4],this.data[7]=e[7],this.data[2]=e[2],this.data[5]=e[5],this.data[8]=e[8]):this.data=new Float32Array(9)}static get temp(){return Rr}static multiply(e,t,r){var n=e.data[0]*t.data[0]+e.data[3]*t.data[1]+e.data[6]*t.data[2],o=e.data[0]*t.data[3]+e.data[3]*t.data[4]+e.data[6]*t.data[5],i=e.data[0]*t.data[6]+e.data[3]*t.data[7]+e.data[6]*t.data[8],a=e.data[1]*t.data[0]+e.data[4]*t.data[1]+e.data[7]*t.data[2],s=e.data[1]*t.data[3]+e.data[4]*t.data[4]+e.data[7]*t.data[5],l=e.data[1]*t.data[6]+e.data[4]*t.data[7]+e.data[7]*t.data[8],d=e.data[2]*t.data[0]+e.data[5]*t.data[1]+e.data[8]*t.data[2],u=e.data[2]*t.data[3]+e.data[5]*t.data[4]+e.data[8]*t.data[5],h=e.data[2]*t.data[6]+e.data[5]*t.data[7]+e.data[8]*t.data[8];return r||(r=new Tr),r.data[0]=n,r.data[3]=o,r.data[6]=i,r.data[1]=a,r.data[4]=s,r.data[7]=l,r.data[2]=d,r.data[5]=u,r.data[8]=h,r}static identity(e){return e||(e=new Tr),e.data[0]=1,e.data[3]=0,e.data[6]=0,e.data[1]=0,e.data[4]=1,e.data[7]=0,e.data[2]=0,e.data[5]=0,e.data[8]=1,e}static translate(e,t,r){return r||(r=new Tr),r.data[0]=1,r.data[3]=0,r.data[6]=e,r.data[1]=0,r.data[4]=1,r.data[7]=t,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static scale(e,t,r){return r||(r=new Tr),r.data[0]=e,r.data[3]=0,r.data[6]=0,r.data[1]=0,r.data[4]=t,r.data[7]=0,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static rotate(e,t){var r=Math.cos(e),n=Math.sin(e);return t||(t=new Tr),t.data[0]=r,t.data[3]=-n,t.data[6]=0,t.data[1]=n,t.data[4]=r,t.data[7]=0,t.data[2]=0,t.data[5]=0,t.data[8]=1,t}static copy(e,t,r){return t||(t=new Tr),t.data[0]=e.data[0],t.data[1]=e.data[1],t.data[2]=e.data[2],t.data[3]=e.data[3],t.data[4]=e.data[4],t.data[5]=e.data[5],t.data[6]=e.data[6],t.data[7]=e.data[7],t.data[8]=e.data[8],t}translate(e,t){return this.data[6]=this.data[0]*e+this.data[3]*t+this.data[6],this.data[7]=this.data[1]*e+this.data[4]*t+this.data[7],this}scale(e,t){return this.data[0]=this.data[0]*e,this.data[3]=this.data[3]*t,this.data[1]=this.data[1]*e,this.data[4]=this.data[4]*t,this}rotate(e){if(0===e||!(e%Math.PI*2))return this;var t=Math.cos(e),r=Math.sin(e),n=this.data[0]*t+this.data[3]*r,o=this.data[3]*t-this.data[0]*r,i=this.data[1]*t+this.data[4]*r,a=this.data[4]*t-this.data[1]*r;return this.data[0]=n,this.data[3]=o,this.data[1]=i,this.data[4]=a,this}multiply(e){return Tr.multiply(this,e,this)}get tx(){return this.data[6]}get ty(){return this.data[7]}get ta(){return this.data[0]}get tb(){return this.data[3]}get tc(){return this.data[1]}get td(){return this.data[4]}transformPoint(e,t){return[this.data[0]*e+this.data[3]*t+this.data[6],this.data[1]*e+this.data[4]*t+this.data[1]]}}var _r,Rr=new Tr;class kr{constructor(e){A(this,"data",void 0),this.data=new Float32Array(8),e&&(this.data[0]=e[0],this.data[2]=e[2],this.data[4]=e[4],this.data[6]=e[6],this.data[1]=e[1],this.data[3]=e[3],this.data[5]=e[5],this.data[7]=e[7])}static translate(e,t,r,n,o,i,a,s,l){return l||(l=new kr),l.data[0]=e,l.data[2]=r,l.data[4]=o,l.data[6]=a,l.data[1]=t,l.data[3]=n,l.data[5]=i,l.data[7]=s,l}get x1(){return this.data[0]}get x2(){return this.data[2]}get x3(){return this.data[4]}get x4(){return this.data[6]}get y1(){return this.data[1]}get y2(){return this.data[3]}get y3(){return this.data[5]}get y4(){return this.data[7]}}!function(e){e[e.Init=0]="Init",e[e.OutOfBounds=2]="OutOfBounds",e[e.InBounds=4]="InBounds",e[e.InViewport=8]="InViewport"}(_r||(_r={}));var Ir,Br=new Map;Br.set(_r.Init,"init"),Br.set(_r.OutOfBounds,"outOfBounds"),Br.set(_r.InBounds,"inBounds"),Br.set(_r.InViewport,"inViewport"),function(e){e[e.Children=1]="Children",e[e.ScaleRotate=2]="ScaleRotate",e[e.Local=4]="Local",e[e.Global=8]="Global",e[e.Clipping=16]="Clipping",e[e.CalculatedZIndex=32]="CalculatedZIndex",e[e.ZIndexSortedChildren=64]="ZIndexSortedChildren",e[e.PremultipliedColors=128]="PremultipliedColors",e[e.WorldAlpha=256]="WorldAlpha",e[e.RenderState=512]="RenderState",e[e.IsRenderable=1024]="IsRenderable",e[e.None=0]="None",e[e.All=2047]="All"}(Ir||(Ir={}));class Er extends E{constructor(e,t){super(),A(this,"stage",void 0),A(this,"children",[]),A(this,"props",void 0),A(this,"updateType",Ir.All),A(this,"globalTransform",void 0),A(this,"scaleRotateTransform",void 0),A(this,"localTransform",void 0),A(this,"renderCoords",void 0),A(this,"renderBound",void 0),A(this,"strictBound",void 0),A(this,"preloadBound",void 0),A(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1}),A(this,"isRenderable",!1),A(this,"renderState",_r.Init),A(this,"worldAlpha",1),A(this,"premultipliedColorTl",0),A(this,"premultipliedColorTr",0),A(this,"premultipliedColorBl",0),A(this,"premultipliedColorBr",0),A(this,"calcZIndex",0),A(this,"hasRTTupdates",!1),A(this,"onTextureLoaded",((e,t)=>{this.autosizeNode(t),this.parentHasRenderTexture&&this.setRTTUpdates(1),this.emit("loaded",{type:"texture",dimensions:t}),queueMicrotask((()=>{this.stage.requestRender()}))})),A(this,"onTextureFailed",((e,t)=>{this.emit("failed",{type:"texture",error:t})})),A(this,"onTextureFreed",(e=>{this.emit("freed",{type:"texture"})})),this.stage=e,this.props=S(S({},t),{},{parent:null,parentHasRenderTexture:!1}),this.parent=t.parent,this.rtt=t.rtt,this.updateScaleRotateTransform()}loadTexture(e,t,r=null){this.props.texture&&this.unloadTexture();var n=this.stage.txManager.loadTexture(e,t,r);this.props.texture=n,this.props.textureOptions=r,this.setUpdateType(Ir.IsRenderable),queueMicrotask((()=>{"loaded"===n.state?this.onTextureLoaded(n,n.dimensions):"failed"===n.state?this.onTextureFailed(n,n.error):"freed"===n.state&&this.onTextureFreed(n),n.on("loaded",this.onTextureLoaded),n.on("failed",this.onTextureFailed),n.on("freed",this.onTextureFreed)}))}unloadTexture(){if(this.props.texture){var e=this.props.texture;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(Ir.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){var r=this.stage.renderer.getShaderManager();_(r);var n=r.loadShader(e,t),o=n.shader,i=n.props;this.props.shader=o,this.props.shaderProps=i,this.setUpdateType(Ir.IsRenderable)}setUpdateType(e){this.updateType|=e;var t=this.props.parent;!t||t.updateType&Ir.Children||t.setUpdateType(Ir.Children),this.parentHasRenderTexture&&this.setRTTUpdates(e)}sortChildren(){this.children.sort(((e,t)=>e.calcZIndex-t.calcZIndex))}updateScaleRotateTransform(){this.scaleRotateTransform=Tr.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){_(this.scaleRotateTransform);var e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,r=this.props.mountX*this.props.width,n=this.props.mountY*this.props.height;this.localTransform=Tr.translate(e-r+this.props.x,t-n+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(Ir.Global)}update(e,t){this.updateType&Ir.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(Ir.Local)),this.updateType&Ir.Local&&(this.updateLocalTransform(),this.setUpdateType(Ir.Global));var r,n=this.props.parent,o=Ir.None;this.updateType&Ir.Global&&(_(this.localTransform),this.globalTransform=Tr.copy((null==n?void 0:n.globalTransform)||this.localTransform,this.globalTransform),this.parentHasRenderTexture&&null!==(r=this.props.parent)&&void 0!==r&&r.rtt&&(this.globalTransform=Tr.identity()),n&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(Ir.Clipping|Ir.RenderState|Ir.Children),o|=Ir.Global);this.updateType&Ir.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(Ir.Children),o|=Ir.Clipping),this.updateType&Ir.WorldAlpha&&(this.worldAlpha=n?n.worldAlpha*this.props.alpha:this.props.alpha,this.setUpdateType(Ir.Children|Ir.PremultipliedColors|Ir.IsRenderable),o|=Ir.WorldAlpha),this.updateType&Ir.PremultipliedColors&&(this.premultipliedColorTl=M(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=M(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=M(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=M(this.props.colorBr,this.worldAlpha,!0))),this.updateType&Ir.RenderState&&(this.updateRenderState(t),this.setUpdateType(Ir.IsRenderable)),this.updateType&Ir.IsRenderable&&this.updateIsRenderable(),n&&this.updateType&Ir.CalculatedZIndex&&(this.calculateZIndex(),n.setUpdateType(Ir.ZIndexSortedChildren)),this.updateType&Ir.Children&&this.children.length&&!this.rtt&&this.children.forEach((t=>{t.setUpdateType(o),0!==t.updateType&&t.update(e,this.clippingRect)})),this.updateType&Ir.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return!!this.props.texture||!(!this.props.width||!this.props.height)&&(!!this.props.shader||(!!this.props.clipping||(0!==this.props.color||(0!==this.props.colorTop||(0!==this.props.colorBottom||(0!==this.props.colorLeft||(0!==this.props.colorRight||(0!==this.props.colorTl||(0!==this.props.colorTr||(0!==this.props.colorBl||0!==this.props.colorBr))))))))))}checkRenderBounds(e){_(this.renderBound);var t=e.width||this.stage.root.width,r=e.height||this.stage.root.height;this.strictBound=B(e.x,e.y,e.x+t,e.y+r,this.strictBound);var n=this.stage.boundsMargin;return this.preloadBound=B(e.x-n[3],e.y-n[0],e.x+t+n[1],e.y+r+n[2],this.preloadBound),Z(this.renderBound,this.strictBound)?_r.InViewport:Z(this.renderBound,this.preloadBound)?_r.InBounds:_r.OutOfBounds}updateRenderState(e){var t=this.checkRenderBounds(e);if(t!==this.renderState){var r=this.renderState;this.renderState=t,r===_r.InViewport&&this.emit("outOfViewport",{previous:r,current:t}),(r<_r.InBounds&&t===_r.InViewport||r>_r.InBounds&&t===_r.OutOfBounds)&&(this.emit(Br.get(_r.InBounds),{previous:r,current:t}),r=_r.InBounds);var n=Br.get(t);_(n),this.emit(n,{previous:r,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(_r[e]))}updateIsRenderable(){var e;e=!(0===this.worldAlpha||!this.checkRenderProps())&&this.renderState>_r.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;null===(t=this.props.texture)||void 0===t||t.setRenderableOwner(this,e)}calculateRenderCoords(){var e=this.width,t=this.height,r=this.globalTransform;_(r);var n=r.tx,o=r.ty,i=r.ta,a=r.tb,s=r.tc,l=r.td;if(0===a&&0===s){var d=n,u=n+e*i,h=o,c=o+t*l;this.renderCoords=kr.translate(d,h,u,h,u,c,d,c,this.renderCoords)}else this.renderCoords=kr.translate(n,o,n+e*i,o+e*s,n+e*i+t*a,o+e*s+t*l,n+t*a,o+t*l,this.renderCoords)}updateBoundingRect(){var e=this.renderCoords,t=this.globalTransform;_(t),_(e);var r=t.tb,n=t.tc,o=e.x1,i=e.y1,a=e.x3,s=e.y3;if(0===r||0===n)this.renderBound=B(o,i,a,s,this.renderBound);else{var l=e.x2,d=e.x4,u=e.y2,h=e.y4;this.renderBound=B(Math.min(o,l,a,d),Math.min(i,u,s,h),Math.max(o,l,a,d),Math.max(i,u,s,h),this.renderBound)}}calculateClippingRect(e){_(this.globalTransform);var t=this.clippingRect,r=this.props,n=this.globalTransform,o=r.clipping,i=0!==n.tb||0!==n.tc;o&&!i?(t.x=n.tx,t.y=n.ty,t.width=this.width*n.ta,t.height=this.height*n.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?L(e,t,t):e.valid&&(Q(e,t),t.valid=!0)}calculateZIndex(){var e,t,r=this.props,n=r.zIndex||0,o=(null===(e=r.parent)||void 0===e?void 0:e.zIndex)||0,i=n;null!==(t=r.parent)&&void 0!==t&&t.zIndexLocked&&(i=n{e.setUpdateType(Ir.CalculatedZIndex)}))}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(Ir.CalculatedZIndex|Ir.Children),this.children.forEach((e=>{e.setUpdateType(Ir.CalculatedZIndex)}))}get parent(){return this.props.parent}set parent(e){var t=this.props.parent;if(t!==e){if(this.props.parent=e,t){var r=t.children.indexOf(this);_(-1!==r,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(r,1),t.setUpdateType(Ir.Children|Ir.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(Ir.All),e.setUpdateType(Ir.Children|Ir.ZIndexSortedChildren),(e.rtt||e.parentHasRenderTexture)&&this.setRTTUpdates(Ir.All)),this.parentHasRenderTexture=(null==e?void 0:e.rtt)||(null==e?void 0:e.parentHasRenderTexture),this.updateScaleRotateTransform()}}get rtt(){return this.props.rtt}set rtt(e){var t;e&&(this.props.rtt=!0,this.hasRTTupdates=!0,null===(t=this.stage.renderer)||void 0===t||t.renderToTexture(this))}set parentHasRenderTexture(e){this.props.parentHasRenderTexture=!!e}get parentHasRenderTexture(){return this.props.parentHasRenderTexture}get framebufferDimensions(){var e;return this.parentHasRenderTexture&&!this.rtt?null===(e=this.parent)||void 0===e?void 0:e.framebufferDimensions:{width:this.width,height:this.height}}get parentRenderTexture(){for(var e=this.parent;e;){if(e.rtt)return e;e=e.parent}return null}get texture(){return this.props.texture}setRTTUpdates(e){var t;this.hasRTTupdates=!0,null===(t=this.parent)||void 0===t||t.setRTTUpdates(e)}}var Nr=1;function Fr(){return Nr++}class Lr extends E{constructor(e,t,r,n){var o;super(),A(this,"rendererMain",void 0),A(this,"stage",void 0),A(this,"id",void 0),A(this,"coreNode",void 0),A(this,"_children",[]),A(this,"_src",""),A(this,"_parent",null),A(this,"_texture",null),A(this,"_shader",null),A(this,"_data",{}),A(this,"onTextureLoaded",((e,t)=>{this.emit("loaded",t)})),A(this,"onTextureFailed",((e,t)=>{this.emit("failed",t)})),A(this,"onTextureFreed",((e,t)=>{this.emit("freed",t)})),A(this,"onOutOfBounds",((e,t)=>{this.emit("outOfBounds",t)})),A(this,"onInBounds",((e,t)=>{this.emit("inBounds",t)})),A(this,"onOutOfViewport",((e,t)=>{this.emit("outOfViewport",t)})),A(this,"onInViewport",((e,t)=>{this.emit("inViewport",t)})),this.rendererMain=t,this.stage=r,this.id=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:Fr(),this.coreNode=n||new Er(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null,rtt:e.rtt,parentHasRenderTexture:e.parentHasRenderTexture}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this.rtt=e.rtt,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){null!==e&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var t,r=this._parent;if(this._parent=e,this.coreNode.parent=null!==(t=null==e?void 0:e.coreNode)&&void 0!==t?t:null,r){var n=r.children.indexOf(this);_(-1!==n,"MainOnlyNode.parent: Node not found in old parent's children!"),r.children.splice(n,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.texture=e?this.rendererMain.createTexture("ImageTexture",{src:e}):null)}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get rtt(){return this.coreNode.rtt}set rtt(e){e&&(this.texture=this.rendererMain.createTexture("RenderTexture",{width:this.width,height:this.height},{preload:!0,flipY:!0})),this.coreNode.rtt=e}get parentHasRenderTexture(){return this.coreNode.parentHasRenderTexture}set parentHasRenderTexture(e){this.coreNode.parentHasRenderTexture=e}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=wr(e)}destroy(){this.emit("beforeDestroy",{});for(var e=this.children[0];e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){var r=new Ar(this.coreNode,e,t);return new Cr(this.stage.animationManager,r)}}class zr{constructor(){A(this,"activeAnimations",new Set)}registerAnimation(e){this.activeAnimations.add(e)}unregisterAnimation(e){this.activeAnimations.delete(e)}update(e){this.activeAnimations.forEach((t=>{t.update(e)}))}}class Mr{constructor(e){A(this,"imageWorkersEnabled",!0),A(this,"messageManager",{}),A(this,"workers",[]),A(this,"workerIndex",0),this.workers=this.createWorkers(e),this.workers.forEach((e=>{e.onmessage=this.handleMessage.bind(this)}))}handleMessage(e){var t=e.data,r=t.src,n=t.data,o=t.error,i=this.messageManager[r];if(i){var a=C(i,2),s=a[0],l=a[1];delete this.messageManager[r],o?l(new Error(o)):s(n)}}createWorkers(e=1){for(var t=new Blob(["\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ".replace('"use strict";',"")],{type:"application/javascript"}),r=(self.URL?URL:webkitURL).createObjectURL(t),n=[],o=0;o{try{if(this.workers){var o=this.convertUrlToAbsolute(e);this.messageManager[o]=[r,n],this.getNextWorker().postMessage({src:o,premultiplyAlpha:t})}}catch(i){n(i)}}))}}class Dr extends O{constructor(e,t){super(e),A(this,"props",void 0),this.props=Dr.resolveDefaults(t)}getTextureData(){var e=this;return b(x().mark((function t(){var r,n,o,i,a,s,l;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=e.props,n=r.width,o=r.height,i=n*o*4,a=new Uint8ClampedArray(i),s=0;s{})}setTextureMemUse(e,t){this.textures.has(e)&&(this.memUsed-=this.textures.get(e)),0!==t?(this.memUsed+=t,this.textures.set(e,t),this.memUsed>this.threshold&&this.gc()):this.textures.delete(e)}gc(){this.textures.forEach(((e,t)=>{t.renderable||t.free()}))}}var Ur,Wr;class Yr extends E{constructor(e){super(),A(this,"options",void 0),A(this,"animationManager",void 0),A(this,"txManager",void 0),A(this,"txMemManager",void 0),A(this,"fontManager",void 0),A(this,"textRenderers",void 0),A(this,"shManager",void 0),A(this,"renderer",void 0),A(this,"root",void 0),A(this,"boundsMargin",void 0),A(this,"deltaTime",0),A(this,"lastFrameTime",0),A(this,"currentFrameTime",0),A(this,"fpsNumFrames",0),A(this,"fpsElapsedTime",0),A(this,"renderRequested",!1),A(this,"contextSpy",null),this.options=e;var t=e.canvas,r=e.clearColor,n=e.rootId,o=e.debug,i=e.appWidth,a=e.appHeight,s=e.boundsMargin,l=e.enableContextSpy,d=e.numImageWorkers,u=e.txMemByteThreshold;this.txManager=new Pr(d),this.txMemManager=new Or(u),this.shManager=new nr,this.animationManager=new zr,this.contextSpy=l?new or:null;var h=[0,0,0,0];s&&(h=Array.isArray(s)?s:[s,s,s,s]),this.boundsMargin=h,null!=o&&o.monitorTextureCache&&setInterval((()=>{_(this.txManager);var e=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",e.idCacheSize),console.log("Texture Key Cache Size: ",e.keyCacheSize)}),1e3),this.renderer=new te({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:null!=r?r:4278190080,bufferMemory:2e6,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new zt(this),sdf:new xr(this)},this.fontManager=new gr(this.textRenderers);var c,f,p,v=new Er(this,{id:n,x:0,y:0,width:i,height:a,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null,rtt:!1});this.root=v,c=this,f=!1,p=()=>{if(c.updateAnimations(),!c.hasSceneUpdates())return c.calculateFps(),setTimeout(p,16.666666666666668),void(f||(c.emit("idle"),f=!0));f=!1,c.drawFrame(),requestAnimationFrame(p)},requestAnimationFrame(p)}updateAnimations(){var e=this.animationManager;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=performance?performance.now():Date.now(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){var e=this.renderer,t=this.renderRequested;0!==this.root.updateType&&this.root.update(this.deltaTime,this.root.clippingRect),null==e||e.reset(),e.rttNodes.length>0&&e.renderRTTNodes(),this.addQuads(this.root),null==e||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var e=this.options.fpsUpdateInterval;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){var t,r,n,o=Math.round(1e3*this.fpsNumFrames/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:o,contextSpyData:null!==(t=null===(r=this.contextSpy)||void 0===r?void 0:r.getData())&&void 0!==t?t:null}),null===(n=this.contextSpy)||void 0===n||n.reset()}}addQuads(e){_(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(var t=0;t{var e=this.contain,t=this.trState.props.width,r=this.trState.props.height,n=this.trState.textW||0,o=this.trState.textH||0;"both"===e?(this.props.width=t,this.props.height=r):"width"===e?(this.props.width=t,this.props.height=o):"none"===e&&(this.props.width=n,this.props.height=o),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})})),A(this,"onTextFailed",((e,t)=>{this.emit("failed",{type:"text",error:t})})),this._textRendererOverride=t.textRendererOverride;var r=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix}),n=r.resolvedTextRenderer,o=r.textRendererState;this.textRenderer=n,this.trState=o}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),"none"===this.contain&&this.setUpdateType(Ir.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),"both"!==this.contain&&this.setUpdateType(Ir.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);var t=this.resolveTextRendererAndState(this.trState.props),r=t.resolvedTextRenderer,n=t.textRendererState;this.textRenderer=r,this.trState=n}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),_(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return""!==this.trState.props.text||super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){var t,r;if(_(this.globalTransform),this.parentHasRenderTexture){if(!e.renderToTextureActive)return;if(this.parentRenderTexture!==e.activeRttNode)return}this.parentHasRenderTexture&&null!==(t=this.props.parent)&&void 0!==t&&t.rtt&&(this.globalTransform=Tr.identity(),this.globalTransform.multiply(null!==(r=this.localTransform)&&void 0!==r?r:Tr.identity()));_(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha,this.parentHasRenderTexture,this.framebufferDimensions)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){var t=this.stage.resolveTextRenderer(e,this._textRendererOverride),r=t.createState(e);return r.emitter.on("loaded",this.onTextLoaded),r.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(r),{resolvedTextRenderer:t,textRendererState:r}}}class jr extends Lr{constructor(e,t,r){super(e,t,r,new Hr(r,{id:Fr(),x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStretch:e.fontStretch,fontStyle:e.fontStyle,contain:e.contain,scrollable:e.scrollable,letterSpacing:e.letterSpacing,textAlign:e.textAlign,scrollY:e.scrollY,offsetY:e.offsetY,textRendererOverride:e.textRendererOverride,lineHeight:e.lineHeight,maxLines:e.maxLines,textBaseline:e.textBaseline,verticalAlign:e.verticalAlign,overflowSuffix:e.overflowSuffix,debug:e.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null,rtt:!1,parentHasRenderTexture:!1}))}get text(){return this.coreNode.text}set text(e){this.coreNode.text=e}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(e){this.coreNode.textRendererOverride=e}get fontSize(){return this.coreNode.fontSize}set fontSize(e){this.coreNode.fontSize=e}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(e){this.coreNode.fontFamily=e}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(e){this.coreNode.fontWeight=e}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(e){this.coreNode.fontStretch=e}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(e){this.coreNode.fontStyle=e}get textAlign(){return this.coreNode.textAlign}set textAlign(e){this.coreNode.textAlign=e}get contain(){return this.coreNode.contain}set contain(e){this.coreNode.contain=e}get scrollable(){return this.coreNode.scrollable}set scrollable(e){this.coreNode.scrollable=e}get scrollY(){return this.coreNode.scrollY}set scrollY(e){this.coreNode.scrollY=e}get offsetY(){return this.coreNode.offsetY}set offsetY(e){this.coreNode.offsetY=e}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(e){this.coreNode.letterSpacing=e}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(e){e&&(this.coreNode.lineHeight=e)}get maxLines(){return this.coreNode.maxLines}set maxLines(e){e&&(this.coreNode.maxLines=e)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(e){e&&(this.coreNode.textBaseline=e)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(e){e&&(this.coreNode.verticalAlign=e)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(e){e&&(this.coreNode.overflowSuffix=e)}get debug(){return this.coreNode.debug}set debug(e){this.coreNode.debug=e}}class Qr{constructor(){A(this,"root",null),A(this,"stage",null),A(this,"rendererMain",null)}init(e,t,r){var n=this;return b(x().mark((function o(){var i;return x().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n.stage=new Yr({rootId:Fr(),appWidth:t.appWidth,appHeight:t.appHeight,txMemByteThreshold:t.txMemByteThreshold,boundsMargin:t.boundsMargin,deviceLogicalPixelRatio:t.deviceLogicalPixelRatio,devicePhysicalPixelRatio:t.devicePhysicalPixelRatio,clearColor:t.clearColor,canvas:r,fpsUpdateInterval:t.fpsUpdateInterval,enableContextSpy:t.enableContextSpy,numImageWorkers:t.numImageWorkers,debug:{monitorTextureCache:!1}}),n.rendererMain=e,_(n.stage.root),i=new Lr(e.resolveNodeDefaults({}),n.rendererMain,n.stage,n.stage.root),n.root=i,i.once("beforeDestroy",n.onBeforeDestroyNode.bind(n,i)),n.onCreateNode(i),!t.coreExtensionModule){o.next=10;break}return o.next=10,yr(t.coreExtensionModule,n.stage);case 10:n.stage.on("fpsUpdate",((e,t)=>{n.onFpsUpdate(t)})),n.stage.on("frameTick",((e,t)=>{n.onFrameTick(t)})),n.stage.on("idle",(()=>{n.onIdle()}));case 13:case"end":return o.stop()}}),o)})))()}createNode(e){_(this.rendererMain),_(this.stage);var t=new Lr(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}createTextNode(e){_(this.rendererMain),_(this.stage);var t=new jr(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}destroyNode(e){e.destroy()}releaseTexture(e){var t=this.stage;_(t),t.txManager.removeTextureIdFromCache(e)}getRootNode(){return _(this.root),this.root}onCreateNode(e){throw new Error("Method not implemented.")}onBeforeDestroyNode(e){throw new Error("Method not implemented.")}onFpsUpdate(e){throw new Error("Method not implemented.")}onFrameTick(e){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}function Kr(e={},t="app"){var r=new Qr;return Ur=new Sr(e,t,r),Wr=Ur.createShader.bind(Ur),Ur}class $r extends Array{constructor(e){super(),this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){var r=this.indexOf(t);this.splice(r,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){var t=this.indexOf(e);t>=0&&this.splice(t,1)}}var Xr=!!{BASE_URL:"/solid-demo-app/",MODE:"development",DEV:!0,PROD:!1,SSR:!1,LEGACY:!0},Gr={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Vr(e){return"object"==typeof e&&e.debug}function Zr(e,t,...r){Xr&&(Gr.debug||Vr(t)||Vr(r[0]))&&console.log(e,t,...r)}function qr(e){return"function"==typeof e}function Jr(e){return Array.isArray(e)}function en(e,t={}){if(Jr(e))e.forEach((e=>{en(e,t)}));else if(e)for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t}class tn extends Array{constructor(e,t={}){return Jr(t)?super(...t):"string"==typeof t?super(t):super(...Object.entries(t).filter((([e,t])=>t)).map((([e])=>e))),this.onChange=e,this}has(e){return this.indexOf(e)>=0}is(e){return this.indexOf(e)>=0}add(e){this.push(e),this.onChange()}toggle(e){this.has(e)?this.remove(e):this.add(e)}remove(e){var t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}var rn=Gr.animationSettings;function nn(e){for(var t=[],r=0,n=Object.entries(e);rmt(this)))}else this.autofocus=!0}isTextNode(){return"text"===this.name}_resizeOnTextLoad(){this.lng.on("loaded",((e,t)=>{if("text"===t.type){var r=t.dimensions;this.parent.updateLayout(this,r)}}))}getText(){return this.children.map((e=>e.text)).join("")}destroy(){var e;this._queueDelete&&(null===(e=this.lng)||void 0===e||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){for(var t in Jr(e)?this._style=en(e):this._style=e,this._style)void 0===this[t]&&(this[t]=this._style[t])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(e){return this.children.find((t=>t.id===e))}searchChildrenById(e){var t,r=T(this.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.id===e)return n;if(n instanceof an){var o=n.searchChildrenById(e);if(o)return o}}}catch(i){r.e(i)}finally{r.f()}}set states(e){this._states=new tn(this._stateChanged.bind(this),e),this.lng&&this._stateChanged()}get states(){return this._states=this._states||new tn(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||rn}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){if(this.hasChildren){Zr("Layout: ",this);var r,n=!1;if(qr(this.onBeforeLayout)&&(n=this.onBeforeLayout.call(this,e,t)),"flex"===this.display){if(function(e){for(var t=[],r=!1,n=0;n(e.flexOrder||0)-(t.flexOrder||0)));var i=t.length,a="row"===(e.flexDirection||"row"),s=a?"width":"height",l=a?"height":"width",d=a?"marginLeft":"marginTop",u=a?"marginRight":"marginBottom",h=a?"x":"y",c=a?"y":"x",f=e[s]||0,p=e[l]||0,v=e.gap||0,g=e.justifyContent||"flexStart",m=e.alignItems,x=0;["center","spaceBetween","spaceEvenly"].includes(g)&&(x=t.reduce(((e,t)=>e+(t[s]||0)),0));var y=p&&m?e=>{"flexStart"===m?e[c]=0:"center"===m?e[c]=(p-(e[l]||0))/2:"flexEnd"===m&&(e[c]=p-(e[l]||0))}:e=>e;if("flexStart"===g){var b=0;if(t.forEach((e=>{e[h]=b+(e[d]||0),b+=(e[s]||0)+v+(e[d]||0)+(e[u]||0),y(e)})),"fixed"!==e.flexBoundary){var w=b-v;if(w!==e[s])return e[s]=w,!0}}else if("flexEnd"===g)for(var S=f,A=i-1;A>=0;A--){var C=t[A];_(C),C[h]=S-(C[s]||0)-(C[u]||0),S-=(C[s]||0)+v+(C[d]||0)+(C[u]||0),y(C)}else if("center"===g){var T=(f-(x+v*(i-1)))/2;t.forEach((e=>{e[h]=T,T+=(e[s]||0)+v,y(e)}))}else if("spaceBetween"===g){var R=(f-x)/(i-1),k=0;t.forEach((e=>{e[h]=k,k+=(e[s]||0)+R,y(e)}))}else if("spaceEvenly"===g){var I=(f-x)/(i+1),B=I;t.forEach((e=>{e[h]=B,B+=(e[s]||0)+I,y(e)}))}return!1}(this)||n)null===(r=this.parent)||void 0===r||r.updateLayout()}else if(n){var o;null===(o=this.parent)||void 0===o||o.updateLayout()}qr(this.onLayout)&&this.onLayout.call(this,e,t)}}_stateChanged(){if(Zr("State Changed: ",this,this.states),this.forwardStates){var e=this.states.slice();this.children.forEach((t=>t.states=e))}var t=this.states;if(this._undoStyles||this.style&&function(e,t){var r,n=T(t);try{for(n.s();!(r=n.n()).done;)if(r.value in e)return!0}catch(o){n.e(o)}finally{n.f()}return!1}(this.style,t)){this._undoStyles=this._undoStyles||[];var r={};this._undoStyles.forEach((e=>{r[e]=this.style[e]}));var n=t.reduce(((e,t)=>{var r=this.style[t];return r&&(e=S(S({},e),r)),e}),{});this._undoStyles=Object.keys(n),void 0!==n.transition&&(this.transition=n.transition),Object.assign(this,r,n)}}render(){var e=this,t=this.parent;if(t)if(t.lng)if(this.lng)console.warn("Node already rendered: ",this);else{t._isDirty&&(t.updateLayout(),t._isDirty=!1),this.states.length&&this._stateChanged();var r=e._renderProps;if(r.x=r.x||0,r.y=r.y||0,t.lng&&(r.parent=t.lng),e._effects&&(this.shader=nn(e._effects)),e.isTextNode()){if(Gr.fontSettings)for(var n in Gr.fontSettings)void 0===r[n]&&(r[n]=Gr.fontSettings[n]);r.text=e.getText(),r.contain&&(r.width||(r.width=(t.width||0)-r.x-(r.marginRight||0),e._autosized=!0),"both"!==r.contain||r.height||r.maxLines||(r.height=(t.height||0)-r.y-(r.marginBottom||0),e._autosized=!0)),Zr("Rendering: ",this,r),e.lng=Ur.createTextNode(r),r.width&&r.height||(e._autosized=!0,e._resizeOnTextLoad())}else r.texture||(isNaN(r.width)&&(r.width=(t.width||0)-r.x,e._autosized=!0),isNaN(r.height)&&(r.height=(t.height||0)-r.y,e._autosized=!0),r.color||r.src||(r.color=0)),Zr("Rendering: ",this,r),e.lng=Ur.createNode(r);e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad),qr(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach((([t,r])=>{var n;null===(n=e.lng)||void 0===n||n.on(t,((t,n)=>r(e,n)))})),e.lng.div&&(e.lng.div.solid=e),"text"!==e.name&&e.children.forEach((e=>{e.render?e.render():""!==e.text&&console.warn("TextNode outside of : ",e)})),e.autofocus&&e.setFocus(),delete this._renderProps}else console.warn("Parent not rendered yet: ",this);else console.warn("Parent not set - no node created for: ",this)}}for(var sn=function(){var e=dn[ln];Object.defineProperty(an.prototype,e,{get(){return this.lng?this.lng[e]:this._renderProps[e]},set(t){this._sendToLightningAnimatable(e,t)}})},ln=0,dn=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"];ln{return t=wn("text"),An(t,e,!1),t;var t},pn=e=>{return t=wn("node"),An(t,e,!1),t;var t};function vn({createElement:e,createTextNode:t,isTextNode:r,replaceText:n,insertNode:o,removeNode:i,setProperty:a,getParentNode:s,getFirstChild:l,getNextSibling:d}){function u(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return h(e,t,n,r);_e((n=>h(e,t(),n,r)),n)}function h(e,i,a,s,d){for(;"function"==typeof a;)a=a();if(i===a)return a;var u=typeof i,m=void 0!==s;if("string"===u||"number"===u)if("number"===u&&(i=i.toString()),m){var x=a[0];x&&r(x)?n(x,i):x=t(i),a=p(e,a,s,x)}else""!==a&&"string"==typeof a?n(l(e),a=i):(p(e,a,s,t(i)),a=i);else if(null==i||"boolean"===u)a=p(e,a,s);else{if("function"===u)return _e((()=>{for(var t=i();"function"==typeof t;)t=t();a=h(e,t,a,s)})),()=>a;if(Array.isArray(i)){var y=[];if(c(y,i,d))return _e((()=>a=h(e,y,a,s,!0))),()=>a;if(0===y.length){var b=p(e,a,s);if(m)return a=b}else Array.isArray(a)?0===a.length?v(e,y,s):f(e,a,y):null==a||""===a?v(e,y):f(e,m&&a||[l(e)],y);a=y}else{if(Array.isArray(a)){if(m)return a=p(e,a,s,i);p(e,a,null,i)}else null!=a&&""!==a&&l(e)?g(e,i,l(e)):o(e,i);a=i}}return a}function c(e,r,n){for(var o=!1,i=0,a=r.length;im-u)for(var w=t[l];u=0;c--){var f=r[c];if(u!==f){var p=s(f)===e;h||c?p&&i(e,f):p?g(e,u,f):o(e,u,n)}else h=!0}else o(e,u,n);return[u]}function v(e,t,r){for(var n=0,i=t.length;nr.children=h(e,t.children,r.children))),_e((()=>t.ref&&t.ref(e))),_e((()=>{for(var n in t)if("children"!==n&&"ref"!==n){var o=t[n];o!==r[n]&&(a(e,n,o,r[n]),r[n]=o)}})),r}return{render(e,t){var r;return Ae((n=>{r=n,u(t,e())})),r},insert:u,spread(e,t,r){"function"==typeof t?_e((n=>m(e,t(),n,r))):m(e,t,void 0,r)},createElement:e,createTextNode:t,insertNode:o,setProp:(e,t,r,n)=>(a(e,t,r,n),r),mergeProps:ut,effect:_e,memo:ke,createComponent:it,use:(e,t,r)=>Ee((()=>e(t,r)))}}var gn={createElement:e=>new an(e),createTextNode:e=>({name:"TextNode",text:e,parent:void 0}),replaceText(e,t){Zr("Replace Text: ",e,t),e.text=t;var r=e.parent;_(r),r.text=r.getText()},setProperty(e,t,r=!0){e[t]=r},insertNode(e,t,r){Zr("INSERT: ",e,t,r),e.children.insert(t,r),t._queueDelete=!1,t instanceof an?e.lng&&t.render():e.isTextNode()&&(e.text=e.getText())},isTextNode:e=>e.isTextNode(),removeNode(e,t){Zr("REMOVE: ",e,t),e.children.remove(t),t._queueDelete=!0,t instanceof an&&queueMicrotask((()=>t.destroy()))},getParentNode:e=>e.parent,getFirstChild:e=>e.children[0],getNextSibling(e){var t=e.parent.children||[],r=t.indexOf(e)+1;if(rr||document});r;){var n=r[t];if(n&&!r.disabled){var o=r[`${t}Data`];if(void 0!==o?n.call(r,o,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}var Bn;function En(){var e=new Set;var t=!1;return{subscribe:function(t){return e.add(t),()=>e.delete(t)},confirm:function(r,n){if(t)return!(t=!1);var o,i={to:r,options:n,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0},a=T(e);try{var s=function(){var e=o.value;e.listener(S(S({},i),{},{from:e.location,retry:o=>{o&&(t=!0),e.navigate(r,S(S({},n),{},{resolve:!1}))}}))};for(a.s();!(o=a.n()).done;)s()}catch(l){a.e(l)}finally{a.f()}return!i.defaultPrevented}}}function Nn(){window.history.state&&null!=window.history.state._depth||window.history.replaceState(S(S({},window.history.state),{},{_depth:window.history.length-1}),""),Bn=window.history.state._depth}Nn();var Fn=/^(?:[a-z0-9]+:)?\/\//i,Ln=/^\/+|(\/)\/+$/g,zn="http://sr";function Mn(e,t=!1){var r=e.replace(Ln,"$1");return r?t||/^[?#]/.test(r)?r:"/"+r:""}function Dn(e,t,r){if(!Fn.test(t)){var n=Mn(e),o=r&&Mn(r),i="";return((i=!o||t.startsWith("/")?n:0!==o.toLowerCase().indexOf(n.toLowerCase())?n+o:o)||"/")+Mn(t,!i)}}function Pn(e){var t={};return e.searchParams.forEach(((e,r)=>{t[r]=e})),t}function On(e,t,r){var n=C(e.split("/*",2),2),o=n[0],i=n[1],a=o.split("/").filter(Boolean),s=a.length;return e=>{var n=e.split("/").filter(Boolean),o=n.length-s;if(o<0||o>0&&void 0===i&&!t)return null;for(var l={path:s?"":"/",params:{}},d=e=>void 0===r?void 0:r[e],u=0;u0===t.localeCompare(e,void 0,{sensitivity:"base"});return void 0===t||("string"==typeof t?r(t):"function"==typeof t?t(e):Array.isArray(t)?t.some(r):t instanceof RegExp&&t.test(e))}function Wn(e){var t=new Map,r=ze();return new Proxy({},{get:(n,o)=>(t.has(o)||Me(r,(()=>t.set(o,ke((()=>e()[o]))))),t.get(o)()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),ownKeys:()=>Reflect.ownKeys(e())})}function Yn(e){var t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];for(var r=e.slice(0,t.index),n=e.slice(t.index+t[0].length),o=[r,r+=t[1]];t=/^(\/\:[^\/]+)\?/.exec(n);)o.push(r+=t[1]),n=n.slice(t[0].length);return Yn(n).reduce(((e,t)=>[...e,...o.map((e=>e+t))]),[])}var Hn,jn=Oe(),Qn=Oe(),Kn=()=>function(e,t){if(null==e)throw new Error(t);return e}(Ue(jn)," and 'use' router primitives can be only used inside a Route."),$n=()=>Kn().navigatorFactory(),Xn=()=>Kn().location,Gn=()=>Kn().params;function Vn(e,t=""){var r=e.component,n=e.load,o=e.children,i=e.info,a=!o||Array.isArray(o)&&!o.length,s={key:e,component:r,load:n,info:i};return qn(e.path).reduce(((r,n)=>{var o,i,l=T(Yn(n));try{for(l.s();!(o=l.n()).done;){var d=o.value,u=(i=d,Mn(t).replace(/\/*(\*.*)?$/g,"")+Mn(i)),h=a?u:u.split("/*",1)[0];h=h.split("/").map((e=>e.startsWith(":")||e.startsWith("*")?e:encodeURIComponent(e))).join("/"),r.push(S(S({},s),{},{originalPath:d,pattern:h,matcher:On(h,!a,e.matchFilters)}))}}catch(c){l.e(c)}finally{l.f()}return r}),[])}function Zn(e,t=0){return{routes:e,score:1e4*(r=e[e.length-1],n=C(r.pattern.split("/*",2),2),o=n[0],i=n[1],a=o.split("/").filter(Boolean),a.reduce(((e,t)=>e+(t.startsWith(":")?2:3)),a.length-(void 0===i?0:1)))-t,matcher(t){for(var r=[],n=e.length-1;n>=0;n--){var o=e[n],i=o.matcher(t);if(!i)return null;r.unshift(S(S({},i),{},{route:o}))}return r}};var r,n,o,i,a}function qn(e){return Array.isArray(e)?e:[e]}function Jn(e,t="",r=[],n=[]){for(var o=qn(e),i=0,a=o.length;it.score-e.score))}function eo(e,t){for(var r=0,n=e.length;re),u=l.renderPath||(e=>e),h=l.beforeLeave||En(),c=Dn("",n.base||"");if(void 0===c)throw new Error(`${c} is not a valid base path`);c&&!i().value&&a({value:c,replace:!0,scroll:!1});var f=C(Ce(!1),2),p=f[0],v=f[1],g=function(){var e=b(x().mark((function e(t){return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,De(t);case 4:return e.prev=4,v(!1),e.finish(4);case 7:case"end":return e.stop()}}),e,null,[[1,,4,7]])})));return function(t){return e.apply(this,arguments)}}(),m=C(Ce(i().value),2),y=m[0],w=m[1],A=C(Ce(i().state),2),T=A[0],_=A[1],R=function(e,t){var r=new URL(zn),n=ke((t=>{var n=e();try{return new URL(n,r)}catch(o){return console.error(`Invalid path ${n}`),t}}),r,{equals:(e,t)=>e.href===t.href}),o=ke((()=>n().pathname)),i=ke((()=>n().search),!0),a=ke((()=>n().hash));return{get pathname(){return o()},get search(){return i()},get hash(){return a()},get state(){return t()},get key(){return""},query:Wn(Ne(i,(()=>Pn(n()))))}}(y,T),k=[],I=Ce([]),B=ke((()=>eo(t(),R.pathname))),E=Wn((()=>{for(var e=B(),t={},r=0;rc,outlet:()=>null,resolvePath:e=>Dn(c,e)};return _e((()=>{var e=i(),t=e.value,r=e.state;Ee((()=>{t!==y()&&g((()=>{Hn="native",w(t),_(r),I[1]([])})).then((()=>{Hn=void 0}))}))})),{base:N,location:R,params:E,isRouting:p,renderPath:u,parsePath:d,navigatorFactory:function(e){return e=e||Ue(Qn)||N,(t,r)=>function(e,t,r){Ee((()=>{if("number"!=typeof t){var n=S({replace:!1,resolve:!0,scroll:!0},r),o=n.replace,i=n.resolve,s=n.scroll,d=n.state,u=i?e.resolvePath(t):Dn("",t);if(void 0===u)throw new Error(`Path '${t}' is not a routable path`);if(k.length>=100)throw new Error("Too many redirects");var c=y();if((u!==c||d!==T())&&h.confirm(u,r)){var f=k.push({value:c,replace:o,scroll:s,state:T()});g((()=>{Hn="navigate",w(u),_(d),I[1]([])})).then((()=>{var e,t;k.length===f&&(Hn=void 0,e={value:u,state:d},(t=k[0])&&(e.value===t.value&&e.state===t.state||a(S(S({},e),{},{replace:t.replace,scroll:t.scroll})),k.length=0))}))}}else t&&(l.go?l.go(t):console.warn("Router integration does not support relative routing"))}))}(e,t,r)},matches:B,beforeLeave:h,preloadRoute:function(e,n){var o=eo(t(),e.pathname),i=Hn;Hn="preload";var a=function(){var t=o[s],i=t.route,a=t.params;i.component&&i.component.preload&&i.component.preload();var l=i.load;n&&l&&Me(r(),(()=>l({params:a,location:{pathname:e.pathname,search:e.search,hash:e.hash,query:Pn(e),state:null,key:""},intent:"preload"})))};for(var s in o)a();Hn=i},singleFlight:void 0===n.singleFlight||n.singleFlight,submissions:I}}var ro=e=>t=>{var r,n=t.base,o=We((()=>t.children)),i=ke((()=>Jn(o(),t.base||""))),a=to(e,i,(()=>r),{base:n,singleFlight:t.singleFlight});return e.create&&e.create(a),bn(jn.Provider,{value:a,get children(){return bn(no,{routerState:a,get root(){return t.root},get load(){return t.rootLoad},get children(){return[yn((()=>(r=ze())&&null)),bn(oo,{routerState:a,get branches(){return i()}})]}})}})};function no(e){var t=e.routerState.location,r=e.routerState.params,n=ke((()=>e.load&&Ee((()=>e.load({params:r,location:t,intent:"preload"})))));return bn(ft,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>bn(o,{params:r,location:t,get data(){return n()},get children(){return e.children}})})}function oo(e){var t,r=[],n=ke(Ne(e.routerState.matches,((o,i,a)=>{for(var s=i&&o.length===i.length,l=[],d=function(t){var d=i&&i[t],u=o[t];a&&d&&u.route.key===d.route.key?l[t]=a[t]:(s=!1,r[t]&&r[t](),Ae((o=>{r[t]=o,l[t]=function(e,t,r,n){var o=e.base,i=e.location,a=e.params,s=n().route,l=s.pattern,d=s.component,u=s.load,h=ke((()=>n().path));d&&d.preload&&d.preload();var c=u?u({params:a,location:i,intent:Hn||"initial"}):void 0;return{parent:t,pattern:l,path:h,outlet:()=>d?it(d,{params:a,location:i,data:c,get children(){return r()}}):r(),resolvePath:e=>Dn(o.path(),e,h())}}(e.routerState,l[t-1]||e.routerState.base,io((()=>n()[t+1])),(()=>e.routerState.matches()[t]))})))},u=0,h=o.length;ue())),a&&s?a:(t=l[0],l)})));return io((()=>n()&&t))()}var io=e=>()=>bn(ft,{get when(){return e()},keyed:!0,children:e=>bn(Qn.Provider,{value:e,get children(){return e.outlet()}})}),ao=e=>{var t=We((()=>e.children));return ut(e,{get children(){return t()}})};function so(e,t){var r=function(e){if("#"===e)return null;try{return document.querySelector(e)}catch(t){return null}}(`#${e}`);r?r.scrollIntoView():t&&window.scrollTo(0,0)}var lo=new Map;function uo(e=!0,t=!1,r="/_server"){return n=>{var o=n.base.path(),i=n.navigatorFactory(n.base),a={};function s(e){if(!(e.defaultPrevented||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)){var r=e.composedPath().find((e=>e instanceof Node&&"A"===e.nodeName.toUpperCase()));if(r&&(!t||r.hasAttribute("link"))){var n="http://www.w3.org/2000/svg"===r.namespaceURI,i=n?r.href.baseVal:r.href;if(!(n?r.target.baseVal:r.target)&&(i||r.hasAttribute("state"))){var a=(r.getAttribute("rel")||"").split(/\s+/);if(!(r.hasAttribute("download")||a&&a.includes("external"))){var s=n?new URL(i,document.baseURI):new URL(i);if(!(s.origin!==window.location.origin||o&&s.pathname&&!s.pathname.toLowerCase().startsWith(o.toLowerCase())))return[r,s]}}}}}function l(e){var t=s(e);if(t){var r=C(t,2),o=r[0],a=r[1],l=n.parsePath(a.pathname+a.search+a.hash),d=o.getAttribute("state");e.preventDefault(),i(l,{resolve:!1,replace:o.hasAttribute("replace"),scroll:!o.hasAttribute("noscroll"),state:d&&JSON.parse(d)})}}function d(e){var t=s(e);if(t){var r=C(t,2),o=r[0],i=r[1];a[i.pathname]||n.preloadRoute(i,"false"!==o.getAttribute("preload"))}}function u(e){var t=s(e);if(t){var r=C(t,2),o=r[0],i=r[1];a[i.pathname]||(a[i.pathname]=setTimeout((()=>{n.preloadRoute(i,"false"!==o.getAttribute("preload")),delete a[i.pathname]}),200))}}function h(e){var t=s(e);if(t){var r=C(t,2)[1];a[r.pathname]&&(clearTimeout(a[r.pathname]),delete a[r.pathname])}}function c(e){var t=e.submitter&&e.submitter.hasAttribute("formaction")?e.submitter.getAttribute("formaction"):e.target.getAttribute("action");if(t){if(!t.startsWith("https://action/")){var o=new URL(t,zn);if(!(t=n.parsePath(o.pathname+o.search)).startsWith(r))return}if("POST"!==e.target.method.toUpperCase())throw new Error("Only POST forms are supported for Actions");var i=lo.get(t);if(i){e.preventDefault();var a=new FormData(e.target);e.submitter&&e.submitter.name&&a.append(e.submitter.name,e.submitter.value),i.call({r:n,f:e.target},a)}}}!function(e,t=window.document){for(var r=t[kn]||(t[kn]=new Set),n=0,o=e.length;n{document.removeEventListener("click",l),e&&(document.removeEventListener("mouseover",u),document.removeEventListener("mouseout",h),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",c)}))}}function ho(e){var t=e.replace(/^.*?#/,"");if(!t.startsWith("/")){var r=C(window.location.hash.split("#",2),2)[1];return`${void 0===r?"/":r}#${t}`}return t}function co(e){var t=()=>window.location.hash.slice(1),r=En();return function(e){var t=!1,r=e=>"string"==typeof e?{value:e}:e,n=function([e,t],r,n){return[r?()=>r(e()):e,n?e=>t(n(e)):t]}(Ce(r(e.get()),{equals:(e,t)=>e.value===t.value}),void 0,(r=>(!t&&e.set(r),r)));return e.init&&Le(e.init(((o=e.get())=>{t=!0,n[1](r(o)),t=!1}))),ro({signal:n,create:e.create,utils:e.utils})}({get:t,set({value:e,replace:t,scroll:r,state:n}){t?window.history.replaceState(function(e){return S(S({},e),{},{_depth:window.history.state&&window.history.state._depth})}(n),"","#"+e):window.location.hash=e;var o=e.indexOf("#");so(o>=0?e.slice(o+1):"",r),Nn()},init:e=>{return n=window,o="hashchange",i=function(e,t){var r=!1;return()=>{var n=Bn;Nn();var o=null==n?null:Bn-n;r?r=!1:o&&t(o)?(r=!0,window.history.go(-o)):e()}}(e,(e=>!r.confirm(e&&e<0?e:t()))),n.addEventListener(o,i),()=>n.removeEventListener(o,i);var n,o,i},create:uo(e.preload,e.explicitLinks,e.actionBase),utils:{go:e=>window.history.go(e),renderPath:e=>`#${e}`,parsePath:ho,beforeLeave:r}})(e)}var fo=!!pt?e=>ze()?Le(e):e:Le;function po(e,t=ze()){var r,n,o=0;return()=>(o++,Le((()=>{o--,queueMicrotask((()=>{!o&&n&&(n(),n=r=void 0)}))})),n||Ae((t=>r=e(n=t)),t),r)}var vo=po((()=>{var e,t,r,n,o=C(Ce(null),2),i=o[0],a=o[1];return e=window,t="keydown",r=e=>{a(e),setTimeout((()=>a(null)))},e.addEventListener(t,r,n),fo(e.removeEventListener.bind(e,t,r,n)),i}));function go(e){return"function"==typeof e}var mo,xo={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},yo=C(Ce([]),2),bo=yo[0],wo=yo[1],So=e=>{var t=vo();if(e)for(var r=function(){var e,t=C(o[n],2),r=t[0],i=t[1];e=i,Array.isArray(e)?i.forEach((e=>{xo[e]=r})):xo[i]=r},n=0,o=Object.entries(e);n{for(var n=e,o=[];n;)n.states.has("focus")||(n.states.add("focus"),go(n.onFocus)&&n.onFocus.call(n,e,t)),o.push(n),n=n.parent;return r.forEach((r=>{o.includes(r)||(r.states.remove("focus"),go(r.onBlur)&&r.onBlur.call(r,e,t))})),wo(o),o}),{defer:!0})),Re((()=>{var e=t();if(e){var r=xo[e.key]||xo[e.keyCode];Ee((()=>{var t,n=void 0,o=T(bo());try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n=n||i,r){var a=i[`on${r}`];if(go(a)&&!0===a.call(i,e,i,n))break}else console.log(`Unhandled key event: ${e.key}`);if(go(i.onKeyPress)&&!0===i.onKeyPress.call(i,e,r,i,n))break}}catch(s){o.e(s)}finally{o.f()}return!1}))}})),bo};function Ao(e,t){var r,n,o,i,a=t();if(Array.isArray(a))if(2===a.length)r=i=a[0],n=o=a[1];else if(3===a.length)r=a[0],n=o=a[1],i=a[2];else{var s=C(a,4);r=s[0],o=s[1],i=s[2],n=s[3]}else r=o=i=n=a;e.onBeforeLayout=(t,a)=>{if(a){e.width=e.children.reduce(((e,t)=>e+(t.width||0)),0)+n+o;var s=e.children[0];s&&(s.x=n,s.marginLeft=n);var l=0;return e.children.forEach((e=>{e.y=r,e.marginTop=r,l=Math.max(l,e.height||0)})),e.height=l+r+i,!0}}}function Co(e){return new Promise((t=>{setTimeout(t,e)}))}function To(e,t,r="en-US"){var n=window.speechSynthesis;return new Promise(((o,i)=>{var a=new SpeechSynthesisUtterance(e);a.lang=r,a.onend=()=>{o()},a.onerror=e=>{i(e)},t.push(a),n.speak(a)}))}function _o(e,t,r=!0){var n=window.speechSynthesis,o=function(e=[]){var t,r=[];for(t=0;t0)){e.next=46;break}return e.prev=20,e.next=23,To(r,a,t);case 23:d=0,e.next=44;break;case 26:if(e.prev=26,e.t0=e.catch(20),!(e.t0 instanceof SpeechSynthesisErrorEvent)){e.next=43;break}if("network"!==e.t0.error){e.next=36;break}return d--,console.warn(`Speech synthesis network error. Retries left: ${d}`),e.next=34,Co(500*(l-d));case 34:e.next=41;break;case 36:if("canceled"!==e.t0.error&&"interrupted"!==e.t0.error){e.next=40;break}d=0,e.next=41;break;case 40:throw new Error(`SpeechSynthesisErrorEvent: ${e.t0.error}`);case 41:e.next=44;break;case 43:throw e.t0;case 44:e.next=19;break;case 46:e.next=60;break;case 48:if("function"!=typeof r){e.next=55;break}return u=_o(r(),t,!1),i.push(u),e.next=53,u.series;case 53:e.next=60;break;case 55:if(!Array.isArray(r)){e.next=60;break}return h=_o(r,t,!1),i.push(h),e.next=60,h.series;case 60:e.next=1;break;case 62:return e.prev=62,s=!1,e.finish(62);case 65:case"end":return e.stop()}}),e,null,[[0,,62,65],[20,26]])})))(),get active(){return s},append:e=>{o.push(e)},cancel:()=>{s&&(r&&n.cancel(),i.forEach((e=>{e.cancel()})),s=!1)}}}function Ro(e,t="en-US"){return mo&&mo.cancel(),mo=_o(e,t)}var ko,Io,Bo=(e,t)=>{var r,n=()=>clearTimeout(r);ze()&&Le(n);return Object.assign(((...o)=>{void 0!==r&&n(),r=setTimeout((()=>e(...o)),t)}),{clear:n})},Eo=[],No=!1;function Fo(e,t){var r,n=Bo(e,t),o=e=>{r=e,n(e)};return o.flush=()=>{n.clear(),e(r)},o.clear=n.clear,o}function Lo(e){return e.id||e.name}function zo(e=[]){if(Mo.onFocusChange&&Mo.enabled){var t=e.every((e=>!e.loading)),r=e.filter((e=>!Eo.includes(e)));if(ko(),t||!Mo.onFocusChange){Eo=e.slice(0);var n=[],o=r.reduce(((e,t)=>(t.announce?(e.push([Lo(t),"Announce",t.announce]),n.push(t.announce)):t.title?(e.push([Lo(t),"Title",t.title]),n.push(t.title)):e.push([Lo(t),"No Announce",""]),e)),[]);return r.reverse().reduce(((e,t)=>(t.announceContext?(e.push([Lo(t),"Context",t.announceContext]),n.push(t.announceContext)):e.push([Lo(t),"No Context",""]),e)),o),Mo.debug&&console.table(o),n.length?Mo.speak(n.reduce(((e,t)=>e.concat(t)),[])):void 0}Mo.onFocusChange([])}}var Mo={debug:!1,enabled:!0,cancel:function(){Io&&Io.cancel()},clearPrevFocus:function(e=0){Eo=Eo.slice(0,e),ko()},speak:function(e,{append:t=!1,notification:r=!1}={}){var n;Mo.onFocusChange&&Mo.enabled&&(Mo.onFocusChange.flush(),t&&Io&&Io.active?Io.append(e):(Mo.cancel(),function(e){if(!No)Io=Ro(e)}(e)),r&&(No=!0,null===(n=Io)||void 0===n||n.series.finally((()=>{No=!1,Mo.refresh()})).catch(console.error)));return Io},refresh:function(e=0){Mo.clearPrevFocus(e),Mo.onFocusChange&&Mo.onFocusChange(Ee((()=>bo())))},setupTimers:function({focusDebounce:e=400,focusChangeTimeout:t=3e5}={}){Mo.onFocusChange=Fo(zo,e),ko=Fo((()=>{Eo=[]}),t)}};var Do,Po,Oo,Uo,Wo,Yo,Ho,jo,Qo,Ko,$o,Xo,Go,Vo,Zo,qo,Jo,ei,ti=C(Ce(""),2),ri=ti[0],ni=ti[1],oi={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQ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VBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC",check:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr8lMAx5P8s9N+Y8wk2cTjfQDu66z080h+zml7yKwpgCSdCOByZyX+BuBRJH/otN84M0kWN/s0gOc4Kv8Nko922B1m0gxAkh4I4AcVwcL9JA/UVnjT7CXdHYD9yEzfVUkAjib5uxqNmgCoBAu/CeBhzsJ/kORZTtuNN5Nk70bXAZ0Hy59G8qIawVoB6LMAnu8suE3tH0/y3077NAMg6esAuoaoC0la7M2dJgdI0ssAXOgs8W8BHEvS/s9UoYCkdwN4bYfL5STto7U7TQpQZbDQ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1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function ii(){var e,t,r,n=0,o={duration:750,easing:"ease-in-out"},i={alpha:1,color:4294967295};return Re(Ne(ri,(i=>{!function(i){i.startsWith("#")?(e.color=Rn(i),e.src="",e.alpha=1,n=1,t.alpha=0,r.alpha=0):(e.color=4294967295,r.alpha=1,0===n?(e.src=i,n=1):1===n?(t.src=i,n=2,t.alpha=0,t.animate({alpha:1},o).start(),e.animate({alpha:0},o).start()):2===n&&(e.src=i,n=1,e.alpha=0,e.animate({alpha:1},o).start(),t.animate({alpha:0},o).start()))}(i)}),{defer:!0})),bn(pn,{width:1920,height:1080,zIndex:-5,get children(){return[bn(pn,{ref(t){"function"==typeof e?e(t):e=t},style:i}),bn(pn,{ref(e){"function"==typeof t?t(e):t=e},style:i,alpha:0}),bn(pn,{ref(e){"function"==typeof r?r(e):r=e},src:"./assets/hero-mask-inverted.png",get color(){return Rn(oi.color.materialBrand)},width:1920,height:1080})]}})}function ai(e){if(!e||!e[Symbol.iterator])throw new Error("objectFromEntries requires a single iterable argument");var t,r={},n=T(e);try{for(n.s();!(t=n.n()).done;){var o=C(t.value,2),i=o[0],a=o[1];r[i]=a}}catch(s){n.e(s)}finally{n.f()}return r}var si=["focus","disabled"],li=["brand","inverse","neutral"];function di({themeKeys:e,base:t,modes:r,tones:n,themeStyles:o,modeKeys:i=si,toneKeys:a=li},s=!1){var l=t=>ai(Object.entries(e).filter((([e,r])=>t[r])).map((([e,r])=>[e,t[r]])));return((e,t,r)=>{var n,d=(n=o,ai(Object.entries(n).map((([e,t])=>{var r=l(t);return Object.entries(t).filter((([e,t])=>i.includes(e))).forEach((([e,t])=>{r[e]=l(t)})),[e,r]}))));s&&console.log(d);var u=((e,t)=>S(S({},e),t.base))(e,d);s&&console.log(u);var h=((e,t)=>ai(i.map((r=>[r,S(S({},null==e?void 0:e[r]),null==t?void 0:t[r])]))))(t,d);s&&console.log(h);var c=((e,t,r)=>ai(a.map((n=>{var o,a,s={};return new Set([].concat.apply([],[null!==(o=null==e?void 0:e[n])&&void 0!==o?o:{},null!==(a=null==t?void 0:t[n])&&void 0!==a?a:{}].map(Object.keys))).forEach((r=>{var o,a,l;i.includes(r)||(s[r]=null!==(l=null==(o=null==t?void 0:t[n])?void 0:o[r])&&void 0!==l?l:null==(a=null==e?void 0:e[n])?void 0:a[r])})),i.forEach((o=>{var i,a;s[o]=S(S(S({},r[o]),null==(i=null==e?void 0:e[n])?void 0:i[o]),null==(a=null==t?void 0:t[n])?void 0:a[o])})),[n,s]}))))(r,d,h);return s&&console.log(c),{base:S(S({},u),h),tones:c}})(t,r,n)}function ui(e=0){return(t,r,n=0,o)=>{var i,a,s;if(0!==t.children.length){var l="row"===t.flexDirection?"width":"height",d="row"===t.flexDirection?"x":"y",u=t.gap||0,h=t.scroll||"auto",c=function(e){var t,r;"row"===e.flexDirection?(t={position:e.children[e.children.length-1].x,size:e.children[e.children.length-1].width},r=e.width):(t={position:e.children[e.children.length-1].y,size:e.children[e.children.length-1].height},r=e.height);return[t,r]}(t),f=C(c,2),p=f[0],v=f[1],g=null!==(i=t[d])&&void 0!==i?i:0,m=null!==(a=null==r?void 0:r[d])&&void 0!==a?a:0,x=null!==(s=null==r?void 0:r[l])&&void 0!==s?s:0,y=void 0===o?"none":n>o?"positive":"negative",b=g;if("auto"===h)null!=t.scrollIndex&&t.scrollIndex>=0?t.selected>=t.scrollIndex&&(b="positive"===y?g-x-u:g+x+u):(Math.abs(g)+vm)b=-m+e;else if("edge"===h&&"positive"===y&&Math.abs(g)+v{var t=e.filter((e=>"function"==typeof e));if(0!==t.length)return 1===t.length?t[0]:function(...e){var r,n,o=T(t);try{for(o.s();!(n=o.n()).done;){if(!0===(r=n.value.apply(this,e)))return r}}catch(i){o.e(i)}finally{o.f()}return r}};function ci(){if(!this||void 0===this.selected||0===this.children.length)return!1;for(var e=this.children[this.selected];null==e?void 0:e.skipFocus;)this.selected++,e=this.children[this.selected];return e instanceof an&&(e.setFocus(),!0)}function fi(e){return function(){var t,r,n,o=this.children.length,i=this.wrap,a=this.selected||0;if(0===o)return!1;if("right"===e||"down"===e){do{if(this.selected=(this.selected||0)%o+1,this.selected>=o){if(!i){this.selected=void 0;break}this.selected=0}}while(null==(t=this.children[this.selected])?void 0:t.skipFocus)}else if("left"===e||"up"===e)do{if(this.selected=(this.selected||0)%o-1,this.selected<0){if(!i){this.selected=void 0;break}this.selected=o-1}}while(null==(r=this.children[this.selected])?void 0:r.skipFocus);if(void 0===this.selected&&(this.selected=a,null==(n=this.children[this.selected])?void 0:n.states.has("focus")))return!1;var s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,a),this.plinko&&void 0!==a){var l=this.children[a].selected||0;s.selected=lbn(pn,Tn(e,{get style(){var t,r;return[...[e.style].flat(),null==(r=Li.Container.tones)?void 0:r[null!==(t=e.tone)&&void 0!==t?t:Li.tone],Li.Container.base]},forwardStates:!0,get children(){return bn(fn,{get style(){var t,r;return[...[null==(r=e.style)?void 0:r.Text].flat(),Li.Text.tones[null!==(t=e.tone)&&void 0!==t?t:Li.tone],Li.Text.base]},get children(){return e.children}})}})),Mi=(null==(Wo=oi)?void 0:Wo.componentConfig).Checkbox,Di=void 0===Mi?{styles:{}}:Mi,Pi=(Di.defaultTone,m(Di,o)),Oi=oi.stroke.sm,Ui=oi.spacer.xxl,Wi={themeKeys:{color:"color",borderRadius:"borderRadius",border:"border",justifyContent:"justifyContent"},base:{width:Ui,height:Ui,display:"flex",justifyContent:"center",color:oi.color.fillNeutral,alignItems:"center",borderRadius:Ui/4,border:{color:oi.color.strokeInverse,width:Oi}},modes:{disabled:{alpha:oi.alpha.inactive}},tones:{brand:{borderRadius:Ui/4,border:{color:oi.color.strokeNeutralSecondary,width:Oi},color:oi.color.fillNeutralSecondary,checked:{borderRadius:Ui/4,border:{color:oi.color.strokeNeutralSecondary,width:Oi},color:oi.color.fillBrand}},neutral:{borderRadius:Ui/4,border:{color:oi.color.strokeNeutralSecondary,width:Oi},color:oi.color.fillInverseSecondary,checked:{borderRadius:Ui/4,border:{color:oi.color.strokeNeutralSecondary,width:Oi},color:oi.color.fillNeutral}},inverse:{borderRadius:Ui/4,border:{color:oi.color.strokeInverseSecondary,width:Oi},color:oi.color.fillNeutralSecondary,checked:{borderRadius:Ui/4,border:{color:oi.color.strokeInverseSecondary,width:Oi},color:oi.color.fillInverse}}},modeKeys:["focus","disabled","checked"],themeStyles:Pi},Yi={themeKeys:{color:"color"},base:{width:oi.spacer.lg,height:oi.spacer.lg,src:oi.asset.check},tones:{neutral:{color:oi.color.fillInverse},inverse:{color:oi.color.fillNeutral},brand:{color:oi.color.fillInverse}},themeStyles:Pi};di(Wi),di(Yi);var Hi=(null==(Yo=oi)?void 0:Yo.componentConfig).Icon,ji=void 0===Hi?{styles:{}}:Hi,Qi=(ji.defaultTone,m(ji,i));di({themeKeys:{color:"color"},base:{width:100,height:100,color:oi.color.fillInverse},tones:{inverse:{color:oi.color.fillInverse},brand:{color:oi.color.fillBrand}},themeStyles:Qi});var Ki=(null==(Ho=oi)?void 0:Ho.componentConfig).Column,$i=void 0===Ki?{styles:{}}:Ki,Xi=$i.defaultTone,Gi=m($i,a),Vi={tone:Xi||"neutral",Container:di({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"column",gap:oi.layout.gutterY,itemTransition:S(S({},oi.animation.standardEntrance),{},{duration:oi.animation.duration.fast})},themeStyles:Gi})},Zi=e=>{var t=fi("up"),r=fi("down");return bn(pn,Tn(e,{get onUp(){return hi(e.onUp,t)},get onDown(){return hi(e.onDown,r)},get selected(){return e.selected||0},forwardFocus:ci,get onCreate(){return hi((t=>{var r,n;return ui(e.y).call(t,t,t.children[null!==(r=e.selected)&&void 0!==r?r:0],null!==(n=e.selected)&&void 0!==n?n:0,void 0)}),e.onCreate)},get onSelectedChanged(){return hi(e.onSelectedChanged,"none"!==e.scroll?ui(e.y):void 0)},get style(){var t;return[...[e.style].flat(),Vi.Container.tones[null!==(t=e.tone)&&void 0!==t?t:Vi.tone],Vi.Container.base]}}))},qi=(null==(jo=oi)?void 0:jo.componentConfig).Label,Ji=void 0===qi?{styles:{}}:qi,ea=(Ji.defaultTone,m(Ji,s)),ta={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:oi.color.textNeutral,padding:[oi.spacer.md,oi.spacer.lg],borderRadius:[oi.radius.md,oi.radius.md,oi.radius.md,oi.radius.none],height:oi.typography.caption1.lineHeight+oi.spacer.md,neutral:{backgroundColor:oi.color.fillNeutral}},tones:{inverse:{color:oi.color.fillInverse},brand:{color:oi.color.fillBrand,focus:{color:oi.color.orange}}},themeStyles:ea},ra={themeKeys:{color:"textColor"},base:S(S({},oi.typography.caption1),{},{color:oi.color.textInverse}),tones:{inverse:{color:oi.color.textNeutral},brand:{color:oi.color.textNeutral}},themeStyles:ea};di(ta),di(ra);var na=(null==(Qo=oi)?void 0:Qo.componentConfig).Rating,oa=void 0===na?{styles:{},defaultTone:"neutral"}:na,ia=oa.styles,aa=(oa.defaultTone,{themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:oi.spacer.sm},toneModes:{},themeStyles:ia}),sa={themeKeys:{color:"textColor"},base:S({color:oi.color.textNeutral},oi.typography.body2),toneModes:{},themeStyles:ia},la={themeKeys:{color:"color"},base:{height:oi.typography.body2.lineHeight,width:oi.typography.body2.lineHeight,color:oi.color.fillNeutral,marginRight:oi.spacer.sm},toneModes:{},themeStyles:ia};di(aa),di(la),di(sa);var da=(null==(Ko=oi)?void 0:Ko.componentConfig).Details,ua=void 0===da?{styles:{}}:da,ha=(ua.defaultTone,m(ua,l)),ca={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:oi.spacer.lg,badgeContentSpacing:oi.spacer.sm,ratingContentSpacing:oi.spacer.lg},themeStyles:ha},fa={themeKeys:{color:"textColor"},base:S(S({},oi.typography.body2),{},{marginRight:oi.spacer.lg,color:oi.color.textNeutral}),tones:{neutral:{disabled:{color:oi.color.textNeutralDisabled}},inverse:{color:oi.color.textInverse,disabled:{color:oi.color.textNeutralDisabled}},brand:{color:oi.color.textNeutral,disabled:{color:oi.color.textNeutralDisabled}}},themeStyles:ha};di(ca),di(fa);var pa=(null==($o=oi)?void 0:$o.componentConfig).Metadata,va=void 0===pa?{styles:{}}:pa,ga=(va.defaultTone,m(va,d)),ma={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:oi.alpha.primary},modes:{disabled:{alpha:oi.alpha.inactive}},themeStyles:ga},xa={themeKeys:{color:"textColor"},base:S(S({maxLines:1,contain:"width"},oi.typography.headline3),{},{color:oi.color.textNeutral}),tones:{neutral:{disabled:{color:oi.color.textNeutralDisabled}},inverse:{color:oi.color.textInverse,disabled:{color:oi.color.textNeutralDisabled}},brand:{color:oi.color.textNeutral,disabled:{color:oi.color.textNeutralDisabled}}},themeStyles:ga},ya={themeKeys:{color:"textColor"},base:S(S({contain:"width",maxLines:2},oi.typography.body2),{},{color:oi.color.textNeutralSecondary}),tones:{neutral:{disabled:{color:oi.color.textNeutralDisabled}},inverse:{color:oi.color.textInverseSecondary,disabled:{color:oi.color.textNeutralDisabled}},brand:{color:oi.color.textNeutralSecondary,disabled:{color:oi.color.textNeutralDisabled}}},themeStyles:ga};di(ma),di(ya),di(xa);var ba=(null==(Xo=oi)?void 0:Xo.componentConfig).ProgressBar,wa=void 0===ba?{styles:{}}:ba,Sa=(wa.defaultTone,m(wa,u)),Aa={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:oi.spacer.md,color:oi.color.fillNeutralTertiary,borderRadius:oi.radius.xs},tones:{inverse:{color:oi.color.fillInverseTertiary}},themeStyles:Sa},Ca={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:oi.radius.xs,color:oi.color.fillNeutral},tones:{inverse:{color:oi.color.fillInverse},brand:{color:oi.color.fillBrand}},themeStyles:Sa};di(Aa),di(Ca);var Ta=(null==(Go=oi)?void 0:Go.componentConfig).Row,_a=void 0===Ta?{styles:{}}:Ta,Ra=_a.defaultTone,ka=m(_a,h),Ia={tone:Ra,Container:di({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",flexBoundary:"fixed",flexDirection:"row",gap:oi.layout.gutterX,itemTransition:S(S({},oi.animation.standardEntrance),{},{duration:oi.animation.duration.fast})},themeStyles:ka})},Ba=e=>{var t=fi("left"),r=fi("right");return bn(pn,Tn(e,{get selected(){return e.selected||0},get onLeft(){return hi(e.onLeft,t)},get onRight(){return hi(e.onRight,r)},forwardFocus:ci,get onCreate(){return hi((t=>{var r,n;return ui(e.x).call(t,t,t.children[null!==(r=e.selected)&&void 0!==r?r:0],null!==(n=e.selected)&&void 0!==n?n:0,void 0)}),e.onCreate)},get onSelectedChanged(){return hi(e.onSelectedChanged,"none"!==e.scroll?ui(e.x):void 0)},get tone(){var t;return null!==(t=e.tone)&&void 0!==t?t:Ia.tone},get style(){return[...[e.style].flat(),Ia.Container.tones[e.tone||Ia.tone],Ia.Container.base]},get states(){var t;return null!==(t=e.tone)&&void 0!==t?t:Ia.tone}}))},Ea=(null==(Vo=oi)?void 0:Vo.componentConfig).Keyboard,Na=void 0===Ea?{styles:{}}:Ea,Fa=(Na.defaultTone,m(Na,c)),La={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:oi.spacer.md,screenW:oi.layout.screenW,marginX:oi.layout.marginX,height:100},themeStyles:Fa},za={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:oi.spacer.md,height:9*oi.spacer.md,paddingX:oi.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:oi.color.fillNeutral,padding:[oi.spacer.xxxl,oi.spacer.xl],baseWidth:7*oi.spacer.md,color:oi.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:oi.radius.sm},modes:{focus:{color:oi.color.interactiveNeutralFocus,contentColor:oi.color.fillInverse},disabled:{color:oi.color.fillNeutralDisabled,contentColor:oi.color.fillNeutralDisabled}},tones:{inverse:{color:oi.color.interactiveInverse,focus:{color:oi.color.interactiveInverseFocus,contentColor:oi.color.fillNeutral}},brand:{focus:{contentColor:oi.color.fillNeutral}}},themeStyles:Fa},Ma={themeKeys:{color:"textColor"},base:S({textAlign:"left",color:oi.color.textNeutral},oi.typography.headline2),modes:{focus:{color:oi.color.textInverse},disabled:{color:oi.color.textNeutralDisabled}},tones:{inverse:{focus:{color:oi.color.textNeutral}}},themeStyles:Fa};di(La),di(za),di(Ma);var Da=(null==(Zo=oi)?void 0:Zo.componentConfig).Key,Pa=void 0===Da?{styles:{}}:Da,Oa=(Pa.defaultTone,m(Pa,f)),Ua={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:oi.spacer.md,height:9*oi.spacer.md,paddingX:oi.spacer.md,contentColor:oi.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[oi.spacer.md],baseWidth:7*oi.spacer.md,color:oi.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:oi.radius.sm},modes:{focus:{color:oi.color.interactiveNeutralFocus,contentColor:oi.color.fillInverse},disabled:{color:oi.color.fillNeutralDisabled,contentColor:oi.color.fillNeutralDisabled}},tones:{inverse:{color:oi.color.interactiveInverse,focus:{color:oi.color.interactiveInverseFocus,contentColor:oi.color.fillNeutral}},brand:{focus:{contentColor:oi.color.fillNeutral}}},themeStyles:Oa},Wa={themeKeys:{color:"textColor"},base:S({textAlign:"left",color:oi.color.textNeutral},oi.typography.headline2),modes:{focus:{color:oi.color.textInverse},disabled:{color:oi.color.textNeutralDisabled}},tones:{inverse:{focus:{color:oi.color.textNeutral}}},themeStyles:Oa};di(Ua),di(Wa);var Ya=(null==(qo=oi)?void 0:qo.componentConfig).Input,Ha=void 0===Ya?{styles:{}}:Ya,ja=(Ha.defaultTone,m(Ha,p)),Qa={themeKeys:{justifyContent:"justifyContent"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"column",width:100,height:100,actualTitle:""},themeStyles:ja},Ka={themeKeys:{borderRadius:"borderRadius",color:"backgroundColor"},base:{width:function(e,t=1){var r=e.layout.screenW,n=e.layout.columnCount,o=e.layout.marginX,i=e.layout.gutterX;if(!(t<1||t>n))return(r-2*o-(t-1)*i)/t;console.error(`Column expects a number between 1 & ${n}. Received ${t}`)}(oi,4),height:100,display:"flex",flexDirection:"column",padding:[oi.spacer.xxxl,oi.spacer.xl],color:oi.color.interactiveNeutral,contentColor:oi.color.fillInverse,borderRadius:oi.radius.sm,marginX:oi.spacer.xxxl},modes:{focus:{color:oi.color.interactiveNeutralFocus},disabled:{color:oi.color.fillNeutralDisabled}},tones:{inverse:{color:oi.color.interactiveInverse},brand:{color:oi.color.interactiveBrand,focus:{color:oi.color.fillNeutral}}},themeStyles:ja},$a={themeKeys:{color:"textColor"},base:S({textAlign:"left",color:oi.color.textNeutral},oi.typography.button1),themeStyles:ja};di(Qa),di(Ka),di($a);var Xa=(null==(Jo=oi)?void 0:Jo.componentConfig).Tile,Ga=void 0===Xa?{styles:{}}:Xa,Va=(Ga.defaultTone,m(Ga,v)),Za=(null==(ei=oi)?void 0:ei.componentConfig).Surface,qa=void 0===Za?{styles:{}}:Za,Ja=(qa.defaultSurfaceTone,m(qa,g)),es={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:oi.spacer.xl,paddingYBetweenContent:oi.spacer.md,borderRadius:oi.radius.md,alpha:oi.alpha.primary},modes:{disabled:{alpha:oi.alpha.inactive}},themeStyles:S(S({},Ja),Va)},ts={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Va},rs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Va},ns={themeKeys:{},base:{width:5*oi.spacer.lg,height:oi.spacer.xxl+oi.spacer.md},themeStyles:Va};di(es),di(ts),di(rs),di(ns);var os={color:255,height:150,width:330,x:1910,y:10,mountX:1,alpha:.8,zIndex:100},is={x:10,fontSize:22,textColor:Rn("#f6f6f6")},as={fontSize:22,textColor:Rn("#f6f6f6")},ss=C(Ce(0),2),ls=ss[0],ds=ss[1],us=C(Ce(0),2),hs=us[0],cs=us[1],fs=C(Ce(99),2),ps=fs[0],vs=fs[1],gs=C(Ce(0),2),ms=gs[0],xs=gs[1],ys=C(Ce(0),2),bs=ys[0],ws=ys[1],Ss=C(Ce(0),2),As=Ss[0],Cs=Ss[1],Ts=C(Ce(0),2),_s=Ts[0],Rs=Ts[1],ks=0,Is=0;function Bs(e){e.renderer.on("fpsUpdate",((e,t)=>{var r,n,o,i,a="number"==typeof t?t:t.fps;a>5&&((e=>{e&&(ds(e),vs((t=>Math.min(e,t))),xs((t=>Math.max(e,t))),Is+=e,ks++,cs(Math.round(Is/ks)))})(a),r=e.root.stage,n=0,o=0,i=0,r.txManager.textureIdCache.forEach(((e,t,r)=>{"loaded"===e.state&&n++,"loading"===e.state&&o++,"failed"===e.state&&i++})),ws(n),Cs(o),Rs(i))}))}var Es=e=>bn(pn,Tn(e,{style:os,get children(){return[bn(pn,{get children(){return[bn(fn,{style:is,children:"FPS:"}),bn(fn,{style:as,x:90,get children(){return ls()}})]}}),bn(pn,{x:160,get children(){return[bn(fn,{style:is,children:"AVG:"}),bn(fn,{style:as,x:100,get children(){return hs()}})]}}),bn(pn,{x:0,y:20,get children(){return[bn(fn,{style:is,children:"MIN:"}),bn(fn,{style:as,x:90,get children(){return ps()}})]}}),bn(pn,{x:160,y:20,get children(){return[bn(fn,{style:is,children:"MAX:"}),bn(fn,{style:as,x:100,get children(){return ms()}})]}}),bn(pn,{x:0,y:50,get children(){return[bn(fn,{style:is,children:"Loaded Textures Cnt:"}),bn(fn,{style:is,x:270,get children(){return bs()}})]}}),bn(pn,{x:0,y:80,get children(){return[bn(fn,{style:is,children:"Loading Textures Cnt:"}),bn(fn,{style:is,x:270,get children(){return As()}})]}}),bn(pn,{x:0,y:110,get children(){return[bn(fn,{style:is,children:"Failed Textures Cnt:"}),bn(fn,{style:is,x:270,get children(){return _s()}})]}})]}})),Ns={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:oi.layout.marginX}},Gradient:{zIndex:99,color:Rn("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:Rn("#424242")},active:{width:328,height:70}}},Fs="/solid-demo-app/",Ls=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function zs(e){var t,r,n,o=(t=Fs+"assets/icons_white.png",r=Ls,n=Ur.createTexture("ImageTexture",{src:t}),r.reduce(((e,t)=>{var r=t.x,o=t.y,i=t.width,a=t.height;return e[t.name]=Ur.createTexture("SubTexture",{texture:n,x:r,y:o,width:i,height:a}),e}),{}));return bn(pn,Tn(e,{get texture(){return o[e.name]},get width(){return o[e.name].props.width},get height(){return o[e.name].props.height},get x(){return(100-(o[e.name].props.width||0))/2},get y(){return(100-(o[e.name].props.height||0))/2}}))}function Ms(e){return bn(pn,Tn(e,{forwardStates:!0,get style(){return Ns.NavButton},get children(){return[bn(pn,{y:-16,get children(){return bn(zs,{scale:.5,get name(){return e.icon}})}}),bn(fn,{style:{fontSize:38,x:116,y:18,height:50,alpha:0,active:{alpha:1}},get children(){return e.children}})]}}))}function Ds(e){var t,r=$n();function n(t){var n,o,i,a;if((n=()=>t,i=Xn(),a=ke((()=>Yn(n()).map((e=>On(e,void 0,o))))),ke((()=>{var e,t=T(a());try{for(t.s();!(e=t.n()).done;){var r=(0,e.value)(i.pathname);if(r)return r}}catch(n){t.e(n)}finally{t.f()}})))())return e.focusPage();r(t)}return[bn(pn,{flexItem:!1,x:40,y:30,zIndex:105,get alpha(){return e.showWidgets?1:0},get children(){return[bn(fn,{x:80,fontSize:28,color:4143380036,children:"Built With:"}),bn(pn,{y:22,src:"./assets/solidWord.png",width:280,height:52})]}}),bn(Zi,Tn(e,{onFocus:function(){t.states.add("focus"),this.children.forEach((e=>e.states.add("active"))),this.children.selected.setFocus()},onBlur:function(){t.states.remove("focus"),this.selected=0,this.children.forEach((e=>e.states.remove("active")))},get style(){return Ns.Column},scroll:"none",get children(){return[bn(Ms,{onEnter:()=>n("/browse/all"),icon:"trending",children:"Trending"}),bn(Ms,{icon:"movie",onEnter:()=>n("/browse/movie"),children:"Movies"}),bn(Ms,{icon:"tv",onEnter:()=>n("/browse/tv"),children:"TV"}),bn(Ms,{icon:"experiment",onEnter:()=>n("/examples"),children:"Examples"})]}})),bn(pn,{ref(e){"function"==typeof t?t(e):t=e},get style(){return Ns.Gradient}})]}var Ps=e=>{So({Announcer:["a"],Menu:["m"],Escape:["Escape",27],Backspace:["Backspace",8],Left:["ArrowLeft",37],Right:["ArrowRight",39],Up:["ArrowUp",38],Down:["ArrowDown",40],Enter:["Enter",13]});var t=(Mo.setupTimers(),Re(Ne(bo,Mo.onFocusChange,{defer:!0})),Mo);t.enabled=!1;var r,n,o=$n();function i(){return!r.states.has("focus")&&(n=gt(),r.setFocus())}Bs({renderer:Ur});var a=C(Ce(!0),2),s=a[0],l=a[1],d=Xn(),u=["/browse","/entity"];return Re((()=>{var e=d.pathname,t=u.some((t=>e.startsWith(t)));"/"===e&&(t=!0),l(t)})),bn(pn,{onAnnouncer:()=>t.enabled=!t.enabled,onLast:()=>history.back(),onMenu:()=>o("/"),style:{width:1920,height:1080},onBackspace:i,onLeft:i,onRight:()=>r.states.has("focus")&&n.setFocus(),get children(){return[bn(ii,{}),bn(Es,{mountX:1,x:1910,y:10,get alpha(){return s()?1:0}}),yn((()=>e.children)),bn(Ds,{ref(e){"function"==typeof r?r(e):r=e},focusPage:()=>n.setFocus(),get showWidgets(){return s()}})]}})},Os={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:oi.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:Rn("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:Rn("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:Rn("#000000")},RowTitle:{height:60,width:300,marginBottom:-40,fontSize:36,color:Rn("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:64,width:oi.layout.screenW-2*oi.layout.marginX,x:oi.layout.marginX+oi.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:Rn("#0000ff")},peopleBio:S(S({},oi.typography.body1),{},{fontFamily:"Ubuntu",fontWeight:"normal",contain:"both",width:780,height:340})},Us={width:120,height:40,color:Rn("#000000"),borderRadius:8,border:{width:2,color:Rn("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:Rn("#333333")}},transition:{scale:!0,color:!0}},Ws={container:Us,topBar:{color:Rn("#00A699"),height:8,y:2,x:-4,width:Us.width+8},text:{fontSize:12,y:12,contain:"width",textAlign:"center",color:Rn("#F6F6F9"),height:Us.height,width:Us.width}},Ys=386,Hs=136,js=(Rn("#715cab"),Rn("#5a39a2"),Rn("#291d43"),{fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:Rn("#FFFFFF"),height:Hs,width:Ys,focus:{fontSize:40},disabled:{color:Rn("#909090")}});function Qs(e){return bn(pn,Tn(e,{get style(){return Os.Thumbnail}}))}function Ks(e){var t=function(e,...t){if(le in e){var r=new Set(t.length>1?t.flat():t[0]),n=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},st)));return n.push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},st)),n}var o,i={},a=t.map((()=>({}))),s=T(Object.getOwnPropertyNames(e));try{for(s.s();!(o=s.n()).done;){var l,d=o.value,u=Object.getOwnPropertyDescriptor(e,d),h=!u.get&&!u.set&&u.enumerable&&u.writable&&u.configurable,c=!1,f=0,p=T(t);try{for(p.s();!(l=p.n()).done;)l.value.includes(d)&&(c=!0,h?a[f][d]=u.value:Object.defineProperty(a[f],d,u)),++f}catch(v){p.e(v)}finally{p.f()}c||(h?i[d]=u.value:Object.defineProperty(i,d,u))}}catch(v){s.e(v)}finally{s.f()}return[...a,i]}(e,["items"]),r=C(t,2),n=r[0],o=r[1];return bn(Ba,Tn(o,{get style(){return Os.Row},get children(){return bn(ct,{get each(){return n.items},children:e=>bn(Qs,e)})}}))}var $s,Xs,Gs="https://api.themoviedb.org/3",Vs="w185",Zs={headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA"}};function qs(e,t=Vs){return Xs+t+e}function Js(e,t={}){return fetch(Gs+e,S(S({},Zs),t)).then((e=>e.json()))}function el(){return Js("/configuration").then((e=>{var t;return $s=e,Xs=null===(t=e.images)||void 0===t?void 0:t.secure_base_url,e}))}var tl={get:function(e,t={}){return $s?Js(e,t):el().then((()=>Js(e,t)))},loadConfig:el};function rl(e=[]){return e.map((e=>{return{src:qs(e.poster_path||e.profile_path),tileSrc:qs(e.backdrop_path||e.profile_path,"w300"),backdrop:qs(e.backdrop_path,"w1280"),href:`/entity/${e.media_type||"people"}/${e.id}`,shortTitle:(t=e.title||e.name,r=30,t.length>r?t.substring(0,r-3)+"...":t),title:e.title||e.name,data:e,entityInfo:{type:e.media_type||"people",id:e.id},heroContent:{title:e.title||e.name,description:e.overview}};var t,r}))}var nl=new Map,ol=new Map;function il(e){var t=C(Ce([]),2),r=t[0],n=t[1],o=C(Ce(1),2),i=o[0],a=o[1],s=C(Ce(!1),2),l=s[0],d=s[1],u=C(Ie(i,e),1)[0];return Te((()=>{var e=u();e&&$e((()=>{0===e.length&&d(!0),n((t=>[...t,...e]))}),!1)})),{pages:r,page:i,setPage:a,setPages:n,end:l,setEnd:d}}var al=900,sl=S(S({},oi.typography.display2),{},{fontFamily:"Ubuntu",fontWeight:700,maxLines:1,width:al,contain:"width"}),ll=e=>bn(fn,Tn(e,{style:sl})),dl=S(S({},oi.typography.body1),{},{fontFamily:"Ubuntu",fontWeight:400,lineHeight:32,width:al,maxLines:3,contain:"width"}),ul={fontSize:16,lineHeight:20},hl=e=>bn(fn,Tn(e,{style:dl,get children(){return e.children}})),cl=e=>{return t=wn("node"),_n(Ao,t,(()=>[8,13,11,13])),An(t,Tn(e,{style:{color:"0x00000099",borderRadius:8,border:{width:2,color:"0xffffffff"}}}),!0),Sn(t,bn(fn,{style:ul,get children(){return e.children}})),t;var t},fl=S(S({},oi.typography.body2),{},{fontFamily:"Ubuntu",fontWeight:400}),pl=e=>bn(pn,{style:{display:"flex",flexDirection:"row",gap:18,width:al,height:48},get children(){return[bn(pn,{y:-4,src:"./assets/stars.png",width:188,height:31}),bn(pn,{y:-4,flexItem:!1,clipping:!0,get width(){return 188*e.voteAverage/10},height:31,get children(){return bn(pn,{src:"./assets/stars-full.png",width:188,height:31})}}),bn(fn,{style:fl,get children(){return[yn((()=>e.voteCount))," reviews"]}}),bn(fn,{style:fl,get children(){return e.metaText}}),bn(ct,{get each(){return e.badges},children:e=>bn(cl,{y:-5,children:e})})]}}),vl=e=>bn(pn,Tn(e,{style:{display:"flex",flexDirection:"column",width:al,height:220,gap:16},get children(){return[bn(ll,{get children(){return e.title}}),bn(hl,{get children(){return e.description}}),bn(ft,{get when(){return e.voteCount},get children(){return bn(pl,{get metaText(){return e.metaText},get badges(){return e.badges},get voteCount(){return e.voteCount},get voteAverage(){return e.voteAverage}})}})]}}));function gl(e){return e.split("-")[0]}function ml({type:e,id:t}){return tl.get(`/${e}/${t}/recommendations`).then((({results:t})=>t.length?rl(t.slice(0,7)):tl.get(`/trending/${e}/week?page=1`).then((({results:e})=>rl(e.slice(0,7))))))}function xl({type:e,id:t}){return tl.get(`/${e}/${t}/credits`).then((({cast:e})=>rl(e.slice(0,7))))}function yl({type:e,id:t}){var r="movie"===e?{rtCrit:86,rtFan:92}:{};return tl.get(`/${e}/${t}`).then((t=>{return S({backgroundImage:qs(t.backdrop_path,"w1280"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD","CC"],voteAverage:t.vote_average,voteCount:t.vote_count,metaText:"movie"===e?(i=t.runtime,a=i%60,Math.floor(i/60)+"h "+(a<10?"0":"")+a+"min "+(n=t.release_date,o=n.split("-"),o[1]+"/"+o[2]+"/"+o[0])):`${gl(t.first_air_date)} - ${gl(t.last_air_date)}`,reviews:r}},t);var n,o,i,a}))}var bl=()=>{var e=Gn(),t=C(Ce(0),2),r=t[0],n=t[1],o=C(Ce(),2),i=o[0];o[1];Ie(i,yl);var a=C(Ce({}),2),s=a[0],l=a[1],d=$n(),u=Be((()=>0)),h=ke((()=>{return il((t=e.filter||"all",e=>{var r=`/trending/${t}/week?page=${e}`;if(nl.has(r))return nl.get(r);var n=tl.get(r).then((e=>{var r=e.results.filter((e=>!e.adult)),n=function(e,t=7){for(var r=[],n=0,o=e.length;nni(e)),400),f=Bo((e=>l(e)),200);function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),n(-1*(this.y||0)+24);var t=h().pages().length;(0===t||this.parent.selected&&this.parent.selected>=t-2)&&h().setPage((e=>e+1))}function v(){var e=this.children.selected;return _(e&&e.href),d(e.href),!0}return Re(Ne(gt,(e=>{e.backdrop&&c(e.backdrop),e.heroContent&&f(e.heroContent)}),{defer:!0})),bn(ft,{get when(){return h().pages().length},get children(){return[bn(vl,Tn({y:360,x:162},s)),bn(pn,{clipping:!0,get style(){return Os.itemsContainer},get children(){return bn(Zi,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return Os.Column},get children(){return bn(ct,{get each(){return h().pages()},children:(e,t)=>bn(Ks,{get autofocus(){return u(t())},items:e,width:1620,onFocus:p,onEnter:v})})}})}})]}})},wl=()=>{var e=$n(),t=Be((()=>0));function r(){var t=this.children.selected;_(t&&t.id),e("/"+t.id)}var n=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(e){var t=C(Ce(4294967295),2),r=t[0],n=t[1];return bn(pn,Tn(e,{onFocus:()=>n(255),onBlur:()=>n(4294967295),style:{width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},get children(){return bn(pn,{x:30,get children(){return[bn(fn,{y:30,fontSize:84,get color(){return r()},get children(){return e.index}}),bn(fn,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return r()},get children(){return e.title}}),bn(fn,{y:200,fontSize:28,width:330,contain:"width",get color(){return r()},get children(){return e.description}})]}})}}))}var i=C(Ce(140),2),a=i[0],s=i[1];function l(e){s(-400*e.selected+140)}return bn(pn,{colorTop:1147903743,colorBottom:743406847,get children(){return[bn(pn,{x:120,get children(){return[bn(pn,{src:"./assets/solidjs.png",width:101,height:90,y:40}),bn(fn,{fontSize:90,x:110,y:40,children:"Examples"}),bn(pn,{y:140,height:1,width:1800,color:3906468351})]}}),bn(Ba,{onSelectedChanged:l,onEnter:r,transition:{x:{delay:20,duration:300}},get x(){return a()},y:300,width:4400,get style(){return Os.Row},justifyContent:"flexStart",gap:40,get children(){return bn(ct,{each:n,children:(e,r)=>bn(o,Tn({get autofocus(){return t(r())},get index(){return r()}},e))})}})]}})},Sl=()=>{var e={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:Rn("00000000")},t={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:Rn("00000000")},r={fontSize:42},n={width:e.width,fontSize:26,contain:"width"},o={fontSize:26};return Fe((()=>{ni("#000000")})),bn(pn,{autofocus:!0,style:e,get children(){return[bn(fn,{style:r,children:"Title of the Page"}),bn(fn,{style:n,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),bn(pn,{style:t,get children(){return[bn(fn,{style:o,children:"Subline Text"}),bn(pn,{width:28,height:28,src:"./assets/rt-popcorn.png"}),bn(fn,{style:o,children:"More Text"})]}})]}})},Al=()=>{var e,t,r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:Rn("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:Rn("00000000")},o={fontSize:42},i={fontSize:26};Fe((()=>{ni("#000000"),e.animate({x:100},{duration:2e3}).start()}));var a=C(Ce(),2),s=a[0],l=a[1],d=C(Ce(),2),u=d[0];d[1];setTimeout((()=>{var e;l("- Inserted -"),null===(e=t.getChildById("child1"))||void 0===e||e.animate({x:600},{duration:2e3}).start()}),2e3);var h={width:400,height:300,color:Rn("#0000ff")},c={color:Rn("#f54242"),focus:{color:Rn("#4287f5")}};function f(e){var t=We((()=>e.children));return bn(pn,Tn(e,{get style(){return[c,e.style,[h]]},get children(){return[bn(pn,{id:"child1",width:100,height:100,get color(){return Rn("#ff0000")},y:25,get children(){return[yn((()=>t())),bn(pn,{id:"subChild",x:150,width:100,height:100,get color(){return Rn("#00ff00")}}),bn(fn,{get children(){return e.title}})]}}),bn(pn,{width:100,height:100,get color(){return Rn("#ffff00")},y:175,get children(){return t()}})]}}))}var p={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},v={color:Rn("#cccccc"),focus:{color:Rn("#000000")}},g={color:Rn("#ffffff"),focus:{color:Rn("#f6f6cc")}};return bn(pn,{style:r,get children(){return[bn(fn,{style:o,children:"Title of the Page"}),bn(pn,{style:n,get children(){return[bn(fn,{get children(){return u()}}),bn(fn,{style:i,get children(){return["Sub ",yn((()=>s()))," Text"]}}),bn(ft,{get when(){return s()},get children(){return bn(pn,{width:28,height:28,src:"./assets/rt-popcorn.png"})}}),bn(fn,{style:i,children:"More Text"})]}}),bn(f,{autofocus:!0,ref(e){"function"==typeof t?t(e):t=e},style:[g,v],get children(){return bn(fn,{children:"Child Test"})}}),bn(pn,{ref(t){"function"==typeof e?e(t):e=t},style:p,width:100,height:100,get color(){return Rn("#00ff00")},x:900,y:400,get alpha(){return e.states.has("focus")?1:.2}})]}})},Cl=()=>{var e,t,r=C(Ce([]),2),n=r[0],o=r[1],i={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:Rn("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},a={fontSize:32,x:960,y:540,mount:.5,lineheight:52},s=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function l(e,t){o((t=>[...t,e].slice(-4))),console.log(e)}return Fe((()=>{ni("#000000"),e.x=910,e.y=490,t=setInterval((()=>{e.rotation=s(-90,90),e.x=s(-300,2220),e.y=s(-300,1380)}),2500)})),Le((()=>{clearInterval(t)})),bn(pn,{get children(){return[bn(fn,{style:a,get children(){return n().join("\n")}}),bn(pn,{autofocus:!0,style:i,ref(t){"function"==typeof e?e(t):e=t},onEvents:[["inBounds",e=>l("inBounds")],["outOfBounds",e=>l("outOfBounds")],["inViewport",e=>l("inViewport")],["outOfViewport",e=>l("outOfViewport")]]})]}})},Tl=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:Rn("00000000"),gap:26,y:400};function r(e){return bn(pn,Tn(e,{forwardStates:!0,get style(){return Ws.container},get children(){return bn(fn,{get style(){return Ws.text},get children(){return e.children}})}}))}var n=e=>{return t=wn("node"),_n(Ao,t,(()=>[10,15])),An(t,Tn(e,{get style(){return{color:Rn("#000000be"),borderRadius:8,border:{width:2,color:Rn("#ffffff")}}}}),!0),Sn(t,bn(fn,{style:{fontSize:20},get children(){return e.children}})),t;var t};return[bn(Ba,{x:100,y:200,gap:5,style:t,get children(){return[bn(n,{children:"HD"}),bn(n,{children:"PG13"}),bn(n,{children:"NC17"}),bn(fn,{fontSize:30,children:"I like bananas"}),bn(n,{children:"DOLBY"})]}}),bn(Ba,{x:100,gap:40,style:t,get children(){return[bn(r,{autofocus:!0,onEnter:e,children:"TV Shows"}),bn(r,{states:{active:!0,disabled:!1},children:"Movies"}),bn(r,{states:"active",children:"Sports"}),bn(r,{states:"disabled",children:"News"})]}})]},_l=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:Rn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return bn(pn,Tn(e,{style:{width:200,height:100,y:5,color:392801023}}))}var n=C(Ce(50),2),o=n[0],i=n[1];function a(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),i(150+-1*(this.y||0))}Fe((()=>{ni("#333333")}));var s=50;return bn(Zi,{x:160,get y(){return o()},gap:30,height:850,get width(){return e.width},get style(){return Os.Column},get children(){return[bn(fn,{style:t,children:"Flex Start"}),bn(Ba,{gap:s,style:e,onFocus:a,get children(){return[bn(r,{autofocus:!0}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(fn,{style:t,children:"Flex Start - Margin Left"}),bn(Ba,{gap:s,style:e,onFocus:a,get children(){return[bn(r,{marginLeft:100}),bn(r,{}),bn(r,{marginLeft:100}),bn(r,{}),bn(r,{})]}}),bn(fn,{style:t,children:"Flex End"}),bn(Ba,{gap:s,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(fn,{style:t,children:"Flex End - Margin Right"}),bn(Ba,{gap:s,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[bn(r,{}),bn(r,{marginRight:100}),bn(r,{}),bn(r,{}),bn(r,{marginRight:100})]}}),bn(fn,{style:t,children:"Center - No Margin Support"}),bn(Ba,{gap:s,justifyContent:"center",style:e,onFocus:a,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(fn,{style:t,children:"Space Between - No Margin Support"}),bn(Ba,{gap:s,justifyContent:"spaceBetween",style:e,onFocus:a,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(fn,{style:t,children:"Space Evenly - No Margin Support"}),bn(Ba,{gap:s,justifyContent:"spaceEvenly",style:e,onFocus:a,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}})]}})},Rl=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:Rn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return bn(pn,Tn(e,{style:{width:200,height:100,y:5,color:392801023}}))}function n(){return Math.floor(91*Math.random())+10}var o=C(Ce(50),2),i=o[0],a=o[1];function s(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),a(150+-1*(this.y||0))}Fe((()=>{ni("#333333")}));var l=50;return bn(Zi,{x:160,get y(){return i()},gap:30,height:850,get width(){return e.width},get style(){return Os.Column},get children(){return[bn(fn,{style:t,children:"Flex Start - AlignItems: center"}),bn(Ba,{alignItems:"center",gap:l,style:e,onFocus:s,get children(){return[bn(r,{autofocus:!0,get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}})]}}),bn(fn,{style:t,children:"Flex Start - Margin Left - AlignItems: flexStart"}),bn(Ba,{gap:l,alignItems:"flexStart",style:e,onFocus:s,get children(){return[bn(r,{marginLeft:100,get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{marginLeft:100,get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}})]}}),bn(fn,{style:t,children:"Flex End - AlignItems: flexEnd"}),bn(Ba,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:e,onFocus:s,get children(){return[bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}})]}}),bn(fn,{style:t,children:"Flex End - Margin Right"}),bn(Ba,{gap:l,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[bn(r,{get height(){return n()}}),bn(r,{marginRight:100,get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{marginRight:100,get height(){return n()}})]}}),bn(fn,{style:t,children:"Center - No Margin Support"}),bn(Ba,{gap:l,justifyContent:"center",style:e,onFocus:s,get children(){return[bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}})]}}),bn(fn,{style:t,children:"Space Between - No Margin Support"}),bn(Ba,{gap:l,justifyContent:"spaceBetween",style:e,onFocus:s,get children(){return[bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}})]}}),bn(fn,{style:t,children:"Space Evenly - No Margin Support"}),bn(Ba,{gap:l,justifyContent:"spaceEvenly",style:e,onFocus:s,get children(){return[bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}}),bn(r,{get height(){return n()}})]}})]}})},kl=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:Rn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:Rn("#4dabf5"),height:850,width:80};function r(e){var t={width:Math.floor(61*Math.random())+10,height:80,x:5,color:Rn("#1769aa")};return bn(pn,Tn(e,{style:t}))}var n=C(Ce(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}Fe((()=>{ni("#333333")}));var a=50;return[bn(fn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),bn(Ba,{gap:a,style:e,onFocus:i,get children(){return[bn(Zi,{gap:30,style:t,alignItems:"center",get children(){return[bn(r,{autofocus:!0}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,style:t,onFocus:i,alignItems:"flexStart",get children(){return[bn(r,{marginTop:100}),bn(r,{}),bn(r,{marginTop:100}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,alignItems:"flexEnd",justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{marginBottom:100}),bn(r,{}),bn(r,{}),bn(r,{marginBottom:100})]}}),bn(Zi,{gap:a,justifyContent:"center",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}})]}})]},Il=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:Rn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:Rn("#4dabf5"),height:850,width:60};function r(e){var t={width:50,height:80,x:5,color:Rn("#1769aa")};return bn(pn,Tn(e,{style:t}))}var n=C(Ce(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}Fe((()=>{ni("#333333")}));var a=50;return[bn(fn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),bn(Ba,{gap:a,style:e,onFocus:i,get children(){return[bn(Zi,{gap:30,style:t,get children(){return[bn(r,{autofocus:!0}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,style:t,onFocus:i,get children(){return[bn(r,{marginTop:100}),bn(r,{}),bn(r,{marginTop:100}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{marginBottom:100}),bn(r,{}),bn(r,{}),bn(r,{marginBottom:100})]}}),bn(Zi,{gap:a,justifyContent:"center",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}}),bn(Zi,{gap:a,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{}),bn(r,{})]}})]}})]},Bl=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:Rn("00000000"),gap:26,y:400,x:100},r={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},n=["RoundedRectangle",{radius:65}];function o(e){return bn(pn,Tn(e,{forwardStates:!0,style:r,shader:n,get children(){return bn(fn,{style:js,get children(){return e.children}})}}))}return bn(Ba,{style:t,get children(){return[bn(o,{autofocus:!0,onEnter:e,children:"Focused"}),bn(o,{states:{active:!0,disabled:!1},children:"Normal"}),bn(o,{states:"disabled",children:"Disabled"})]}})},El="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function Nl(){return(Nl=b(x().mark((function e(){var t,r;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.getElementById("video"),r=new shaka.Player,e.next=4,r.attach(t);case 4:return window.player=r,r.addEventListener("error",Fl),e.prev=6,e.next=9,r.load(El);case 9:console.log("The video has now been loaded!"),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),Ll(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function Fl(e){Ll(e.detail)}function Ll(e){console.error("Error code",e.code,"object",e)}document.addEventListener("DOMContentLoaded",(function(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?function(){Nl.apply(this,arguments)}():console.error("Browser not supported!")}));var zl=()=>{var e=Gn(),t=$n(),r=C(Ie((()=>S({},e)),yl),1)[0],n=C(Ie((()=>S({},e)),xl),1)[0],o=C(Ie((()=>S({},e)),ml),1)[0],i=C(Ce(0),2),a=i[0],s=i[1];Re(Ne(r,(e=>{ni(e.backgroundImage)}),{defer:!0}));var l,d,u,h=640,c={color:Rn("#000000"),alpha:0,width:1900,height:890,x:-160,y:h,borderRadius:30};function f(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=h,d.y=h,d.alpha=0}function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=200,d.y=160,d.alpha=.9}function v(){var e=this.children.selected;_(e&&e.href),t(e.href)}function g(){var e;(e=document.getElementById("video")).hidden=!0,e.pause(),document.getElementsByTagName("canvas")[0].focus(),u.setFocus(),s(0)}function m(){var e=function(){var e=document.getElementById("video");return e.hidden=!1,setTimeout((()=>e.play()),50),e.focus(),e}();mt(e),s(.9)}return bn(ft,{get when(){return r()},keyed:!0,get children(){return[bn(pn,{x:170,onUp:()=>u.setFocus(),onEscape:g,get children(){return[bn(vl,Tn({y:260},(()=>r().heroContent))),bn(Ba,{ref(e){"function"==typeof u?u(e):u=e},y:500,scroll:"none",height:90,width:640,gap:40,onDown:()=>l.setFocus(),onEnter:m,get children(){return[bn(zi,{width:300,autofocus:!0,children:"Play"}),bn(zi,{width:300,children:"Resume"})]}}),bn(Zi,{ref(e){"function"==typeof l?l(e):l=e},x:0,y:h,get style(){return Os.Column},zIndex:5,get children(){return bn(ft,{get when(){return yn((()=>!!o()))()&&n()},get children(){return[bn(fn,{skipFocus:!0,get style(){return Os.RowTitle},children:"Recommendations"}),bn(Ks,{onFocus:f,onEnter:v,get items(){return o()},width:1620}),bn(fn,{skipFocus:!0,get style(){return Os.RowTitle},children:"Cast and Crew"}),bn(Ks,{onFocus:p,onEnter:v,get items(){return n()},width:1620})]}})}}),bn(pn,{ref(e){"function"==typeof d?d(e):d=e},style:c,transition:{alpha:!0,y:!0}})]}}),bn(pn,{get alpha(){return a()},get color(){return Rn("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function Ml({id:e}){return tl.get(`/person/${e}/combined_credits`).then((({cast:e})=>rl(e.slice(0,7))))}function Dl({id:e}){return tl.get(`/person/${e}`).then((e=>S({backgroundImage:qs(e.profile_path,"original"),heroContent:{title:e.title||e.name,description:e.biography}},e)))}var Pl=()=>{var e=Gn(),t=$n(),r=C(Ie((()=>S({},e)),Dl),1)[0],n=C(Ie((()=>S({},e)),Ml),1)[0],o={color:Rn("#000000"),alpha:.8,width:800,height:440,x:130,y:180,borderRadius:30};function i(){var e=this.children.selected;_(e&&e.href),t(e.href)}return Fe((()=>{ni("#333333")})),bn(ft,{get when(){return r()},keyed:!0,get children(){return[bn(pn,{get src(){return r().backgroundImage},width:400,autosize:!0,y:0,x:1800,mountX:1}),bn(pn,{x:150,y:200,width:800,gap:24,get style(){return Os.Column},zIndex:3,get children(){return[bn(fn,{contain:"width",fontFamily:"Ubuntu",get style(){return oi.typography.display2},get children(){return r().name}}),bn(fn,{contain:"both",get style(){return Os.peopleBio},get children(){return r().biography}})]}}),bn(pn,{style:o}),bn(Zi,{y:670,x:140,get style(){return Os.Column},scroll:"none",get children(){return bn(ft,{get when(){return n()},get children(){return[bn(fn,{skipFocus:!0,get style(){return Os.RowTitle},children:"Credits"}),bn(Ks,{autofocus:!0,onEnter:i,get items(){return n()}})]}})}})]}})},Ol=()=>{return e=wn("node"),Cn(e,"style",{width:1920,height:1080,color:868483072}),e;var e},Ul=new URL("AppCoreExtensions-legacy-TAdaOCdk.js",w.meta.url).href;Gr.debug=!1,Gr.animationsEnabled=!0,Gr.fontSettings.fontFamily="Ubuntu",Gr.fontSettings.color=Rn("#f6f6f6"),Gr.fontSettings.fontSize=32,Gr.rendererOptions={coreExtensionModule:Ul,fpsUpdateInterval:200,enableInspector:!0},xn((()=>bn(co,{root:e=>bn(Ps,e),get children(){return[bn(ao,{path:"",component:bl}),bn(ao,{path:"examples",component:wl}),bn(ao,{path:"browse/:filter",component:bl}),bn(ao,{path:"text",component:Sl}),bn(ao,{path:"buttons",component:Tl}),bn(ao,{path:"flex",component:_l}),bn(ao,{path:"create",component:Al}),bn(ao,{path:"viewport",component:Cl}),bn(ao,{path:"flexsize",component:Rl}),bn(ao,{path:"flexcolumnsize",component:kl}),bn(ao,{path:"flexcolumn",component:Il}),bn(ao,{path:"buttonsmaterial",component:Bl}),bn(ao,{path:"entity/people/:id",component:Pl}),bn(ao,{path:"entity/:type/:id",component:zl}),bn(ao,{path:"*all",component:Ol})]}})))}}}))}(); -//# sourceMappingURL=index-legacy-DV4tWBPR.js.map diff --git a/assets/index-legacy-DV4tWBPR.js.map b/assets/index-legacy-DV4tWBPR.js.map deleted file mode 100644 index 3b3bfd1..0000000 --- a/assets/index-legacy-DV4tWBPR.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-legacy-DV4tWBPR.js","sources":["../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/dev.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/activeElement.ts","../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/lightningInit.ts","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/children.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/config.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/utils.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/states.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/node/index.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/flex.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/components/Text.tsx","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/dev.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/solidUniversal.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/core/render.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.6_@babel+core@7.24.4_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.4_vite@5.2.8/node_modules/@lightningjs/solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/dev.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.1_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_l6qk66ywnsrdb5zvon2uxgrjiy/node_modules/@lightningjs/solid-ui/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nconst DevHooks = {\n afterUpdate: null,\n afterCreateOwner: null,\n afterCreateSignal: null\n};\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n }\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned\n ? () =>\n fn(() => {\n throw new Error(\"Dispose method must be an explicit argument to createRoot function\");\n })\n : () => fn(() => untrack(() => cleanNode(root)));\n DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n {\n if (options.name) s.name = options.name;\n if (DevHooks.afterCreateSignal) DevHooks.afterCreateSignal(s);\n if (!options.internal) registerGraph(s);\n }\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE, options);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE, options);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE, options),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0,\n options\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0, options);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE,\n options\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n console.warn(\"cleanups created outside a `createRoot` or `render` will never be run\");\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction devComponent(Comp, props) {\n const c = createComputation(\n () =>\n untrack(() => {\n Object.assign(Comp, {\n [$DEVCOMP]: true\n });\n return Comp(props);\n }),\n undefined,\n true,\n 0\n );\n c.props = props;\n c.observers = null;\n c.observerSlots = null;\n c.name = Comp.name;\n c.component = Comp;\n updateComputation(c);\n return c.tValue !== undefined ? c.tValue : c.value;\n}\nfunction registerGraph(value) {\n if (!Owner) return;\n if (Owner.sourceMap) Owner.sourceMap.push(value);\n else Owner.sourceMap = [value];\n value.graph = Owner;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id, options),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()), undefined, {\n name: \"children\"\n });\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (true) throw new Error(\"Potential Infinite Loop Detected.\");\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null)\n console.warn(\"computations created outside a `createRoot` or `render` will never be disposed\");\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (options && options.name) c.name = options.name;\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(c);\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n else DevHooks.afterUpdate && DevHooks.afterUpdate();\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n delete node.sourceMap;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined,\n options\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null)\n console.warn(\"error handlers created outside a `createRoot` or `render` will never be run\");\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j, {\n name: \"index\"\n });\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i], {\n name: \"value\"\n });\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = devComponent(Comp, props || {});\n setHydrateContext(c);\n return r;\n }\n }\n return devComponent(Comp, props || {});\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (true)\n Object.assign(Comp, {\n [$DEVCOMP]: true\n });\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name =>\n `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(\n mapArray(() => props.each, props.children, fallback || undefined),\n undefined,\n {\n name: \"value\"\n }\n );\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(\n indexArray(() => props.each, props.children, fallback || undefined),\n undefined,\n {\n name: \"value\"\n }\n );\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b),\n name: \"condition\"\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n {\n name: \"value\"\n }\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals,\n name: \"eval conditions\"\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n {\n name: \"value\"\n }\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, {\n name: \"errored\"\n });\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n if (typeof f !== \"function\" || f.length == 0) console.error(e);\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n {\n name: \"value\"\n }\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = {\n hooks: DevHooks,\n writeSignal,\n registerGraph\n};\nif (globalThis) {\n if (!globalThis.Solid$$) globalThis.Solid$$ = true;\n else\n console.warn(\n \"You appear to have multiple instances of Solid. This can lead to unexpected behavior.\"\n );\n}\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n if (!(src.substr(0, 5) == \"data:\")) {\n // Base64.\n img.crossOrigin = \"Anonymous\";\n }\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha, parentHasRenderTexture, framebufferDimensions) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex, false, parentHasRenderTexture, framebufferDimensions);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n const parentHasRenderTexture = props.parent?.rtt ?? props.parent?.parentHasRenderTexture ?? false;\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n rtt: props.rtt ?? false,\n parentHasRenderTexture,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n hasRTTupdates = false;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n // Assign a default value to parentHasRenderTexture\n parentHasRenderTexture: false,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n // Allow for Render Texture to be processed appropriately\n this.rtt = props.rtt;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // If parent has a render texture, flag that we need to update\n // @todo: Reserve type for RTT updates\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(1);\n }\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n queueMicrotask(() => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n // If node is part of RTT texture\n // Flag that we need to update\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(type);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n }\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children &&\n this.children.length &&\n !this.rtt) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps, rtt, parentHasRenderTexture, } = this.props;\n // Prevent quad rendering if parent has a render texture\n // and renderer is not currently rendering to a texture\n if (parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n rtt,\n parentHasRenderTexture,\n framebufferDimensions: this.framebufferDimensions,\n });\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n if (newParent.rtt || newParent.parentHasRenderTexture) {\n this.setRTTUpdates(UpdateType.All);\n }\n }\n this.parentHasRenderTexture =\n newParent?.rtt || newParent?.parentHasRenderTexture;\n this.updateScaleRotateTransform();\n }\n get rtt() {\n return this.props.rtt;\n }\n set rtt(value) {\n if (!value) {\n return;\n }\n this.props.rtt = true;\n this.hasRTTupdates = true;\n // Store RTT nodes in a separate list\n this.stage.renderer?.renderToTexture(this);\n }\n set parentHasRenderTexture(value) {\n this.props.parentHasRenderTexture = !!value;\n }\n get parentHasRenderTexture() {\n return this.props.parentHasRenderTexture;\n }\n /**\n * Returns the framebuffer dimensions of the node.\n * If the node has a render texture, the dimensions are the same as the node's dimensions.\n * If the node does not have a render texture, the dimensions are inherited from the parent.\n * If the node parent has a render texture and the node is a render texture, the nodes dimensions are used.\n */\n get framebufferDimensions() {\n if (this.parentHasRenderTexture && !this.rtt) {\n return this.parent?.framebufferDimensions;\n }\n return { width: this.width, height: this.height };\n }\n /**\n * Returns the parent render texture node if it exists.\n */\n get parentRenderTexture() {\n let parent = this.parent;\n while (parent) {\n if (parent.rtt) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n get texture() {\n return this.props.texture;\n }\n setRTTUpdates(type) {\n this.hasRTTupdates = true;\n this.parent?.setRTTUpdates(type);\n }\n}\n//# sourceMappingURL=CoreNode.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n rtt: props.rtt,\n parentHasRenderTexture: props.parentHasRenderTexture,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this.rtt = props.rtt;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n get rtt() {\n return this.coreNode.rtt;\n }\n set rtt(value) {\n if (value) {\n this.texture = this.rendererMain.createTexture('RenderTexture', {\n width: this.width,\n height: this.height,\n }, { preload: true, flipY: true });\n }\n this.coreNode.rtt = value;\n }\n get parentHasRenderTexture() {\n return this.coreNode.parentHasRenderTexture;\n }\n set parentHasRenderTexture(value) {\n this.coreNode.parentHasRenderTexture = value;\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n this.registerTextureType('RenderTexture', RenderTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // Reset render operations and clear the canvas\n renderer?.reset();\n // If we have RTT nodes draw them first\n // So we can use them as textures in the main scene\n if (renderer.rttNodes.length > 0) {\n renderer.renderRTTNodes();\n }\n // Fill quads buffer\n this.addQuads(this.root);\n // Perform render pass\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n // Prevent quad rendering if parent has a render texture\n // and this node is not the render texture\n if (this.parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n this.globalTransform.multiply(this.localTransform ?? Matrix3d.identity());\n }\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha, this.parentHasRenderTexture, this.framebufferDimensions);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n parentHasRenderTexture: false,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n let changedLayout = false;\n if (isFunc(this.onBeforeLayout)) {\n changedLayout = this.onBeforeLayout.call(\n this,\n child,\n dimensions,\n ) as boolean;\n }\n\n if (this.display === 'flex') {\n if (calculateFlex(this) || changedLayout) {\n this.parent?.updateLayout();\n }\n } else if (changedLayout) {\n this.parent?.updateLayout();\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n $DEVCOMP\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n if (!element) {\n throw new Error(\n \"The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.\"\n );\n }\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n if (sharedConfig.context)\n throw new Error(\n \"Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.\"\n );\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n if (sharedConfig.context)\n throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}`);\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else console.warn(`Unrecognized value. Skipped inserting`, value);\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = true;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n Object.assign(component, {\n [$DEVCOMP]: true\n });\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n // let flex know we need to re-layout\n return true;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For, hexColor } from \"@lightningjs/solid\";\nimport { createMemo, For as For$1, createSignal } from \"solid-js\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For$1, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For$1, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKU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JKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NY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gWgs8pQ06lxY3N4QtCWZBRgPDezdnHvPr+alV2EiaL0DlF2Dbn20bdB40XtHwQ5nOHqAC0SyCjEM1Wkv57AqACkRvBvB2p7hrDzI6yzU7s90EUPNBxtnR4SjwrgGo9EK1Qca8cM4ByU4mkuz++F93ZHELyZX3iW31n+S+sKWZWfNBxkCbNeUq6ekArugo1I0kH1xT8EkBKj1R80HGGkFbtZVkZ3bb2d2r0tUkn1hTh8kBKhB9DMBLnQWfJMjoLFuTZpJsO/ONAB7UUcBLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: (string | number)[];\n Menu: (string | number)[];\n Escape: (string | number)[];\n Backspace: (string | number)[];\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: [\"a\"],\n Menu: [\"m\"],\n Escape: [\"Escape\", 27],\n Backspace: [\"Backspace\", 8],\n Left: [\"ArrowLeft\", 37],\n Right: [\"ArrowRight\", 39],\n Up: [\"ArrowUp\", 38],\n Down: [\"ArrowDown\", 40],\n Enter: [\"Enter\", 13],\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n setupFPS({ renderer });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: \"normal\",\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n fontFamily: \"Ubuntu\",\n fontWeight: 700,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = {\n ...theme.typography.body2,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n};\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"names":["getUnicodeCodepoints","SuspenseContext","equalFn","a","b","$PROXY","Symbol","$TRACK","$DEVCOMP","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","context","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","length","current","undefined","root","updateFn","Error","untrack","cleanNode","runUpdates","createSignal","value","options","s","observers","observerSlots","comparator","Object","assign","name","internal","registerGraph","readSignal","bind","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","render","user","push","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","arguments","pr","initP","scheduled","resolved","dynamic","contexts","Set","_ref2","_slicedToArray","storage","initialValue","setValue","_createSignal2","error","setError","_createSignal4","track","trigger","_createSignal6","state","setState","loadEnd","p","v","key","onHydrated","queueMicrotask","err","_step4","_iterator4","_createForOfIteratorHelper","keys","n","done","decrement","e","f","clear","completeLoad","read","has","increment","add","load","refetching","lookup","status","then","castError","defineProperties","get","loading","latest","refetch","mutate","createSelector","subs","Map","node","_step5","_iterator5","entries","_step5$value","val","_step6","_iterator6","values","pure","l","set","onCleanup","delete","size","on","deps","prevInput","isArray","Array","defer","prevValue","input","i","result","onMount","console","warn","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","Promise","resolve","sourceMap","graph","createContext","defaultValue","id","Provider","createProvider","useContext","children","memo","resolveChildren","toArray","this","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","time","nextValue","forEach","updatedAt","runComputation","init","runTop","suspense","inFallback","effects","ancestors","wait","res","completeUpdates","queue","userLength","ignore","pop","index","obs","cause","results","apply","props","_objectSpread","FALLBACK","dispose","d","createComponent","Comp","component","tValue","devComponent","trueFn","propTraps","_","property","receiver","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","Proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","desc","target","definedKeys","defineProperty","narrowedError","For","fallback","list","mapFn","items","mapped","disposers","len","indexes","j","newItems","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","start","end","newEnd","item","newLen","disposer","mapper","Math","min","slice","_createSignal8","mapArray","each","Show","keyed","condition","when","child","DEV","hooks","afterUpdate","afterCreateOwner","afterCreateSignal","globalThis","Solid$$","_createSignal10","activeElement","setActiveElement","TextureUsageTracker","constructor","releaseCallback","_defineProperty","ManualCountTextureUsageTracker","_options$textureClean","_options$textureClean2","super","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step9","now","Date","thresholdMs","_iterator9","zeroReferenceTextureSet","textureRefInfo","lastUpdate","textureMap","registerTexture","texture","_texture$options","textureId","assertTruthy","nodeRefCount","incrementTextureRefCount","_texture$options2","txType","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","prop","x","y","width","w","height","h","zIndex","fontFamily","fontSize","fontStyle","fontWeight","fontStretch","lineHeight","letterSpacing","textAlign","overflowSuffix","maxLines","contain","verticalAlign","clipping","rotation","scale","scaleX","scaleY","color","convertColorToRgba","domPropertyMap","Inspector","canvas","settings","_settings$appHeight","_settings$deviceLogic","_settings$appWidth","_settings$deviceLogic2","_settings$deviceLogic3","_settings$deviceLogic4","isProductionEnvironment","ceil","appHeight","deviceLogicalPixelRatio","appWidth","document","createElement","setRootPosition","body","appendChild","MutationObserver","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","properties","div","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Reflect","destroyNode","anim","animate","animateNode","getElementById","remove","innerHTML","String","visibility","setAttribute","_stylePropertyMap$pro","mappedStyleResponse","call","setProperty","parentId","parent","_settings$duration","duration","_settings$delay","delay","_props$alpha","_props$rotation","_props$scale","setTimeout","opacity","rotate","ShaderEffect","getEffectKey","getMethodParameters","uniforms","u","uni","define","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","getPropertySetters","freeze","fromEntries","map","setter","requestRender","setStatus","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","eventName","off","scheduleUpdateState","updateScheduled","updateState","WebTrFontFace","TrFontFace","descriptors","fontUrl","fontUrlWithoutParentheses","replace","determinedDescriptors","cssDescriptors","weight","stretch","unicodeRange","variant","featureSettings","display","fontFace","FontFace","loaded","catch","calcHeight","numLines","max","LightningTextTextureRenderer","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","ffs","_load","fonts","fontSetting","check","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","split","lines","usedLines","otherLines","measureText","al","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","draw","linesOverride","linePositionX","linePositionY","textRenderIssueMargin","globalAlpha","fillRect","translate","drawLines","highlight","highlightColor","hlHeight","highlightHeight","offset","highlightOffset","hlPaddingLeft","highlightPaddingLeft","hlPaddingRight","highlightPaddingRight","fillStyle","getRgbaString","drawLine","prevShadowSettings","shadow","shadowColor","shadowOffsetX","shadowOffsetY","shadowBlur","textColor","fillText","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","floor","truncWordWidth","substring","indent","allLines","realNewlines","resultLines","spaceLeft","words","wordWidthWithSpace","concat","space","reduce","acc","char","wordBreak","advancedRenderer","fontBaselineRatio","resolvedGlobal","self","globalFontSet","_resolvedGlobal$docum","tmpElementBounds","createBound","CanvasTextRenderer","OffscreenCanvas","getContext","rendererBounds","x1","y1","x2","y2","fontInfo","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step10","_iterator10","pageInfo","_pageInfo$texture","setRenderableOwner","txManager","loadTexture","src","_pageInfo$texture2","getImageData","preload","renderQuads","clippingRect","_state$textW","_state$textH","_state$props2","elementRect","intersectRect","_canvasPages$0$textur","_canvasPages$0$textur2","_canvasPages$1$textur","_canvasPages$1$textur2","_canvasPages$2$textur","_canvasPages$2$textur2","pageSize","_state$props3","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","renderer","addQuad","colorBl","colorBr","colorTl","colorTr","dimensions","textureOptions","shader","shaderProps","tx","ty","ta","tb","tc","td","_state$canvasPages","_pageInfo$texture3","_state$canvasPages2","_pageInfo$texture4","_state$fontInfo","_state$fontInfo2","DefaultShader","WebGlCoreShader","bindTextures","textures","glw","activeTexture","bindTexture","ctxTexture","vertex","fragment","DefaultShaderBatched","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","t","samplers","from","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","eff","_eff$props","fxClass","uniInfo","fxProp","propInfo","validator","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","currentClass","next","effectMethod","methodCollection","$alpha","makeCacheKey","_props$effects","RoundedRectangle","radius","IDENTITY_MATRIX_3x3","SdfShader","resolvedProps","components","_props$transform","_props$scrollY","_props$color","_props$size","_props$distanceRange","_props$debug","distanceRange","RadiusEffect","args","_props$radius","fillMask","boxDist","BorderEffect","_props$width","_props$color2","rgba","LinearGradientEffect","colors","_props$colors","_props$angle","stops","colorsL","tmp","angle","_LinearGradientEffect","rgbas","fromLinear","toLinear","calcPoint","amount","loop","ColorLoop","GrayscaleEffect","_props$amount","BorderRightEffect","_props$width2","_props$color3","rectDist","BorderTopEffect","_props$width3","_props$color4","BorderBottomEffect","_props$width4","_props$color5","BorderLeftEffect","_props$width5","_props$color6","GlitchEffect","_props$amplitude","_props$narrowness","_props$blockiness","_props$minimizer","_props$time","amplitude","narrowness","blockiness","minimizer","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref3","_props$height","_props$pivot","pivot","_RadialGradientEffect","RadialProgressEffect","_props$width7","_props$progress","_props$offset","_props$range","_props$rounded","_props$radius2","_props$color7","progress","range","PI","rounded","rotateUV","drawDot","HolePunchEffect","_props$radius3","CoreShaderManager","registerShaderType","registerEffectType","shType","shClass","shConstructors","effectType","effectClass","effectConstructors","getRegisteredShaders","loadShader","ShaderClass","loadDynamicShader","cacheKey","shCache","useShader","attachedShader","detach","attach","ContextSpy","reset","data","getData","loadCompressedTexture","_ref4","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","_ref5","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref6","_callee3","pvrHeaderLength","header","dataOffset","pvrtcData","level","_context3","Int32Array","Uint8Array","byteOffset","_x4","ImageTexture","Texture","hasAlphaChannel","mimeType","getTextureData","_this","_callee4","_this$props","blob","img","_callee4$","_context4","ImageData","test","imageWorkerManager","getImage","hasCreateImageBitmap","createImageBitmap","colorSpaceConversion","imageOrientation","t0","t1","Image","substr","crossOrigin","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","codePoint","getUnicodeCodepoints$","_context5","codePointAt","_marked","layoutText","curLineIndex","startX","startY","vertexBuffer","lineCache","rwSdf","trFontFace","shaper","glyphResult","fontSizeRatio","info","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","codepointIndex","maxX","maxY","curX","curY","bufferOffset","lastWord","xStart","shaperProps","glyphs","shapeText","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","_step11","_iterator11","glyph","xAdvance","moreLines","nextLineWillFit","maxCharHeight","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","cluster","codepoint","charEndX","xOffset","quadX","quadY","yOffset","atlasEntry","getAtlasEntry","glyphId","common","scaleW","scaleH","uvWidth","uvHeight","bufferStart","bufferEnd","vertexTextW","line","bufferNumFloats","bufferNumQuads","layoutNumCharacters","fullyProcessed","setRenderWindow","outRenderWindow","bufferMargin","multiple","screen","sdf","isBoundPositive","y1Base","roundUpToMultiple","firstLineIdx","weightConversions","normal","bold","bolder","lighter","fontWeightToNumber","resolveFontToUse","familyMapsByPriority","family","weightIn","_step12","_iterator12","fontFaces","_step13","weightMap","_iterator13","fontFamilyWeight","msg","TrFontManager","textRenderers","trId","tr","resolveFontFace","tmpRect","SdfTextRenderer","ssdfFontFamilies","msdfFontFamilies","sdfShader","releaseFontFace","setElementBoundsX","boundsOverlap","setElementBoundsY","SdfTrFontFace","familyName","fontFamiles","faceSet","webGlBuffers","bufferUploaded","_state$props4","sdfFontSize","sdfLineHeight","distanceField","neededLength","rwScreen","_state$props5","startLineIndex","sdfVerticalAlignYOffset","sdfStartY","sdfX","sdfY","lineIndex","getStartConditions","out2","byteLength","once","parentHasRenderTexture","framebufferDimensions","_trFontFace$data","_state$trFontFace","_state$props6","_state$textW2","_state$textH2","stride","BYTES_PER_ELEMENT","webGlBuffer","createBuffer","BufferCollection","a_position","FLOAT","normalized","a_textureCoordinate","_webGlBuffers$getBuff","_webGlBuffers","getBuffer","arrayBufferData","STATIC_DRAW","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","sdfShaderDebug","getCtxTexture","addTexture","numQuads","addRenderOp","_state$trFontFace2","_state$trFontFace3","fontFamilyArray","_state$props7","_state$props8","loadCoreExtension","_x5","_x6","_loadCoreExtension","_callee12","coreExtensionModule","module$1","ExtensionClass","coreExtension","_callee12$","_context13","log","__vitePreload","module","default","classExtendsCoreExtension","prototype","CoreExtension","run","santizeCustomDataMap","validTypes","boolean","string","number","valueType","RendererMain","_settings$clearColor","_settings$experimenta","_settings$enableConte","_settings$enableInspe","resolvedSettings","txMemByteThreshold","boundsMargin","devicePhysicalPixelRatio","devicePixelRatio","clearColor","experimental_FinalizationRegistryTextureUsageTracker","textureCleanupOptions","fpsUpdateInterval","numImageWorkers","enableContextSpy","enableInspector","releaseTexture","useFinalizationRegistryTracker","textureTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","onCreateNode","nodes","onBeforeDestroyNode","onFpsUpdate","fpsData","onFrameTick","frameTickData","onIdle","inspector","_this2","_callee5","_context6","getRootNode","resolveNodeDefaults","_props$fontSize","_props$text","_props$textRendererOv","_props$fontFamily","_props$fontStyle","_props$fontWeight","_props$fontStretch","_props$textAlign","_props$contain","_props$scrollable","_props$scrollY2","_props$offsetY","_props$letterSpacing","_props$lineHeight","_props$maxLines","_props$textBaseline","_props$verticalAlign","_props$overflowSuffix","_props$debug2","textRendererOverride","_props$color8","_ref7","_ref8","_props$colorTl","_ref9","_ref10","_props$colorTr","_ref11","_ref12","_props$colorBl","_ref13","_ref14","_props$colorBr","_props$data","_ref15","_props$parent$rtt","_props$parent","_props$parent2","_props$x","_props$y","_props$width8","_props$height2","_props$alpha2","_props$autosize","_props$clipping","_props$colorTop","_props$colorBottom","_props$colorLeft","_props$colorRight","_props$zIndex","_props$zIndexLocked","_props$parent3","_props$texture","_props$shader","_props$src2","_props$scale2","_ref16","_props$scaleX","_ref17","_props$scaleY","_props$mount","_ref18","_props$mountX","_ref19","_props$mountY","_props$pivot2","_ref20","_props$pivotX","_ref21","_props$pivotY","_props$rotation2","_props$rtt","colorTop","colorLeft","colorRight","colorBottom","rtt","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","descType","shaderType","getNodeById","toggleFreeze","advanceFrame","rerender","CoreAnimation","propStartValues","propsList","propName","timingFunction","easing","getTimingFunction","delayFor","update","restore","reverse","startValue","endValue","stopMethod","applyEasing","dt","_this$settings","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","makeStartedPromise","started","makeStoppedPromise","finished","activeAnimations","registerAnimation","unregisterAnimation","stoppedResolve","pause","waitUntilStarted","promise","startedPromise","waitUntilStopped","stoppedPromise","startedResolve","_this$animation$setti","Matrix3d","tempMatrix","multiply","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","identity","sx","sy","cos","sin","copy","dst","transpose","other","transformPoint","CoreNodeRenderState","RenderCoords","x3","y3","x4","y4","UpdateType","CoreNodeRenderStateMap","Init","OutOfBounds","InBounds","InViewport","CoreNode","All","autosizeNode","setRTTUpdates","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","_this$props$parent","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent4","_props$parent5","z","destroy","removeAllListeners","_this$props2","renderToTextureActive","parentRenderTexture","activeRttNode","absX","_this$props$parent2","_this$props$parent3","absY","_this$props$parent$ab","_this$props$parent4","newParent","oldParent","splice","_this$stage$renderer","hasRTTupdates","renderToTexture","_this$parent","_this$parent2","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","flipY","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","numWorkers","Blob","blobURL","URL","webkitURL","createObjectURL","Worker","getNextWorker","workerIndex","convertUrlToAbsolute","location","href","absoluteSrcUrl","postMessage","NoiseTexture","_this3","_callee6","_this3$props","pixelData8","_context7","Uint8ClampedArray","random","cacheId","_props$width9","_props$height3","_props$cacheId","CoreTextureManager","WeakMap","hasWorker","registerTextureType","ColorTexture","SubTexture","RenderTexture","textureClass","txConstructors","TextureClass","textureIdCache","_options$cacheKey","descId","textureKeyCache","addTextureIdToCache","textureDescId","textureRefCountMap","count","removeTextureIdFromCache","_this$ctxTextureCache","refCountObj","ctxTextureCache","free","getDebugInfo","keyCacheSize","idCacheSize","textureSource","createCtxTexture","TextureMemoryManager","byteThreshold","threshold","setTextureMemUse","byteSize","memUsed","gc","Stage","rootId","txMemManager","contextSpy","bm","monitorTextureCache","debugInfo","WebGlCoreRenderer","pixelRatio","bufferMemory","fontManager","isIdle","runLoop","rootNode","updateAnimations","hasSceneUpdates","calculateFps","drawFrame","requestAnimationFrame","lastFrameTime","currentFrameTime","deltaTime","renderRequested","rttNodes","renderRTTNodes","addQuads","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i14","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","_this$props$parent5","_this$localTransform","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","isDev","BASE_URL","MODE","PROD","SSR","LEGACY","config","animationsEnabled","animationSettings","fontSettings","hasDebug","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","_animationQueue","_animationRunning","_renderProps","_effects","lng","_p$lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationQueueSettings","_this5","_callee8","_callee8$","_context9","setFocus","forwardFocus","focusedIndex","autofocus","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","_step15","_iterator15","found","states","_states","_stateChanged","_animationSettings","_this$parent3","changedLayout","onBeforeLayout","hasOrder","flexItem","flexOrder","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","flexBoundary","calculatedSize","toPad","calculateFlex","_this$parent4","onLayout","forwardStates","_undoStyles","_step14","_iterator14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_autosized","marginBottom","isNaN","onFail","onLoad","onCreate","handler","_node$lng","inode","solid","_loop2","_i17","_LightningRendererNum","_loop3","_i18","_LightningRendererNon","borderRadius","_borderRadius","border","borderLeft","borderRight","borderTop","borderBottom","linearGradient","_linearGradient","Text","_el$","_$createElement","View","createRenderer$1","replaceText","insertNode","removeNode","getParentNode","getFirstChild","getNextSibling","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","spread","setProp","use","arg","universalLightning","anchor","solidRenderer","createRenderer","_ref22","_callee9","_callee9$","_context10","rendererOptions","_x7","_x8","hexColor","Number","isInteger","startsWith","$$EVENTS","eventHandler","composedPath","disabled","cancelBubble","_$host","host","depth","createBeforeLeave","listeners","subscribe","confirm","to","_step16","defaultPrevented","preventDefault","_iterator16","_loop4","retry","force","navigate","saveCurrentDepth","history","_depth","replaceState","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","basePath","fromPath","toLowerCase","extractSearchParams","params","searchParams","createMatcher","partial","matchFilters","_path$split2","pattern","splat","segments","Boolean","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","isEqual","localeCompare","sensitivity","some","createMemoObject","expandOptionals","exec","prefix","prefixes","expansion","intent","RouterContextObj","RouteContextObj","useRouter","message","invariant","useNavigate","navigatorFactory","useLocation","useParams","createRoutes","routeDef","isLeaf","shared","asArray","_step18","_iterator18","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step19","_iterator19","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref23","_callee10","_context11","finish","_x9","_createSignal14","reference","setReference","_createSignal16","origin","path_","pathname","search","hash","query","createLocation","referrers","submissions","baseRoute","outlet","_source","_replace$resolve$scro","nextState","resolvedTo","first","go","navigateFromRoute","preloadRoute","preloadData","prevIntent","_loop5","_matches$match","singleFlight","createRouterComponent","routerState","router","_$createComponent","Root","rootLoad","_$memo","Routes","routeStates","nextMatches","prevMatches","equal","_loop6","prevMatch","nextMatch","_match$route","createRouteContext","createOutlet","Route","childRoutes","scrollToHash","fallbackTop","selector","querySelector","scrollIntoView","scrollTo","actions","setupNativeEvents","explicitLinks","actionBase","preloadTimeout","handleAnchor","evt","button","metaKey","altKey","ctrlKey","shiftKey","Node","nodeName","toUpperCase","hasAttribute","svg","namespaceURI","baseVal","rel","getAttribute","baseURI","handleAnchorClick","_res","parse","handleAnchorPreload","_res2","handleAnchorIn","_res3","handleAnchorOut","clearTimeout","handleFormSubmit","actionRef","submitter","FormData","append","eventNames","delegateEvents","removeEventListener","hashParser","str","_window$location$hash3","HashRouter","getSource","intercept","createRouter","keepDepth","hashIndex","notify","bindEvent","block","prevDepth","notifyIfNotBlocked","tryOnCleanup","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","_createSignal18","setEvent","makeEventListener","currentSeries","keyMapEntries","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Backspace","Escape","_createSignal20","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","_loop7","_Object$entries3$_i","_Object$entries3","_i20","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","onFocus","elm","onBlur","mappedKeyEvent","keyCode","_step20","finalFocusElm","_iterator20","onKeyHandler","onKeyPress","withPadding","padding","right","bottom","pad","_pad","marginLeft","maxHeight","marginTop","speak","phrase","utterances","lang","synth","speechSynthesis","utterance","SpeechSynthesisUtterance","onend","speakSeries","series","remainingPhrases","flattenedSeries","flattenStrings","nestedSeriesResults","active","_callee11","totalRetries","retriesLeft","seriesResult","_seriesResult","_callee11$","_context12","SpeechSynthesisErrorEvent","toSpeak","cancel","SpeechEngine","resetFocusPathTimer","currentlySpeaking","debounce","timeoutId","debounced","voiceOutDisabled","debounceWithFlush","scopedValue","newValue","getElmName","onFocusChangeCore","Announcer","onFocusChange","enabled","every","focusDiff","toAnnounceText","toAnnounce","announce","title","announceContext","table","clearPrevFocus","notification","_currentlySpeaking","textToSpeech","finally","refresh","setupTimers","focusDebounce","focusChangeTimeout","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","_p","_q","_r","_createSignal22","globalBackground","setGlobalBackground","theme","primary","secondary","tertiary","inactive","full","none","alpha1","alpha2","alpha3","alpha4","alpha5","xfast","fast","slow","xslow","expressive","expressiveEntrance","expressiveExit","standard","standardEntrance","standardExit","utility","utilityEntrance","utilityExit","asset","arrowLeft","arrowRight","backspaceOutline","palette","white","black","grey","red","orange","yellow","green","blue","purple","material","materialBrand","overlay","textNeutral","textNeutralSecondary","textNeutralTertiary","textNeutralDisabled","textInverse","textInverseSecondary","textInverseTertiary","textInverseDisabled","textBrand","textBrandSecondary","textBrandTertiary","textBrandDisabled","textPositive","textNegative","textInfo","textCaution","fillTransparent","fillNeutral","fillNeutralSecondary","fillNeutralTertiary","fillNeutralDisabled","fillInverse","fillInverseSecondary","fillInverseTertiary","fillInverseDisabled","fillBrand","fillBrandSecondary","fillBrandTertiary","fillBrandDisabled","fillPositive","fillNegative","fillInfo","fillCaution","strokeNeutral","strokeNeutralSecondary","strokeNeutralTertiary","strokeNeutralDisabled","strokeInverse","strokeInverseSecondary","strokeInverseTertiary","strokeInverseDisabled","strokeBrand","strokeBrandSecondary","strokeBrandTertiary","strokeBrandDisabled","strokePositive","strokeNegative","strokeInfo","strokeCaution","interactiveNeutral","interactiveNeutralFocus","interactiveNeutralFocusSoft","interactiveInverse","interactiveInverseFocus","interactiveInverseFocusSoft","interactiveBrand","interactiveBrandFocus","interactiveBrandFocusSoft","shadowNeutral","shadowNeutralFocus","shadowNeutralFocusSoft","shadowNeutralText","shadowInverse","shadowInverseFocus","shadowInverseFocusSoft","shadowInverseText","shadowBrand","shadowBrandFocus","shadowBrandFocusSoft","shadowBrandText","layout","columnCount","focusScale","gutterX","gutterY","marginX","marginY","safe","screenW","screenH","xs","sm","md","lg","xl","spacer","xxs","xxl","xxxl","stroke","typography","display1","display2","headline1","headline2","headline3","body1","body2","body3","button1","button2","callout1","caption1","tag1","footnote1","componentConfig","Keyboard","keyProps","icon","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","r$","objectFromEntries","_step21","_iterator21","_step21$value","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles","themeStyles2","modeKeys","toneKeys","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","generateSolidStylesFromLookupObject","base2","modes2","tones2","themeStyles3","themeComponentStyles","variantName","styles2","convertedStyles","styleName","modeName","modeStyles","baseStyles","makeBaseStyles","makeModeStyles","mode","toneStyles","makeToneStyles","tone","_ref25","_ref26","_a2","_b2","_ref27","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_componentRef$axis","_ref28","_ref29","axis","_updateLastIndex","lastItem","updateLastIndex","_updateLastIndex2","rootPosition","selectedPosition","selectedSize","direct","scrollIndex","abs","currentChildIndex","_currentChild$dimensi","chainFunctions","onlyFunctions","func","innerArgs","_step22","_iterator22","onGridFocus","skipFocus","handleNavigation","_c2","onSelectedChanged","plinko","num","_ref30$Artwork","Artwork","_ref30$Artwork2","themeStyles$e","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref31$Badge","Badge","_ref31$Badge2","themeStyles$d","_excluded2","container$e","inverse","brand","text$7","icon$2","_ref32$Button","Button","_ref32$Button2","defaultTone$d","themeStyles$c","_excluded3","_ref33$Surface","Surface","_ref33$Surface2","surfaceDefaultTone","surfaceThemeStyles$1","_excluded4","container$d","contentColor","focus","content","text$6","styles$c","Container","Content","_props$tone","flat","Text$7","_props$tone2","_ref34$Checkbox","Checkbox","_ref34$Checkbox2","themeStyles$b","_excluded5","strokeWidth","container$c","checked","neutral","icon$1","_ref35$Icon","Icon","_ref35$Icon2","themeStyles$a","_excluded6","_ref36$Column","Column","_ref36$Column2","defaultTone$a","themeStyles$9","_excluded7","styles$9","itemTransition","onUp","onDown","_props$selected","_props$selected2","_props$tone3","_ref37$Label","Label","_ref37$Label2","themeStyles$8","_excluded8","container$9","backgroundColor","text$5","_ref38$Rating","Rating","_ref38$Rating2","themeStyles$7","container$8","itemSpacing","toneModes","text$4","_ref39$Details","Details","_ref39$Details2","themeStyles$6","_excluded9","container$7","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$3","_ref40$Metadata","Metadata","_ref40$Metadata2","themeStyles$5","_excluded10","container$6","titleText","descriptionText","_ref41$ProgressBar","ProgressBar","_ref41$ProgressBar2","themeStyles$4","_excluded11","container$5","_ref42$Row","Row","_ref42$Row2","defaultTone$4","themeStyles$3","_excluded12","styles$3","onLeft","onRight","_props$selected3","_props$selected4","_props$tone4","_props$tone5","_ref43$Keyboard","_ref43$Keyboard2","themeStyles$2","_excluded13","container$3","keySpacing","baseWidth","sizes","paddingX","text$2","_ref44$Key","Key","_ref44$Key2","themeStyles$1","_excluded14","container$2","text$1","_ref45$Input","Input","_ref45$Input2","_excluded15","container$1","actualTitle","theme2","upCount","getWidthByUpCount$1","_ref46$Tile","Tile","_ref46$Tile2","tileThemeStyles","_excluded16","_ref47$Surface","_ref47$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded17","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","_createSignal32","isLoadedCount","setIsLoadedCount","_createSignal34","isLoadingCount","setIsLoadingCount","_createSignal36","isFailedCount","setIsFailedCount","totalFps","setupFPS","isLoadedCount2","isLoadingCount2","isFailedCount2","fps2","calcFps","FPSCounter","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","handleNavigate","page","isOnPage","matchers","_step17","_iterator17","focusPage","showWidgets","onEnter","App","Menu","Left","Right","Up","Down","announcer","navDrawer","lastFocused","focusNavDrawer","_createSignal38","setShowWidgets","showOnPaths","currentPath","matchesPartial","onAnnouncer","onLast","back","onMenu","onBackspace","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step7","otherObject","objects","_iterator7","_step8","isDefaultDesc","writable","objectIndex","_iterator8","splitProps","_splitProps2","local","others","tmdbConfig","baseImageUrl","API_BASE","basePosterSize","defaultFetchParams","headers","Authorization","getImageUrl","posterSize","_get","json","loadConfig","_data$images","images","secure_base_url","api","convertItemsToTiles","poster_path","profile_path","tileSrc","backdrop_path","media_type","shortTitle","maxLength","entityInfo","heroContent","description","overview","cache","leftoverTiles","createInfiniteScroll","_createSignal40","pages","setPages","_createSignal42","setPage","_createSignal44","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","voteAverage","voteCount","metaText","badges","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","rtCrit","rtFan","backgroundImage","vote_average","vote_count","minutes","runtime","remainingMinutes","minutesToHMM","release_date","parts","first_air_date","last_air_date","reviews","Browse","_createSignal46","columnY","setcolumnY","_createSignal48","setEntityInfo","entityProvider","_createSignal50","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","delayedBackgrounds","delayedHero","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal52","setColor","_createSignal54","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal56","insertTest","setInsertTest","_createSignal58","emptyTest","setEmptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal60","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal62","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal64","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal66","_this$children$select4","_createSignal68","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal70","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","entityActions","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"ihVAsBiBA,sQC+GjB,IAqhBIC,GArhBEC,GAAUA,CAACC,EAAGC,IAAMD,IAAMC,EAC1BC,GAASC,OAAO,eAChBC,GAASD,OAAO,eAChBE,GAAWF,OAAO,uBAClBG,GAAgB,CACpBC,OAAQR,IAGNS,GAAaC,GACXC,GAAQ,EACRC,GAAU,EACVC,GAAU,CACdC,MAAO,KACPC,SAAU,KACVC,QAAS,KACTC,MAAO,MAEHC,GAAU,CAAA,EACZC,GAAQ,KACRC,GAAa,KAGbC,GAAW,KACXC,GAAU,KACVC,GAAU,KACVC,GAAY,EAMhB,SAASC,GAAWC,EAAIC,GACtB,IAAMC,EAAWP,GACfJ,EAAQE,GACRU,EAAwB,IAAdH,EAAGI,OACbC,OAA4BC,IAAlBL,EAA8BV,EAAQU,EAChDM,EAAOJ,EACH,CACEf,MAAO,KAC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rCe,GAAK,CAAC1I,KAAI,UAAWlpD,UAAWimF,KAAWp1B,GAC3Ce,GAAK,CAAC1I,KAAI,OAAQlpD,UAAWomF,KAAQv1B,GACrCe,GAAK,CAAC1I,KAAI,SAAUlpD,UAAWqkF,KAAUxzB,GACzCe,GAAK,CAAC1I,KAAI,WAAYlpD,UAAWslF,KAAYz0B,GAC7Ce,GAAK,CAAC1I,KAAI,WAAYlpD,UAAW0mF,KAAY71B,GAC7Ce,GAAK,CAAC1I,KAAI,iBAAkBlpD,UAAW+pF,KAAkBl5B,GACzDe,GAAK,CAAC1I,KAAI,aAAclpD,UAAW8mF,KAAcj2B,GACjDe,GAAK,CAAC1I,KAAI,kBAAmBlpD,UAAWgqF,KAAmBn5B,GAC3De,GAAK,CAAC1I,KAAI,oBAAqBlpD,UAAWypF,KAAM54B,GAChDe,GAAK,CAAC1I,KAAI,mBAAoBlpD,UAAWqoF,KAAMx3B,GAC/Ce,GAAK,CAAC1I,KAAI,OAAQlpD,UAAW0pF,KAAQ","x_google_ignoreList":[1,2,57,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,99,102]} \ No newline at end of file diff --git a/index.html b/index.html index e1fcfec..83f661a 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ Solid Demo - - + + @@ -28,6 +28,6 @@ > - +