From f73e485a53fc7ef35bbb9447421e5253e7beb90e Mon Sep 17 00:00:00 2001 From: Chris Lorenzo Date: Fri, 5 Apr 2024 10:48:31 -0400 Subject: [PATCH] Updates --- ...Extensions-Bz0_JhbI.js => AppCoreExtensions-CFmx_IUh.js} | 4 ++-- ...ns-Bz0_JhbI.js.map => AppCoreExtensions-CFmx_IUh.js.map} | 2 +- ...acy-BHJ85DAG.js => AppCoreExtensions-legacy-DUknoeiY.js} | 4 ++-- ...5DAG.js.map => AppCoreExtensions-legacy-DUknoeiY.js.map} | 2 +- assets/CoreExtension-BVIaGMQL.js | 2 -- assets/CoreExtension-BVIaGMQL.js.map | 1 - assets/CoreExtension-GJaPZupQ.js | 2 ++ assets/CoreExtension-GJaPZupQ.js.map | 1 + assets/CoreExtension-legacy-BJPLTHoz.js.map | 1 - ...-legacy-BJPLTHoz.js => CoreExtension-legacy-CBgSiwe5.js} | 4 ++-- assets/CoreExtension-legacy-CBgSiwe5.js.map | 1 + assets/{index-DdLHrQIy.js => index-D71SC9OT.js} | 4 ++-- assets/{index-DdLHrQIy.js.map => index-D71SC9OT.js.map} | 2 +- .../{index-legacy-BVITNsdb.js => index-legacy-bcLqKdOS.js} | 4 ++-- ...-legacy-BVITNsdb.js.map => index-legacy-bcLqKdOS.js.map} | 2 +- index.html | 6 +++--- 16 files changed, 21 insertions(+), 21 deletions(-) rename assets/{AppCoreExtensions-Bz0_JhbI.js => AppCoreExtensions-CFmx_IUh.js} (76%) rename assets/{AppCoreExtensions-Bz0_JhbI.js.map => AppCoreExtensions-CFmx_IUh.js.map} (96%) rename assets/{AppCoreExtensions-legacy-BHJ85DAG.js => AppCoreExtensions-legacy-DUknoeiY.js} (98%) rename assets/{AppCoreExtensions-legacy-BHJ85DAG.js.map => AppCoreExtensions-legacy-DUknoeiY.js.map} (97%) delete mode 100644 assets/CoreExtension-BVIaGMQL.js delete mode 100644 assets/CoreExtension-BVIaGMQL.js.map create mode 100644 assets/CoreExtension-GJaPZupQ.js create mode 100644 assets/CoreExtension-GJaPZupQ.js.map delete mode 100644 assets/CoreExtension-legacy-BJPLTHoz.js.map rename assets/{CoreExtension-legacy-BJPLTHoz.js => CoreExtension-legacy-CBgSiwe5.js} (67%) create mode 100644 assets/CoreExtension-legacy-CBgSiwe5.js.map rename assets/{index-DdLHrQIy.js => index-D71SC9OT.js} (99%) rename assets/{index-DdLHrQIy.js.map => index-D71SC9OT.js.map} (99%) rename assets/{index-legacy-BVITNsdb.js => index-legacy-bcLqKdOS.js} (99%) rename assets/{index-legacy-BVITNsdb.js.map => index-legacy-bcLqKdOS.js.map} (99%) diff --git a/assets/AppCoreExtensions-Bz0_JhbI.js b/assets/AppCoreExtensions-CFmx_IUh.js similarity index 76% rename from assets/AppCoreExtensions-Bz0_JhbI.js rename to assets/AppCoreExtensions-CFmx_IUh.js index c229f61..9532487 100644 --- a/assets/AppCoreExtensions-Bz0_JhbI.js +++ b/assets/AppCoreExtensions-CFmx_IUh.js @@ -1,2 +1,2 @@ -import{C as t,W as a,S as e}from"./CoreExtension-BVIaGMQL.js";function r(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}const o="/solid-demo-app/";class f extends t{async run(n){n.fontManager.addFontFace(new a("NotoSans",{},o+"fonts/NotoSans-Regular.ttf")),n.fontManager.addFontFace(new e("Ubuntu",{},"msdf",n,o+"fonts/Ubuntu-Bold.msdf.png",o+"fonts/Ubuntu-Bold.msdf.json"))}}export{r as __vite_legacy_guard,f as default}; -//# sourceMappingURL=AppCoreExtensions-Bz0_JhbI.js.map +import{C as t,W as a,S as e}from"./CoreExtension-GJaPZupQ.js";function r(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}const o="/solid-demo-app/";class f extends t{async run(n){n.fontManager.addFontFace(new a("NotoSans",{},o+"fonts/NotoSans-Regular.ttf")),n.fontManager.addFontFace(new e("Ubuntu",{},"msdf",n,o+"fonts/Ubuntu-Bold.msdf.png",o+"fonts/Ubuntu-Bold.msdf.json"))}}export{r as __vite_legacy_guard,f as default}; +//# sourceMappingURL=AppCoreExtensions-CFmx_IUh.js.map diff --git a/assets/AppCoreExtensions-Bz0_JhbI.js.map b/assets/AppCoreExtensions-CFmx_IUh.js.map similarity index 96% rename from assets/AppCoreExtensions-Bz0_JhbI.js.map rename to assets/AppCoreExtensions-CFmx_IUh.js.map index cabc647..71900b2 100644 --- a/assets/AppCoreExtensions-Bz0_JhbI.js.map +++ b/assets/AppCoreExtensions-CFmx_IUh.js.map @@ -1 +1 @@ -{"version":3,"file":"AppCoreExtensions-Bz0_JhbI.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 {},\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","AppCoreExtension","CoreExtension","stage","WebTrFontFace","SdfTrFontFace"],"mappings":"iJA0BA,MAAMA,EAAW,mBAEjB,MAAqBC,UAAyBC,CAAc,CAC1D,MAAM,IAAIC,EAAc,CACtBA,EAAM,YAAY,YAChB,IAAIC,EACF,WACA,CAAC,EACDJ,EAAW,4BACb,CAAA,EAEFG,EAAM,YAAY,YAChB,IAAIE,EACF,SACA,CAAC,EACD,OACAF,EACAH,EAAW,6BACXA,EAAW,6BACb,CAAA,CAEJ,CACF"} \ No newline at end of file +{"version":3,"file":"AppCoreExtensions-CFmx_IUh.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 {},\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","AppCoreExtension","CoreExtension","stage","WebTrFontFace","SdfTrFontFace"],"mappings":"iJA0BA,MAAMA,EAAW,mBAEjB,MAAqBC,UAAyBC,CAAc,CAC1D,MAAM,IAAIC,EAAc,CACtBA,EAAM,YAAY,YAChB,IAAIC,EACF,WACA,CAAC,EACDJ,EAAW,4BACb,CAAA,EAEFG,EAAM,YAAY,YAChB,IAAIE,EACF,SACA,CAAC,EACD,OACAF,EACAH,EAAW,6BACXA,EAAW,6BACb,CAAA,CAEJ,CACF"} \ No newline at end of file diff --git a/assets/AppCoreExtensions-legacy-BHJ85DAG.js b/assets/AppCoreExtensions-legacy-DUknoeiY.js similarity index 98% rename from assets/AppCoreExtensions-legacy-BHJ85DAG.js rename to assets/AppCoreExtensions-legacy-DUknoeiY.js index 6851a44..2e954ca 100644 --- a/assets/AppCoreExtensions-legacy-BHJ85DAG.js +++ b/assets/AppCoreExtensions-legacy-DUknoeiY.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 P(n||[]);return i(a,"_invoke",{value:N(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(G([])));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 N(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=S(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 S(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,S(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 k(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 F(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function G(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),F(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;F(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:G(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-BJPLTHoz.js"],(function(e,n){"use strict";var o,i,a;return{setters:[t=>{o=t.C,i=t.W,a=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("NotoSans",{},n+"fonts/NotoSans-Regular.ttf")),e.fontManager.addFontFace(new a("Ubuntu",{},"msdf",e,n+"fonts/Ubuntu-Bold.msdf.png",n+"fonts/Ubuntu-Bold.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-BHJ85DAG.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 P(n||[]);return i(a,"_invoke",{value:N(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(G([])));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 N(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=S(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 S(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,S(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 k(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 F(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function G(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),F(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;F(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:G(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-CBgSiwe5.js"],(function(e,n){"use strict";var o,i,a;return{setters:[t=>{o=t.C,i=t.W,a=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("NotoSans",{},n+"fonts/NotoSans-Regular.ttf")),e.fontManager.addFontFace(new a("Ubuntu",{},"msdf",e,n+"fonts/Ubuntu-Bold.msdf.png",n+"fonts/Ubuntu-Bold.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-DUknoeiY.js.map diff --git a/assets/AppCoreExtensions-legacy-BHJ85DAG.js.map b/assets/AppCoreExtensions-legacy-DUknoeiY.js.map similarity index 97% rename from assets/AppCoreExtensions-legacy-BHJ85DAG.js.map rename to assets/AppCoreExtensions-legacy-DUknoeiY.js.map index 5a843aa..f79776d 100644 --- a/assets/AppCoreExtensions-legacy-BHJ85DAG.js.map +++ b/assets/AppCoreExtensions-legacy-DUknoeiY.js.map @@ -1 +1 @@ -{"version":3,"file":"AppCoreExtensions-legacy-BHJ85DAG.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 {},\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","exports","CoreExtension","run","stage","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_callee$","_context","prev","next","fontManager","addFontFace","WebTrFontFace","SdfTrFontFace","stop"],"mappings":"oyNA0BA,IAAMA,EAAW,mBAsBjBC,EAAA,UApBA,cAA8CC,EACtCC,GAAAA,CAAIC,GAAcC,SAAAC,IAAAC,MAAAC,SAAAA,IAAAF,OAAAA,IAAAG,MAAAC,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EACtBT,EAAMU,YAAYC,YAChB,IAAIC,EACF,WACA,CAAC,EACDhB,EAAW,+BAGfI,EAAMU,YAAYC,YAChB,IAAIE,EACF,SACA,CAAC,EACD,OACAb,EACAJ,EAAW,6BACXA,EAAW,gCAEf,KAAAW,EAAAA,IAAAA,MAAAA,OAAAA,EAAAO,OAAAV,GAAAA,EACF,0LAAA"} \ No newline at end of file +{"version":3,"file":"AppCoreExtensions-legacy-DUknoeiY.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 {},\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","exports","CoreExtension","run","stage","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_callee$","_context","prev","next","fontManager","addFontFace","WebTrFontFace","SdfTrFontFace","stop"],"mappings":"oyNA0BA,IAAMA,EAAW,mBAsBjBC,EAAA,UApBA,cAA8CC,EACtCC,GAAAA,CAAIC,GAAcC,SAAAC,IAAAC,MAAAC,SAAAA,IAAAF,OAAAA,IAAAG,MAAAC,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EACtBT,EAAMU,YAAYC,YAChB,IAAIC,EACF,WACA,CAAC,EACDhB,EAAW,+BAGfI,EAAMU,YAAYC,YAChB,IAAIE,EACF,SACA,CAAC,EACD,OACAb,EACAJ,EAAW,6BACXA,EAAW,gCAEf,KAAAW,EAAAA,IAAAA,MAAAA,OAAAA,EAAAO,OAAAV,GAAAA,EACF,0LAAA"} \ No newline at end of file diff --git a/assets/CoreExtension-BVIaGMQL.js b/assets/CoreExtension-BVIaGMQL.js deleted file mode 100644 index 8784116..0000000 --- a/assets/CoreExtension-BVIaGMQL.js +++ /dev/null @@ -1,2 +0,0 @@ -var oe=Object.defineProperty;var ce=(n,t,e)=>t in n?oe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var a=(n,t,e)=>(ce(n,typeof t!="symbol"?t+"":t,e),e);function he(n,t){const e={alpha:!0,antialias:!1,depth:!1,premultipliedAlpha:!0};console.log(e);const 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 m(n,t){if(!ue()&&!n)throw new Error(t||"Assertion failed")}function De(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),c=Math.trunc(t>>>24),h=Math.trunc(t>>>16&255),u=Math.trunc(t>>>8&255),d=Math.trunc(t&255),f=Math.round(c*e+r*(1-e)),T=Math.round(h*e+s*(1-e)),_=Math.round(u*e+i*(1-e)),x=Math.round(d*e+o*(1-e));return(f<<24|T<<16|_<<8|x)>>>0}function Ge(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 Oe(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),c=Math.trunc(r*255);return e?(c<<24|o<<16|i<<8|s)>>>0:(s<<24|i<<16|o<<8|c)>>>0}function v(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ue(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!0}class J{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 le{static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}function Z(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 fe(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 de(n){return self.WebGL2RenderingContext&&n instanceof self.WebGL2RenderingContext}class W extends le{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||[],c=i?"2.0":"1.0";o.forEach(E=>{if(!s.getExtension(E))throw new Error('Shader "'.concat(this.constructor.name,'" requires extension "').concat(E,'" for WebGL ').concat(c," but wasn't found"))});const h=e.shaderSources||this.constructor.shaderSources;if(h)i&&(h!=null&&h.webGl2)&&(h.fragment=h.webGl2.fragment,h.vertex=h.webGl2.vertex,delete h.webGl2);else throw new Error('Shader "'.concat(this.constructor.name,'" is missing shaderSources.'));const u=r.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,d=h.vertex instanceof Function?h.vertex(u):h.vertex,f=h.fragment instanceof Function?h.fragment(u):h.fragment,T=Z(s,s.VERTEX_SHADER,d),_=Z(s,s.FRAGMENT_SHADER,f);if(!T||!_)throw new Error;const x=fe(s,T,_);if(!x)throw new Error;if(this.program=x,i){const E=s.createVertexArray();if(!E)throw new Error;this.vao=E,s.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...e.attributes].forEach(E=>{const R=s.getAttribLocation(this.program,E);if(R<0)throw new Error("".concat(this.constructor.name,': Vertex shader must have an attribute "').concat(E,'"!'));const A=s.createBuffer();if(!A)throw new Error("".concat(this.constructor.name,': Could not create buffer for attribute "').concat(E,'"'));this.attributeLocations[E]=R,this.attributeBuffers[E]=A,this.attributeNames.push(E)}),this.uniformLocations={},this.uniformTypes={},e.uniforms.forEach(E=>{const R=s.getUniformLocation(this.program,E.name);if(this.uniformTypes[E.name]=E.uniform,!R){console.warn('Shader "'.concat(this.constructor.name,'" could not get uniform location for "').concat(E.name,'"'));return}this.uniformLocations[E.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}=e;if(this.setUniform("u_resolution",[s.canvas.width,s.canvas.height]),this.setUniform("u_pixelRatio",e.options.pixelRatio),r){if(v(r,"$dimensions")){let i=r.$dimensions;i||(i=e.dimensions),this.setUniform("u_dimensions",[i.width,i.height])}if(v(r,"$alpha")){let i=r.$alpha;i||(i=e.alpha),this.setUniform("u_alpha",i)}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);m(s,'Buffer for "'.concat(r,'" not found')),m(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(W,"shaderSources");class Y extends J{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 Ee=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 Xe(n){return(n&255)/255}function Fe(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 Q(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 ve(n,t,e){const r=Q(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 Ve(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 He(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 Ye(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 Te(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 ke(n,t){return n.x1<=t.x2&&n.y1<=t.y2&&n.x2>=t.x1&&n.y2>=t.y1}function $e(n){return n.x1{this.loaded=!0,this.emit("loaded")}).catch(console.error),this.fontFace=h,this.fontUrl=s}}class _e{constructor(t,e){a(this,"memManager");a(this,"textureSource");this.memManager=t,this.textureSource=e}}class xe{constructor(t){a(this,"stage");this.stage=t}}class Re{}class Ae extends Re{constructor(e,r,s,i,o,c,h,u,d,f){super();a(this,"glw");a(this,"options");a(this,"buffers");a(this,"shader");a(this,"shaderProps");a(this,"alpha");a(this,"clippingRect");a(this,"dimensions");a(this,"bufferIdx");a(this,"zIndex");a(this,"length",0);a(this,"numQuads",0);a(this,"textures",[]);a(this,"maxTextures");this.glw=e,this.options=r,this.buffers=s,this.shader=i,this.shaderProps=o,this.alpha=c,this.clippingRect=h,this.dimensions=u,this.bufferIdx=d,this.zIndex=f,this.maxTextures=i.supportsIndexedTextures?e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS):1}addTexture(e){const{textures:r,maxTextures:s}=this,i=r.findIndex(c=>c===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 c=this.bufferIdx/24*6*2;if(this.clippingRect.valid){const{x:h,y:u,width:d,height:f}=this.clippingRect,T=i.pixelRatio,_=i.canvas.height,x=Math.round(h*T),E=Math.round(d*T),R=Math.round(f*T),A=Math.round(_-R-u*T);e.setScissorTest(!0),e.scissor(x,A,E,R)}else e.setScissorTest(!1);e.drawElements(e.TRIANGLES,6*this.numQuads,e.UNSIGNED_SHORT,c)}}function ge(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 me(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 pe(n,t){const e=~~(t/80),r=new Uint16Array(e*6);for(let i=0,o=0;in&&!(n&n-1),g=(n,t,e,r)=>{const s=3*n,i=3*(e-n)-s,o=1-s-i,c=3*t,h=3*(r-t)-c,u=1-c-h;return function(d){if(d>=1)return 1;if(d<=0)return 0;let f=.5,T,_,x;for(let A=0;A<20;A++){if(T=f*(f*(f*o+i)+s),x=d-T,x>-1e-8&&x<1e-8)return f*(f*(f*u+h)+c);if(_=f*(f*(3*o)+2*i)+s,_>1e-10&&_<1e-10)break;f+=x/_}let E=0,R=1;for(let A=0;A<20;A++){if(f=.5*(E+R),T=f*(f*(f*o+i)+s),x=d-T,x>-1e-8&&x<1e-8)return f*(f*(f*u+h)+c);x<0?R=f:E=f}}},qe=Se(n=>{switch(n){case"linear":return function(e){return e};case"ease":return g(.25,.1,.25,1);case"ease-in":return g(.42,0,1,1);case"ease-out":return g(0,0,.58,1);case"ease-in-out":return g(.42,0,.58,1);case"ease-in-sine":return g(.12,0,.39,0);case"ease-out-sine":return g(.12,0,.39,0);case"ease-in-out-sine":return g(.37,0,.63,1);case"ease-in-cubic":return g(.32,0,.67,0);case"ease-out-cubic":return g(.33,1,.68,1);case"ease-in-out-cubic":return g(.65,0,.35,1);case"ease-in-circ":return g(.55,0,1,.45);case"ease-out-circ":return g(0,.55,.45,1);case"ease-in-out-circ":return g(.85,0,.15,1);case"ease-in-back":return g(.36,0,.66,-.56);case"ease-out-back":return g(.34,1.56,.64,1);case"ease-in-out-back":return g(.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(c){return c};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(c){return c}):g(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 B=new Uint8Array([0,0,0,0]);class V extends _e{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(),m(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 c,h;const{glw:e,memManager:r}=this;e.activeTexture(0),e.bindTexture(this._nativeCtxTexture),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),e.texImage2D(0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,B),r.setTextureMemUse(this,B.byteLength);const s=await((c=this.textureSource)==null?void 0:c.getTextureData());if(!this._nativeCtxTexture)return m(this._state==="freed"),{width:0,height:0};let i=0,o=0;if(m(this._nativeCtxTexture),e.activeTexture(0),s.data instanceof ImageBitmap||s.data instanceof ImageData||Ie(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,B),r.setTextureMemUse(this,B.byteLength);else if("mipmaps"in s.data&&s.data.mipmaps){const{mipmaps:u,width:d=0,height:f=0,type:T,glInternalFormat:_}=s.data,x=T==="ktx"?new DataView((h=u[0])!=null?h:new ArrayBuffer(0)):u[0];e.bindTexture(this._nativeCtxTexture),e.compressedTexImage2D(0,_,d,f,0,x),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,x.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 r}}const P=class P extends Y{constructor(e,r){super(e);a(this,"props");this.props=P.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=P.resolveDefaults(e);return"ColorTexture,".concat(r.color)}static resolveDefaults(e){return{color:e.color||4294967295}}};a(P,"z$__type__Props");let H=P;const D=class D extends Y{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=D.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(D,"z$__type__Props");let C=D;class Me extends V{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 ye{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 Ne{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,"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");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.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}isWebGl2(){return de(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,c,h){const{gl:u}=this;o?u.texImage2D(u.TEXTURE_2D,t,e,r,s,i,o,c,h):u.texImage2D(u.TEXTURE_2D,t,e,r,s,i)}compressedTexImage2D(t,e,r,s,i,o){const{gl:c}=this;c.compressedTexImage2D(c.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:c,scissorWidth:h,scissorHeight:u}=this;(t!==o||e!==c||r!==h||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:c}=this;(t!==s||e!==i||t!==o||e!==c)&&(r.blendFunc(t,e),this.blendSrcRgb=t,this.blendDstRgb=e,this.blendSrcAlpha=t,this.blendDstAlpha=e)}createBuffer(){const{gl:t}=this;return t.createBuffer()}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,c){const{gl:h,boundArrayBuffer:u}=this;u!==t&&(h.bindBuffer(h.ARRAY_BUFFER,t),this.boundArrayBuffer=t),h.vertexAttribPointer(e,r,s,i,o,c)}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 c=o.get(e);(!c||!Le(c,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 m(t instanceof WebGL2RenderingContext),t.createVertexArray()}bindVertexArray(t){const{gl:e}=this;m(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 Le(n,t){return n.length!==t.length?!1:n.every((e,r)=>Array.isArray(e)||e instanceof Float32Array?!1:e===t[r])}const Ue=24;class Pe extends xe{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,"renderables",[]);a(this,"defaultShader");a(this,"quadBufferCollection");a(this,"defaultTexture");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 H(this.txManager),this.defaultTexture.once("loaded",()=>{this.stage.requestRender()});const o=he(r,e.contextSpy),c=this.glw=new Ne(o),h=Ee(s);c.viewport(0,0,r.width,r.height),c.clearColor(h[0],h[1],h[2],h[3]),c.setBlend(!0),c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA),pe(c,i),this.system={parameters:ge(this.glw),extensions:me(this.glw)},this.shManager.renderer=this,this.defaultShader=this.shManager.loadShader("DefaultShader").shader;const u=c.createBuffer();m(u);const d=6*Float32Array.BYTES_PER_ELEMENT;this.quadBufferCollection=new ye([{buffer:u,attributes:{a_position:{name:"a_position",size:2,type:c.FLOAT,normalized:!1,stride:d,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:c.FLOAT,normalized:!1,stride:d,offset:2*Float32Array.BYTES_PER_ELEMENT},a_color:{name:"a_color",size:4,type:c.UNSIGNED_BYTE,normalized:!0,stride:d,offset:4*Float32Array.BYTES_PER_ELEMENT},a_textureIndex:{name:"a_textureIndex",size:1,type:c.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 C?new Me(this.glw,this.txMemManager,e):new V(this.glw,this.txMemManager,e)}addQuad(e){var $,z;const{fQuadBuffer:r,uiQuadBuffer:s}=this,{width:i,height:o,colorTl:c,colorTr:h,colorBl:u,colorBr:d,textureOptions:f,shader:T,shaderProps:_,alpha:x,clippingRect:E,tx:R,ty:A,ta:G,tb:O,tc:X,td:F}=e;let{texture:I}=e;if(_&&v(_,"$dimensions")){const U=_.$dimensions;U.width=i,U.height=o}I=I!=null?I:this.defaultTexture,m(I instanceof Y,"Invalid texture type");let{curBufferIdx:l,curRenderOp:p}=this;const te={width:i,height:o},w=T||this.defaultShader;m(w instanceof W),p&&(p.shader!==w||!Te(p.clippingRect,E)||p.shader!==this.defaultShader&&(!_||!p.shader.canBatchShaderProps(p.shaderProps,_)))&&(p=null),m(w instanceof W),p||(this.newRenderOp(w,_,x,te,E,l),p=this.curRenderOp,m(p));const re=($=f==null?void 0:f.flipX)!=null?$:!1,se=(z=f==null?void 0:f.flipY)!=null?z:!1;let S=0,M=0,N=1,L=1;if(I instanceof C){const{x:U,y:b,width:ie,height:ae}=I.props,{width:q=0,height:K=0}=I.parentTexture.dimensions||{width:0,height:0};S=U/q,N=S+ie/q,M=b/K,L=M+ae/K,I=I.parentTexture}re&&([S,N]=[N,S]),se&&([M,L]=[L,M]);const{txManager:ne}=this.stage,k=ne.getCtxTexture(I);m(k instanceof V);const y=this.addTexture(k,l);if(p=this.curRenderOp,m(p),O!==0||X!==0)r[l++]=R,r[l++]=A,r[l++]=S,r[l++]=M,s[l++]=c,r[l++]=y,r[l++]=R+i*G,r[l++]=A+i*X,r[l++]=N,r[l++]=M,s[l++]=h,r[l++]=y,r[l++]=R+o*O,r[l++]=A+o*F,r[l++]=S,r[l++]=L,s[l++]=u,r[l++]=y,r[l++]=R+i*G+o*O,r[l++]=A+i*X+o*F,r[l++]=N,r[l++]=L,s[l++]=d,r[l++]=y;else{const U=R+i*G,b=A+o*F;r[l++]=R,r[l++]=A,r[l++]=S,r[l++]=M,s[l++]=c,r[l++]=y,r[l++]=U,r[l++]=A,r[l++]=N,r[l++]=M,s[l++]=h,r[l++]=y,r[l++]=R,r[l++]=b,r[l++]=S,r[l++]=L,s[l++]=u,r[l++]=y,r[l++]=U,r[l++]=b,r[l++]=N,r[l++]=L,s[l++]=d,r[l++]=y}p.length+=Ue,p.numQuads++,this.curBufferIdx=l}newRenderOp(e,r,s,i,o,c){const h=new Ae(this.glw,this.options,this.quadBufferCollection,e,r,s,o,i,c,0);this.curRenderOp=h,this.renderOps.push(h)}addTexture(e,r,s){const{curRenderOp:i}=this;m(i);const o=i.addTexture(e);if(o===4294967295){if(s)throw new Error("Unable to add texture to render op");const{shader:c,shaderProps:h,dimensions:u,clippingRect:d,alpha:f}=i;return this.newRenderOp(c,h,f,u,d,r),this.addTexture(e,r,!0)}return o}addRenderOp(e){this.renderOps.push(e),this.curRenderOp=null}render(e="screen"){var c;const{glw:r,quadBuffer:s}=this,i=new Float32Array(s,0,this.curBufferIdx),o=(c=this.quadBufferCollection.getBuffer("a_position"))!=null?c:null;r.arrayBufferData(o,i,r.STATIC_DRAW),this.renderOps.forEach((h,u)=>{h.draw()}),this.renderables=[]}}const we={LINE_FEED:10,CARRIAGE_RETURN:13,SPACE:32,TAB:9,ZERO_WIDTH_SPACE:8203,ZERO_WIDTH_NON_JOINER:8204,ZERO_WIDTH_JOINER:8205,LEFT_TO_RIGHT_MARK:8206,RIGHT_TO_LEFT_MARK:8207,LEFT_TO_RIGHT_EMBEDDING:8234,RIGHT_TO_LEFT_EMBEDDING:8235,POP_DIRECTIONAL_FORMATTING:8236,LEFT_TO_RIGHT_OVERRIDE:8237,RIGHT_TO_LEFT_OVERRIDE:8238,LINE_SEPARATOR:8232,PARAGRAPH_SEPARATOR:8233,OBJECT_REPLACEMENT_CHARACTER:65532,REPLACEMENT_CHARACTER:65533,ZERO_WIDTH_NO_BREAK_SPACE:65279,LEFT_TO_RIGHT_ISOLATE:8294,RIGHT_TO_LEFT_ISOLATE:8295,FIRST_STRONG_ISOLATE:8296,POP_DIRECTIONAL_ISOLATE:8297,INHIBIT_SYMMETRIC_SWAPPING:8298,ACTIVATE_SYMMETRIC_SWAPPING:8299,INHIBIT_ARABIC_FORM_SHAPING:8300,ACTIVATE_ARABIC_FORM_SHAPING:8301,NATIONAL_DIGIT_SHAPES:8302,NOMINAL_DIGIT_SHAPES:8303,LEFT_TO_RIGHT_BOUNDARY:8206,RIGHT_TO_LEFT_BOUNDARY:8207};class be{}class Be extends be{constructor(e,r){super();a(this,"data");a(this,"glyphMap");a(this,"kernings");this.data=e,this.glyphMap=r;const s=this.kernings={};e.kernings.forEach(i=>{const o=i.second,c=s[o]=s[o]||{};c[i.first]=i.amount}),this.kernings=s}*shapeText(e,r){var o;let s,i;for(;(s=r.peek())&&!s.done;){const c=s.value,h=this.glyphMap.get(c);if(r.next(),h!==void 0){const u=i!==void 0?(((o=this.kernings[h.id])==null?void 0:o[i])||0)+e.letterSpacing:0;i=h.id,yield{mapped:!0,glyphId:h.id,codepoint:c,cluster:r.lastIndex,xAdvance:h.xadvance+u,yAdvance:0,xOffset:h.xoffset+u,yOffset:h.yoffset,xBearing:0,yBearing:0,width:h.width,height:h.height}}else c===we.LINE_FEED&&(i=void 0),yield{mapped:!1,codepoint:c,cluster:r.lastIndex}}}}class Ke extends ee{constructor(e,r,s,i,o,c){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 h=i.renderer;m(h instanceof Pe,"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(c).then(async u=>{this.data=await u.json();let d=0;this.data.chars.forEach(f=>{this.glyphMap.set(f.id,f);const T=f.yoffset+f.height;T>d&&(d=T)}),this.maxCharHeight=d,this.shaper=new Be(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 Ze{}export{ye as B,Ze as C,J as E,Ke as S,Y as T,ze as W,m as a,Ee as b,Q as c,ve as d,He as e,Xe as f,Fe as g,W as h,ue as i,Se as j,$e as k,We as l,Oe as m,Ve as n,Ye as o,Ae as p,Ge as q,qe as r,De as s,ke as t,H as u,C as v,Pe as w}; -//# sourceMappingURL=CoreExtension-BVIaGMQL.js.map diff --git a/assets/CoreExtension-BVIaGMQL.js.map b/assets/CoreExtension-BVIaGMQL.js.map deleted file mode 100644 index d2f48f5..0000000 --- a/assets/CoreExtension-BVIaGMQL.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CoreExtension-BVIaGMQL.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/text-rendering/font-face-types/WebTrFontFace.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/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 console.log(config);\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 } = renderOp;\n // Bind standard automatic uniforms\n this.setUniform('u_resolution', [glw.canvas.width, glw.canvas.height]);\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\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 */\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 */\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 length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex) {\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.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 // shaderOp.draw(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 // 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(this._nativeCtxTexture);\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 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 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 createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\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 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 //#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.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 }\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 * createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\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 { 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';\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 renderables = [];\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\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 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, } = 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 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (curRenderOp) {\n // If the current render op is not the same shader, create a new one\n // If the current render op's shader props are not compatible with the\n // the new shader props, create a new one render op.\n if (curRenderOp.shader !== targetShader ||\n !compareRect(curRenderOp.clippingRect, clippingRect) ||\n (curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !curRenderOp.shader.canBatchShaderProps(curRenderOp.shaderProps, shaderProps)))) {\n curRenderOp = null;\n }\n }\n assertTruthy(targetShader instanceof WebGlCoreShader);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n if (!curRenderOp) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx);\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) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0);\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 * 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('renderOp', i, renderOp.numQuads);\n }\n renderOp.draw();\n });\n // clean up\n this.renderables = [];\n }\n}\nconst idx = 0;\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","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","width","height","copyRect","compareRect","boundInsideBound","bound1","bound2","isBoundPositive","TrFontFace","fontFamily","descriptors","WebTrFontFace","fontUrl","fontUrlWithoutParentheses","determinedDescriptors","cssDescriptors","fontFace","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","buffers","shaderProps","clippingRect","bufferIdx","zIndex","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","usage","boundArrayBuffer","boundElementArrayBuffer","normalized","stride","offset","curProgram","programUniforms","uniforms","uniformArgs","compareArrays","mode","count","vertexArray","v","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","surface","arr","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,GAMP,mBAAoB,EAAA,EAGxB,QAAQ,IAAIA,CAAM,EACZ,MAAAC,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,IAAU,EAAE,EAC5BI,EAAK,KAAK,MAAOJ,IAAU,GAAM,GAAI,EACrCK,EAAK,KAAK,MAAOL,IAAU,EAAK,GAAI,EACpCM,EAAK,KAAK,MAAMN,EAAQ,GAAI,EAC5BO,EAAK,KAAK,MAAMN,IAAU,EAAE,EAC5BO,EAAK,KAAK,MAAOP,IAAU,GAAM,GAAI,EACrCQ,EAAK,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ACb,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":[15]} \ No newline at end of file diff --git a/assets/CoreExtension-GJaPZupQ.js b/assets/CoreExtension-GJaPZupQ.js new file mode 100644 index 0000000..a979e3d --- /dev/null +++ b/assets/CoreExtension-GJaPZupQ.js @@ -0,0 +1,2 @@ +var oe=Object.defineProperty;var ce=(n,t,e)=>t in n?oe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var a=(n,t,e)=>(ce(n,typeof t!="symbol"?t+"":t,e),e);function he(n,t){const e={};console.log(e);const 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 m(n,t){if(!ue()&&!n)throw new Error(t||"Assertion failed")}function De(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),c=Math.trunc(t>>>24),h=Math.trunc(t>>>16&255),u=Math.trunc(t>>>8&255),d=Math.trunc(t&255),l=Math.round(c*e+r*(1-e)),T=Math.round(h*e+s*(1-e)),_=Math.round(u*e+i*(1-e)),x=Math.round(d*e+o*(1-e));return(l<<24|T<<16|_<<8|x)>>>0}function Ge(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 Oe(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),c=Math.trunc(r*255);return e?(c<<24|o<<16|i<<8|s)>>>0:(s<<24|i<<16|o<<8|c)>>>0}function v(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ue(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!0}class J{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 fe{static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}function Z(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 le(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 de(n){return self.WebGL2RenderingContext&&n instanceof self.WebGL2RenderingContext}class W extends fe{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||[],c=i?"2.0":"1.0";o.forEach(E=>{if(!s.getExtension(E))throw new Error('Shader "'.concat(this.constructor.name,'" requires extension "').concat(E,'" for WebGL ').concat(c," but wasn't found"))});const h=e.shaderSources||this.constructor.shaderSources;if(h)i&&(h!=null&&h.webGl2)&&(h.fragment=h.webGl2.fragment,h.vertex=h.webGl2.vertex,delete h.webGl2);else throw new Error('Shader "'.concat(this.constructor.name,'" is missing shaderSources.'));const u=r.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,d=h.vertex instanceof Function?h.vertex(u):h.vertex,l=h.fragment instanceof Function?h.fragment(u):h.fragment,T=Z(s,s.VERTEX_SHADER,d),_=Z(s,s.FRAGMENT_SHADER,l);if(!T||!_)throw new Error;const x=le(s,T,_);if(!x)throw new Error;if(this.program=x,i){const E=s.createVertexArray();if(!E)throw new Error;this.vao=E,s.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...e.attributes].forEach(E=>{const R=s.getAttribLocation(this.program,E);if(R<0)throw new Error("".concat(this.constructor.name,': Vertex shader must have an attribute "').concat(E,'"!'));const A=s.createBuffer();if(!A)throw new Error("".concat(this.constructor.name,': Could not create buffer for attribute "').concat(E,'"'));this.attributeLocations[E]=R,this.attributeBuffers[E]=A,this.attributeNames.push(E)}),this.uniformLocations={},this.uniformTypes={},e.uniforms.forEach(E=>{const R=s.getUniformLocation(this.program,E.name);if(this.uniformTypes[E.name]=E.uniform,!R){console.warn('Shader "'.concat(this.constructor.name,'" could not get uniform location for "').concat(E.name,'"'));return}this.uniformLocations[E.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}=e;if(this.setUniform("u_resolution",[s.canvas.width,s.canvas.height]),this.setUniform("u_pixelRatio",e.options.pixelRatio),r){if(v(r,"$dimensions")){let i=r.$dimensions;i||(i=e.dimensions),this.setUniform("u_dimensions",[i.width,i.height])}if(v(r,"$alpha")){let i=r.$alpha;i||(i=e.alpha),this.setUniform("u_alpha",i)}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);m(s,'Buffer for "'.concat(r,'" not found')),m(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(W,"shaderSources");class Y extends J{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 Ee=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 Xe(n){return(n&255)/255}function Fe(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 Q(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 ve(n,t,e){const r=Q(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 Ve(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 He(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 Ye(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 Te(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 ke(n,t){return n.x1<=t.x2&&n.y1<=t.y2&&n.x2>=t.x1&&n.y2>=t.y1}function $e(n){return n.x1{this.loaded=!0,this.emit("loaded")}).catch(console.error),this.fontFace=h,this.fontUrl=s}}class _e{constructor(t,e){a(this,"memManager");a(this,"textureSource");this.memManager=t,this.textureSource=e}}class xe{constructor(t){a(this,"stage");this.stage=t}}class Re{}class Ae extends Re{constructor(e,r,s,i,o,c,h,u,d,l){super();a(this,"glw");a(this,"options");a(this,"buffers");a(this,"shader");a(this,"shaderProps");a(this,"alpha");a(this,"clippingRect");a(this,"dimensions");a(this,"bufferIdx");a(this,"zIndex");a(this,"length",0);a(this,"numQuads",0);a(this,"textures",[]);a(this,"maxTextures");this.glw=e,this.options=r,this.buffers=s,this.shader=i,this.shaderProps=o,this.alpha=c,this.clippingRect=h,this.dimensions=u,this.bufferIdx=d,this.zIndex=l,this.maxTextures=i.supportsIndexedTextures?e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS):1}addTexture(e){const{textures:r,maxTextures:s}=this,i=r.findIndex(c=>c===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 c=this.bufferIdx/24*6*2;if(this.clippingRect.valid){const{x:h,y:u,width:d,height:l}=this.clippingRect,T=i.pixelRatio,_=i.canvas.height,x=Math.round(h*T),E=Math.round(d*T),R=Math.round(l*T),A=Math.round(_-R-u*T);e.setScissorTest(!0),e.scissor(x,A,E,R)}else e.setScissorTest(!1);e.drawElements(e.TRIANGLES,6*this.numQuads,e.UNSIGNED_SHORT,c)}}function ge(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 me(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 pe(n,t){const e=~~(t/80),r=new Uint16Array(e*6);for(let i=0,o=0;in&&!(n&n-1),g=(n,t,e,r)=>{const s=3*n,i=3*(e-n)-s,o=1-s-i,c=3*t,h=3*(r-t)-c,u=1-c-h;return function(d){if(d>=1)return 1;if(d<=0)return 0;let l=.5,T,_,x;for(let A=0;A<20;A++){if(T=l*(l*(l*o+i)+s),x=d-T,x>-1e-8&&x<1e-8)return l*(l*(l*u+h)+c);if(_=l*(l*(3*o)+2*i)+s,_>1e-10&&_<1e-10)break;l+=x/_}let E=0,R=1;for(let A=0;A<20;A++){if(l=.5*(E+R),T=l*(l*(l*o+i)+s),x=d-T,x>-1e-8&&x<1e-8)return l*(l*(l*u+h)+c);x<0?R=l:E=l}}},qe=Se(n=>{switch(n){case"linear":return function(e){return e};case"ease":return g(.25,.1,.25,1);case"ease-in":return g(.42,0,1,1);case"ease-out":return g(0,0,.58,1);case"ease-in-out":return g(.42,0,.58,1);case"ease-in-sine":return g(.12,0,.39,0);case"ease-out-sine":return g(.12,0,.39,0);case"ease-in-out-sine":return g(.37,0,.63,1);case"ease-in-cubic":return g(.32,0,.67,0);case"ease-out-cubic":return g(.33,1,.68,1);case"ease-in-out-cubic":return g(.65,0,.35,1);case"ease-in-circ":return g(.55,0,1,.45);case"ease-out-circ":return g(0,.55,.45,1);case"ease-in-out-circ":return g(.85,0,.15,1);case"ease-in-back":return g(.36,0,.66,-.56);case"ease-out-back":return g(.34,1.56,.64,1);case"ease-in-out-back":return g(.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(c){return c};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(c){return c}):g(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 B=new Uint8Array([0,0,0,0]);class V extends _e{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(),m(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 c,h;const{glw:e,memManager:r}=this;e.activeTexture(0),e.bindTexture(this._nativeCtxTexture),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),e.texImage2D(0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,B),r.setTextureMemUse(this,B.byteLength);const s=await((c=this.textureSource)==null?void 0:c.getTextureData());if(!this._nativeCtxTexture)return m(this._state==="freed"),{width:0,height:0};let i=0,o=0;if(m(this._nativeCtxTexture),e.activeTexture(0),s.data instanceof ImageBitmap||s.data instanceof ImageData||Ie(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,B),r.setTextureMemUse(this,B.byteLength);else if("mipmaps"in s.data&&s.data.mipmaps){const{mipmaps:u,width:d=0,height:l=0,type:T,glInternalFormat:_}=s.data,x=T==="ktx"?new DataView((h=u[0])!=null?h:new ArrayBuffer(0)):u[0];e.bindTexture(this._nativeCtxTexture),e.compressedTexImage2D(0,_,d,l,0,x),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,x.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 r}}const P=class P extends Y{constructor(e,r){super(e);a(this,"props");this.props=P.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=P.resolveDefaults(e);return"ColorTexture,".concat(r.color)}static resolveDefaults(e){return{color:e.color||4294967295}}};a(P,"z$__type__Props");let H=P;const D=class D extends Y{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=D.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(D,"z$__type__Props");let C=D;class Me extends V{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 ye{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 Ne{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,"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");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.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}isWebGl2(){return de(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,c,h){const{gl:u}=this;o?u.texImage2D(u.TEXTURE_2D,t,e,r,s,i,o,c,h):u.texImage2D(u.TEXTURE_2D,t,e,r,s,i)}compressedTexImage2D(t,e,r,s,i,o){const{gl:c}=this;c.compressedTexImage2D(c.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:c,scissorWidth:h,scissorHeight:u}=this;(t!==o||e!==c||r!==h||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:c}=this;(t!==s||e!==i||t!==o||e!==c)&&(r.blendFunc(t,e),this.blendSrcRgb=t,this.blendDstRgb=e,this.blendSrcAlpha=t,this.blendDstAlpha=e)}createBuffer(){const{gl:t}=this;return t.createBuffer()}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,c){const{gl:h,boundArrayBuffer:u}=this;u!==t&&(h.bindBuffer(h.ARRAY_BUFFER,t),this.boundArrayBuffer=t),h.vertexAttribPointer(e,r,s,i,o,c)}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 c=o.get(e);(!c||!Le(c,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 m(t instanceof WebGL2RenderingContext),t.createVertexArray()}bindVertexArray(t){const{gl:e}=this;m(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 Le(n,t){return n.length!==t.length?!1:n.every((e,r)=>Array.isArray(e)||e instanceof Float32Array?!1:e===t[r])}const Ue=24;class Pe extends xe{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,"renderables",[]);a(this,"defaultShader");a(this,"quadBufferCollection");a(this,"defaultTexture");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 H(this.txManager),this.defaultTexture.once("loaded",()=>{this.stage.requestRender()});const o=he(r,e.contextSpy),c=this.glw=new Ne(o),h=Ee(s);c.viewport(0,0,r.width,r.height),c.clearColor(h[0],h[1],h[2],h[3]),c.setBlend(!0),c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA),pe(c,i),this.system={parameters:ge(this.glw),extensions:me(this.glw)},this.shManager.renderer=this,this.defaultShader=this.shManager.loadShader("DefaultShader").shader;const u=c.createBuffer();m(u);const d=6*Float32Array.BYTES_PER_ELEMENT;this.quadBufferCollection=new ye([{buffer:u,attributes:{a_position:{name:"a_position",size:2,type:c.FLOAT,normalized:!1,stride:d,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:c.FLOAT,normalized:!1,stride:d,offset:2*Float32Array.BYTES_PER_ELEMENT},a_color:{name:"a_color",size:4,type:c.UNSIGNED_BYTE,normalized:!0,stride:d,offset:4*Float32Array.BYTES_PER_ELEMENT},a_textureIndex:{name:"a_textureIndex",size:1,type:c.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 C?new Me(this.glw,this.txMemManager,e):new V(this.glw,this.txMemManager,e)}addQuad(e){var $,z;const{fQuadBuffer:r,uiQuadBuffer:s}=this,{width:i,height:o,colorTl:c,colorTr:h,colorBl:u,colorBr:d,textureOptions:l,shader:T,shaderProps:_,alpha:x,clippingRect:E,tx:R,ty:A,ta:G,tb:O,tc:X,td:F}=e;let{texture:I}=e;if(_&&v(_,"$dimensions")){const U=_.$dimensions;U.width=i,U.height=o}I=I!=null?I:this.defaultTexture,m(I instanceof Y,"Invalid texture type");let{curBufferIdx:f,curRenderOp:p}=this;const te={width:i,height:o},w=T||this.defaultShader;m(w instanceof W),p&&(p.shader!==w||!Te(p.clippingRect,E)||p.shader!==this.defaultShader&&(!_||!p.shader.canBatchShaderProps(p.shaderProps,_)))&&(p=null),m(w instanceof W),p||(this.newRenderOp(w,_,x,te,E,f),p=this.curRenderOp,m(p));const re=($=l==null?void 0:l.flipX)!=null?$:!1,se=(z=l==null?void 0:l.flipY)!=null?z:!1;let S=0,M=0,N=1,L=1;if(I instanceof C){const{x:U,y:b,width:ie,height:ae}=I.props,{width:q=0,height:K=0}=I.parentTexture.dimensions||{width:0,height:0};S=U/q,N=S+ie/q,M=b/K,L=M+ae/K,I=I.parentTexture}re&&([S,N]=[N,S]),se&&([M,L]=[L,M]);const{txManager:ne}=this.stage,k=ne.getCtxTexture(I);m(k instanceof V);const y=this.addTexture(k,f);if(p=this.curRenderOp,m(p),O!==0||X!==0)r[f++]=R,r[f++]=A,r[f++]=S,r[f++]=M,s[f++]=c,r[f++]=y,r[f++]=R+i*G,r[f++]=A+i*X,r[f++]=N,r[f++]=M,s[f++]=h,r[f++]=y,r[f++]=R+o*O,r[f++]=A+o*F,r[f++]=S,r[f++]=L,s[f++]=u,r[f++]=y,r[f++]=R+i*G+o*O,r[f++]=A+i*X+o*F,r[f++]=N,r[f++]=L,s[f++]=d,r[f++]=y;else{const U=R+i*G,b=A+o*F;r[f++]=R,r[f++]=A,r[f++]=S,r[f++]=M,s[f++]=c,r[f++]=y,r[f++]=U,r[f++]=A,r[f++]=N,r[f++]=M,s[f++]=h,r[f++]=y,r[f++]=R,r[f++]=b,r[f++]=S,r[f++]=L,s[f++]=u,r[f++]=y,r[f++]=U,r[f++]=b,r[f++]=N,r[f++]=L,s[f++]=d,r[f++]=y}p.length+=Ue,p.numQuads++,this.curBufferIdx=f}newRenderOp(e,r,s,i,o,c){const h=new Ae(this.glw,this.options,this.quadBufferCollection,e,r,s,o,i,c,0);this.curRenderOp=h,this.renderOps.push(h)}addTexture(e,r,s){const{curRenderOp:i}=this;m(i);const o=i.addTexture(e);if(o===4294967295){if(s)throw new Error("Unable to add texture to render op");const{shader:c,shaderProps:h,dimensions:u,clippingRect:d,alpha:l}=i;return this.newRenderOp(c,h,l,u,d,r),this.addTexture(e,r,!0)}return o}addRenderOp(e){this.renderOps.push(e),this.curRenderOp=null}render(e="screen"){var c;const{glw:r,quadBuffer:s}=this,i=new Float32Array(s,0,this.curBufferIdx),o=(c=this.quadBufferCollection.getBuffer("a_position"))!=null?c:null;r.arrayBufferData(o,i,r.STATIC_DRAW),this.renderOps.forEach((h,u)=>{h.draw()}),this.renderables=[]}}const we={LINE_FEED:10,CARRIAGE_RETURN:13,SPACE:32,TAB:9,ZERO_WIDTH_SPACE:8203,ZERO_WIDTH_NON_JOINER:8204,ZERO_WIDTH_JOINER:8205,LEFT_TO_RIGHT_MARK:8206,RIGHT_TO_LEFT_MARK:8207,LEFT_TO_RIGHT_EMBEDDING:8234,RIGHT_TO_LEFT_EMBEDDING:8235,POP_DIRECTIONAL_FORMATTING:8236,LEFT_TO_RIGHT_OVERRIDE:8237,RIGHT_TO_LEFT_OVERRIDE:8238,LINE_SEPARATOR:8232,PARAGRAPH_SEPARATOR:8233,OBJECT_REPLACEMENT_CHARACTER:65532,REPLACEMENT_CHARACTER:65533,ZERO_WIDTH_NO_BREAK_SPACE:65279,LEFT_TO_RIGHT_ISOLATE:8294,RIGHT_TO_LEFT_ISOLATE:8295,FIRST_STRONG_ISOLATE:8296,POP_DIRECTIONAL_ISOLATE:8297,INHIBIT_SYMMETRIC_SWAPPING:8298,ACTIVATE_SYMMETRIC_SWAPPING:8299,INHIBIT_ARABIC_FORM_SHAPING:8300,ACTIVATE_ARABIC_FORM_SHAPING:8301,NATIONAL_DIGIT_SHAPES:8302,NOMINAL_DIGIT_SHAPES:8303,LEFT_TO_RIGHT_BOUNDARY:8206,RIGHT_TO_LEFT_BOUNDARY:8207};class be{}class Be extends be{constructor(e,r){super();a(this,"data");a(this,"glyphMap");a(this,"kernings");this.data=e,this.glyphMap=r;const s=this.kernings={};e.kernings.forEach(i=>{const o=i.second,c=s[o]=s[o]||{};c[i.first]=i.amount}),this.kernings=s}*shapeText(e,r){var o;let s,i;for(;(s=r.peek())&&!s.done;){const c=s.value,h=this.glyphMap.get(c);if(r.next(),h!==void 0){const u=i!==void 0?(((o=this.kernings[h.id])==null?void 0:o[i])||0)+e.letterSpacing:0;i=h.id,yield{mapped:!0,glyphId:h.id,codepoint:c,cluster:r.lastIndex,xAdvance:h.xadvance+u,yAdvance:0,xOffset:h.xoffset+u,yOffset:h.yoffset,xBearing:0,yBearing:0,width:h.width,height:h.height}}else c===we.LINE_FEED&&(i=void 0),yield{mapped:!1,codepoint:c,cluster:r.lastIndex}}}}class Ke extends ee{constructor(e,r,s,i,o,c){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 h=i.renderer;m(h instanceof Pe,"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(c).then(async u=>{this.data=await u.json();let d=0;this.data.chars.forEach(l=>{this.glyphMap.set(l.id,l);const T=l.yoffset+l.height;T>d&&(d=T)}),this.maxCharHeight=d,this.shaper=new Be(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 Ze{}export{ye as B,Ze as C,J as E,Ke as S,Y as T,ze as W,m as a,Ee as b,Q as c,ve as d,He as e,Xe as f,Fe as g,W as h,ue as i,Se as j,$e as k,We as l,Oe as m,Ve as n,Ye as o,Ae as p,Ge as q,qe as r,De as s,ke as t,H as u,C as v,Pe as w}; +//# sourceMappingURL=CoreExtension-GJaPZupQ.js.map diff --git a/assets/CoreExtension-GJaPZupQ.js.map b/assets/CoreExtension-GJaPZupQ.js.map new file mode 100644 index 0000000..fcac62c --- /dev/null +++ b/assets/CoreExtension-GJaPZupQ.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CoreExtension-GJaPZupQ.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/text-rendering/font-face-types/WebTrFontFace.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/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 console.log(config);\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 } = renderOp;\n // Bind standard automatic uniforms\n this.setUniform('u_resolution', [glw.canvas.width, glw.canvas.height]);\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\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 */\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 */\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 length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex) {\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.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 // shaderOp.draw(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 // 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(this._nativeCtxTexture);\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 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 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 createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\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 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 //#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.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 }\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 * createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\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 { 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';\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 renderables = [];\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\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 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, } = 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 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (curRenderOp) {\n // If the current render op is not the same shader, create a new one\n // If the current render op's shader props are not compatible with the\n // the new shader props, create a new one render op.\n if (curRenderOp.shader !== targetShader ||\n !compareRect(curRenderOp.clippingRect, clippingRect) ||\n (curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !curRenderOp.shader.canBatchShaderProps(curRenderOp.shaderProps, shaderProps)))) {\n curRenderOp = null;\n }\n }\n assertTruthy(targetShader instanceof WebGlCoreShader);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n if (!curRenderOp) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx);\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) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0);\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 * 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('renderOp', i, renderOp.numQuads);\n }\n renderOp.draw();\n });\n // clean up\n this.renderables = [];\n }\n}\nconst idx = 0;\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","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","width","height","copyRect","compareRect","boundInsideBound","bound1","bound2","isBoundPositive","TrFontFace","fontFamily","descriptors","WebTrFontFace","fontUrl","fontUrlWithoutParentheses","determinedDescriptors","cssDescriptors","fontFace","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","buffers","shaderProps","clippingRect","bufferIdx","zIndex","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","usage","boundArrayBuffer","boundElementArrayBuffer","normalized","stride","offset","curProgram","programUniforms","uniforms","uniformArgs","compareArrays","mode","count","vertexArray","v","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","surface","arr","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,CAAA,EAYf,QAAQ,IAAIA,CAAM,EACZ,MAAAC,EAGLH,EAAO,WAAW,QAASE,CAAM,GAC9BF,EAA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AAAO,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":[15]} \ No newline at end of file diff --git a/assets/CoreExtension-legacy-BJPLTHoz.js.map b/assets/CoreExtension-legacy-BJPLTHoz.js.map deleted file mode 100644 index 31b8d51..0000000 --- a/assets/CoreExtension-legacy-BJPLTHoz.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CoreExtension-legacy-BJPLTHoz.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/text-rendering/font-face-types/WebTrFontFace.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/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 console.log(config);\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 } = renderOp;\n // Bind standard automatic uniforms\n this.setUniform('u_resolution', [glw.canvas.width, glw.canvas.height]);\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\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 */\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 */\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 length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex) {\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.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 // shaderOp.draw(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 // 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(this._nativeCtxTexture);\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 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 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 createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\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 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 //#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.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 }\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 * createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\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 { 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';\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 renderables = [];\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\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 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, } = 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 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (curRenderOp) {\n // If the current render op is not the same shader, create a new one\n // If the current render op's shader props are not compatible with the\n // the new shader props, create a new one render op.\n if (curRenderOp.shader !== targetShader ||\n !compareRect(curRenderOp.clippingRect, clippingRect) ||\n (curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !curRenderOp.shader.canBatchShaderProps(curRenderOp.shaderProps, shaderProps)))) {\n curRenderOp = null;\n }\n }\n assertTruthy(targetShader instanceof WebGlCoreShader);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n if (!curRenderOp) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx);\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) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0);\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 * 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('renderOp', i, renderOp.numQuads);\n }\n renderOp.draw();\n });\n // clean up\n this.renderables = [];\n }\n}\nconst idx = 0;\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","setUniform","canvas","pixelRatio","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","fontUrl","fontUrlWithoutParentheses","replace","determinedDescriptors","cssDescriptors","fontFace","FontFace","load","then","loaded","catch","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","_nativeCtxTexture","w","_w","h","_h","createNativeCtxTexture","onLoadRequest","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","activeTexture","bindTexture","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","texImage2D","RGBA","UNSIGNED_BYTE","setTextureMemUse","byteLength","getTextureData","sent","abrupt","ImageBitmap","ImageData","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","premultiplyAlpha","generateMipmap","DataView","ArrayBuffer","compressedTexImage2D","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","FLOAT","ONE","ONE_MINUS_SRC_ALPHA","STATIC_DRAW","DYNAMIC_DRAW","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","COLOR_BUFFER_BIT","arrayBufferData","usage","bindBuffer","ARRAY_BUFFER","bufferData","elementArrayBufferData","ELEMENT_ARRAY_BUFFER","programUniforms","Map","uniformArgs","every","v","isArray","Float32Array","compareArrays","mode","count","vertexArray","WebGlCoreRenderer","quadBuffer","bufferMemory","txMemManager","defaultTexture","requestRender","contextSpy","antialias","depth","premultipliedAlpha","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","targetDims","targetShader","newRenderOp","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","_texture$props","tw","th","_ref","_ref$width","parentW","_ref$height","parentH","_ref2","_ref3","getCtxTexture","textureIdx","rightCornerX","rightCornerY","recursive","addRenderOp","render","surface","_this$quadBufferColle","arr","renderables","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","first","amount","shapeText","codepoints","_this5","_callee5","codepointResult","lastGlyphId","codepoint","glyph","_this5$kernings$glyph","_context5","peek","done","id","letterSpacing","mapped","glyphId","cluster","lastIndex","xAdvance","xadvance","yAdvance","xOffset","xoffset","yOffset","yoffset","xBearing","yBearing","atlasUrl","atlasDataUrl","_this6","preload","checkLoaded","fetch","_ref4","_callee6","response","maxCharHeight","_context6","json","chars","charHeight","shaper","_x","getAtlasEntry"],"mappings":"8hPAmEgB,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,cC/GO,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,EAAEe,OAAQd,EAAEY,EAAIZ,EAAEc,QAAUF,EAC1D,GAAIC,EAAQ,GAAKC,EA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c,MAAA,SAAA+R,iBAAAA,EAAA5V,KAAA4V,EAAA7V,MAAA6V,KAAAA,EAEH,OAFGA,EAAA7V,KAEH,EAAA2V,EAASG,OAA3BT,KAAAA,EAAAA,EAAKrjB,KAAI6jB,EAAA7Q,KAGL4Q,EAAgB,EACpBP,EAAKrjB,KAAK+jB,MAAM7jB,SAAS6hB,IACrBsB,EAAKnC,SAAS9H,IAAI2I,EAAMK,GAAIL,GAC5B,IAAMiC,EAAajC,EAAMiB,QAAUjB,EAAM1kB,OACrC2mB,EAAaJ,IACbA,EAAgBI,EACnB,IAGLX,EAAKO,cAAgBA,EAGrBP,EAAKY,OAAS,IAAIhD,EAAcoC,EAAKrjB,KAAMqjB,EAAKnC,UAChDmC,EAAKE,cAAc,KAAA,EAAA,IAAA,MAAA,OAAAM,EAAAlQ,OAAA+P,GAAAA,EACtB,KAAA,OAAA,SAAAQ,GAAAT,OAAAA,EAAArV,MAAAlP,KAAA4O,UAAC,CAAA,KACGrE,MAAMtI,QAAQ8G,MACtB,CACDkc,aAAAA,CAAc5B,GACV,IAAMR,EAAQ7iB,KAAKgiB,SAAS/H,IAAIoJ,GAChC,QAAc/L,IAAVuL,EACA,MAAU,IAAAjhB,MAAO,SAAQyhB,uBAA6BrjB,KAAKkJ,cAE/D,MAAO,CACHlL,EAAG6kB,EAAM7kB,EACTC,EAAG4kB,EAAM5kB,EACTC,MAAO2kB,EAAM3kB,MACbC,OAAQ0kB,EAAM1kB,OAErB,CACDkmB,WAAAA,GACQrkB,KAAKsK,QAEkB,WAAvBtK,KAAKsL,QAAQ3C,OAAsB3I,KAAKc,OACxCd,KAAKsK,QAAS,EACdtK,KAAKe,KAAK,UAEjB,ICpELG,EAAA,IADO","x_google_ignoreList":[14]} \ No newline at end of file diff --git a/assets/CoreExtension-legacy-BJPLTHoz.js b/assets/CoreExtension-legacy-CBgSiwe5.js similarity index 67% rename from assets/CoreExtension-legacy-BJPLTHoz.js rename to assets/CoreExtension-legacy-CBgSiwe5.js index 7b28e1d..1ec6052 100644 --- a/assets/CoreExtension-legacy-BJPLTHoz.js +++ b/assets/CoreExtension-legacy-CBgSiwe5.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 r};var e,r={},i=Object.prototype,n=i.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",h=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,r){return t[e]=r}}function d(t,e,r,i){var n=e&&e.prototype instanceof x?e:x,s=Object.create(n.prototype),o=new U(i||[]);return a(s,"_invoke",{value:S(t,r,o)}),s}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=d;var f="suspendedStart",g="suspendedYield",v="executing",E="completed",p={};function x(){}function T(){}function _(){}var m={};c(m,o,(function(){return this}));var A=Object.getPrototypeOf,R=A&&A(A(N([])));R&&R!==i&&n.call(R,o)&&(m=R);var y=_.prototype=x.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(i,a,s,o){var h=l(t[i],t,a);if("throw"!==h.type){var u=h.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(c).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,o)}))}o(h.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(a,a):a()}})}function S(t,r,i){var n=f;return function(a,s){if(n===v)throw Error("Generator is already running");if(n===E){if("throw"===a)throw s;return{value:e,done:!0}}for(i.method=a,i.arg=s;;){var o=i.delegate;if(o){var h=M(o,i);if(h){if(h===p)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===f)throw n=E,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=v;var u=l(t,r,i);if("normal"===u.type){if(n=i.done?E:g,u.arg===p)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(n=E,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")),p;var a=l(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,p;var s=a.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 U(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(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,a=function r(){for(;++i=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var h=n.call(s,"catchLoc"),u=n.call(s,"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),p}},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:N(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=e),p}},r}function e(t,e,r,i,n,a,s){try{var o=t[a](s),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,a){var s=t.apply(r,i);function o(t){e(s,n,a,o,h,"next",t)}function h(t){e(s,n,a,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,a){"use strict";return{execute:function(){function a(t,e){}function s(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:a,c:g,d:function(t,e,r){var i=g(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&&s>0)return r?(r.x=i,r.y=n,r.width=a,r.height=s,r):{x:i,y:n,width:a,height:s};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)})`},i:o,j:A,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),a=Math.trunc((t>>>16&255)*i),s=Math.trunc((t>>>8&255)*i),o=Math.trunc(255*i);if(r)return(o<<24|s<<16|a<<8|n)>>>0;return(n<<24|a<<16|s<<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,a=Math.trunc((255&t)*e);return(r<<24|i<<16|n<<8|a)>>>0},s:function(t,e,r){var i=Math.trunc(t>>>24),n=Math.trunc(t>>>16&255),a=Math.trunc(t>>>8&255),s=Math.trunc(255&t),o=Math.trunc(e>>>24),h=Math.trunc(e>>>16&255),u=Math.trunc(e>>>8&255),c=Math.trunc(255&e),d=Math.round(o*r+i*(1-r)),l=Math.round(h*r+n*(1-r)),f=Math.round(u*r+a*(1-r)),g=Math.round(c*r+s*(1-r));return(d<<24|l<<16|f<<8|g)>>>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 c(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 d 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(),a=i&&t.webgl2Extensions||!i&&t.webgl1Extensions||[],s=i?"2.0":"1.0";a.forEach((t=>{if(!r.getExtension(t))throw new Error(`Shader "${this.constructor.name}" requires extension "${t}" for WebGL ${s} 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,d=o.fragment instanceof Function?o.fragment(h):o.fragment,l=c(r,r.VERTEX_SHADER,u),f=c(r,r.FRAGMENT_SHADER,d);if(!l||!f)throw new Error;var g=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(!g)throw new Error;if(this.program=g,i){var v=r.createVertexArray();if(!v)throw new Error;this.vao=v,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;if(this.setUniform("u_resolution",[r.canvas.width,r.canvas.height]),this.setUniform("u_pixelRatio",t.options.pixelRatio),e){if(s(e,"$dimensions")){var i=e.$dimensions;i||(i=t.dimensions),this.setUniform("u_dimensions",[i.width,i.height])}if(s(e,"$alpha")){var n=e.$alpha;n||(n=t.alpha),this.setUniform("u_alpha",n)}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(d,"shaderSources",void 0),e("h",d);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("T",l);var f=e("b",(t=>[(t>>>24)/255,(t>>>16&255)/255,(t>>>8&255)/255,(255&t)/255]));function g(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 v 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;e{this.loaded=!0,this.emit("loaded")})).catch(console.error),this.fontFace=o,this.fontUrl=r}});class E{constructor(t,e){n(this,"memManager",void 0),n(this,"textureSource",void 0),this.memManager=t,this.textureSource=e}}class p{constructor(t){n(this,"stage",void 0),this.stage=t}}class x{}class T extends x{constructor(t,e,r,i,a,s,o,h,u,c){super(),n(this,"glw",void 0),n(this,"options",void 0),n(this,"buffers",void 0),n(this,"shader",void 0),n(this,"shaderProps",void 0),n(this,"alpha",void 0),n(this,"clippingRect",void 0),n(this,"dimensions",void 0),n(this,"bufferIdx",void 0),n(this,"zIndex",void 0),n(this,"length",0),n(this,"numQuads",0),n(this,"textures",[]),n(this,"maxTextures",void 0),this.glw=t,this.options=e,this.buffers=r,this.shader=i,this.shaderProps=a,this.alpha=s,this.clippingRect=o,this.dimensions=h,this.bufferIdx=u,this.zIndex=c,this.maxTextures=i.supportsIndexedTextures?t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS):1}addTexture(t){var e=this.textures,r=this.maxTextures,i=e.findIndex((e=>e===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 a=this.clippingRect,s=a.x,o=a.y,h=a.width,u=a.height,c=i.pixelRatio,d=i.canvas.height,l=Math.round(s*c),f=Math.round(h*c),g=Math.round(u*c),v=Math.round(d-g-o*c);t.setScissorTest(!0),t.scissor(l,v,f,g)}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 A(t,e){var r,i,n=0;function a(){var a,s,o=r,h=arguments.length;t:for(;o;){if(o.args.length===arguments.length){for(s=0;st&&!(t&t-1),y=(t,e,r,i)=>{var n=3*t,a=3*(r-t)-n,s=1-n-a,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,c=0;c<20;c++){if((r=t-i*(i*(i*s+a)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);if((e=i*(i*(3*s)+2*a)+n)>1e-10&&e<1e-10)break;i+=r/e}for(var d=0,l=1,f=0;f<20;f++){if((r=t-(i=.5*(d+l))*(i*(i*s+a)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);r<0?l=i:d=i}}};e("r",A((t=>{switch(t){case"linear":return function(t){return t};case"ease":return y(.25,.1,.25,1);case"ease-in":return y(.42,0,1,1);case"ease-out":return y(0,0,.58,1);case"ease-in-out":return y(.42,0,.58,1);case"ease-in-sine":case"ease-out-sine":return y(.12,0,.39,0);case"ease-in-out-sine":return y(.37,0,.63,1);case"ease-in-cubic":return y(.32,0,.67,0);case"ease-out-cubic":return y(.33,1,.68,1);case"ease-in-out-cubic":return y(.65,0,.35,1);case"ease-in-circ":return y(.55,0,1,.45);case"ease-out-circ":return y(0,.55,.45,1);case"ease-in-out-circ":return y(.85,0,.15,1);case"ease-in-back":return y(.36,0,.66,-.56);case"ease-out-back":return y(.34,1.56,.64,1);case"ease-in-out-back":return y(.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"),a=parseFloat(r[2]||"1"),s=parseFloat(r[3]||"1");return isNaN(i)||isNaN(n)||isNaN(a)||isNaN(s)?(console.warn(" Unknown timing function: "+t),function(t){return t}):y(i,n,a,s)}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 b=new Uint8Array([0,0,0,0]);class w extends E{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,a,s,o,h,u,c,d,l,f,g,v,E,p,x,T;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.glw,a=e.memManager,n.activeTexture(0),n.bindTexture(e._nativeCtxTexture),n.texParameteri(n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,b),a.setTextureMemUse(e,b.byteLength),t.next=11,null===(i=e.textureSource)||void 0===i?void 0:i.getTextureData();case 11:if(s=t.sent,e._nativeCtxTexture){t.next=15;break}return e._state,t.abrupt("return",{width:0,height:0});case 15:return o=0,h=0,e._nativeCtxTexture,n.activeTexture(0),s.data instanceof ImageBitmap||s.data instanceof ImageData||null!==(r=s.data)&&"object"==typeof r&&r.constructor&&"HTMLImageElement"===r.constructor.name?(u=s.data,o=u.width,h=u.height,n.bindTexture(e._nativeCtxTexture),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!!s.premultiplyAlpha),n.texImage2D(0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u),a.setTextureMemUse(e,o*h*4),(n.isWebGl2()||R(o)&&R(h))&&n.generateMipmap()):null===s.data?(o=0,h=0,n.bindTexture(e._nativeCtxTexture),n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,b),a.setTextureMemUse(e,b.byteLength)):"mipmaps"in s.data&&s.data.mipmaps?(d=s.data,l=d.mipmaps,f=d.width,g=void 0===f?0:f,v=d.height,E=void 0===v?0:v,p=d.type,x=d.glInternalFormat,T="ktx"===p?new DataView(null!==(c=l[0])&&void 0!==c?c:new ArrayBuffer(0)):l[0],n.bindTexture(e._nativeCtxTexture),n.compressedTexImage2D(0,x,g,E,0,T),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,T.byteLength)):console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",s),t.abrupt("return",{width:o,height:h});case 21: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.createTexture();if(!t)throw new Error("Could not create WebGL Texture");return t}}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,a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.textureSource.getTextureData();case 2:return a=t.sent,t.abrupt("return",{width:(null===(i=a.data)||void 0===i?void 0:i.width)||0,height:(null===(n=a.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 U{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,"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),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.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}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 a=i.get(n);a||(a={},i.set(n,a)),a[t]!==e&&(a[t]=e,r.texParameteri(r.TEXTURE_2D,t,e))}texImage2D(t,e,r,i,n,a,s,o){var h=this.gl;a?h.texImage2D(h.TEXTURE_2D,t,e,r,i,n,a,s,o):h.texImage2D(h.TEXTURE_2D,t,e,r,i,n)}compressedTexImage2D(t,e,r,i,n,a){var s=this.gl;s.compressedTexImage2D(s.TEXTURE_2D,t,e,r,i,n,a)}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,a=this.scissorX,s=this.scissorY,o=this.scissorWidth,h=this.scissorHeight;t===a&&e===s&&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,a=this.blendSrcAlpha,s=this.blendDstAlpha;t===i&&e===n&&t===a&&e===s||(r.blendFunc(t,e),this.blendSrcRgb=t,this.blendDstRgb=e,this.blendSrcAlpha=t,this.blendDstAlpha=e)}createBuffer(){return this.gl.createBuffer()}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,a,s){var o=this.gl;this.boundArrayBuffer!==t&&(o.bindBuffer(o.ARRAY_BUFFER,t),this.boundArrayBuffer=t),o.vertexAttribPointer(e,r,i,n,a,s)}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,a=n.get(this.curProgram);a||(a=new Map,n.set(this.curProgram,a));var s=a.get(e);s&&function(t,e){if(t.length!==e.length)return!1;return t.every(((t,r)=>!(Array.isArray(t)||t instanceof Float32Array)&&t===e[r]))}(s,r)||(a.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 N extends p{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,"renderables",[]),n(this,"defaultShader",void 0),n(this,"quadBufferCollection",void 0),n(this,"defaultTexture",void 0);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,premultipliedAlpha:!0};console.log(r);var 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),s=this.glw=new U(a),o=f(r);s.viewport(0,0,e.width,e.height),s.clearColor(o[0],o[1],o[2],o[3]),s.setBlend(!0),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),function(t,e){for(var r=~~(e/80),i=new Uint16Array(6*r),n=0,a=0;n{t.draw()})),this.renderables=[]}}e("w",N);var P=10;class O{}class B extends O{constructor(t,e){super(),n(this,"data",void 0),n(this,"glyphMap",void 0),n(this,"kernings",void 0),this.data=t,this.glyphMap=e;var r=this.kernings={};t.kernings.forEach((t=>{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 a,s,o,h,u,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=void 0;case 1:if(!(a=r.peek())||a.done){t.next=17;break}if(o=a.value,h=i.glyphMap.get(o),r.next(),void 0===h){t.next=12;break}return c=void 0!==s?((null===(u=i.kernings[h.id])||void 0===u?void 0:u[s])||0)+e.letterSpacing:0,s=h.id,t.next=10,{mapped:!0,glyphId:h.id,codepoint:o,cluster:r.lastIndex,xAdvance:h.xadvance+c,yAdvance:0,xOffset:h.xoffset+c,yOffset:h.yoffset,xBearing:0,yBearing:0,width:h.width,height:h.height};case 10:t.next=15;break;case 12:return o===P&&(s=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 v{constructor(e,i,a,s,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=a;s.renderer;this.texture=s.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 B(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-BJPLTHoz.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 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 c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,r){return t[e]=r}}function d(t,e,r,i){var n=e&&e.prototype instanceof x?e:x,a=Object.create(n.prototype),o=new U(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=d;var f="suspendedStart",g="suspendedYield",v="executing",E="completed",p={};function x(){}function T(){}function _(){}var m={};c(m,o,(function(){return this}));var A=Object.getPrototypeOf,R=A&&A(A(N([])));R&&R!==i&&n.call(R,o)&&(m=R);var y=_.prototype=x.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){c(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,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,o)}),(function(t){r("throw",t,a,o)})):e.resolve(c).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===v)throw Error("Generator is already running");if(n===E){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===p)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===f)throw n=E,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=v;var u=l(t,r,i);if("normal"===u.type){if(n=i.done?E:g,u.arg===p)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(n=E,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")),p;var s=l(n,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,p;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,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 U(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(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),p}},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:N(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=e),p}},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:g,d:function(t,e,r){var i=g(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)})`},i:o,j:A,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),c=Math.trunc(255&e),d=Math.round(o*r+i*(1-r)),l=Math.round(h*r+n*(1-r)),f=Math.round(u*r+s*(1-r)),g=Math.round(c*r+a*(1-r));return(d<<24|l<<16|f<<8|g)>>>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 c(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 d 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,d=o.fragment instanceof Function?o.fragment(h):o.fragment,l=c(r,r.VERTEX_SHADER,u),f=c(r,r.FRAGMENT_SHADER,d);if(!l||!f)throw new Error;var g=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(!g)throw new Error;if(this.program=g,i){var v=r.createVertexArray();if(!v)throw new Error;this.vao=v,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;if(this.setUniform("u_resolution",[r.canvas.width,r.canvas.height]),this.setUniform("u_pixelRatio",t.options.pixelRatio),e){if(a(e,"$dimensions")){var i=e.$dimensions;i||(i=t.dimensions),this.setUniform("u_dimensions",[i.width,i.height])}if(a(e,"$alpha")){var n=e.$alpha;n||(n=t.alpha),this.setUniform("u_alpha",n)}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(d,"shaderSources",void 0),e("h",d);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("T",l);var f=e("b",(t=>[(t>>>24)/255,(t>>>16&255)/255,(t>>>8&255)/255,(255&t)/255]));function g(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 v 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;e{this.loaded=!0,this.emit("loaded")})).catch(console.error),this.fontFace=o,this.fontUrl=r}});class E{constructor(t,e){n(this,"memManager",void 0),n(this,"textureSource",void 0),this.memManager=t,this.textureSource=e}}class p{constructor(t){n(this,"stage",void 0),this.stage=t}}class x{}class T extends x{constructor(t,e,r,i,s,a,o,h,u,c){super(),n(this,"glw",void 0),n(this,"options",void 0),n(this,"buffers",void 0),n(this,"shader",void 0),n(this,"shaderProps",void 0),n(this,"alpha",void 0),n(this,"clippingRect",void 0),n(this,"dimensions",void 0),n(this,"bufferIdx",void 0),n(this,"zIndex",void 0),n(this,"length",0),n(this,"numQuads",0),n(this,"textures",[]),n(this,"maxTextures",void 0),this.glw=t,this.options=e,this.buffers=r,this.shader=i,this.shaderProps=s,this.alpha=a,this.clippingRect=o,this.dimensions=h,this.bufferIdx=u,this.zIndex=c,this.maxTextures=i.supportsIndexedTextures?t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS):1}addTexture(t){var e=this.textures,r=this.maxTextures,i=e.findIndex((e=>e===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,c=i.pixelRatio,d=i.canvas.height,l=Math.round(a*c),f=Math.round(h*c),g=Math.round(u*c),v=Math.round(d-g-o*c);t.setScissorTest(!0),t.scissor(l,v,f,g)}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 A(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),y=(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,c=0;c<20;c++){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 d=0,l=1,f=0;f<20;f++){if((r=t-(i=.5*(d+l))*(i*(i*a+s)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);r<0?l=i:d=i}}};e("r",A((t=>{switch(t){case"linear":return function(t){return t};case"ease":return y(.25,.1,.25,1);case"ease-in":return y(.42,0,1,1);case"ease-out":return y(0,0,.58,1);case"ease-in-out":return y(.42,0,.58,1);case"ease-in-sine":case"ease-out-sine":return y(.12,0,.39,0);case"ease-in-out-sine":return y(.37,0,.63,1);case"ease-in-cubic":return y(.32,0,.67,0);case"ease-out-cubic":return y(.33,1,.68,1);case"ease-in-out-cubic":return y(.65,0,.35,1);case"ease-in-circ":return y(.55,0,1,.45);case"ease-out-circ":return y(0,.55,.45,1);case"ease-in-out-circ":return y(.85,0,.15,1);case"ease-in-back":return y(.36,0,.66,-.56);case"ease-out-back":return y(.34,1.56,.64,1);case"ease-in-out-back":return y(.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}):y(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 b=new Uint8Array([0,0,0,0]);class w extends E{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,c,d,l,f,g,v,E,p,x,T;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.glw,s=e.memManager,n.activeTexture(0),n.bindTexture(e._nativeCtxTexture),n.texParameteri(n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,b),s.setTextureMemUse(e,b.byteLength),t.next=11,null===(i=e.textureSource)||void 0===i?void 0:i.getTextureData();case 11:if(a=t.sent,e._nativeCtxTexture){t.next=15;break}return e._state,t.abrupt("return",{width:0,height:0});case 15: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()||R(o)&&R(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,b),s.setTextureMemUse(e,b.byteLength)):"mipmaps"in a.data&&a.data.mipmaps?(d=a.data,l=d.mipmaps,f=d.width,g=void 0===f?0:f,v=d.height,E=void 0===v?0:v,p=d.type,x=d.glInternalFormat,T="ktx"===p?new DataView(null!==(c=l[0])&&void 0!==c?c:new ArrayBuffer(0)):l[0],n.bindTexture(e._nativeCtxTexture),n.compressedTexImage2D(0,x,g,E,0,T),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,T.byteLength)):console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",a),t.abrupt("return",{width:o,height:h});case 21: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.createTexture();if(!t)throw new Error("Could not create WebGL Texture");return t}}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 U{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,"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),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.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}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()}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 N extends p{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,"renderables",[]),n(this,"defaultShader",void 0),n(this,"quadBufferCollection",void 0),n(this,"defaultTexture",void 0);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={};console.log(r);var 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 U(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()})),this.renderables=[]}}e("w",N);var P=10;class O{}class B extends O{constructor(t,e){super(),n(this,"data",void 0),n(this,"glyphMap",void 0),n(this,"kernings",void 0),this.data=t,this.glyphMap=e;var r=this.kernings={};t.kernings.forEach((t=>{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,c;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 c=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+c,yAdvance:0,xOffset:h.xoffset+c,yOffset:h.yoffset,xBearing:0,yBearing:0,width:h.width,height:h.height};case 10:t.next=15;break;case 12:return o===P&&(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 v{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 B(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-CBgSiwe5.js.map diff --git a/assets/CoreExtension-legacy-CBgSiwe5.js.map b/assets/CoreExtension-legacy-CBgSiwe5.js.map new file mode 100644 index 0000000..aa1a5ac --- /dev/null +++ b/assets/CoreExtension-legacy-CBgSiwe5.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CoreExtension-legacy-CBgSiwe5.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/text-rendering/font-face-types/WebTrFontFace.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/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 console.log(config);\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 } = renderOp;\n // Bind standard automatic uniforms\n this.setUniform('u_resolution', [glw.canvas.width, glw.canvas.height]);\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\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 */\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 */\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 length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex) {\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.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 // shaderOp.draw(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 // 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(this._nativeCtxTexture);\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 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 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 createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\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 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 //#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.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 }\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 * createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\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 { 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';\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 renderables = [];\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\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 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, } = 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 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (curRenderOp) {\n // If the current render op is not the same shader, create a new one\n // If the current render op's shader props are not compatible with the\n // the new shader props, create a new one render op.\n if (curRenderOp.shader !== targetShader ||\n !compareRect(curRenderOp.clippingRect, clippingRect) ||\n (curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !curRenderOp.shader.canBatchShaderProps(curRenderOp.shaderProps, shaderProps)))) {\n curRenderOp = null;\n }\n }\n assertTruthy(targetShader instanceof WebGlCoreShader);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n if (!curRenderOp) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx);\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) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0);\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 * 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('renderOp', i, renderOp.numQuads);\n }\n renderOp.draw();\n });\n // clean up\n this.renderables = [];\n }\n}\nconst idx = 0;\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","setUniform","canvas","pixelRatio","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","fontUrl","fontUrlWithoutParentheses","replace","determinedDescriptors","cssDescriptors","fontFace","FontFace","load","then","loaded","catch","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","_nativeCtxTexture","w","_w","h","_h","createNativeCtxTexture","onLoadRequest","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","activeTexture","bindTexture","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","texImage2D","RGBA","UNSIGNED_BYTE","setTextureMemUse","byteLength","getTextureData","sent","abrupt","ImageBitmap","ImageData","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","premultiplyAlpha","generateMipmap","DataView","ArrayBuffer","compressedTexImage2D","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","FLOAT","ONE","ONE_MINUS_SRC_ALPHA","STATIC_DRAW","DYNAMIC_DRAW","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","COLOR_BUFFER_BIT","arrayBufferData","usage","bindBuffer","ARRAY_BUFFER","bufferData","elementArrayBufferData","ELEMENT_ARRAY_BUFFER","programUniforms","Map","uniformArgs","every","v","isArray","Float32Array","compareArrays","mode","count","vertexArray","WebGlCoreRenderer","quadBuffer","bufferMemory","txMemManager","defaultTexture","requestRender","contextSpy","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","targetDims","targetShader","newRenderOp","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","_texture$props","tw","th","_ref","_ref$width","parentW","_ref$height","parentH","_ref2","_ref3","getCtxTexture","textureIdx","rightCornerX","rightCornerY","recursive","addRenderOp","render","surface","_this$quadBufferColle","arr","renderables","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","first","amount","shapeText","codepoints","_this5","_callee5","codepointResult","lastGlyphId","codepoint","glyph","_this5$kernings$glyph","_context5","peek","done","id","letterSpacing","mapped","glyphId","cluster","lastIndex","xAdvance","xadvance","yAdvance","xOffset","xoffset","yOffset","yoffset","xBearing","yBearing","atlasUrl","atlasDataUrl","_this6","preload","checkLoaded","fetch","_ref4","_callee6","response","maxCharHeight","_context6","json","chars","charHeight","shaper","_x","getAtlasEntry"],"mappings":"8hPAmEgB,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,cC/GO,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,GACpB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","x_google_ignoreList":[14]} \ No newline at end of file diff --git a/assets/index-DdLHrQIy.js b/assets/index-D71SC9OT.js similarity index 99% rename from assets/index-DdLHrQIy.js rename to assets/index-D71SC9OT.js index 98144e1..7b7bec9 100644 --- a/assets/index-DdLHrQIy.js +++ b/assets/index-D71SC9OT.js @@ -4,5 +4,5 @@ function __vite__mapDeps(indexes) { } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -var ri=Object.defineProperty;var oi=(r,n,e)=>n in r?ri(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var h=(r,n,e)=>(oi(r,typeof n!="symbol"?n+"":n,e),e);import{a as F,i as ro,g as _n,c as ht,W as yr,E as nt,b as ke,d as ii,e as nr,f as si,m as At,h as Lt,j as oo,T as io,k as ai,l as In,S as vr,B as li,n as ci,o as so,p as di,q as hi,C as ui,r as fi,s as wr,t as br,u as gi,v as pi,w as mi}from"./CoreExtension-BVIaGMQL.js";function Yc(){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)}})();class ao{constructor(n){h(this,"releaseCallback");this.releaseCallback=n}}class xi extends ao{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(F(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;F(t,"Texture must have an id to be registered");let o=this.textureMap.get(t);o||(this.registerTexture(e),o=this.textureMap.get(t)),F(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;F(t,"Texture must have an id to be registered");const o=this.textureMap.get(t);F(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 yi extends ao{constructor(e){super(e);h(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,o;F((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 yt={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:lo(r)}},lo=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,")")},vi={id:"id"};class wi{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(ro())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(yt[e]){const i=(o=yt[e])==null?void 0:o.call(yt,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(vi[e]){n.setAttribute(String(yt[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:y=0,scale:b=1,color:x}=t;function w(){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(y,"rad"),n.style.scale="".concat(b),n.style.color=lo(x)},i)}setTimeout(w,s)}}const bi="modulepreload",Si=function(r){return"/solid-demo-app/"+r},Sr={},Ai=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=Si(c),c in Sr)return;Sr[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(!!t)for(let b=i.length-1;b>=0;b--){const x=i[b];if(x.href===c&&(!d||x.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(c,'"]').concat(u)))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":bi,d||(y.as="script",y.crossOrigin=""),y.href=c,a&&y.setAttribute("nonce",a),document.head.appendChild(y),d)return new Promise((b,x)=>{y.addEventListener("load",b),y.addEventListener("error",()=>x(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,y="".concat(e,"_").concat(d);let b="";u.size&&(b="[".concat(u.size(o),"]")),s.push(y),a+="uniform ".concat(g," ").concat(y).concat(b,";"),i[d]={name:y,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 Ci={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 co{constructor(n){h(this,"stage");h(this,"set");this.stage=n;const e={...Ci,...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)}))}}const Ar=2048;function Cr(r,n,e,t,o){const i=r!=="bottom"?.5*n:0;return e*(t-1)+i+Math.max(e,n)+(o||0)}class Ti{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,y=this._settings.cutEx*e,b=this._settings.cutSy*e,x=this._settings.cutEy*e,w=(this._settings.letterSpacing||0)*e,S=this._settings.textIndent*e;this.setFontProperties();let A=c||2048/this.getPrecision(),p=A-t;if(p<10&&(A+=10-p,p=10),u||(u=p),this._settings.textOverflow&&!this._settings.wordWrap){let C;switch(this._settings.textOverflow){case"clip":C="";break;case"ellipsis":C=this._settings.overflowSuffix;break;default:C=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,u-S,C)}let m;if(this._settings.wordWrap)m=this.wrapText(this._settings.text,u,w,S);else{m={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const C=m.l.length;for(let _=0;_this._settings.maxLines){const C=v.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(C[C.length-1],u-O,w,S);C[C.length-1]="".concat(D.l[0]).concat(this._settings.overflowSuffix),_=[D.l.length>1?D.l[1]:""]}else _=[""];let E;const P=v.length;let k=0;const z=m.n.length;for(E=this._settings.maxLines;E=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,y=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?(b>0&&(d.push(u),u=""),u+=y[b],g=e-x-(b===0?o:0)):(g-=w,u+=" ".concat(y[b]))}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 Tr=typeof self>"u"?globalThis:self;var no;const _r=((no=Tr.document)==null?void 0:no.fonts)||Tr.fonts;function _i(r){const{fontFamily:n,fontStyle:e,fontWeight:t,fontStretch:o,fontSize:i}=r;return[e,t,o,"".concat(i,"px"),n].join(" ")}const Ii=ht(0,0,0,0);class Ri extends co{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")),F(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 yr}addFontFace(e){F(e instanceof yr),_r.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new nt,canvasPages:void 0,lightning2TextRenderer:new Ti(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 x,w;if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const S=_i(e.props);if(e.fontInfo={cssString:S,loaded:!1},!e.fontInfo.loaded){_r.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,A=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,p=A>0&&S>0?Math.min(A,S):Math.max(A,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:p,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=ht(t,o,c!=="none"?t+i:1/0,c==="both"?o+s:1/0,Ii);ii(this.rendererBounds,S,d),d.valid=!0}const y=d.y2-d.y1,b=Math.ceil(y/e.renderInfo.lineHeight);if(y===0){g=void 0,u=void 0,this.setStatus(e,"loaded");return}else if(u&&g){const S=t+u.x1,A=o-a+u.y1,p=t+u.x2,m=o-a+u.y2;if(S<=d.x1&&p>=d.x2&&A<=d.y1&&m>=d.y2){this.setStatus(e,"loaded");return}md.y1&&(u.y1-=b*e.renderInfo.lineHeight,u.y2-=b*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-b,g[0].lineNumEnd=g[0].lineNumStart+b,g[0].valid=!1)}else{const S=e.renderInfo.lineHeight*b,A=Math.ceil(a/S),p=A*b,m=p-b,v=p+b;g=[{texture:g==null?void 0:g[0].texture,lineNumStart:m,lineNumEnd:m+b,valid:!1},{texture:g==null?void 0:g[1].texture,lineNumStart:p,lineNumEnd:p+b,valid:!1},{texture:g==null?void 0:g[2].texture,lineNumStart:v,lineNumEnd:v+b,valid:!1}],e.canvasPages=g;const T=A*S;u={x1:0,y1:T-S,x2:i,y2:T+S*2}}e.renderWindow=u,performance.now();for(const S of g)if(!S.valid){if(S.lineNumStart<0){(x=S.texture)==null||x.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||((w=S.texture)==null||w.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 C,_,E,P,k,z,O,D,W,j,se,te;const{stage:s}=this,{canvasPages:a,textW:c=0,textH:d=0,renderWindow:u}=e;if(!a||!u)return;const{x:g,y,scrollY:b,contain:x,width:w,height:S}=e.props,A={x:g,y,width:x!=="none"?w:c,height:x==="both"?S:d};nr({x:0,y:0,width:s.options.appWidth,height:s.options.appHeight},A),F(a,"canvasPages is not defined"),F(u,"renderWindow is not defined");const m=(u.y2-u.y1)/3,{zIndex:v,color:T}=e.props,R=i*si(T),I=At(4294967295,R);a[0].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((_=(C=a[0].texture)==null?void 0:C.dimensions)==null?void 0:_.width)||0,height:((P=(E=a[0].texture)==null?void 0:E.dimensions)==null?void 0:P.height)||0,texture:a[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[1].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((z=(k=a[1].texture)==null?void 0:k.dimensions)==null?void 0:z.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:v,tx:t.tx,ty:t.ty-b+u.y1+m,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[2].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((j=(W=a[2].texture)==null?void 0:W.dimensions)==null?void 0:j.width)||0,height:((te=(se=a[2].texture)==null?void 0:se.dimensions)==null?void 0:te.height)||0,texture:a[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1+m+m,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 ho extends Lt{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(ho,"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 / 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 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 uo extends Lt{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(uo,"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 Rn=new Map,Bi=(r,n)=>{const e=JSON.stringify(r);if(Rn.has(e))return Rn.get(e);const t=(r!=null?r:[]).map(o=>({type:o.type,props:n[o.type].resolveDefaults(o.props||{})}));return Rn.set(e,t),t},Ne=class Ne extends Lt{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=oo(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(y=>{const b=c.uniforms[y],x=u[y];let w=b.validator?b.validator(d[y],d):d[y];Array.isArray(w)&&(w=new Float32Array(w)),o.push({name:x.name,value:w})})}),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 w=t[x.type],S=w.getEffectKey(x.props||{});o[S]=o[S]?++o[S]:1;const A=o[S];A===1&&c.push({key:S,type:x.type,props:x.props});const p=new w({ref:"".concat(S).concat(A===1?"":A),target:S,props:x.props});return s+=p.declaredUniforms,a.push(...Object.values(p.uniformInfo)),p});let u="";c==null||c.forEach(x=>{var I;const w=t[x.type],S=w.resolveDefaults((I=x.props)!=null?I:{}),A=[];for(const C in w.methods){let _=C;const E=w.methods[C];i[C]&&i[C]!==E&&(_=Ne.resolveMethodDuplicate(C,E,i)),i[_]=E.replace("function",_),A.push({m:C,cm:_})}let p=w.onShaderMask instanceof Function?w.onShaderMask(S):w.onShaderMask,m=w.onColorize instanceof Function?w.onColorize(S):w.onColorize,v=w.onEffectMask instanceof Function?w.onEffectMask(S):w.onEffectMask;A.forEach(C=>{const{m:_,cm:E}=C,P=new RegExp("\\$".concat(_),"g");p&&(p=p.replace(P,E)),m&&(m=m.replace(P,E)),v&&(v=v.replace(P,E))});const T=w.getMethodParameters(w.uniforms,S),R=T.length>0?", ".concat(T):"";p&&(u+="\n float fx_".concat(x.key,"_onShaderMask(float shaderMask ").concat(R,") {\n ").concat(p,"\n }\n ")),m&&(u+="\n vec4 fx_".concat(x.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(m,"\n }\n ")),v&&(u+="\n vec4 fx_".concat(x.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(v,"\n }\n "))});let g="";for(const x in i)g+=i[x];let y="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",b="\n\n ";for(let x=0;x0?", ".concat(w.passParameters):"",A=t[w.name];A.onShaderMask&&(b+="\n shaderMask = fx_".concat(w.target,"_onShaderMask(shaderMask ").concat(S,");\n ")),A.onColorize&&(b+="\n maskColor = fx_".concat(w.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(S,");\n ")),A.onEffectMask&&(y="fx_".concat(w.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(S,")"));const p=d[x+1];(p===void 0||t[p.name].onEffectMask)&&(b+="\n shaderColor = ".concat(y,";\n "))}return{effects:d,uniforms:a,fragment:Ne.fragment(s,g,u,b),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:Bi(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 ut=Ne;class Mn extends Lt{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(Mn,"z$__type__Props"),h(Mn,"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 ki=new Float32Array([1,0,0,0,1,0,0,0,1]),yn=class yn extends Lt{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=yn.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:ki,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(yn,"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 gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\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 zn=yn;class ot 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(ot,"z$__type__Props"),h(ot,"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(ot,"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(ot,"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(ot,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Ct 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(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,"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(Ct,"onColorize","\n return color;\n ");const Ye=class Ye 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(Ye,"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(Ye,"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(Ye.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Pn=Ye;class Dn 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(Dn,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),h(Dn,"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 it 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(it,"z$__type__Props"),h(it,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(it,"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(it,"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(it,"onColorize","\n return color;\n ");class st 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(st,"z$__type__Props"),h(st,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(st,"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(st,"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(st,"onColorize","\n return color;\n ");class at 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(at,"z$__type__Props"),h(at,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(at,"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(at,"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(at,"onColorize","\n return color;\n ");class lt 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(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(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 Tt 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(Tt,"z$__type__Props"),h(Tt,"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(Tt,"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(Tt,"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 rn 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(rn,"z$__type__Props"),h(rn,"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(rn,"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 qe=class qe 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 y=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(qe,"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(qe.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let On=qe;class ct 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(ct,"z$__type__Props"),h(ct,"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(ct,"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(ct,"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(ct,"onColorize","\n return color;\n ");class dt 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(dt,"z$__type__Props"),h(dt,"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(dt,"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(dt,"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(dt,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class Ei{constructor(){h(this,"shCache",new Map);h(this,"shConstructors",{});h(this,"attachedShader",null);h(this,"effectConstructors",{});h(this,"renderer");this.registerShaderType("DefaultShader",ho),this.registerShaderType("DefaultShaderBatched",uo),this.registerShaderType("RoundedRectangle",Mn),this.registerShaderType("DynamicShader",ut),this.registerShaderType("SdfShader",zn),this.registerEffectType("border",Ct),this.registerEffectType("borderBottom",at),this.registerEffectType("borderLeft",lt),this.registerEffectType("borderRight",it),this.registerEffectType("borderTop",st),this.registerEffectType("fadeOut",rn),this.registerEffectType("linearGradient",Pn),this.registerEffectType("radialGradient",On),this.registerEffectType("grayscale",Dn),this.registerEffectType("glitch",Tt),this.registerEffectType("radius",ot),this.registerEffectType("radialProgress",ct),this.registerEffectType("holePunch",dt)}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=ut.resolveDefaults(n,this.effectConstructors),t=ut.makeCacheKey(e,this.effectConstructors);if(t&&this.shCache.has(t))return{shader:this.shCache.get(t),props:e};const o=new ut(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 Fi{constructor(){h(this,"data",{})}reset(){this.data={}}increment(n){this.data[n]||(this.data[n]=0),this.data[n]++}getData(){return{...this.data}}}function Ni(r){return/\.(ktx|pvr)$/.test(r)}const Li=async r=>{const e=await(await fetch(r)).arrayBuffer();return r.indexOf(".ktx")!==-1?Mi(e):zi(e)},Mi=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=[],y={pixelWidth:c[7],pixelHeight:c[6],numberOfMipmapLevels:c[11]||0};let b=0,x=y.pixelWidth||0,w=y.pixelHeight||0;for(let S=0;S>2)*(w+3>>2)*8,p=new Uint8Array(a,u.byteOffset+b,A);g.push(p),b+=A,x=x>>1,w=w>>1}return{data:{glInternalFormat:36196,mipmaps:g,width:y.pixelWidth||0,height:y.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},Et=class Et extends io{constructor(e,t){super(e);h(this,"props");this.props=Et.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(Ni(e))return Li(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 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=Et.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(Et,"z$__type__Props");let Un=Et;const Pi=24;function Di(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 b=o/i+d*n+g;if(!(c&&b>=c/i))return{sdfX:u,sdfY:b,lineIndex:d}}class _t{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*It(r,n=0){let e=n;for(;e=b.y1,De=O<=b.y2,pe=Pe&&De;for(;(de=te.next())&&!de.done;){const K=de.value;if(r===y.length)y.push({codepointIndex:K.cluster,maxY:k,maxX:P});else if(r>y.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?W.codepointIndex!==-1&&(W.codepointIndex=-1,re=z):W.codepointIndex===-1&&(W.codepointIndex=K.cluster,W.bufferOffset=D,W.xStart=re),K.mapped){const Ut=z+K.xOffset+K.width;if(g!=="none"&&Ut>=ge&&W.codepointIndex!==-1&&W.xStart>0)if(be){te=j.shapeText(se,new _t(It(t,W.codepointIndex),W.codepointIndex)),D=W.bufferOffset;break}else te=j.shapeText(se,new _t(It(A,0),0)),z=W.xStart,D=W.bufferOffset,g="none";else{const Oe=z+K.xOffset,Ue=O+K.yOffset;if(pe){Ce===-1&&(Ce=D);const Ke=x.getAtlasEntry(K.glyphId),Xe=Ke.x/x.data.common.scaleW,Ve=Ke.y/x.data.common.scaleH,xt=Ke.width/x.data.common.scaleW,xr=Ke.height/x.data.common.scaleH;u[D++]=Oe,u[D++]=Ue,u[D++]=Xe,u[D++]=Ve,u[D++]=Oe+K.width,u[D++]=Ue,u[D++]=Xe+xt,u[D++]=Ve,u[D++]=Oe,u[D++]=Ue+K.height,u[D++]=Xe,u[D++]=Ve+xr,u[D++]=Oe+K.width,u[D++]=Ue+K.height,u[D++]=Xe+xt,u[D++]=Ve+xr}k=Math.max(k,Ue+K.height),P=Math.max(P,Oe+K.width),z+=K.xAdvance}}else if(K.codepoint===10){if(be)break;te=j.shapeText(se,new _t(It(A,0),0)),g="none"}}Ce!==-1&&(ze.push({bufferStart:Ce,bufferEnd:D}),Ce=-1),z=0,O+=v,r++,W.codepointIndex=-1,re=0,!w&&g==="both"&&O>b.y2||de&&de.done?Qe=!1:be||(Qe=!1)}if(o==="center"){const be=g==="none"?P:T;for(let ge=0;getypeof r=="number"?r:Hi[r]||400;function ji(r,n,e,t,o){let i=Ir(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=Ir(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 Qi=oo(ji);class fo{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 Qi(n,t,o,i,s)}}const Ki={x:0,y:0,width:0,height:0};class Xi extends co{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&&In(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&In(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 vr}addFontFace(e){F(e instanceof vr);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}F(t.data,"Font face data should be loaded");const{text:c,fontSize:d,x:u,y:g,contain:y,width:b,height:x,lineHeight:w,verticalAlign:S,scrollable:A,overflowSuffix:p,maxLines:m}=e.props,v=y==="both"&&A?e.props.scrollY:0,{renderWindow:T}=e,R=t.data.info.size,I=d/R,C=w/I;e.distanceRange=I*t.data.distanceField.distanceRange;const _=c.length*Pi;let E=e.vertexBuffer;(!E||E.length<_)&&(E=new Float32Array(_*2));const P=e.elementBounds;if(P.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),P.valid=!0),!a&&T.valid){const j=T.screen;if(u+j.x1<=P.x1&&u+j.x2>=P.x2&&g-v+j.y1<=P.y1&&g-v+j.y2>=P.y2){this.setStatus(e,"loaded");return}T.valid=!1,this.setStatus(e,"loading")}const{offsetY:k,textAlign:z}=e.props;if(!T.valid){if(!In(P,this.rendererBounds))return;$i(T,u,g,v,w,y==="both"?P.y2-P.y1:0,P,I)}const O=Di(R,C,w,S,k,I,T,i,o);if(!O){this.setStatus(e,"loaded");return}const{letterSpacing:D}=e.props,W=Ui(O.lineIndex,O.sdfX,O.sdfY,c,z,b,x,d,w,D,E,y,i,T.sdf,t,a,A,p,m);e.bufferUploaded=!1,e.bufferNumFloats=W.bufferNumFloats,e.bufferNumQuads=W.bufferNumQuads,e.vertexBuffer=E,e.renderWindow=T,s.lastLayoutNumCharacters=W.layoutNumCharacters,s.bufferSize=E.byteLength,W.fullyProcessed&&(e.textW=W.maxX*I,e.textH=W.maxY*I),this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var _,E,P;if(!e.vertexBuffer)return;const{renderer:s}=this.stage,{fontSize:a,color:c,contain:d,scrollable:u,zIndex:g,debug:y}=e.props,b=d==="both"&&u?e.props.scrollY:0,{textW:x=0,textH:w=0,distanceRange:S,vertexBuffer:A,bufferUploaded:p,trFontFace:m,elementBounds:v}=e;let{webGlBuffers:T}=e;if(!T){const k=s.glw,z=4*Float32Array.BYTES_PER_ELEMENT,O=k.createBuffer();F(O),e.webGlBuffers=new li([{buffer:O,attributes:{a_position:{name:"a_position",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,F(e.webGlBuffers),T=e.webGlBuffers}if(!p){const k=s.glw,z=(_=T==null?void 0:T.getBuffer("a_textureCoordinate"))!=null?_:null;k.arrayBufferData(z,A,k.STATIC_DRAW),e.bufferUploaded=!0}if(F(m),u&&d==="both"){F(v.valid);const k=ci(v,Ki);o.valid?(e.clippingRect.valid=!0,o=nr(o,k,e.clippingRect)):(e.clippingRect.valid=!0,o=so(k,e.clippingRect))}const R=new di(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:hi(c,i),size:a/(((E=m.data)==null?void 0:E.info.size)||0),scrollY:b,distanceRange:S,debug:y.sdfShaderDebug},i,o,{height:w,width:x},0,g),I=(P=e.trFontFace)==null?void 0:P.texture;F(I);const C=this.stage.txManager.getCtxTexture(I);R.addTexture(C),R.length=e.bufferNumFloats,R.numQuads=e.bufferNumQuads,s.addRenderOp(R)}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 fo.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 Vi(r){return r.prototype instanceof ui}async function Gi(r,n){let e;try{console.log("Loading core extension",r),e=await Ai(()=>import(r),__vite__mapDeps([]))}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(Vi(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 go(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 qi extends nt{constructor(e,t,o){var A,p,m,v;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:(A=e.clearColor)!=null?A:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:(p=e.experimental_FinalizationRegistryTextureUsageTracker)!=null?p:!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:(m=e.enableContextSpy)!=null?m:!1,enableInspector:(v=e.enableInspector)!=null?v:!1};this.settings=i;const{appWidth:s,appHeight:a,deviceLogicalPixelRatio:c,devicePhysicalPixelRatio:d,enableInspector:u}=i,g=T=>{this.driver.releaseTexture(T)},y=i.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=y?new yi(g):new xi(g,this.settings.textureCleanupOptions);const b=s*c,x=a*c;this.driver=o;const w=document.createElement("canvas");this.canvas=w,w.width=b*d,w.height=x*d,w.style.width="".concat(b,"px"),w.style.height="".concat(x,"px");let S;if(typeof t=="string"?S=document.getElementById(t):S=t,!S)throw new Error("Could not find target element");o.onCreateNode=T=>{this.nodes.set(T.id,T)},o.onBeforeDestroyNode=T=>{this.nodes.delete(T.id)},o.onFpsUpdate=T=>{this.emit("fpsUpdate",T)},o.onFrameTick=T=>{this.emit("frameTick",T)},o.onIdle=()=>{this.emit("idle")},S.appendChild(w),u&&!ro()&&(this.inspector=new wi(w,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,y,b,x,w,S,A,p,m,v,T,R,I;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:(y=e.textAlign)!=null?y:"left",contain:(b=e.contain)!=null?b:"none",scrollable:(x=e.scrollable)!=null?x:!1,scrollY:(w=e.scrollY)!=null?w:0,offsetY:(S=e.offsetY)!=null?S:0,letterSpacing:(A=e.letterSpacing)!=null?A:0,lineHeight:(p=e.lineHeight)!=null?p:t,maxLines:(m=e.maxLines)!=null?m:0,textBaseline:(v=e.textBaseline)!=null?v:"alphabetic",verticalAlign:(T=e.verticalAlign)!=null?T:"top",overflowSuffix:(R=e.overflowSuffix)!=null?R:"...",debug:(I=e.debug)!=null?I:{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(e){var d,u,g,y,b,x,w,S,A,p,m,v,T,R,I,C,_,E,P,k,z,O,D,W,j,se,te,de,Ce,ze,Dt,Ot,Qe,be,ge,re,Pe,De,pe,K,Ut,Oe,Ue,Ke,Xe,Ve,xt;const t=(d=e.color)!=null?d:4294967295,o=(y=(g=(u=e.colorTl)!=null?u:e.colorTop)!=null?g:e.colorLeft)!=null?y:t,i=(w=(x=(b=e.colorTr)!=null?b:e.colorTop)!=null?x:e.colorRight)!=null?w:t,s=(p=(A=(S=e.colorBl)!=null?S:e.colorBottom)!=null?A:e.colorLeft)!=null?p:t,a=(T=(v=(m=e.colorBr)!=null?m:e.colorBottom)!=null?v:e.colorRight)!=null?T:t,c=go((R=e.data)!=null?R:{});return{x:(I=e.x)!=null?I:0,y:(C=e.y)!=null?C:0,width:(_=e.width)!=null?_:0,height:(E=e.height)!=null?E:0,alpha:(P=e.alpha)!=null?P:1,autosize:(k=e.autosize)!=null?k:!1,clipping:(z=e.clipping)!=null?z:!1,color:t,colorTop:(O=e.colorTop)!=null?O:t,colorBottom:(D=e.colorBottom)!=null?D:t,colorLeft:(W=e.colorLeft)!=null?W:t,colorRight:(j=e.colorRight)!=null?j:t,colorBl:s,colorBr:a,colorTl:o,colorTr:i,zIndex:(se=e.zIndex)!=null?se:0,zIndexLocked:(te=e.zIndexLocked)!=null?te:0,parent:(de=e.parent)!=null?de:null,texture:(Ce=e.texture)!=null?Ce:null,shader:(ze=e.shader)!=null?ze:null,src:(Dt=e.src)!=null?Dt:"",scale:(Ot=e.scale)!=null?Ot:null,scaleX:(be=(Qe=e.scaleX)!=null?Qe:e.scale)!=null?be:1,scaleY:(re=(ge=e.scaleY)!=null?ge:e.scale)!=null?re:1,mount:(Pe=e.mount)!=null?Pe:0,mountX:(pe=(De=e.mountX)!=null?De:e.mount)!=null?pe:0,mountY:(Ut=(K=e.mountY)!=null?K:e.mount)!=null?Ut:0,pivot:(Oe=e.pivot)!=null?Oe:.5,pivotX:(Ke=(Ue=e.pivotX)!=null?Ue:e.pivot)!=null?Ke:.5,pivotY:(Ve=(Xe=e.pivotY)!=null?Xe:e.pivot)!=null?Ve:.5,rotation:(xt=e.rotation)!=null?xt:0,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 Zi 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=fi(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(){F(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){F(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 q=0,Z=3,ce=6,X=1,J=4,he=7,me=2,xe=5,ye=8;class ve{constructor(n){h(this,"data");n?(this.data=new Float32Array(9),this.data[q]=n[0],this.data[Z]=n[3],this.data[ce]=n[6],this.data[X]=n[1],this.data[J]=n[4],this.data[he]=n[7],this.data[me]=n[2],this.data[xe]=n[5],this.data[ye]=n[8]):this.data=new Float32Array(9)}static get temp(){return es}static multiply(n,e,t){const o=n.data[q]*e.data[q]+n.data[Z]*e.data[X]+n.data[ce]*e.data[me],i=n.data[q]*e.data[Z]+n.data[Z]*e.data[J]+n.data[ce]*e.data[xe],s=n.data[q]*e.data[ce]+n.data[Z]*e.data[he]+n.data[ce]*e.data[ye],a=n.data[X]*e.data[q]+n.data[J]*e.data[X]+n.data[he]*e.data[me],c=n.data[X]*e.data[Z]+n.data[J]*e.data[J]+n.data[he]*e.data[xe],d=n.data[X]*e.data[ce]+n.data[J]*e.data[he]+n.data[he]*e.data[ye],u=n.data[me]*e.data[q]+n.data[xe]*e.data[X]+n.data[ye]*e.data[me],g=n.data[me]*e.data[Z]+n.data[xe]*e.data[J]+n.data[ye]*e.data[xe],y=n.data[me]*e.data[ce]+n.data[xe]*e.data[he]+n.data[ye]*e.data[ye];return t||(t=new ve),t.data[q]=o,t.data[Z]=i,t.data[ce]=s,t.data[X]=a,t.data[J]=c,t.data[he]=d,t.data[me]=u,t.data[xe]=g,t.data[ye]=y,t}static identity(n){return n||(n=new ve),n.data[q]=1,n.data[Z]=0,n.data[ce]=0,n.data[X]=0,n.data[J]=1,n.data[he]=0,n.data[me]=0,n.data[xe]=0,n.data[ye]=1,n}static translate(n,e,t){return t||(t=new ve),t.data[q]=1,t.data[Z]=0,t.data[ce]=n,t.data[X]=0,t.data[J]=1,t.data[he]=e,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static scale(n,e,t){return t||(t=new ve),t.data[q]=n,t.data[Z]=0,t.data[ce]=0,t.data[X]=0,t.data[J]=e,t.data[he]=0,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static rotate(n,e){const t=Math.cos(n),o=Math.sin(n);return e||(e=new ve),e.data[q]=t,e.data[Z]=-o,e.data[ce]=0,e.data[X]=o,e.data[J]=t,e.data[he]=0,e.data[me]=0,e.data[xe]=0,e.data[ye]=1,e}static copy(n,e,t){return e||(e=new ve),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[q]*n+this.data[Z]*e+this.data[ce],this.data[he]=this.data[X]*n+this.data[J]*e+this.data[he],this}scale(n,e){return this.data[q]=this.data[q]*n,this.data[Z]=this.data[Z]*e,this.data[X]=this.data[X]*n,this.data[J]=this.data[J]*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[q]*e+this.data[Z]*t,i=this.data[Z]*e-this.data[q]*t,s=this.data[X]*e+this.data[J]*t,a=this.data[J]*e-this.data[X]*t;return this.data[q]=o,this.data[Z]=i,this.data[X]=s,this.data[J]=a,this}multiply(n){return ve.multiply(this,n,this)}get tx(){return this.data[ce]}get ty(){return this.data[he]}get ta(){return this.data[q]}get tb(){return this.data[Z]}get tc(){return this.data[X]}get td(){return this.data[J]}transformPoint(n,e){return[this.data[q]*n+this.data[Z]*e+this.data[ce],this.data[X]*n+this.data[J]*e+this.data[X]]}}const es=new ve,Wt=0,Yt=2,$t=4,Ht=6,jt=1,Qt=3,Kt=5,Xt=7;class sn{constructor(n){h(this,"data");this.data=new Float32Array(8),n&&(this.data[Wt]=n[Wt],this.data[Yt]=n[Yt],this.data[$t]=n[$t],this.data[Ht]=n[Ht],this.data[jt]=n[jt],this.data[Qt]=n[Qt],this.data[Kt]=n[Kt],this.data[Xt]=n[Xt])}static translate(n,e,t,o,i,s,a,c,d){return d||(d=new sn),d.data[Wt]=n,d.data[Yt]=t,d.data[$t]=i,d.data[Ht]=a,d.data[jt]=e,d.data[Qt]=o,d.data[Kt]=s,d.data[Xt]=c,d}get x1(){return this.data[Wt]}get x2(){return this.data[Yt]}get x3(){return this.data[$t]}get x4(){return this.data[Ht]}get y1(){return this.data[jt]}get y2(){return this.data[Qt]}get y3(){return this.data[Kt]}get y4(){return this.data[Xt]}}var V;(function(r){r[r.Init=0]="Init",r[r.OutOfBounds=2]="OutOfBounds",r[r.InBounds=4]="InBounds",r[r.InViewport=8]="InViewport"})(V||(V={}));const Je=new Map;Je.set(V.Init,"init");Je.set(V.OutOfBounds,"outOfBounds");Je.set(V.InBounds,"inBounds");Je.set(V.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 rr 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",V.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,"onTextureLoaded",(e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})});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},this.parent=t.parent,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();F(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)}sortChildren(){this.children.sort((e,t)=>e.calcZIndex-t.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=ve.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){F(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=ve.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){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&&(F(this.localTransform),this.globalTransform=ve.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),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=At(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=At(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=At(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=At(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.children.forEach(s=>{s.setUpdateType(i),s.updateType!==0&&s.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){F(this.renderBound);const t=e.width||this.stage.root.width,o=e.height||this.stage.root.height;this.strictBound=ht(e.x,e.y,e.x+t,e.y+o,this.strictBound);const i=this.stage.boundsMargin;return this.preloadBound=ht(e.x-i[3],e.y-i[0],e.x+t+i[1],e.y+o+i[2],this.preloadBound),br(this.renderBound,this.strictBound)?V.InViewport:br(this.renderBound,this.preloadBound)?V.InBounds:V.OutOfBounds}updateRenderState(e){const t=this.checkRenderBounds(e);if(t!==this.renderState){let o=this.renderState;this.renderState=t,o===V.InViewport&&this.emit("outOfViewport",{previous:o,current:t}),oV.InBounds&&t===V.OutOfBounds&&(this.emit(Je.get(V.InBounds),{previous:o,current:t}),o=V.InBounds);const i=Je.get(t);F(i),this.emit(i,{previous:o,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(V[e]))}updateIsRenderable(){let e;this.worldAlpha===0||!this.checkRenderProps()?e=!1:e=this.renderState>V.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;F(o);const{tx:i,ty:s,ta:a,tb:c,tc:d,td:u}=o;if(c===0&&d===0){const g=i,y=i+e*a,b=s,x=s+t*u;this.renderCoords=sn.translate(g,b,y,b,y,x,g,x,this.renderCoords)}else this.renderCoords=sn.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;F(t),F(e);const{tb:o,tc:i}=t,{x1:s,y1:a,x3:c,y3:d}=e;if(o===0||i===0)this.renderBound=ht(s,a,c,d,this.renderBound);else{const{x2:u,x4:g,y2:y,y4:b}=e;this.renderBound=ht(Math.min(s,u,c,g),Math.min(a,y,d,b),Math.max(s,u,c,g),Math.max(a,y,d,b),this.renderBound)}}calculateClippingRect(e){F(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);F(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)),this.updateScaleRotateTransform()}}}let ts=1;function or(){return ts++}class Wn 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:or(),this.coreNode=i||new rr(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}),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._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);F(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 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=go(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 Zi(this.coreNode,e,t);return new Ji(this.stage.animationManager,o)}}const ns=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)},rs=()=>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 is{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 Ft=class Ft extends io{constructor(e,t){super(e);h(this,"props");this.props=Ft.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 ls=2e6;class cs 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:y}=e;this.txManager=new ss(g),this.txMemManager=new as(y),this.shManager=new Ei,this.animationManager=new os,this.contextSpy=u?new Fi:null;let b=[0,0,0,0];d&&(b=Array.isArray(d)?d:[d,d,d,d]),this.boundsMargin=b,s!=null&&s.monitorTextureCache&&setInterval(()=>{F(this.txManager);const w=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",w.idCacheSize),console.log("Texture Key Cache Size: ",w.keyCacheSize)},1e3),this.renderer=new mi({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:o!=null?o:4278190080,bufferMemory:ls,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new Ri(this),sdf:new Xi(this)},this.fontManager=new fo(this.textRenderers);const x=new rr(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});this.root=x,ns(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=rs(),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(),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){F(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),F(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){F(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}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 hs extends Wn{constructor(n,e,t){super(n,e,t,new ds(t,{id:or(),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}))}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 us{constructor(){h(this,"root",null);h(this,"stage",null);h(this,"rendererMain",null)}async init(n,e,t){this.stage=new cs({rootId:or(),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,F(this.stage.root);const o=new Wn(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 Gi(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){F(this.rendererMain),F(this.stage);const e=new Wn(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(n){F(this.rendererMain),F(this.stage);const e=new hs(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;F(e),e.txManager.removeTextureIdFromCache(n)}getRootNode(){return F(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.")}}const po=(r,n)=>r===n,an=Symbol("solid-proxy"),fs=Symbol("solid-track"),ln={equals:po};let mo=Co;const Se=1,cn=2,xo={owned:null,cleanups:null,context:null,owner:null},Bn={};var $=null;let kn=null,gs=null,H=null,ae=null,Ie=null,vn=0;function ft(r,n){const e=H,t=$,o=r.length===0,i=n===void 0?t:n,s=o?xo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?r:()=>r(()=>le(()=>bn(s)));$=s,H=null;try{return Re(a,!0)}finally{H=e,$=t}}function U(r,n){n=n?Object.assign({},ln,n):ln;const e={value:r,observers:null,observerSlots:null,comparator:n.equals||void 0},t=o=>(typeof o=="function"&&(o=o(e.value)),Ao(e,o));return[So.bind(e),t]}function $n(r,n,e){const t=zt(r,n,!0,Se);rt(t)}function _e(r,n,e){const t=zt(r,n,!1,Se);rt(t)}function $e(r,n,e){mo=bs;const t=zt(r,n,!1,Se);(!e||!e.render)&&(t.user=!0),Ie?Ie.push(t):rt(t)}function ne(r,n,e){e=e?Object.assign({},ln,e):ln;const t=zt(r,n,!0,0);return t.observers=null,t.observerSlots=null,t.comparator=e.equals||void 0,rt(t),So.bind(t)}function ps(r){return r&&typeof r=="object"&&"then"in r}function et(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=Bn,c=!1,d="initialValue"in i,u=typeof t=="function"&&ne(t);const g=new Set,[y,b]=(i.storage||U)(i.initialValue),[x,w]=U(void 0),[S,A]=U(void 0,{equals:!1}),[p,m]=U(d?"ready":"unresolved");function v(C,_,E,P){return s===C&&(s=null,P!==void 0&&(d=!0),(C===a||_===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(P,{value:_})),a=Bn,T(_,E)),_}function T(C,_){Re(()=>{_===void 0&&b(()=>C),m(_!==void 0?"errored":d?"ready":"unresolved"),w(_);for(const E of g.keys())E.decrement();g.clear()},!1)}function R(){const C=ys,_=y(),E=x();if(E!==void 0&&!s)throw E;return H&&!H.user&&C&&$n(()=>{S(),s&&(C.resolved||g.has(C)||(C.increment(),g.add(C)))}),_}function I(C=!0){if(C!==!1&&c)return;c=!1;const _=u?u():t;if(_==null||_===!1){v(s,le(y));return}const E=a!==Bn?a:le(()=>o(_,{value:y(),refetching:C}));return ps(E)?(s=E,"value"in E?(E.status==="success"?v(s,E.value,void 0,_):v(s,void 0,void 0,_),E):(c=!0,queueMicrotask(()=>c=!1),Re(()=>{m(d?"refreshing":"pending"),A()},!1),E.then(P=>v(E,P,void 0,_),P=>v(E,void 0,_o(P),_)))):(v(s,E,void 0,_),E)}return Object.defineProperties(R,{state:{get:()=>p()},error:{get:()=>x()},loading:{get(){const C=p();return C==="pending"||C==="refreshing"}},latest:{get(){if(!d)return R();const C=x();if(C&&!s)throw C;return y()}}}),u?$n(()=>I(!1)):I(!1),[R,{refetch:I,mutate:b}]}function yo(r,n=po,e){const t=new Map,o=zt(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=Se,d.pure?ae.push(d):Ie.push(d);return s},void 0,!0,Se);return rt(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 ms(r){return Re(r,!1)}function le(r){if(H===null)return r();const n=H;H=null;try{return r()}finally{H=n}}function He(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 je(r){$e(()=>le(r))}function Me(r){return $===null||($.cleanups===null?$.cleanups=[r]:$.cleanups.push(r)),r}function Mt(){return $}function vo(r,n){const e=$,t=H;$=r,H=null;try{return Re(n,!0)}catch(o){ir(o)}finally{$=e,H=t}}function xs(r){const n=H,e=$;return Promise.resolve().then(()=>{H=n,$=e;let t;return Re(r,!1),H=$=null,t?t.done:void 0})}function wo(r,n){const e=Symbol("context");return{id:e,Provider:Ss(e),defaultValue:r}}function bo(r){return $&&$.context&&$.context[r.id]!==void 0?$.context[r.id]:r.defaultValue}function wn(r){const n=ne(r),e=ne(()=>Hn(n()));return e.toArray=()=>{const t=e();return Array.isArray(t)?t:t!=null?[t]:[]},e}let ys;function So(){if(this.sources&&this.state)if(this.state===Se)rt(this);else{const r=ae;ae=null,Re(()=>hn(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 Ao(r,n,e){let t=r.value;return(!r.comparator||!r.comparator(t,n))&&(r.value=n,r.observers&&r.observers.length&&Re(()=>{for(let o=0;o1e6)throw ae=[],new Error},!1)),n}function rt(r){if(!r.fn)return;bn(r);const n=vn;vs(r,r.value,n)}function vs(r,n,e){let t;const o=$,i=H;H=$=r;try{t=r.fn(n)}catch(s){return r.pure&&(r.state=Se,r.owned&&r.owned.forEach(bn),r.owned=null),r.updatedAt=e+1,ir(s)}finally{H=i,$=o}(!r.updatedAt||r.updatedAt<=e)&&(r.updatedAt!=null&&"observers"in r?Ao(r,t):r.value=t,r.updatedAt=e)}function zt(r,n,e,t=Se,o){const i={fn:r,state:t,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:$,context:$?$.context:null,pure:e};return $===null||$!==xo&&($.owned?$.owned.push(i):$.owned=[i]),i}function dn(r){if(r.state===0)return;if(r.state===cn)return hn(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===Se)rt(r);else if(r.state===cn){const t=ae;ae=null,Re(()=>hn(r,n[0]),!1),ae=t}}function Re(r,n){if(ae)return r();let e=!1;n||(ae=[]),Ie?e=!0:Ie=[],vn++;try{const t=r();return ws(e),t}catch(t){e||(Ie=null),ae=null,ir(t)}}function ws(r){if(ae&&(Co(ae),ae=null),r)return;const n=Ie;Ie=null,n.length&&Re(()=>mo(n),!1)}function Co(r){for(let n=0;n=0;n--)bn(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}function _o(r){return r instanceof Error?r:new Error(typeof r=="string"?r:"Unknown error",{cause:r})}function ir(r,n=$){throw _o(r)}function Hn(r){if(typeof r=="function"&&!r.length)return Hn(r());if(Array.isArray(r)){const n=[];for(let e=0;eo=le(()=>($.context={...$.context,[r]:t.value},wn(()=>t.children))),void 0),o}}const As=Symbol("fallback");function Rr(r){for(let n=0;n1?[]:null;return Me(()=>Rr(i)),()=>{let c=r()||[],d,u;return c[fs],le(()=>{let y=c.length,b,x,w,S,A,p,m,v,T;if(y===0)s!==0&&(Rr(i),i=[],t=[],o=[],s=0,a&&(a=[])),e.fallback&&(t=[As],o[0]=ft(R=>(i[0]=R,e.fallback())),s=1);else if(s===0){for(o=new Array(y),u=0;u=p&&v>=p&&t[m]===c[v];m--,v--)w[v]=o[m],S[v]=i[m],a&&(A[v]=a[m]);for(b=new Map,x=new Array(v+1),u=v;u>=p;u--)T=c[u],d=b.get(T),x[u]=d===void 0?-1:d,b.set(T,u);for(d=p;d<=m;d++)T=t[d],u=b.get(T),u!==void 0&&u!==-1?(w[u]=o[d],S[u]=i[d],a&&(A[u]=a[d]),u=x[u],b.set(T,u)):i[d]();for(u=p;ur(n||{}))}function Vt(){return!0}const jn={get(r,n,e){return n===an?e:r.get(n)},has(r,n){return n===an?!0:r.has(n)},set:Vt,deleteProperty:Vt,getOwnPropertyDescriptor(r,n){return{configurable:!0,enumerable:!0,get(){return r.get(n)},set:Vt,deleteProperty:Vt}},ownKeys(r){return r.keys()}};function En(r){return(r=typeof r=="function"?r():r)?r:{}}function Ts(){for(let r=0,n=this.length;r=0;a--){const c=En(r[a])[s];if(c!==void 0)return c}},has(s){for(let a=r.length-1;a>=0;a--)if(s in En(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:Ts.bind(e[u]=[g.get.bind(a)])}:g.value!==void 0?g:void 0;else{const y=e[u];y&&(g.get?y.push(g.get.bind(a)):g.value!==void 0&&y.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 _s(r,...n){if(an 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)}},jn));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))}},jn)),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 Is=r=>"Stale read from <".concat(r,">.");function Sn(r){const n="fallback"in r&&{fallback:()=>r.fallback};return ne(Cs(()=>r.each,r.children,n||void 0))}function Be(r){const n=r.keyed,e=ne(()=>r.when,void 0,{equals:(t,o)=>n?t===o:!t==!o});return ne(()=>{const t=e();if(t){const o=r.children;return typeof o=="function"&&o.length>0?le(()=>o(n?t:()=>{if(!le(e))throw Is("Show");return r.when})):o}return r.fallback},void 0,void 0)}const Rs=void 0;let Le,ar;function Bs(r={},n="app"){const e=new us;return Le=new qi(r,n,e),ar=Le.createShader.bind(Le),Le}class ks extends Array{constructor(e){super();h(this,"_parent");this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){const o=this.indexOf(t);this.splice(o,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){const t=this.indexOf(e);t>=0&&this.splice(t,1)}}function Es(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!1}const Fs=Es()||!1,Ae={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Br(r){return Ns(r)&&r.debug}function Ze(r,n,...e){Fs&&(Ae.debug||Br(n)||Br(e[0]))&&console.log(r,n,...e)}function vt(r){return typeof r=="function"}function Ns(r){return typeof r=="object"}function un(r){return Array.isArray(r)}function Ls(r){return typeof r=="string"}function Ms(r){return typeof r=="number"}function zs(r){return Number.isInteger(r)}function Ps(r,n){for(const e of n)if(e in r)return!0;return!1}function Ro(r,n={}){if(un(r))r.forEach(e=>{Ro(e,n)});else if(r)for(const e in r)n[e]===void 0&&(n[e]=r[e]);return n}class kr extends Array{constructor(e,t={}){var n=(...ld)=>(super(...ld),h(this,"onChange"),this);return un(t)?n(...t):Ls(t)?n(t):n(...Object.entries(t).filter(([o,i])=>i).map(([o])=>o)),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){const t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}function Ds(r){const n=[];for(let p=0;pp+(m[i]||0),0));const A=y&&w?p=>{w==="flexStart"?p[u]=0:w==="center"?p[u]=(y-(p[s]||0))/2:w==="flexEnd"&&(p[u]=y-(p[s]||0))}:p=>p;if(x==="flexStart"){let p=0;if(n.forEach(m=>{m[d]=p+(m[a]||0),p+=(m[i]||0)+b+(m[a]||0)+(m[c]||0),A(m)}),r._autosized){const m=p-b;if(m!==r[i])return r[i]=m,!0}}else if(x==="flexEnd"){let p=g;for(let m=e-1;m>=0;m--){const v=n[m];F(v),v[d]=p-(v[i]||0)-(v[c]||0),p-=(v[i]||0)+b+(v[a]||0)+(v[c]||0),A(v)}}else if(x==="center"){let p=(g-(S+b*(e-1)))/2;n.forEach(m=>{m[d]=p,p+=(m[i]||0)+b,A(m)})}else if(x==="spaceBetween"){const p=(g-S)/(e-1);let m=0;n.forEach(v=>{v[d]=m,m+=(v[i]||0)+p,A(v)})}else if(x==="spaceEvenly"){const p=(g-S)/(e+1);let m=p;n.forEach(v=>{v[d]=m,m+=(v[i]||0)+p,A(v)})}return!1}const[lr,Qn]=U(void 0),{animationSettings:Os}=Ae;function Er(r){const n=[];for(const[e,t]of Object.entries(r))n.push({type:e,props:t});return ar("DynamicShader",{effects:n})}function wt(r=""){return{set(n){Ms(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 Us=["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"],Ws=["clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"];class we extends Object{constructor(e){super();h(this,"id");h(this,"debug");h(this,"name");h(this,"lng");h(this,"renderer");h(this,"selected");h(this,"rendered");h(this,"autofocus");h(this,"flexItem");h(this,"_queueDelete");h(this,"forwardFocus");h(this,"_undoStyles");h(this,"_renderProps");h(this,"_effects");h(this,"_parent");h(this,"_shader");h(this,"_style");h(this,"_states");h(this,"_events");h(this,"_animationSettings");h(this,"_width");h(this,"_height");h(this,"_color");h(this,"_borderRadius");h(this,"_border");h(this,"_borderLeft");h(this,"_borderRight");h(this,"_borderTop");h(this,"_borderBottom");h(this,"_autosized");h(this,"_isDirty");h(this,"_animationQueue",[]);h(this,"_animationQueueSettings");h(this,"_animationRunning",!1);h(this,"children");this.name=e,this.rendered=!1,this.autofocus=!1,this._renderProps={x:0,y:0},this.children=new ks(this)}get effects(){return this._effects}set effects(e){this._effects=e,this.rendered&&(this.shader=Er(e))}get parent(){return this._parent}set parent(e){var t;this._parent=e,this.rendered&&this.lng&&(this.lng.parent=(t=e==null?void 0:e.lng)!=null?t:null)}get shader(){return this._shader}set shader(e){un(e)?this._shader=ar(...e):this._shader=e,this._sendToLightning("shader",this._shader)}_sendToLightningAnimatable(e,t){if(this.lng){if(Ae.animationsEnabled&&this.transition&&(this.transition===!0||this.transition[e])){const o=this.transition===!0||this.transition[e]===!0?void 0:this.transition[e];return this.animate({[e]:t},o).start()}this.lng[e]=t}else this._renderProps[e]=t}_sendToLightning(e,t){this.rendered&&this.lng?this.lng[e]=t:this._renderProps[e]=t}animate(e,t){return F(this.lng,"Node must be rendered before animating"),this.lng.animate(e,t||this.animationSettings)}chain(e,t){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),t?this._animationQueueSettings=t:this._animationQueueSettings||(this._animationQueueSettings=t||this.animationSettings),t=t||this._animationQueueSettings,this._animationQueue.push({props:e,animationSettings:t}),this}async start(){let e=this._animationQueue.shift();for(;e;)this._animationRunning=!0,await this.animate(e.props,e.animationSettings).start().waitUntilStopped(),e=this._animationQueue.shift();this._animationRunning=!1,this._animationQueueSettings=void 0}setFocus(){if(this.rendered){if(this.forwardFocus!==void 0)if(vt(this.forwardFocus)){if(this.forwardFocus.call(this,this)!==!1)return}else{const e=typeof this.forwardFocus=="number"?this.forwardFocus:null;if(e!==null&&eQn(this))}else this.autofocus=!0}isTextNode(){return this.name==="text"}_resizeOnTextLoad(){this.lng.on("loaded",(e,t)=>{if(t.type==="text"){const{dimensions:o}=t;this.parent.updateLayout(this,o)}})}getText(){return this.children.map(e=>e.text).join("")}destroy(){var e;this._queueDelete&&((e=this.lng)==null||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){un(e)?this._style=Ro(e):this._style=e;for(const t in this._style)this[t]===void 0&&(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){for(const t of this.children){if(t.id===e)return t;if(t instanceof we){const o=t.searchChildrenById(e);if(o)return o}}}set states(e){this._states=new kr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new kr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||Os}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){var o;this.hasChildren&&(Ze("Layout: ",this),vt(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),this.display==="flex"&&Ds(this)&&((o=this.parent)==null||o.updateLayout()),vt(this.onLayout)&&this.onLayout.call(this,e,t))}_stateChanged(){if(Ze("State Changed: ",this,this.states),this.forwardStates){const t=this.states.slice();this.children.forEach(o=>o.states=t)}const e=this.states;if(this._undoStyles||this.style&&Ps(this.style,e)){this._undoStyles=this._undoStyles||[];const t={};this._undoStyles.forEach(i=>{t[i]=this.style[i]});const o=e.reduce((i,s)=>{const a=this.style[s];return a&&(i={...i,...a}),i},{});this._undoStyles=Object.keys(o),o.transition!==void 0&&(this.transition=o.transition),Object.assign(this,{...t,...o})}}render(){const e=this,t=this.parent;if(!t){console.warn("Parent not set - no node created for: ",this);return}if(!t.rendered){console.warn("Parent not rendered yet: ",this);return}if(this.rendered){console.warn("Node already rendered: ",this);return}t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();let o=e._renderProps;t.lng&&(o.parent=t.lng),e._effects&&(this.shader=Er(e._effects)),e.isTextNode()?(o={...Ae.fontSettings,...o,text:e.getText()},o.contain&&(o.width||(o.width=(t.width||0)-(o.x||0)-(o.marginRight||0),e._width=o.width,e._autosized=!0),o.contain==="both"&&!o.height&&!o.maxLines&&(o.height=(t.height||0)-(o.y||0)-(o.marginBottom||0),e._height=o.height,e._autosized=!0)),Ze("Rendering: ",this,o),e.lng=Le.createTextNode(o),vt(e.onLoad)&&e.lng.on("loaded",e.onLoad),(!e.width||!e.height)&&(e._autosized=!0,e._resizeOnTextLoad())):(o.texture||(isNaN(o.width)&&(o.width=(t.width||0)-(o.x||0),e._width=o.width,e._autosized=!0),isNaN(o.height)&&(o.height=(t.height||0)-(o.y||0),e._height=o.height,e._autosized=!0),!o.color&&!o.src&&(e._color=o.color=0)),Ze("Rendering: ",this,o),e.lng=Le.createNode(o),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,vt(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach(([i,s])=>{var a;(a=e.lng)==null||a.on(i,(c,d)=>s(e,d))}),e.lng.div&&(e.lng.div.solid=e),delete this._renderProps,e.name!=="text"&&e.children.forEach(i=>{i.render?i.render():i.text!==""&&console.warn("TextNode outside of : ",i)}),e.autofocus&&e.setFocus()}}for(const r of Us)Object.defineProperty(we.prototype,r,{get(){var n;return(n=this.lng&&this.lng[r])!=null?n:this["_".concat(r)]},set(n){this["_".concat(r)]=n,this._sendToLightningAnimatable(r,n)}});for(const r of Ws)Object.defineProperty(we.prototype,r,{get(){var n;return(n=this.lng&&this.lng[r])!=null?n:this["_".concat(r)]},set(n){this["_".concat(r)]=n,this._sendToLightning(r,n)}});Object.defineProperties(we.prototype,{borderRadius:{set(r){this._borderRadius=r,this.effects={...this.effects||{},radius:{radius:r}}},get(){return this._borderRadius}},border:wt(),borderLeft:wt("Left"),borderRight:wt("Right"),borderTop:wt("Top"),borderBottom:wt("Bottom")});Object.defineProperties(we.prototype,{linearGradient:{set(r={}){this._linearGradient=r,this.effects={...this.effects||{},linearGradient:r}},get(){return this._linearGradient}}});const N=r=>(()=>{var n=Pt("text");return An(n,r,!1),n})(),M=r=>(()=>{var n=Pt("node");return An(n,r,!1),n})();function Ys({createElement:r,createTextNode:n,isTextNode:e,replaceText:t,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:c,getNextSibling:d}){function u(p,m,v,T){if(v!==void 0&&!T&&(T=[]),typeof m!="function")return g(p,m,T,v);_e(R=>g(p,m(),R,v),T)}function g(p,m,v,T,R){for(;typeof v=="function";)v=v();if(m===v)return v;const I=typeof m,C=T!==void 0;if(I==="string"||I==="number")if(I==="number"&&(m=m.toString()),C){let _=v[0];_&&e(_)?t(_,m):_=n(m),v=x(p,v,T,_)}else v!==""&&typeof v=="string"?t(c(p),v=m):(x(p,v,T,n(m)),v=m);else if(m==null||I==="boolean")v=x(p,v,T);else{if(I==="function")return _e(()=>{let _=m();for(;typeof _=="function";)_=_();v=g(p,_,v,T)}),()=>v;if(Array.isArray(m)){const _=[];if(y(_,m,R))return _e(()=>v=g(p,_,v,T,!0)),()=>v;if(_.length===0){const E=x(p,v,T);if(C)return v=E}else Array.isArray(v)?v.length===0?w(p,_,T):b(p,v,_):v==null||v===""?w(p,_):b(p,C&&v||[c(p)],_);v=_}else{if(Array.isArray(v)){if(C)return v=x(p,v,T,m);x(p,v,null,m)}else v==null||v===""||!c(p)?o(p,m):S(p,m,c(p));v=m}}return v}function y(p,m,v){let T=!1;for(let R=0,I=m.length;Rk-_){const W=m[C];for(;_=0;C--){const _=m[C];if(R!==_){const E=a(_)===p;!I&&!C?E?S(p,R,_):o(p,R,v):E&&i(p,_)}else I=!0}}else o(p,R,v);return[R]}function w(p,m,v){for(let T=0,R=m.length;Tv.children=g(p,m.children,v.children)),_e(()=>m.ref&&m.ref(p)),_e(()=>{for(const R in m){if(R==="children"||R==="ref")continue;const I=m[R];I!==v[R]&&(s(p,R,I,v[R]),v[R]=I)}}),v}return{render(p,m){let v;return ft(T=>{v=T,u(m,p())}),v},insert:u,spread(p,m,v){typeof m=="function"?_e(T=>A(p,m(),T,v)):A(p,m,void 0,v)},createElement:r,createTextNode:n,insertNode:o,setProp(p,m,v,T){return s(p,m,v,T),v},mergeProps:sr,effect:_e,memo:ne,createComponent:Io,use(p,m,v){return le(()=>p(m,v))}}}function $s(r){const n=Ys(r);return n.mergeProps=sr,n}const Hs={createElement(r){return new we(r)},createTextNode(r){return{name:"TextNode",text:r,parent:void 0}},replaceText(r,n){Ze("Replace Text: ",r,n),r.text=n;const e=r.parent;F(e),e.text=e.getText()},setProperty(r,n,e=!0){r[n]=e},insertNode(r,n,e){Ze("INSERT: ",r,n,e),r.children.insert(n,e),n._queueDelete=!1,n instanceof we?r.rendered&&n.render():r.isTextNode()&&(r.text=r.getText())},isTextNode(r){return r.isTextNode()},removeNode(r,n){Ze("REMOVE: ",r,n),r.children.remove(n),n._queueDelete=!0,n instanceof we&&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 Kn;function cr(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Kn=window.history.state._depth}cr();function Gs(r){return{...r,_depth:window.history.state&&window.history.state._depth}}function qs(r,n){let e=!1;return()=>{const t=Kn;cr();const o=t==null?null:Kn-t;if(e){e=!1;return}o&&n(o)?(e=!0,window.history.go(-o)):r()}}const Zs=/^(?:[a-z0-9]+:)?\/\//i,Js=/^\/+|(\/)\/+$/g,No="http://sr";function Rt(r,n=!1){const e=r.replace(Js,"$1");return e?n||/^[?#]/.test(e)?e:"/"+e:""}function on(r,n,e){if(Zs.test(n))return;const t=Rt(r),o=e&&Rt(e);let i="";return!o||n.startsWith("/")?i=t:o.toLowerCase().indexOf(t.toLowerCase())!==0?i=t+o:i=o,(i||"/")+Rt(n,!i)}function ea(r,n){if(r==null)throw new Error(n);return r}function ta(r,n){return Rt(r).replace(/\/*(\*.*)?$/g,"")+Rt(n)}function Lo(r){const n={};return r.searchParams.forEach((e,t)=>{n[t]=e}),n}function na(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=y=>e===void 0?void 0:e[y];for(let y=0;yt.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 ra(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 Mo(r){const n=new Map,e=Mt();return new Proxy({},{get(t,o){return n.has(o)||vo(e,()=>n.set(o,ne(()=>r()[o]))),n.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(r())}})}function zo(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 zo(t).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const oa=100,Po=wo(),Do=wo(),Oo=()=>ea(bo(Po)," and 'use' router primitives can be only used inside a Route."),mt=()=>Oo().navigatorFactory(),dr=()=>Oo().params;function ia(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 Uo(r.path).reduce((c,d)=>{for(const u of zo(d)){const g=ta(n,u);let y=s?g:g.split("/*",1)[0];y=y.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),c.push({...a,originalPath:u,pattern:y,matcher:na(y,!s,r.matchFilters)})}return c},[])}function sa(r,n=0){return{routes:r,score:ra(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 Uo(r){return Array.isArray(r)?r:[r]}function Wo(r,n="",e=[],t=[]){const o=Uo(r);for(let i=0,s=o.length;is.score-i.score)}function Nr(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=ne(()=>t().pathname),i=ne(()=>t().search,!0),s=ne(()=>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:Mo(He(i,()=>Lo(t())))}}let We;function la(r,n,e,t={}){const{signal:[o,i],utils:s={}}=r,a=s.parsePath||(k=>k),c=s.renderPath||(k=>k),d=s.beforeLeave||Fo(),u=on("",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,y]=U(!1),b=async k=>{y(!0);try{await xs(k)}finally{y(!1)}},[x,w]=U(o().value),[S,A]=U(o().state),p=aa(x,S),m=[],v=U([]),T=ne(()=>Nr(n(),p.pathname)),R=Mo(()=>{const k=T(),z={};for(let O=0;Ou,outlet:()=>null,resolvePath(k){return on(u,k)}};return _e(()=>{const{value:k,state:z}=o();le(()=>{k!==x()&&b(()=>{We="native",w(k),A(z),v[1]([])}).then(()=>{We=void 0})})}),{base:I,location:p,params:R,isRouting:g,renderPath:c,parsePath:a,navigatorFactory:_,matches:T,beforeLeave:d,preloadRoute:P,singleFlight:t.singleFlight===void 0?!0:t.singleFlight,submissions:v};function C(k,z,O){le(()=>{if(typeof z=="number"){z&&(s.go?s.go(z):console.warn("Router integration does not support relative routing"));return}const{replace:D,resolve:W,scroll:j,state:se}={replace:!1,resolve:!0,scroll:!0,...O},te=W?k.resolvePath(z):on("",z);if(te===void 0)throw new Error("Path '".concat(z,"' is not a routable path"));if(m.length>=oa)throw new Error("Too many redirects");const de=x();if((te!==de||se!==S())&&!Vs){if(d.confirm(te,O)){const Ce=m.push({value:de,replace:D,scroll:j,state:S()});b(()=>{We="navigate",w(te),A(se),v[1]([])}).then(()=>{m.length===Ce&&(We=void 0,E({value:te,state:se}))})}}})}function _(k){return k=k||bo(Do)||I,(z,O)=>C(k,z,O)}function E(k){const z=m[0];z&&((k.value!==z.value||k.state!==z.state)&&i({...k,replace:z.replace,scroll:z.scroll}),m.length=0)}function P(k,z){const O=Nr(n(),k.pathname),D=We;We="preload";for(let W in O){const{route:j,params:se}=O[W];j.component&&j.component.preload&&j.component.preload();const{load:te}=j;z&&te&&vo(e(),()=>te({params:se,location:{pathname:k.pathname,search:k.search,hash:k.hash,query:Lo(k),state:null,key:""},intent:"preload"}))}We=D}}function ca(r,n,e,t){const{base:o,location:i,params:s}=r,{pattern:a,component:c,load:d}=t().route,u=ne(()=>t().path);c&&c.preload&&c.preload();const g=d?d({params:s,location:i,intent:We||"initial"}):void 0;return{parent:n,pattern:a,path:u,outlet:()=>c?Io(c,{params:s,location:i,data:g,get children(){return e()}}):e(),resolvePath(b){return on(o.path(),b,u())}}}const da=r=>n=>{const{base:e}=n,t=wn(()=>n.children),o=ne(()=>Wo(t(),n.base||""));let i;const s=la(r,o,()=>i,{base:e,singleFlight:n.singleFlight});return r.create&&r.create(s),l(Po.Provider,{value:s,get children(){return l(ha,{routerState:s,get root(){return n.root},get load(){return n.rootLoad},get children(){return[pt(()=>(i=Mt())&&null),l(ua,{routerState:s,get branches(){return o()}})]}})}})};function ha(r){const n=r.routerState.location,e=r.routerState.params,t=ne(()=>r.load&&le(()=>r.load({params:e,location:n,intent:"preload"})));return l(Be,{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 ua(r){const n=[];let e;const t=ne(He(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]=b,c[d]=ca(r.routerState,c[d-1]||r.routerState.base,Lr(()=>t()[d+1]),()=>r.routerState.matches()[d])}))}return n.splice(o.length).forEach(d=>d()),s&&a?s:(e=c[0],c)}));return Lr(()=>t()&&e)()}const Lr=r=>()=>l(Be,{get when(){return r()},keyed:!0,children:n=>l(Do.Provider,{value:n,get children(){return n.outlet()}})}),ue=r=>{const n=wn(()=>r.children);return sr(r,{get children(){return n()}})};function fa([r,n],e,t){return[e?()=>e(r()):r,t?o=>n(t(o)):n]}function ga(r){if(r==="#")return null;try{return document.querySelector(r)}catch(n){return null}}function pa(r){let n=!1;const e=o=>typeof o=="string"?{value:o}:o,t=fa(U(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})),da({signal:t,create:r.create,utils:r.utils})}function ma(r,n,e){return r.addEventListener(n,e),()=>r.removeEventListener(n,e)}function xa(r,n){const e=ga("#".concat(r));e?e.scrollIntoView():n&&window.scrollTo(0,0)}const ya=new Map;function va(r=!0,n=!1,e="/_server"){return t=>{const o=t.base.path(),i=t.navigatorFactory(t.base);let s={};function a(x){return x.namespaceURI==="http://www.w3.org/2000/svg"}function c(x){if(x.defaultPrevented||x.button!==0||x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)return;const w=x.composedPath().find(T=>T instanceof Node&&T.nodeName.toUpperCase()==="A");if(!w||n&&!w.hasAttribute("link"))return;const S=a(w),A=S?w.href.baseVal:w.href;if((S?w.target.baseVal:w.target)||!A&&!w.hasAttribute("state"))return;const m=(w.getAttribute("rel")||"").split(/\s+/);if(w.hasAttribute("download")||m&&m.includes("external"))return;const v=S?new URL(A,document.baseURI):new URL(A);if(!(v.origin!==window.location.origin||o&&v.pathname&&!v.pathname.toLowerCase().startsWith(o.toLowerCase())))return[w,v]}function d(x){const w=c(x);if(!w)return;const[S,A]=w,p=t.parsePath(A.pathname+A.search+A.hash),m=S.getAttribute("state");x.preventDefault(),i(p,{resolve:!1,replace:S.hasAttribute("replace"),scroll:!S.hasAttribute("noscroll"),state:m&&JSON.parse(m)})}function u(x){const w=c(x);if(!w)return;const[S,A]=w;s[A.pathname]||t.preloadRoute(A,S.getAttribute("preload")!=="false")}function g(x){const w=c(x);if(!w)return;const[S,A]=w;s[A.pathname]||(s[A.pathname]=setTimeout(()=>{t.preloadRoute(A,S.getAttribute("preload")!=="false"),delete s[A.pathname]},200))}function y(x){const w=c(x);if(!w)return;const[,S]=w;s[S.pathname]&&(clearTimeout(s[S.pathname]),delete s[S.pathname])}function b(x){let w=x.submitter&&x.submitter.hasAttribute("formaction")?x.submitter.getAttribute("formaction"):x.target.getAttribute("action");if(!w)return;if(!w.startsWith("https://action/")){const A=new URL(w,No);if(w=t.parsePath(A.pathname+A.search),!w.startsWith(e))return}if(x.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const S=ya.get(w);if(S){x.preventDefault();const A=new FormData(x.target);x.submitter&&x.submitter.name&&A.append(x.submitter.name,x.submitter.value),S.call({r:t,f:x.target},A)}}Ks(["click","submit"]),document.addEventListener("click",d),r&&(document.addEventListener("mouseover",g),document.addEventListener("mouseout",y),document.addEventListener("focusin",u),document.addEventListener("touchstart",u)),document.addEventListener("submit",b),Me(()=>{document.removeEventListener("click",d),r&&(document.removeEventListener("mouseover",g),document.removeEventListener("mouseout",y),document.removeEventListener("focusin",u),document.removeEventListener("touchstart",u)),document.removeEventListener("submit",b)})}}function wa(r){const n=r.replace(/^.*?#/,"");if(!n.startsWith("/")){const[,e="/"]=window.location.hash.split("#",2);return"".concat(e,"#").concat(n)}return n}function ba(r){const n=()=>window.location.hash.slice(1),e=Fo();return pa({get:n,set({value:t,replace:o,scroll:i,state:s}){o?window.history.replaceState(Gs(s),"","#"+t):window.location.hash=t;const a=t.indexOf("#"),c=a>=0?t.slice(a+1):"";xa(c,i),cr()},init:t=>ma(window,"hashchange",qs(t,o=>!e.confirm(o&&o<0?o:n()))),create:va(r.preload,r.explicitLinks,r.actionBase),utils:{go:t=>window.history.go(t),renderPath:t=>"#".concat(t),parsePath:wa,beforeLeave:e}})(r)}var Sa=!!Rs,Aa=Sa?r=>Mt()?Me(r):r:Me;function Ca(r,n,e,t){return r.addEventListener(n,e,t),Aa(r.removeEventListener.bind(r,n,e,t))}function Ta(r,n=Mt()){let e=0,t,o;return()=>(e++,Me(()=>{e--,queueMicrotask(()=>{!e&&o&&(o(),o=t=void 0)})}),o||ft(i=>t=r(o=i),n),t)}var _a=Ta(()=>{const[r,n]=U(null);return Ca(window,"keydown",e=>{n(e),setTimeout(()=>n(null))}),r});function Gt(r){return typeof r=="function"}function Ia(r){return Array.isArray(r)}const qt={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},[fn,Ra]=U([]),Ba=r=>{const n=_a();if(r)for(const[e,t]of Object.entries(r))Ia(t)?t.forEach(o=>{qt[o]=e}):qt[t]=e;return $e(He(lr,(e,t,o=[])=>{let i=e;const s=[];for(;i;)i.states.has("focus")||(i.states.add("focus"),Gt(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"),Gt(a.onBlur)&&a.onBlur.call(a,e,t))}),Ra(s),s},{defer:!0})),$e(()=>{const e=n();if(e){const t=qt[e.key]||qt[e.keyCode];le(()=>{const o=fn();let i;for(const s of o){if(i=i||s,t){const a=s["on".concat(t)];if(Gt(a)&&a.call(s,e,s,i)===!0)break}else console.log("Unhandled key event: ".concat(e.key));if(Gt(s.onKeyPress)&&s.onKeyPress.call(s,e,t,s,i)===!0)break}return!1})}}),fn};function Yo(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,y)=>g+(y.width||0),0)+o+i;const d=r.children[0];d&&(d.x=o,d.marginLeft=o);let u=0;r.children.forEach(g=>{g.y=t,g.marginTop=t,u=Math.max(u,g.height||0)}),r.height=u+t+s}}}function ka(r=[]){const n=[];let e;for(e=0;e{setTimeout(n,r)})}function Ea(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 Xn(r,n,e=!0){const t=window.speechSynthesis,o=ka(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 Mr(u)}else if(typeof d=="string"&&d.length){let g=3;for(;a&&g>0;)try{await Ea(d,s,n),g=0}catch(y){if(y instanceof SpeechSynthesisErrorEvent)if(y.error==="network")g--,console.warn("Speech synthesis network error. Retries left: ".concat(g)),await Mr(500*(3-g));else if(y.error==="canceled"||y.error==="interrupted")g=0;else throw new Error("SpeechSynthesisErrorEvent: ".concat(y.error));else throw y}}else if(typeof d=="function"){const u=Xn(d(),n,!1);i.push(u),await u.series}else if(Array.isArray(d)){const u=Xn(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 Zt;function Fa(r,n="en-US"){return Zt&&Zt.cancel(),Zt=Xn(r,n),Zt}var hr=(r,n)=>{let e;const t=()=>clearTimeout(e);return Mt()&&Me(t),Object.assign((...i)=>{e!==void 0&&t(),e=setTimeout(()=>r(...i),n)},{clear:t})};let Vn,Bt=[],Te,Gn=!1;const Na=3e5;function zr(r,n){const e=hr(r,n);let t;const o=i=>{t=i,e(i)};return o.flush=()=>{e.clear(),r(t)},o.clear=e.clear,o}function bt(r){return r.id||r.name}function La(r=[]){if(!oe.onFocusChange||!oe.enabled)return;const n=r.every(i=>!i.loading),e=r.filter(i=>!Bt.includes(i));if(Vn(),!n&&oe.onFocusChange){oe.onFocusChange([]);return}Bt=r.slice(0);const t=[],o=e.reduce((i,s)=>(s.announce?(i.push([bt(s),"Announce",s.announce]),t.push(s.announce)):s.title?(i.push([bt(s),"Title",s.title]),t.push(s.title)):i.push([bt(s),"No Announce",""]),i),[]);if(e.reverse().reduce((i,s)=>(s.announceContext?(i.push([bt(s),"Context",s.announceContext]),t.push(s.announceContext)):i.push([bt(s),"No Context",""]),i),o),oe.debug&&console.table(o),t.length)return oe.speak(t.reduce((i,s)=>i.concat(s),[]))}function Ma(r){if(!Gn)return Te=Fa(r)}const oe={debug:!1,enabled:!0,cancel:function(){Te&&Te.cancel()},clearPrevFocus:function(r=0){Bt=Bt.slice(0,r),Vn()},speak:function(r,{append:n=!1,notification:e=!1}={}){return oe.onFocusChange&&oe.enabled&&(oe.onFocusChange.flush(),n&&Te&&Te.active?Te.append(r):(oe.cancel(),Ma(r)),e&&(Gn=!0,Te==null||Te.series.finally(()=>{Gn=!1,oe.refresh()}).catch(console.error))),Te},refresh:function(r=0){oe.clearPrevFocus(r),oe.onFocusChange&&oe.onFocusChange(le(()=>fn()))},setupTimers:function({focusDebounce:r=400,focusChangeTimeout:n=Na}={}){oe.onFocusChange=zr(La,r),Vn=zr(()=>{Bt=[]},n)}},za=()=>(oe.setupTimers(),$e(He(fn,oe.onFocusChange,{defer:!0})),oe);function Pa(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[Da,Ee]=U(""),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,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDW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Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+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+Z8h6t88QJ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jwrgGo9EK1Qca8cM4ByU4mkuz++F93ZHELyZX3iW31n+S+sKWZWfNBxkCbNeUq6ekArugo1I0kH1xT8EkBKj1R80HGGkFbtZVkZ3bb2d2r0tUkn1hTh8kBKhB9DMBLnQWfJMjoLFuTZpJsO/ONAB7UUcBLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function Oa(){let r,n,e,t=0;const o=1,i={duration:750,easing:"ease-in-out"},s={alpha:o,color:4294967295};function a(d){if(d.startsWith("#")){r.color=L(d),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=d,t=1;return}if(t===1){n.src=d,t=2,n.alpha=0,n.animate({alpha:o},i).start(),r.animate({alpha:0},i).start();return}t===2&&(r.src=d,t=1,r.alpha=0,r.animate({alpha:o},i).start(),n.animate({alpha:0},i).start())}const c=hr(a,400);return $e(He(Da,d=>{c(d)},{defer:!0})),l(M,{width:1920,height:1080,zIndex:-5,get children(){return[l(M,{ref(d){var u=r;typeof u=="function"?u(d):r=d},style:s}),l(M,{ref(d){var u=n;typeof u=="function"?u(d):n=d},style:s,alpha:0}),l(M,{ref(d){var u=e;typeof u=="function"?u(d):e=d},src:"./assets/hero-mask-inverted.png",get color(){return L(f.color.materialBrand)},width:1920,height:1080})]}})}var Pr,Dr,Or,Ur,Wr,Yr,$r,Hr,jr,Qr,Kr,Xr,Vr,Gr,qr,Zr;const Ua=["focus","disabled"],Wa=["brand","inverse","neutral"];function Y({themeKeys:r,base:n,modes:e,tones:t,themeStyles:o,modeKeys:i=Ua,toneKeys:s=Wa},a=!1){const c=(x,w,S)=>{const A=s.map(p=>{var T,R;const m={};return new Set([].concat.apply([],[(T=x==null?void 0:x[p])!=null?T:{},(R=w==null?void 0:w[p])!=null?R:{}].map(Object.keys))).forEach(I=>{var E;var C,_;i.includes(I)||(m[I]=(E=(C=w==null?void 0:w[p])==null?void 0:C[I])!=null?E:(_=x==null?void 0:x[p])==null?void 0:_[I])}),i.forEach(I=>{var C,_;m[I]={...S[I],...(C=x==null?void 0:x[p])==null?void 0:C[I],...(_=w==null?void 0:w[p])==null?void 0:_[I]}}),[p,m]});return Object.fromEntries(A)},d=(x,w)=>{const S=i.map(p=>[p,{...x==null?void 0:x[p],...w==null?void 0:w[p]}]);return Object.fromEntries(S)},u=(x,w)=>({...x,...w.base}),g=x=>Object.fromEntries(Object.entries(r).filter(([w,S])=>x[S]).map(([w,S])=>[w,x[S]])),y=x=>Object.fromEntries(Object.entries(x).map(([S,A])=>{const p=g(A);return Object.entries(A).filter(([m,v])=>i.includes(m)).forEach(([m,v])=>{p[m]=g(v)}),[S,p]}));return((x,w,S)=>{const A=y(o);a&&console.log(A);const p=u(x,A);a&&console.log(p);const m=d(w,A);a&&console.log(m);const v=c(S,A,m);return a&&console.log(v),{base:{...p,...m},tones:v}})(n,e,t)}function $o(r=0){return(n,e,t,o)=>{if(n.children.length===0)return;const i=n.gap||0,s=n.scroll||"auto",[a,c]=Ya(n),d=n.flexDirection==="row"?n.x:n.y,u=n.flexDirection==="row"?e.x:e.y,g=n.flexDirection==="row"?e.width:e.height,y=t>o?"positive":"negative";let b=d;s==="auto"?n.scrollIndex!=null&&n.scrollIndex>=0?n.selected>=n.scrollIndex&&(y==="positive"?b=d-g-i:b=d+g+i):(Math.abs(d)+cu?b=-u+r:s==="edge"&&y==="positive"&&Math.abs(d)+c{const n=r.filter(e=>typeof e=="function");if(n.length!==0)return function(...e){for(const t of n)if(t.apply(this,e)===!0)return!0}};function Ho(){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];if(!(r instanceof we))return!1;r.setFocus()}function gn(r){return function(){var n,e;const t=this.children.length,o=this.wrap,i=this.selected||0;if(t===0)return!1;if(r==="right"||r==="down")do if(this.selected=(this.selected||0)%t+1,this.selected>=t){if(!o){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)%t-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=t-1}while((e=this.children[this.selected])!=null&&e.skipFocus);if(this.selected===void 0&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;const s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&i!==void 0){const c=this.children[i].selected||0;s.selected=c{const n=gn("up"),e=gn("down");return l(M,Q(r,{get onUp(){return gt(r.onUp,n)},get onDown(){return gt(r.onDown,e)},get selected(){return r.selected||0},forwardFocus:Ho,get onSelectedChanged(){return gt(r.onSelectedChanged,r.scroll!=="none"?$o(r.y):void 0)},get style(){var t;return[...[r.style].flat(),Nn.Container.tones[(t=r.tone)!=null?t:Nn.tone],Nn.Container.base]}}))},{Label:{defaultTone:Zc,...Qo}={styles:{}}}=($r=f)==null?void 0:$r.componentConfig,il={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:Qo},sl={themeKeys:{color:"textColor"},base:{...f.typography.caption1,color:f.color.textInverse},tones:{inverse:{color:f.color.textNeutral},brand:{color:f.color.textNeutral}},themeStyles:Qo};Y(il);Y(sl);const{Rating:{styles:gr,defaultTone:Jc}={styles:{},defaultTone:"neutral"}}=(Hr=f)==null?void 0:Hr.componentConfig,al={themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:f.spacer.sm},toneModes:{},themeStyles:gr},ll={themeKeys:{color:"textColor"},base:{color:f.color.textNeutral,...f.typography.body2},toneModes:{},themeStyles:gr},cl={themeKeys:{color:"color"},base:{height:f.typography.body2.lineHeight,width:f.typography.body2.lineHeight,color:f.color.fillNeutral,marginRight:f.spacer.sm},toneModes:{},themeStyles:gr};Y(al);Y(cl);Y(ll);const{Details:{defaultTone:ed,...Ko}={styles:{}}}=(jr=f)==null?void 0:jr.componentConfig,dl={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:Ko},hl={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:Ko};Y(dl);Y(hl);const{Metadata:{defaultTone:td,...pr}={styles:{}}}=(Qr=f)==null?void 0:Qr.componentConfig,ul={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:pr},fl={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:pr},gl={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:pr};Y(ul);Y(gl);Y(fl);const{ProgressBar:{defaultTone:nd,...Xo}={styles:{}}}=(Kr=f)==null?void 0:Kr.componentConfig,pl={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:Xo},ml={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:Xo};Y(pl);Y(ml);const{Row:{defaultTone:xl,...yl}={styles:{}}}=(Xr=f)==null?void 0:Xr.componentConfig,vl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:f.layout.gutterX,width:f.layout.screenW,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:yl},wl=Y(vl),St={tone:xl,Container:wl},G=r=>{const n=gn("left"),e=gn("right");return l(M,Q(r,{get selected(){return r.selected||0},get onLeft(){return gt(r.onLeft,n)},get onRight(){return gt(r.onRight,e)},forwardFocus:Ho,get onSelectedChanged(){return gt(r.onSelectedChanged,r.scroll!=="none"?$o(r.x):void 0)},get tone(){var t;return(t=r.tone)!=null?t:St.tone},get style(){return[...[r.style].flat(),St.Container.tones[r.tone||St.tone],St.Container.base]},get states(){var t;return(t=r.tone)!=null?t:St.tone}}))},{Keyboard:{defaultTone:rd,...mr}={styles:{}}}=(Vr=f)==null?void 0:Vr.componentConfig,bl={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:f.spacer.md,screenW:f.layout.screenW,marginX:f.layout.marginX,height:100},themeStyles:mr},Sl={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:mr},Al={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:mr};Y(bl);Y(Sl);Y(Al);const{Key:{defaultTone:od,...Vo}={styles:{}}}=(Gr=f)==null?void 0:Gr.componentConfig,Cl={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.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:Vo},Tl={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:Vo};Y(Cl);Y(Tl);const{Tile:{defaultTone:id,...Cn}={styles:{}}}=(qr=f)==null?void 0:qr.componentConfig,{Surface:{defaultSurfaceTone:sd,..._l}={styles:{}}}=(Zr=f)==null?void 0:Zr.componentConfig,Il={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:{..._l,...Cn}},Rl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Cn},Bl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Cn},kl={themeKeys:{},base:{width:f.spacer.lg*5,height:f.spacer.xxl+f.spacer.md},themeStyles:Cn};Y(Il);Y(Rl);Y(Bl);Y(kl);const qn={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:L("#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:L("#424242")},active:{width:328,height:70}}},El="/solid-demo-app/",Fl=[{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 Nl(r){const n=Pa(El+"assets/icons_white.png",Fl);return l(M,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 Jt(r){return l(M,Q(r,{forwardStates:!0,get style(){return qn.NavButton},get children(){return[l(M,{y:-16,get children(){return l(Nl,{scale:.5,get name(){return r.icon}})}}),l(N,{get style(){return{...f.typography.button1,fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}}},get children(){return r.children}})]}}))}function Ll(r){let n;const e=mt();function t(){n.states.add("focus"),this.children.forEach(i=>i.states.add("active")),this.children.selected.setFocus()}function o(){n.states.remove("focus"),this.selected=0,this.children.forEach(i=>i.states.remove("active"))}return[l(ee,Q(r,{onFocus:t,onBlur:o,get style(){return qn.Column},scroll:"none",get children(){return[l(Jt,{onEnter:()=>e("/browse/all"),icon:"trending",children:"Trending"}),l(Jt,{icon:"movie",onEnter:()=>e("/browse/movie"),children:"Movies"}),l(Jt,{icon:"tv",onEnter:()=>e("/browse/tv"),children:"TV"}),l(Jt,{icon:"experiment",onEnter:()=>e("/examples"),children:"Examples"})]}})),l(M,{ref(i){var s=n;typeof s=="function"?s(i):n=i},get style(){return qn.Gradient}})]}const Ml={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},en={x:10,fontSize:36,textColor:L("#ffffff")},tn={fontSize:36,textColor:L("#ffffff")},[zl,Pl]=U(0),[Dl,Ol]=U(0),[Ul,Go]=U(99),[Wl,Yl]=U(0);let Zn=0,Jn=0;const $l=hr(()=>{Jn=0,Zn=0,Go(99)},1e4),Hl=r=>{r&&(Pl(r),Go(n=>Math.min(r,n)),Yl(n=>Math.max(r,n)),Jn+=r,Zn++,Ol(Math.round(Jn/Zn)),$l())};function jl(r){r.renderer.on("fpsUpdate",(n,e)=>{const t=typeof e=="number"?e:e.fps;t>5&&Hl(t)})}const Ql=r=>l(M,Q(r,{style:Ml,get children(){return[l(M,{get children(){return[l(N,{style:en,children:"FPS:"}),l(N,{style:tn,x:94,get children(){return zl().toString()}})]}}),l(M,{x:160,get children(){return[l(N,{style:en,children:"AVG:"}),l(N,{style:tn,x:104,get children(){return Dl().toString()}})]}}),l(M,{x:0,y:40,get children(){return[l(N,{style:en,children:"MIN:"}),l(N,{style:tn,x:94,get children(){return Ul().toString()}})]}}),l(M,{x:160,y:40,get children(){return[l(N,{style:en,children:"MAX:"}),l(N,{style:tn,x:104,get children(){return Wl().toString()}})]}})]}})),Kl=r=>{Ba({Announcer:"a",Menu:"m",Escape:"Escape"});const n=za();n.enabled=!1;const e=mt();let t,o;return je(()=>{jl({renderer:Le})}),l(M,{onAnnouncer:()=>n.enabled=!n.enabled,onLast:()=>history.back(),onMenu:()=>e("/"),style:{width:1920,height:1080},onLeft:()=>{if(t.states.has("focus"))return!1;o=lr(),t.setFocus()},onRight:()=>t.states.has("focus")&&o.setFocus(),get children(){return[l(Oa,{}),l(Ql,{}),pt(()=>r.children),l(Ll,{ref(i){var s=t;typeof s=="function"?s(i):t=i}})]}})},fe={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:L("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:L("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:L("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:L("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,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:L("#0000ff")},peopleBio:{...f.typography.body1,contain:"both",width:1500,height:400}},pn={width:120,height:40,color:L("#000000"),borderRadius:8,border:{width:2,color:L("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:L("#333333")}},transition:{scale:!0,color:!0}},Xl={color:L("#00A699"),height:8,y:2,x:-4,width:pn.width+8},Vl={fontSize:12,y:12,contain:"width",textAlign:"center",color:L("#F6F6F9"),height:pn.height,width:pn.width},mn={container:pn,topBar:Xl,text:Vl},Jr={width:386,height:136,color:L("#715cab"),focus:{color:L("#5a39a2")},disabled:{color:L("#291d43")}},Gl={fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:L("#FFFFFF"),height:Jr.height,width:Jr.width,focus:{fontSize:40},disabled:{color:L("#909090")}};function ql(r){return l(M,Q(r,{get style(){return fe.Thumbnail}}))}function xn(r){const[n,e]=_s(r,["items"]);return l(G,Q(e,{get style(){return fe.Row},get children(){return l(Sn,{get each(){return n.items},children:t=>l(ql,t)})}}))}function Zl(r){return l(M,Q(r,{forwardStates:!0,get style(){return mn.container},get children(){return l(N,{get style(){return mn.text},get children(){return r.children}})}}))}const Jl="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA",ec="https://api.themoviedb.org/3";let qo,Zo;const tc="w185",nc={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Jl}};function kt(r,n=tc){return Zo+n+r}function rc(r,n={}){return qo?er(r,n):Jo().then(()=>er(r,n))}function er(r,n={}){return fetch(ec+r,{...nc,...n}).then(e=>e.json())}function Jo(){return er("/configuration").then(r=>{var n;return qo=r,Zo=(n=r.images)==null?void 0:n.secure_base_url,r})}const tt={get:rc,loadConfig:Jo};function oc(r,n){return r.length>n?r.substring(0,n-3)+"...":r}function ic(r,n=7){let e=[];for(let t=0,o=r.length;t({src:kt(n.poster_path||n.profile_path),tileSrc:kt(n.backdrop_path||n.profile_path,"w300"),backdrop:kt(n.backdrop_path,"w1280"),href:"/entity/".concat(n.media_type||"people","/").concat(n.id),shortTitle:oc(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 Ln=new Map;const nn=new Map;function sc(r){return n=>{const e="/trending/".concat(r,"/week?page=").concat(n);if(Ln.has(e))return Ln.get(e);let t=tt.get(e).then(o=>{let i=o.results.filter(c=>!c.adult),s=(nn.has(r)?nn.get(r):[]).concat(Nt(i)),a=ic(s);return a[a.length-1].length<7?nn.set(r,a.pop()):nn.delete(r),a});return Ln.set(e,t),t}}function ac(r){const[n,e]=U([]),[t,o]=U(1),[i,s]=U(!1),[a]=et(t,r);return $n(()=>{const c=a();c&&ms(()=>{c.length===0&&s(!0),e(d=>[...d,...c])})}),{pages:n,page:t,setPage:o,setPages:e,end:i,setEnd:s}}const Tn=1100,lc={...f.typography.display2,width:Tn,height:58,contain:"both"},cc=r=>l(N,Q(r,{style:lc,get children(){return r.children}})),dc={...f.typography.body1,width:Tn,height:72,contain:"both"},hc={fontSize:20,lineHeight:20},uc=r=>l(N,Q(r,{style:dc,get children(){return r.children}}));function fc(r){return[l(Be,{get when(){return(r==null?void 0:r.rtCrit)&&(r==null?void 0:r.rtCrit)!=="0"},get children(){return[l(M,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),l(N,{style:tr,get children(){return r.rtCrit+"%"}})]}}),l(Be,{get when(){return(r==null?void 0:r.rtFan)&&(r==null?void 0:r.rtFan)!=="0"},get children(){return[l(M,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),l(N,{style:tr,get children(){return r.rtFan+"%"}})]}})]}const gc=r=>(()=>{var n=Pt("node");return Eo(Yo,n,()=>[8,15,13,15]),An(n,Q(r,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),ko(n,l(N,{style:hc,get children(){return r.children}})),n})(),tr=f.typography.body2,pc=r=>l(M,{style:{display:"flex",flexDirection:"row",gap:12,width:Tn,height:48},get children(){return[l(N,{style:tr,get children(){return r.metaText}}),l(Sn,{get each(){return r.badges},children:n=>l(gc,{y:-5,children:n})}),pt(()=>fc(r.reviews))]}}),ei=r=>l(M,Q(r,{style:{display:"flex",flexDirection:"column",width:Tn,height:160,gap:16},get children(){return[l(cc,{get children(){return r.title}}),l(uc,{get children(){return r.description}}),l(pc,{get metaText(){return r.metaText},get badges(){return r.badges},get reviews(){return r.reviews}})]}}));function mc(r){const n=Math.floor(r/60),e=r%60;return n+"h "+(e<10?"0":"")+e+"m"}function eo(r){return r.split("-")[0]}function xc({type:r,id:n}){return tt.get("/".concat(r,"/").concat(n,"/recommendations")).then(({results:e})=>e.length?Nt(e.slice(0,7)):tt.get("/trending/".concat(r,"/week?page=1")).then(({results:t})=>Nt(t.slice(0,7))))}function yc({type:r,id:n}){return tt.get("/".concat(r,"/").concat(n,"/credits")).then(({cast:e})=>Nt(e.slice(0,7)))}function ti({type:r,id:n}){let e=r==="movie"?{rtCrit:86,rtFan:92}:{};return tt.get("/".concat(r,"/").concat(n)).then(t=>({backgroundImage:kt(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:r==="movie"?mc(t.runtime)+" - "+t.release_date:"".concat(eo(t.first_air_date)," - ").concat(eo(t.last_air_date)),reviews:e},...t}))}const to=()=>{const r=dr(),[n,e]=U(0),[t,o]=U();et(t,ti);const[i,s]=U({}),a=mt(),c=yo(()=>0),d=ne(()=>ac(sc(r.filter||"all")));$e(He(lr,y=>{y.backdrop&&Ee(y.backdrop),y.heroContent&&s(y.heroContent)},{defer:!0}));function u(){var b;(b=this.children.selected)==null||b.setFocus(),e((this.y||0)*-1+24);let y=d().pages().length;(y===0||this.parent.selected&&this.parent.selected>=y-2)&&d().setPage(x=>x+1)}function g(){let y=this.children.selected;F(y&&y.href),a(y.href)}return l(Be,{get when(){return d().pages().length},get children(){return[l(ei,Q({y:360,x:150},i)),l(M,{clipping:!0,get style(){return fe.itemsContainer},get children(){return l(ee,{plinko:!0,announce:"All Trending - Week",get y(){return n()},get style(){return fe.Column},get children(){return l(Sn,{get each(){return d().pages()},children:(y,b)=>l(xn,{get autofocus(){return c(b())},items:y,onFocus:u,onEnter:g})})}})}})]}})},vc=()=>{const r=mt(),n=yo(()=>0);function e(){let c=this.children.selected;F(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]=U(4294967295);return l(M,Q(c,{onFocus:()=>g(255),onBlur:()=>g(4294967295),style:d,get children(){return l(M,{x:30,get children(){return[l(N,{y:30,fontSize:84,get color(){return u()},get children(){return c.index}}),l(N,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return u()},get children(){return c.title}}),l(N,{y:200,fontSize:28,width:330,contain:"width",get color(){return u()},get children(){return c.description}})]}})}}))}const[i,s]=U(140);function a(c){s(c.selected*-400+140)}return l(M,{colorTop:1147903743,colorBottom:743406847,get children(){return[l(M,{x:120,get children(){return[l(M,{src:"/assets/solidjs.png",width:101,height:90,y:40}),l(N,{fontSize:90,x:110,y:40,children:"Examples"}),l(M,{y:140,height:1,width:1800,color:3906468351})]}}),l(G,{onSelectedChanged:a,onEnter:e,transition:{x:{delay:20,duration:300}},get x(){return i()},y:300,width:4400,get style(){return fe.Row},justifyContent:"flexStart",gap:40,get children(){return l(Sn,{each:t,children:(c,d)=>l(o,Q({get autofocus(){return n(d())},get index(){return d()}},c))})}})]}})},wc=()=>{const r={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:L("00000000")},e={fontSize:42},t={width:r.width,fontSize:26,contain:"width"},o={fontSize:26};return je(()=>{Ee("#000000")}),l(M,{autofocus:!0,style:r,get children(){return[l(N,{style:e,children:"Title of the Page"}),l(N,{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(M,{style:n,get children(){return[l(N,{style:o,children:"Subline Text"}),l(M,{width:28,height:28,src:"/assets/rt-popcorn.png"}),l(N,{style:o,children:"More Text"})]}})]}})},bc=()=>{const r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:L("00000000")},e={fontSize:42},t={fontSize:26};let o,i;je(()=>{Ee("#000000"),o.animate({x:100},{duration:2e3}).start()});const[s,a]=U(),[c,d]=U();setTimeout(()=>{var A;a("- Inserted -"),(A=i.getChildById("child1"))==null||A.animate({x:600},{duration:2e3}).start()},2e3);const u={width:400,height:300,color:L("#0000ff")},g={color:L("#f54242"),focus:{color:L("#4287f5")}};function y(A){const p=wn(()=>A.children);return l(M,Q(A,{get style(){return[g,A.style,[u]]},get children(){return[l(M,{id:"child1",width:100,height:100,get color(){return L("#ff0000")},y:25,get children(){return[pt(()=>p()),l(M,{id:"subChild",x:150,width:100,height:100,get color(){return L("#00ff00")}}),l(N,{get children(){return A.title}})]}}),l(M,{width:100,height:100,get color(){return L("#ffff00")},y:175,get children(){return p()}})]}}))}const b={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},x={color:L("#cccccc"),focus:{color:L("#000000")}},w={color:L("#ffffff"),focus:{color:L("#f6f6cc")}};function S(A){return console.log("Ref is available: ",A),!0}return l(M,{style:r,get children(){return[l(N,{style:e,children:"Title of the Page"}),l(M,{style:n,get children(){return[l(N,{get children(){return c()}}),l(N,{style:t,get children(){return["Sub ",pt(()=>s())," Text"]}}),l(Be,{get when(){return s()},get children(){return l(M,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),l(N,{style:t,children:"More Text"})]}}),l(y,{autofocus:!0,ref(A){var p=i;typeof p=="function"?p(A):i=A},style:[w,x],get children(){return l(N,{children:"Child Test"})}}),l(M,{ref(A){var p=o;typeof p=="function"?p(A):o=A},style:b,width:100,height:100,get color(){return L("#00ff00")},x:900,y:400,get alpha(){return S(o)?1:.5}})]}})},Sc=()=>{let r,n;const[e,t]=U([]),o={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:L("#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);je(()=>{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(M,{get children(){return[l(N,{style:i,get children(){return e().join("\n")}}),l(M,{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")]]})]}})},Ac=()=>{function r(o,i){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:L("00000000"),gap:26,y:400};function e(o){return l(M,Q(o,{forwardStates:!0,get style(){return mn.container},get children(){return l(N,{get style(){return mn.text},get children(){return o.children}})}}))}const t=o=>(()=>{var i=Pt("node");return Eo(Yo,i,()=>[10,15]),An(i,Q(o,{get style(){return{color:L("#000000be"),borderRadius:8,border:{width:2,color:L("#ffffff")}}}}),!0),ko(i,l(N,{style:{fontSize:20},get children(){return o.children}})),i})();return[l(G,{x:100,y:200,gap:5,style:n,get children(){return[l(t,{children:"HD"}),l(t,{children:"PG13"}),l(t,{children:"NC17"}),l(N,{fontSize:30,children:"I like bananas"}),l(t,{children:"DOLBY"})]}}),l(G,{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"})]}})]},Cc=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:L("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(a){return l(M,Q(a,{style:{width:200,height:100,y:5,color:392801023}}))}const[t,o]=U(50);function i(){var a;(a=this.children.selected)==null||a.setFocus(),o(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const s=50;return l(ee,{x:160,get y(){return t()},gap:30,height:850,get width(){return r.width},get style(){return fe.Column},get children(){return[l(N,{style:n,children:"Flex Start"}),l(G,{gap:s,style:r,onFocus:i,get children(){return[l(e,{autofocus:!0}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex Start - Margin Left"}),l(G,{gap:s,style:r,onFocus:i,get children(){return[l(e,{marginLeft:100}),l(e,{}),l(e,{marginLeft:100}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex End"}),l(G,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex End - Margin Right"}),l(G,{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(N,{style:n,children:"Center - No Margin Support"}),l(G,{gap:s,justifyContent:"center",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Space Between - No Margin Support"}),l(G,{gap:s,justifyContent:"spaceBetween",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Space Evenly - No Margin Support"}),l(G,{gap:s,justifyContent:"spaceEvenly",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}})]}})},Tc=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:L("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(c){return l(M,Q(c,{style:{width:200,height:100,y:5,color:392801023}}))}function t(){return Math.floor(Math.random()*91)+10}const[o,i]=U(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const a=50;return l(ee,{x:160,get y(){return o()},gap:30,height:850,get width(){return r.width},get style(){return fe.Column},get children(){return[l(N,{style:n,children:"Flex Start - AlignItems: center"}),l(G,{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(N,{style:n,children:"Flex Start - Margin Left - AlignItems: flexStart"}),l(G,{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(N,{style:n,children:"Flex End - AlignItems: flexEnd"}),l(G,{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(N,{style:n,children:"Flex End - Margin Right"}),l(G,{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(N,{style:n,children:"Center - No Margin Support"}),l(G,{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(N,{style:n,children:"Space Between - No Margin Support"}),l(G,{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(N,{style:n,children:"Space Evenly - No Margin Support"}),l(G,{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()}})]}})]}})},_c=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:L("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("#4dabf5"),height:850,width:80},e={fontSize:44,y:20,x:150};function t(d){const u={width:o(),height:80,x:5,color:L("#1769aa")};return l(M,Q(d,{style:u}))}function o(){return Math.floor(Math.random()*61)+10}const[i,s]=U(50);function a(){var d;(d=this.children.selected)==null||d.setFocus(),s(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const c=50;return[l(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(G,{gap:c,style:r,onFocus:a,get children(){return[l(ee,{gap:30,style:n,alignItems:"center",get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{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(ee,{gap:c,alignItems:"flexEnd",justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{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(ee,{gap:c,justifyContent:"center",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"spaceBetween",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"spaceEvenly",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Ic=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:L("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("#4dabf5"),height:850,width:60},e={fontSize:44,y:20,x:150};function t(c){const d={width:50,height:80,x:5,color:L("#1769aa")};return l(M,Q(c,{style:d}))}const[o,i]=U(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const a=50;return[l(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(G,{gap:a,style:r,onFocus:s,get children(){return[l(ee,{gap:30,style:n,get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,style:n,onFocus:s,get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{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(ee,{gap:a,justifyContent:"center",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"spaceBetween",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"spaceEvenly",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Rc=()=>{function r(i,s){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:L("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(M,Q(i,{forwardStates:!0,style:e,shader:t,get children(){return l(N,{style:Gl,get children(){return i.children}})}}))}return l(G,{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"})]}})},Bc="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function kc(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?Ec():console.error("Browser not supported!")}async function Ec(){const r=document.getElementById("video"),n=new shaka.Player;await n.attach(r),window.player=n,n.addEventListener("error",Fc);try{await n.load(Bc),console.log("The video has now been loaded!")}catch(e){ni(e)}}function Fc(r){ni(r.detail)}function ni(r){console.error("Error code",r.code,"object",r)}function Nc(){const r=document.getElementById("video");return r.hidden=!1,setTimeout(()=>r.play(),50),r.focus(),r}function Lc(){const r=document.getElementById("video");return r.hidden=!0,r.pause(),r}document.addEventListener("DOMContentLoaded",kc);const Mc=()=>{const r=dr(),n=mt(),[e]=et(()=>({...r}),ti),[t]=et(()=>({...r}),yc),[o]=et(()=>({...r}),xc),[i,s]=U(0);$e(He(e,A=>{Ee(A.backgroundImage)},{defer:!0}));const a=600,c={color:L("#000000"),alpha:0,width:1900,height:890,x:10,y:a,borderRadius:30};function d(){var A;(A=this.children.selected)==null||A.setFocus(),x.y=a,w.y=a,w.alpha=0}function u(){var A;(A=this.children.selected)==null||A.setFocus(),x.y=200,w.y=160,w.alpha=.9}function g(){let A=this.children.selected;F(A&&A.href),n(A.href)}function y(){Lc(),document.getElementsByTagName("canvas")[0].focus(),Qn(S),s(0)}function b(){const A=Nc();Qn(A),s(.9)}let x,w,S;return l(Be,{get when(){return e()},keyed:!0,get children(){return[l(M,{onUp:()=>S.setFocus(),onEscape:y,get children(){return[l(ei,Q({y:360,x:150},()=>e().heroContent)),l(Zl,{autofocus:!0,ref(A){var p=S;typeof p=="function"?p(A):S=A},y:560,x:150,onDown:()=>x.setFocus(),onEnter:b,children:"Watch Trailer"}),l(ee,{ref(A){var p=x;typeof p=="function"?p(A):x=A},y:a,x:140,get style(){return fe.Column},zIndex:5,get children(){return l(Be,{get when(){return pt(()=>!!o())()&&t()},get children(){return[l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Recommendations"}),l(xn,{onFocus:d,onEnter:g,get items(){return o()}}),l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Cast and Crew"}),l(xn,{onFocus:u,onEnter:g,get items(){return t()}})]}})}}),l(M,{ref(A){var p=w;typeof p=="function"?p(A):w=A},style:c,transition:{alpha:!0,y:!0}})]}}),l(M,{get alpha(){return i()},get color(){return L("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function zc({id:r}){return tt.get("/person/".concat(r,"/combined_credits")).then(({cast:n})=>Nt(n.slice(0,7)))}function Pc({id:r}){return tt.get("/person/".concat(r)).then(n=>({backgroundImage:kt(n.profile_path,"original"),heroContent:{title:n.title||n.name,description:n.biography},...n}))}const Dc=()=>{const r=dr(),n=mt(),[e]=et(()=>({...r}),Pc),[t]=et(()=>({...r}),zc);$e(He(e,s=>{Ee(s.backgroundImage)},{defer:!0}));const o={color:L("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){let s=this.children.selected;F(s&&s.href),n(s.href)}return l(Be,{get when(){return e()},keyed:!0,get children(){return[l(M,{x:150,y:200,get style(){return fe.Column},zIndex:3,get children(){return[l(N,{get style(){return f.typography.display2},get children(){return e().name}}),l(N,{get style(){return fe.peopleBio},get children(){return e().biography}})]}}),l(M,{style:o}),l(ee,{y:670,x:140,get style(){return fe.Column},get children(){return l(Be,{get when(){return t()},get children(){return[l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Credits"}),l(xn,{autofocus:!0,onEnter:i,get items(){return t()}})]}})}})]}})},Oc=()=>(()=>{var r=Pt("node");return Qs(r,"style",{width:1920,height:1080,color:868483072}),r})(),Uc=new URL("AppCoreExtensions-Bz0_JhbI.js",import.meta.url).href;Ae.debug=!1;Ae.animationsEnabled=!0;Ae.fontSettings.fontFamily="Ubuntu";Ae.fontSettings.color=L("#ffffff");Ae.fontSettings.fontSize=32;Ae.rendererOptions={coreExtensionModule:Uc,fpsUpdateInterval:1e3,enableInspector:!0};js(()=>l(ba,{root:r=>l(Kl,r),get children(){return[l(ue,{path:"",component:to}),l(ue,{path:"examples",component:vc}),l(ue,{path:"browse/:filter",component:to}),l(ue,{path:"text",component:wc}),l(ue,{path:"buttons",component:Ac}),l(ue,{path:"flex",component:Cc}),l(ue,{path:"create",component:bc}),l(ue,{path:"viewport",component:Sc}),l(ue,{path:"flexsize",component:Tc}),l(ue,{path:"flexcolumnsize",component:_c}),l(ue,{path:"flexcolumn",component:Ic}),l(ue,{path:"buttonsmaterial",component:Rc}),l(ue,{path:"entity/people/:id",component:Dc}),l(ue,{path:"entity/:type/:id",component:Mc}),l(ue,{path:"*all",component:Oc})]}}));export{Yc as __vite_legacy_guard}; -//# sourceMappingURL=index-DdLHrQIy.js.map +var ri=Object.defineProperty;var oi=(r,n,e)=>n in r?ri(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var h=(r,n,e)=>(oi(r,typeof n!="symbol"?n+"":n,e),e);import{a as F,i as ro,g as _n,c as ht,W as yr,E as nt,b as ke,d as ii,e as nr,f as si,m as At,h as Lt,j as oo,T as io,k as ai,l as In,S as vr,B as li,n as ci,o as so,p as di,q as hi,C as ui,r as fi,s as wr,t as br,u as gi,v as pi,w as mi}from"./CoreExtension-GJaPZupQ.js";function Yc(){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)}})();class ao{constructor(n){h(this,"releaseCallback");this.releaseCallback=n}}class xi extends ao{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(F(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;F(t,"Texture must have an id to be registered");let o=this.textureMap.get(t);o||(this.registerTexture(e),o=this.textureMap.get(t)),F(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;F(t,"Texture must have an id to be registered");const o=this.textureMap.get(t);F(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 yi extends ao{constructor(e){super(e);h(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,o;F((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 yt={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:lo(r)}},lo=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,")")},vi={id:"id"};class wi{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(ro())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(yt[e]){const i=(o=yt[e])==null?void 0:o.call(yt,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(vi[e]){n.setAttribute(String(yt[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:y=0,scale:b=1,color:x}=t;function w(){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(y,"rad"),n.style.scale="".concat(b),n.style.color=lo(x)},i)}setTimeout(w,s)}}const bi="modulepreload",Si=function(r){return"/solid-demo-app/"+r},Sr={},Ai=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=Si(c),c in Sr)return;Sr[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(!!t)for(let b=i.length-1;b>=0;b--){const x=i[b];if(x.href===c&&(!d||x.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(c,'"]').concat(u)))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":bi,d||(y.as="script",y.crossOrigin=""),y.href=c,a&&y.setAttribute("nonce",a),document.head.appendChild(y),d)return new Promise((b,x)=>{y.addEventListener("load",b),y.addEventListener("error",()=>x(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,y="".concat(e,"_").concat(d);let b="";u.size&&(b="[".concat(u.size(o),"]")),s.push(y),a+="uniform ".concat(g," ").concat(y).concat(b,";"),i[d]={name:y,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 Ci={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 co{constructor(n){h(this,"stage");h(this,"set");this.stage=n;const e={...Ci,...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)}))}}const Ar=2048;function Cr(r,n,e,t,o){const i=r!=="bottom"?.5*n:0;return e*(t-1)+i+Math.max(e,n)+(o||0)}class Ti{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,y=this._settings.cutEx*e,b=this._settings.cutSy*e,x=this._settings.cutEy*e,w=(this._settings.letterSpacing||0)*e,S=this._settings.textIndent*e;this.setFontProperties();let A=c||2048/this.getPrecision(),p=A-t;if(p<10&&(A+=10-p,p=10),u||(u=p),this._settings.textOverflow&&!this._settings.wordWrap){let C;switch(this._settings.textOverflow){case"clip":C="";break;case"ellipsis":C=this._settings.overflowSuffix;break;default:C=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,u-S,C)}let m;if(this._settings.wordWrap)m=this.wrapText(this._settings.text,u,w,S);else{m={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const C=m.l.length;for(let _=0;_this._settings.maxLines){const C=v.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(C[C.length-1],u-O,w,S);C[C.length-1]="".concat(D.l[0]).concat(this._settings.overflowSuffix),_=[D.l.length>1?D.l[1]:""]}else _=[""];let E;const P=v.length;let k=0;const z=m.n.length;for(E=this._settings.maxLines;E=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,y=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?(b>0&&(d.push(u),u=""),u+=y[b],g=e-x-(b===0?o:0)):(g-=w,u+=" ".concat(y[b]))}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 Tr=typeof self>"u"?globalThis:self;var no;const _r=((no=Tr.document)==null?void 0:no.fonts)||Tr.fonts;function _i(r){const{fontFamily:n,fontStyle:e,fontWeight:t,fontStretch:o,fontSize:i}=r;return[e,t,o,"".concat(i,"px"),n].join(" ")}const Ii=ht(0,0,0,0);class Ri extends co{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")),F(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 yr}addFontFace(e){F(e instanceof yr),_r.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new nt,canvasPages:void 0,lightning2TextRenderer:new Ti(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 x,w;if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const S=_i(e.props);if(e.fontInfo={cssString:S,loaded:!1},!e.fontInfo.loaded){_r.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,A=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,p=A>0&&S>0?Math.min(A,S):Math.max(A,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:p,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=ht(t,o,c!=="none"?t+i:1/0,c==="both"?o+s:1/0,Ii);ii(this.rendererBounds,S,d),d.valid=!0}const y=d.y2-d.y1,b=Math.ceil(y/e.renderInfo.lineHeight);if(y===0){g=void 0,u=void 0,this.setStatus(e,"loaded");return}else if(u&&g){const S=t+u.x1,A=o-a+u.y1,p=t+u.x2,m=o-a+u.y2;if(S<=d.x1&&p>=d.x2&&A<=d.y1&&m>=d.y2){this.setStatus(e,"loaded");return}md.y1&&(u.y1-=b*e.renderInfo.lineHeight,u.y2-=b*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-b,g[0].lineNumEnd=g[0].lineNumStart+b,g[0].valid=!1)}else{const S=e.renderInfo.lineHeight*b,A=Math.ceil(a/S),p=A*b,m=p-b,v=p+b;g=[{texture:g==null?void 0:g[0].texture,lineNumStart:m,lineNumEnd:m+b,valid:!1},{texture:g==null?void 0:g[1].texture,lineNumStart:p,lineNumEnd:p+b,valid:!1},{texture:g==null?void 0:g[2].texture,lineNumStart:v,lineNumEnd:v+b,valid:!1}],e.canvasPages=g;const T=A*S;u={x1:0,y1:T-S,x2:i,y2:T+S*2}}e.renderWindow=u,performance.now();for(const S of g)if(!S.valid){if(S.lineNumStart<0){(x=S.texture)==null||x.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||((w=S.texture)==null||w.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 C,_,E,P,k,z,O,D,W,j,se,te;const{stage:s}=this,{canvasPages:a,textW:c=0,textH:d=0,renderWindow:u}=e;if(!a||!u)return;const{x:g,y,scrollY:b,contain:x,width:w,height:S}=e.props,A={x:g,y,width:x!=="none"?w:c,height:x==="both"?S:d};nr({x:0,y:0,width:s.options.appWidth,height:s.options.appHeight},A),F(a,"canvasPages is not defined"),F(u,"renderWindow is not defined");const m=(u.y2-u.y1)/3,{zIndex:v,color:T}=e.props,R=i*si(T),I=At(4294967295,R);a[0].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((_=(C=a[0].texture)==null?void 0:C.dimensions)==null?void 0:_.width)||0,height:((P=(E=a[0].texture)==null?void 0:E.dimensions)==null?void 0:P.height)||0,texture:a[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[1].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((z=(k=a[1].texture)==null?void 0:k.dimensions)==null?void 0:z.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:v,tx:t.tx,ty:t.ty-b+u.y1+m,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[2].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((j=(W=a[2].texture)==null?void 0:W.dimensions)==null?void 0:j.width)||0,height:((te=(se=a[2].texture)==null?void 0:se.dimensions)==null?void 0:te.height)||0,texture:a[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1+m+m,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 ho extends Lt{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(ho,"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 / 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 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 uo extends Lt{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(uo,"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 Rn=new Map,Bi=(r,n)=>{const e=JSON.stringify(r);if(Rn.has(e))return Rn.get(e);const t=(r!=null?r:[]).map(o=>({type:o.type,props:n[o.type].resolveDefaults(o.props||{})}));return Rn.set(e,t),t},Ne=class Ne extends Lt{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=oo(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(y=>{const b=c.uniforms[y],x=u[y];let w=b.validator?b.validator(d[y],d):d[y];Array.isArray(w)&&(w=new Float32Array(w)),o.push({name:x.name,value:w})})}),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 w=t[x.type],S=w.getEffectKey(x.props||{});o[S]=o[S]?++o[S]:1;const A=o[S];A===1&&c.push({key:S,type:x.type,props:x.props});const p=new w({ref:"".concat(S).concat(A===1?"":A),target:S,props:x.props});return s+=p.declaredUniforms,a.push(...Object.values(p.uniformInfo)),p});let u="";c==null||c.forEach(x=>{var I;const w=t[x.type],S=w.resolveDefaults((I=x.props)!=null?I:{}),A=[];for(const C in w.methods){let _=C;const E=w.methods[C];i[C]&&i[C]!==E&&(_=Ne.resolveMethodDuplicate(C,E,i)),i[_]=E.replace("function",_),A.push({m:C,cm:_})}let p=w.onShaderMask instanceof Function?w.onShaderMask(S):w.onShaderMask,m=w.onColorize instanceof Function?w.onColorize(S):w.onColorize,v=w.onEffectMask instanceof Function?w.onEffectMask(S):w.onEffectMask;A.forEach(C=>{const{m:_,cm:E}=C,P=new RegExp("\\$".concat(_),"g");p&&(p=p.replace(P,E)),m&&(m=m.replace(P,E)),v&&(v=v.replace(P,E))});const T=w.getMethodParameters(w.uniforms,S),R=T.length>0?", ".concat(T):"";p&&(u+="\n float fx_".concat(x.key,"_onShaderMask(float shaderMask ").concat(R,") {\n ").concat(p,"\n }\n ")),m&&(u+="\n vec4 fx_".concat(x.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(m,"\n }\n ")),v&&(u+="\n vec4 fx_".concat(x.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(v,"\n }\n "))});let g="";for(const x in i)g+=i[x];let y="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",b="\n\n ";for(let x=0;x0?", ".concat(w.passParameters):"",A=t[w.name];A.onShaderMask&&(b+="\n shaderMask = fx_".concat(w.target,"_onShaderMask(shaderMask ").concat(S,");\n ")),A.onColorize&&(b+="\n maskColor = fx_".concat(w.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(S,");\n ")),A.onEffectMask&&(y="fx_".concat(w.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(S,")"));const p=d[x+1];(p===void 0||t[p.name].onEffectMask)&&(b+="\n shaderColor = ".concat(y,";\n "))}return{effects:d,uniforms:a,fragment:Ne.fragment(s,g,u,b),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:Bi(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 ut=Ne;class Mn extends Lt{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(Mn,"z$__type__Props"),h(Mn,"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 ki=new Float32Array([1,0,0,0,1,0,0,0,1]),yn=class yn extends Lt{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=yn.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:ki,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(yn,"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 gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\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 zn=yn;class ot 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(ot,"z$__type__Props"),h(ot,"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(ot,"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(ot,"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(ot,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Ct 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(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,"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(Ct,"onColorize","\n return color;\n ");const Ye=class Ye 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(Ye,"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(Ye,"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(Ye.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Pn=Ye;class Dn 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(Dn,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),h(Dn,"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 it 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(it,"z$__type__Props"),h(it,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(it,"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(it,"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(it,"onColorize","\n return color;\n ");class st 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(st,"z$__type__Props"),h(st,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(st,"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(st,"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(st,"onColorize","\n return color;\n ");class at 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(at,"z$__type__Props"),h(at,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(at,"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(at,"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(at,"onColorize","\n return color;\n ");class lt 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(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(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 Tt 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(Tt,"z$__type__Props"),h(Tt,"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(Tt,"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(Tt,"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 rn 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(rn,"z$__type__Props"),h(rn,"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(rn,"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 qe=class qe 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 y=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(qe,"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(qe.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let On=qe;class ct 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(ct,"z$__type__Props"),h(ct,"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(ct,"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(ct,"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(ct,"onColorize","\n return color;\n ");class dt 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(dt,"z$__type__Props"),h(dt,"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(dt,"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(dt,"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(dt,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class Ei{constructor(){h(this,"shCache",new Map);h(this,"shConstructors",{});h(this,"attachedShader",null);h(this,"effectConstructors",{});h(this,"renderer");this.registerShaderType("DefaultShader",ho),this.registerShaderType("DefaultShaderBatched",uo),this.registerShaderType("RoundedRectangle",Mn),this.registerShaderType("DynamicShader",ut),this.registerShaderType("SdfShader",zn),this.registerEffectType("border",Ct),this.registerEffectType("borderBottom",at),this.registerEffectType("borderLeft",lt),this.registerEffectType("borderRight",it),this.registerEffectType("borderTop",st),this.registerEffectType("fadeOut",rn),this.registerEffectType("linearGradient",Pn),this.registerEffectType("radialGradient",On),this.registerEffectType("grayscale",Dn),this.registerEffectType("glitch",Tt),this.registerEffectType("radius",ot),this.registerEffectType("radialProgress",ct),this.registerEffectType("holePunch",dt)}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=ut.resolveDefaults(n,this.effectConstructors),t=ut.makeCacheKey(e,this.effectConstructors);if(t&&this.shCache.has(t))return{shader:this.shCache.get(t),props:e};const o=new ut(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 Fi{constructor(){h(this,"data",{})}reset(){this.data={}}increment(n){this.data[n]||(this.data[n]=0),this.data[n]++}getData(){return{...this.data}}}function Ni(r){return/\.(ktx|pvr)$/.test(r)}const Li=async r=>{const e=await(await fetch(r)).arrayBuffer();return r.indexOf(".ktx")!==-1?Mi(e):zi(e)},Mi=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=[],y={pixelWidth:c[7],pixelHeight:c[6],numberOfMipmapLevels:c[11]||0};let b=0,x=y.pixelWidth||0,w=y.pixelHeight||0;for(let S=0;S>2)*(w+3>>2)*8,p=new Uint8Array(a,u.byteOffset+b,A);g.push(p),b+=A,x=x>>1,w=w>>1}return{data:{glInternalFormat:36196,mipmaps:g,width:y.pixelWidth||0,height:y.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},Et=class Et extends io{constructor(e,t){super(e);h(this,"props");this.props=Et.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(Ni(e))return Li(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 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=Et.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(Et,"z$__type__Props");let Un=Et;const Pi=24;function Di(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 b=o/i+d*n+g;if(!(c&&b>=c/i))return{sdfX:u,sdfY:b,lineIndex:d}}class _t{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*It(r,n=0){let e=n;for(;e=b.y1,De=O<=b.y2,pe=Pe&&De;for(;(de=te.next())&&!de.done;){const K=de.value;if(r===y.length)y.push({codepointIndex:K.cluster,maxY:k,maxX:P});else if(r>y.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?W.codepointIndex!==-1&&(W.codepointIndex=-1,re=z):W.codepointIndex===-1&&(W.codepointIndex=K.cluster,W.bufferOffset=D,W.xStart=re),K.mapped){const Ut=z+K.xOffset+K.width;if(g!=="none"&&Ut>=ge&&W.codepointIndex!==-1&&W.xStart>0)if(be){te=j.shapeText(se,new _t(It(t,W.codepointIndex),W.codepointIndex)),D=W.bufferOffset;break}else te=j.shapeText(se,new _t(It(A,0),0)),z=W.xStart,D=W.bufferOffset,g="none";else{const Oe=z+K.xOffset,Ue=O+K.yOffset;if(pe){Ce===-1&&(Ce=D);const Ke=x.getAtlasEntry(K.glyphId),Xe=Ke.x/x.data.common.scaleW,Ve=Ke.y/x.data.common.scaleH,xt=Ke.width/x.data.common.scaleW,xr=Ke.height/x.data.common.scaleH;u[D++]=Oe,u[D++]=Ue,u[D++]=Xe,u[D++]=Ve,u[D++]=Oe+K.width,u[D++]=Ue,u[D++]=Xe+xt,u[D++]=Ve,u[D++]=Oe,u[D++]=Ue+K.height,u[D++]=Xe,u[D++]=Ve+xr,u[D++]=Oe+K.width,u[D++]=Ue+K.height,u[D++]=Xe+xt,u[D++]=Ve+xr}k=Math.max(k,Ue+K.height),P=Math.max(P,Oe+K.width),z+=K.xAdvance}}else if(K.codepoint===10){if(be)break;te=j.shapeText(se,new _t(It(A,0),0)),g="none"}}Ce!==-1&&(ze.push({bufferStart:Ce,bufferEnd:D}),Ce=-1),z=0,O+=v,r++,W.codepointIndex=-1,re=0,!w&&g==="both"&&O>b.y2||de&&de.done?Qe=!1:be||(Qe=!1)}if(o==="center"){const be=g==="none"?P:T;for(let ge=0;getypeof r=="number"?r:Hi[r]||400;function ji(r,n,e,t,o){let i=Ir(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=Ir(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 Qi=oo(ji);class fo{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 Qi(n,t,o,i,s)}}const Ki={x:0,y:0,width:0,height:0};class Xi extends co{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&&In(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&In(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 vr}addFontFace(e){F(e instanceof vr);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}F(t.data,"Font face data should be loaded");const{text:c,fontSize:d,x:u,y:g,contain:y,width:b,height:x,lineHeight:w,verticalAlign:S,scrollable:A,overflowSuffix:p,maxLines:m}=e.props,v=y==="both"&&A?e.props.scrollY:0,{renderWindow:T}=e,R=t.data.info.size,I=d/R,C=w/I;e.distanceRange=I*t.data.distanceField.distanceRange;const _=c.length*Pi;let E=e.vertexBuffer;(!E||E.length<_)&&(E=new Float32Array(_*2));const P=e.elementBounds;if(P.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),P.valid=!0),!a&&T.valid){const j=T.screen;if(u+j.x1<=P.x1&&u+j.x2>=P.x2&&g-v+j.y1<=P.y1&&g-v+j.y2>=P.y2){this.setStatus(e,"loaded");return}T.valid=!1,this.setStatus(e,"loading")}const{offsetY:k,textAlign:z}=e.props;if(!T.valid){if(!In(P,this.rendererBounds))return;$i(T,u,g,v,w,y==="both"?P.y2-P.y1:0,P,I)}const O=Di(R,C,w,S,k,I,T,i,o);if(!O){this.setStatus(e,"loaded");return}const{letterSpacing:D}=e.props,W=Ui(O.lineIndex,O.sdfX,O.sdfY,c,z,b,x,d,w,D,E,y,i,T.sdf,t,a,A,p,m);e.bufferUploaded=!1,e.bufferNumFloats=W.bufferNumFloats,e.bufferNumQuads=W.bufferNumQuads,e.vertexBuffer=E,e.renderWindow=T,s.lastLayoutNumCharacters=W.layoutNumCharacters,s.bufferSize=E.byteLength,W.fullyProcessed&&(e.textW=W.maxX*I,e.textH=W.maxY*I),this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var _,E,P;if(!e.vertexBuffer)return;const{renderer:s}=this.stage,{fontSize:a,color:c,contain:d,scrollable:u,zIndex:g,debug:y}=e.props,b=d==="both"&&u?e.props.scrollY:0,{textW:x=0,textH:w=0,distanceRange:S,vertexBuffer:A,bufferUploaded:p,trFontFace:m,elementBounds:v}=e;let{webGlBuffers:T}=e;if(!T){const k=s.glw,z=4*Float32Array.BYTES_PER_ELEMENT,O=k.createBuffer();F(O),e.webGlBuffers=new li([{buffer:O,attributes:{a_position:{name:"a_position",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,F(e.webGlBuffers),T=e.webGlBuffers}if(!p){const k=s.glw,z=(_=T==null?void 0:T.getBuffer("a_textureCoordinate"))!=null?_:null;k.arrayBufferData(z,A,k.STATIC_DRAW),e.bufferUploaded=!0}if(F(m),u&&d==="both"){F(v.valid);const k=ci(v,Ki);o.valid?(e.clippingRect.valid=!0,o=nr(o,k,e.clippingRect)):(e.clippingRect.valid=!0,o=so(k,e.clippingRect))}const R=new di(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:hi(c,i),size:a/(((E=m.data)==null?void 0:E.info.size)||0),scrollY:b,distanceRange:S,debug:y.sdfShaderDebug},i,o,{height:w,width:x},0,g),I=(P=e.trFontFace)==null?void 0:P.texture;F(I);const C=this.stage.txManager.getCtxTexture(I);R.addTexture(C),R.length=e.bufferNumFloats,R.numQuads=e.bufferNumQuads,s.addRenderOp(R)}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 fo.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 Vi(r){return r.prototype instanceof ui}async function Gi(r,n){let e;try{console.log("Loading core extension",r),e=await Ai(()=>import(r),__vite__mapDeps([]))}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(Vi(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 go(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 qi extends nt{constructor(e,t,o){var A,p,m,v;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:(A=e.clearColor)!=null?A:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:(p=e.experimental_FinalizationRegistryTextureUsageTracker)!=null?p:!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:(m=e.enableContextSpy)!=null?m:!1,enableInspector:(v=e.enableInspector)!=null?v:!1};this.settings=i;const{appWidth:s,appHeight:a,deviceLogicalPixelRatio:c,devicePhysicalPixelRatio:d,enableInspector:u}=i,g=T=>{this.driver.releaseTexture(T)},y=i.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=y?new yi(g):new xi(g,this.settings.textureCleanupOptions);const b=s*c,x=a*c;this.driver=o;const w=document.createElement("canvas");this.canvas=w,w.width=b*d,w.height=x*d,w.style.width="".concat(b,"px"),w.style.height="".concat(x,"px");let S;if(typeof t=="string"?S=document.getElementById(t):S=t,!S)throw new Error("Could not find target element");o.onCreateNode=T=>{this.nodes.set(T.id,T)},o.onBeforeDestroyNode=T=>{this.nodes.delete(T.id)},o.onFpsUpdate=T=>{this.emit("fpsUpdate",T)},o.onFrameTick=T=>{this.emit("frameTick",T)},o.onIdle=()=>{this.emit("idle")},S.appendChild(w),u&&!ro()&&(this.inspector=new wi(w,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,y,b,x,w,S,A,p,m,v,T,R,I;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:(y=e.textAlign)!=null?y:"left",contain:(b=e.contain)!=null?b:"none",scrollable:(x=e.scrollable)!=null?x:!1,scrollY:(w=e.scrollY)!=null?w:0,offsetY:(S=e.offsetY)!=null?S:0,letterSpacing:(A=e.letterSpacing)!=null?A:0,lineHeight:(p=e.lineHeight)!=null?p:t,maxLines:(m=e.maxLines)!=null?m:0,textBaseline:(v=e.textBaseline)!=null?v:"alphabetic",verticalAlign:(T=e.verticalAlign)!=null?T:"top",overflowSuffix:(R=e.overflowSuffix)!=null?R:"...",debug:(I=e.debug)!=null?I:{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(e){var d,u,g,y,b,x,w,S,A,p,m,v,T,R,I,C,_,E,P,k,z,O,D,W,j,se,te,de,Ce,ze,Dt,Ot,Qe,be,ge,re,Pe,De,pe,K,Ut,Oe,Ue,Ke,Xe,Ve,xt;const t=(d=e.color)!=null?d:4294967295,o=(y=(g=(u=e.colorTl)!=null?u:e.colorTop)!=null?g:e.colorLeft)!=null?y:t,i=(w=(x=(b=e.colorTr)!=null?b:e.colorTop)!=null?x:e.colorRight)!=null?w:t,s=(p=(A=(S=e.colorBl)!=null?S:e.colorBottom)!=null?A:e.colorLeft)!=null?p:t,a=(T=(v=(m=e.colorBr)!=null?m:e.colorBottom)!=null?v:e.colorRight)!=null?T:t,c=go((R=e.data)!=null?R:{});return{x:(I=e.x)!=null?I:0,y:(C=e.y)!=null?C:0,width:(_=e.width)!=null?_:0,height:(E=e.height)!=null?E:0,alpha:(P=e.alpha)!=null?P:1,autosize:(k=e.autosize)!=null?k:!1,clipping:(z=e.clipping)!=null?z:!1,color:t,colorTop:(O=e.colorTop)!=null?O:t,colorBottom:(D=e.colorBottom)!=null?D:t,colorLeft:(W=e.colorLeft)!=null?W:t,colorRight:(j=e.colorRight)!=null?j:t,colorBl:s,colorBr:a,colorTl:o,colorTr:i,zIndex:(se=e.zIndex)!=null?se:0,zIndexLocked:(te=e.zIndexLocked)!=null?te:0,parent:(de=e.parent)!=null?de:null,texture:(Ce=e.texture)!=null?Ce:null,shader:(ze=e.shader)!=null?ze:null,src:(Dt=e.src)!=null?Dt:"",scale:(Ot=e.scale)!=null?Ot:null,scaleX:(be=(Qe=e.scaleX)!=null?Qe:e.scale)!=null?be:1,scaleY:(re=(ge=e.scaleY)!=null?ge:e.scale)!=null?re:1,mount:(Pe=e.mount)!=null?Pe:0,mountX:(pe=(De=e.mountX)!=null?De:e.mount)!=null?pe:0,mountY:(Ut=(K=e.mountY)!=null?K:e.mount)!=null?Ut:0,pivot:(Oe=e.pivot)!=null?Oe:.5,pivotX:(Ke=(Ue=e.pivotX)!=null?Ue:e.pivot)!=null?Ke:.5,pivotY:(Ve=(Xe=e.pivotY)!=null?Xe:e.pivot)!=null?Ve:.5,rotation:(xt=e.rotation)!=null?xt:0,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 Zi 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=fi(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(){F(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){F(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 q=0,Z=3,ce=6,X=1,J=4,he=7,me=2,xe=5,ye=8;class ve{constructor(n){h(this,"data");n?(this.data=new Float32Array(9),this.data[q]=n[0],this.data[Z]=n[3],this.data[ce]=n[6],this.data[X]=n[1],this.data[J]=n[4],this.data[he]=n[7],this.data[me]=n[2],this.data[xe]=n[5],this.data[ye]=n[8]):this.data=new Float32Array(9)}static get temp(){return es}static multiply(n,e,t){const o=n.data[q]*e.data[q]+n.data[Z]*e.data[X]+n.data[ce]*e.data[me],i=n.data[q]*e.data[Z]+n.data[Z]*e.data[J]+n.data[ce]*e.data[xe],s=n.data[q]*e.data[ce]+n.data[Z]*e.data[he]+n.data[ce]*e.data[ye],a=n.data[X]*e.data[q]+n.data[J]*e.data[X]+n.data[he]*e.data[me],c=n.data[X]*e.data[Z]+n.data[J]*e.data[J]+n.data[he]*e.data[xe],d=n.data[X]*e.data[ce]+n.data[J]*e.data[he]+n.data[he]*e.data[ye],u=n.data[me]*e.data[q]+n.data[xe]*e.data[X]+n.data[ye]*e.data[me],g=n.data[me]*e.data[Z]+n.data[xe]*e.data[J]+n.data[ye]*e.data[xe],y=n.data[me]*e.data[ce]+n.data[xe]*e.data[he]+n.data[ye]*e.data[ye];return t||(t=new ve),t.data[q]=o,t.data[Z]=i,t.data[ce]=s,t.data[X]=a,t.data[J]=c,t.data[he]=d,t.data[me]=u,t.data[xe]=g,t.data[ye]=y,t}static identity(n){return n||(n=new ve),n.data[q]=1,n.data[Z]=0,n.data[ce]=0,n.data[X]=0,n.data[J]=1,n.data[he]=0,n.data[me]=0,n.data[xe]=0,n.data[ye]=1,n}static translate(n,e,t){return t||(t=new ve),t.data[q]=1,t.data[Z]=0,t.data[ce]=n,t.data[X]=0,t.data[J]=1,t.data[he]=e,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static scale(n,e,t){return t||(t=new ve),t.data[q]=n,t.data[Z]=0,t.data[ce]=0,t.data[X]=0,t.data[J]=e,t.data[he]=0,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static rotate(n,e){const t=Math.cos(n),o=Math.sin(n);return e||(e=new ve),e.data[q]=t,e.data[Z]=-o,e.data[ce]=0,e.data[X]=o,e.data[J]=t,e.data[he]=0,e.data[me]=0,e.data[xe]=0,e.data[ye]=1,e}static copy(n,e,t){return e||(e=new ve),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[q]*n+this.data[Z]*e+this.data[ce],this.data[he]=this.data[X]*n+this.data[J]*e+this.data[he],this}scale(n,e){return this.data[q]=this.data[q]*n,this.data[Z]=this.data[Z]*e,this.data[X]=this.data[X]*n,this.data[J]=this.data[J]*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[q]*e+this.data[Z]*t,i=this.data[Z]*e-this.data[q]*t,s=this.data[X]*e+this.data[J]*t,a=this.data[J]*e-this.data[X]*t;return this.data[q]=o,this.data[Z]=i,this.data[X]=s,this.data[J]=a,this}multiply(n){return ve.multiply(this,n,this)}get tx(){return this.data[ce]}get ty(){return this.data[he]}get ta(){return this.data[q]}get tb(){return this.data[Z]}get tc(){return this.data[X]}get td(){return this.data[J]}transformPoint(n,e){return[this.data[q]*n+this.data[Z]*e+this.data[ce],this.data[X]*n+this.data[J]*e+this.data[X]]}}const es=new ve,Wt=0,Yt=2,$t=4,Ht=6,jt=1,Qt=3,Kt=5,Xt=7;class sn{constructor(n){h(this,"data");this.data=new Float32Array(8),n&&(this.data[Wt]=n[Wt],this.data[Yt]=n[Yt],this.data[$t]=n[$t],this.data[Ht]=n[Ht],this.data[jt]=n[jt],this.data[Qt]=n[Qt],this.data[Kt]=n[Kt],this.data[Xt]=n[Xt])}static translate(n,e,t,o,i,s,a,c,d){return d||(d=new sn),d.data[Wt]=n,d.data[Yt]=t,d.data[$t]=i,d.data[Ht]=a,d.data[jt]=e,d.data[Qt]=o,d.data[Kt]=s,d.data[Xt]=c,d}get x1(){return this.data[Wt]}get x2(){return this.data[Yt]}get x3(){return this.data[$t]}get x4(){return this.data[Ht]}get y1(){return this.data[jt]}get y2(){return this.data[Qt]}get y3(){return this.data[Kt]}get y4(){return this.data[Xt]}}var V;(function(r){r[r.Init=0]="Init",r[r.OutOfBounds=2]="OutOfBounds",r[r.InBounds=4]="InBounds",r[r.InViewport=8]="InViewport"})(V||(V={}));const Je=new Map;Je.set(V.Init,"init");Je.set(V.OutOfBounds,"outOfBounds");Je.set(V.InBounds,"inBounds");Je.set(V.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 rr 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",V.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,"onTextureLoaded",(e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})});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},this.parent=t.parent,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();F(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)}sortChildren(){this.children.sort((e,t)=>e.calcZIndex-t.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=ve.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){F(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=ve.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){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&&(F(this.localTransform),this.globalTransform=ve.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),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=At(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=At(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=At(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=At(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.children.forEach(s=>{s.setUpdateType(i),s.updateType!==0&&s.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){F(this.renderBound);const t=e.width||this.stage.root.width,o=e.height||this.stage.root.height;this.strictBound=ht(e.x,e.y,e.x+t,e.y+o,this.strictBound);const i=this.stage.boundsMargin;return this.preloadBound=ht(e.x-i[3],e.y-i[0],e.x+t+i[1],e.y+o+i[2],this.preloadBound),br(this.renderBound,this.strictBound)?V.InViewport:br(this.renderBound,this.preloadBound)?V.InBounds:V.OutOfBounds}updateRenderState(e){const t=this.checkRenderBounds(e);if(t!==this.renderState){let o=this.renderState;this.renderState=t,o===V.InViewport&&this.emit("outOfViewport",{previous:o,current:t}),oV.InBounds&&t===V.OutOfBounds&&(this.emit(Je.get(V.InBounds),{previous:o,current:t}),o=V.InBounds);const i=Je.get(t);F(i),this.emit(i,{previous:o,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(V[e]))}updateIsRenderable(){let e;this.worldAlpha===0||!this.checkRenderProps()?e=!1:e=this.renderState>V.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;F(o);const{tx:i,ty:s,ta:a,tb:c,tc:d,td:u}=o;if(c===0&&d===0){const g=i,y=i+e*a,b=s,x=s+t*u;this.renderCoords=sn.translate(g,b,y,b,y,x,g,x,this.renderCoords)}else this.renderCoords=sn.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;F(t),F(e);const{tb:o,tc:i}=t,{x1:s,y1:a,x3:c,y3:d}=e;if(o===0||i===0)this.renderBound=ht(s,a,c,d,this.renderBound);else{const{x2:u,x4:g,y2:y,y4:b}=e;this.renderBound=ht(Math.min(s,u,c,g),Math.min(a,y,d,b),Math.max(s,u,c,g),Math.max(a,y,d,b),this.renderBound)}}calculateClippingRect(e){F(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);F(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)),this.updateScaleRotateTransform()}}}let ts=1;function or(){return ts++}class Wn 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:or(),this.coreNode=i||new rr(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}),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._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);F(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 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=go(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 Zi(this.coreNode,e,t);return new Ji(this.stage.animationManager,o)}}const ns=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)},rs=()=>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 is{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 Ft=class Ft extends io{constructor(e,t){super(e);h(this,"props");this.props=Ft.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 ls=2e6;class cs 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:y}=e;this.txManager=new ss(g),this.txMemManager=new as(y),this.shManager=new Ei,this.animationManager=new os,this.contextSpy=u?new Fi:null;let b=[0,0,0,0];d&&(b=Array.isArray(d)?d:[d,d,d,d]),this.boundsMargin=b,s!=null&&s.monitorTextureCache&&setInterval(()=>{F(this.txManager);const w=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",w.idCacheSize),console.log("Texture Key Cache Size: ",w.keyCacheSize)},1e3),this.renderer=new mi({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:o!=null?o:4278190080,bufferMemory:ls,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new Ri(this),sdf:new Xi(this)},this.fontManager=new fo(this.textRenderers);const x=new rr(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});this.root=x,ns(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=rs(),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(),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){F(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),F(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){F(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}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 hs extends Wn{constructor(n,e,t){super(n,e,t,new ds(t,{id:or(),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}))}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 us{constructor(){h(this,"root",null);h(this,"stage",null);h(this,"rendererMain",null)}async init(n,e,t){this.stage=new cs({rootId:or(),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,F(this.stage.root);const o=new Wn(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 Gi(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){F(this.rendererMain),F(this.stage);const e=new Wn(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(n){F(this.rendererMain),F(this.stage);const e=new hs(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;F(e),e.txManager.removeTextureIdFromCache(n)}getRootNode(){return F(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.")}}const po=(r,n)=>r===n,an=Symbol("solid-proxy"),fs=Symbol("solid-track"),ln={equals:po};let mo=Co;const Se=1,cn=2,xo={owned:null,cleanups:null,context:null,owner:null},Bn={};var $=null;let kn=null,gs=null,H=null,ae=null,Ie=null,vn=0;function ft(r,n){const e=H,t=$,o=r.length===0,i=n===void 0?t:n,s=o?xo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?r:()=>r(()=>le(()=>bn(s)));$=s,H=null;try{return Re(a,!0)}finally{H=e,$=t}}function U(r,n){n=n?Object.assign({},ln,n):ln;const e={value:r,observers:null,observerSlots:null,comparator:n.equals||void 0},t=o=>(typeof o=="function"&&(o=o(e.value)),Ao(e,o));return[So.bind(e),t]}function $n(r,n,e){const t=zt(r,n,!0,Se);rt(t)}function _e(r,n,e){const t=zt(r,n,!1,Se);rt(t)}function $e(r,n,e){mo=bs;const t=zt(r,n,!1,Se);(!e||!e.render)&&(t.user=!0),Ie?Ie.push(t):rt(t)}function ne(r,n,e){e=e?Object.assign({},ln,e):ln;const t=zt(r,n,!0,0);return t.observers=null,t.observerSlots=null,t.comparator=e.equals||void 0,rt(t),So.bind(t)}function ps(r){return r&&typeof r=="object"&&"then"in r}function et(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=Bn,c=!1,d="initialValue"in i,u=typeof t=="function"&&ne(t);const g=new Set,[y,b]=(i.storage||U)(i.initialValue),[x,w]=U(void 0),[S,A]=U(void 0,{equals:!1}),[p,m]=U(d?"ready":"unresolved");function v(C,_,E,P){return s===C&&(s=null,P!==void 0&&(d=!0),(C===a||_===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(P,{value:_})),a=Bn,T(_,E)),_}function T(C,_){Re(()=>{_===void 0&&b(()=>C),m(_!==void 0?"errored":d?"ready":"unresolved"),w(_);for(const E of g.keys())E.decrement();g.clear()},!1)}function R(){const C=ys,_=y(),E=x();if(E!==void 0&&!s)throw E;return H&&!H.user&&C&&$n(()=>{S(),s&&(C.resolved||g.has(C)||(C.increment(),g.add(C)))}),_}function I(C=!0){if(C!==!1&&c)return;c=!1;const _=u?u():t;if(_==null||_===!1){v(s,le(y));return}const E=a!==Bn?a:le(()=>o(_,{value:y(),refetching:C}));return ps(E)?(s=E,"value"in E?(E.status==="success"?v(s,E.value,void 0,_):v(s,void 0,void 0,_),E):(c=!0,queueMicrotask(()=>c=!1),Re(()=>{m(d?"refreshing":"pending"),A()},!1),E.then(P=>v(E,P,void 0,_),P=>v(E,void 0,_o(P),_)))):(v(s,E,void 0,_),E)}return Object.defineProperties(R,{state:{get:()=>p()},error:{get:()=>x()},loading:{get(){const C=p();return C==="pending"||C==="refreshing"}},latest:{get(){if(!d)return R();const C=x();if(C&&!s)throw C;return y()}}}),u?$n(()=>I(!1)):I(!1),[R,{refetch:I,mutate:b}]}function yo(r,n=po,e){const t=new Map,o=zt(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=Se,d.pure?ae.push(d):Ie.push(d);return s},void 0,!0,Se);return rt(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 ms(r){return Re(r,!1)}function le(r){if(H===null)return r();const n=H;H=null;try{return r()}finally{H=n}}function He(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 je(r){$e(()=>le(r))}function Me(r){return $===null||($.cleanups===null?$.cleanups=[r]:$.cleanups.push(r)),r}function Mt(){return $}function vo(r,n){const e=$,t=H;$=r,H=null;try{return Re(n,!0)}catch(o){ir(o)}finally{$=e,H=t}}function xs(r){const n=H,e=$;return Promise.resolve().then(()=>{H=n,$=e;let t;return Re(r,!1),H=$=null,t?t.done:void 0})}function wo(r,n){const e=Symbol("context");return{id:e,Provider:Ss(e),defaultValue:r}}function bo(r){return $&&$.context&&$.context[r.id]!==void 0?$.context[r.id]:r.defaultValue}function wn(r){const n=ne(r),e=ne(()=>Hn(n()));return e.toArray=()=>{const t=e();return Array.isArray(t)?t:t!=null?[t]:[]},e}let ys;function So(){if(this.sources&&this.state)if(this.state===Se)rt(this);else{const r=ae;ae=null,Re(()=>hn(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 Ao(r,n,e){let t=r.value;return(!r.comparator||!r.comparator(t,n))&&(r.value=n,r.observers&&r.observers.length&&Re(()=>{for(let o=0;o1e6)throw ae=[],new Error},!1)),n}function rt(r){if(!r.fn)return;bn(r);const n=vn;vs(r,r.value,n)}function vs(r,n,e){let t;const o=$,i=H;H=$=r;try{t=r.fn(n)}catch(s){return r.pure&&(r.state=Se,r.owned&&r.owned.forEach(bn),r.owned=null),r.updatedAt=e+1,ir(s)}finally{H=i,$=o}(!r.updatedAt||r.updatedAt<=e)&&(r.updatedAt!=null&&"observers"in r?Ao(r,t):r.value=t,r.updatedAt=e)}function zt(r,n,e,t=Se,o){const i={fn:r,state:t,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:$,context:$?$.context:null,pure:e};return $===null||$!==xo&&($.owned?$.owned.push(i):$.owned=[i]),i}function dn(r){if(r.state===0)return;if(r.state===cn)return hn(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===Se)rt(r);else if(r.state===cn){const t=ae;ae=null,Re(()=>hn(r,n[0]),!1),ae=t}}function Re(r,n){if(ae)return r();let e=!1;n||(ae=[]),Ie?e=!0:Ie=[],vn++;try{const t=r();return ws(e),t}catch(t){e||(Ie=null),ae=null,ir(t)}}function ws(r){if(ae&&(Co(ae),ae=null),r)return;const n=Ie;Ie=null,n.length&&Re(()=>mo(n),!1)}function Co(r){for(let n=0;n=0;n--)bn(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}function _o(r){return r instanceof Error?r:new Error(typeof r=="string"?r:"Unknown error",{cause:r})}function ir(r,n=$){throw _o(r)}function Hn(r){if(typeof r=="function"&&!r.length)return Hn(r());if(Array.isArray(r)){const n=[];for(let e=0;eo=le(()=>($.context={...$.context,[r]:t.value},wn(()=>t.children))),void 0),o}}const As=Symbol("fallback");function Rr(r){for(let n=0;n1?[]:null;return Me(()=>Rr(i)),()=>{let c=r()||[],d,u;return c[fs],le(()=>{let y=c.length,b,x,w,S,A,p,m,v,T;if(y===0)s!==0&&(Rr(i),i=[],t=[],o=[],s=0,a&&(a=[])),e.fallback&&(t=[As],o[0]=ft(R=>(i[0]=R,e.fallback())),s=1);else if(s===0){for(o=new Array(y),u=0;u=p&&v>=p&&t[m]===c[v];m--,v--)w[v]=o[m],S[v]=i[m],a&&(A[v]=a[m]);for(b=new Map,x=new Array(v+1),u=v;u>=p;u--)T=c[u],d=b.get(T),x[u]=d===void 0?-1:d,b.set(T,u);for(d=p;d<=m;d++)T=t[d],u=b.get(T),u!==void 0&&u!==-1?(w[u]=o[d],S[u]=i[d],a&&(A[u]=a[d]),u=x[u],b.set(T,u)):i[d]();for(u=p;ur(n||{}))}function Vt(){return!0}const jn={get(r,n,e){return n===an?e:r.get(n)},has(r,n){return n===an?!0:r.has(n)},set:Vt,deleteProperty:Vt,getOwnPropertyDescriptor(r,n){return{configurable:!0,enumerable:!0,get(){return r.get(n)},set:Vt,deleteProperty:Vt}},ownKeys(r){return r.keys()}};function En(r){return(r=typeof r=="function"?r():r)?r:{}}function Ts(){for(let r=0,n=this.length;r=0;a--){const c=En(r[a])[s];if(c!==void 0)return c}},has(s){for(let a=r.length-1;a>=0;a--)if(s in En(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:Ts.bind(e[u]=[g.get.bind(a)])}:g.value!==void 0?g:void 0;else{const y=e[u];y&&(g.get?y.push(g.get.bind(a)):g.value!==void 0&&y.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 _s(r,...n){if(an 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)}},jn));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))}},jn)),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 Is=r=>"Stale read from <".concat(r,">.");function Sn(r){const n="fallback"in r&&{fallback:()=>r.fallback};return ne(Cs(()=>r.each,r.children,n||void 0))}function Be(r){const n=r.keyed,e=ne(()=>r.when,void 0,{equals:(t,o)=>n?t===o:!t==!o});return ne(()=>{const t=e();if(t){const o=r.children;return typeof o=="function"&&o.length>0?le(()=>o(n?t:()=>{if(!le(e))throw Is("Show");return r.when})):o}return r.fallback},void 0,void 0)}const Rs=void 0;let Le,ar;function Bs(r={},n="app"){const e=new us;return Le=new qi(r,n,e),ar=Le.createShader.bind(Le),Le}class ks extends Array{constructor(e){super();h(this,"_parent");this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){const o=this.indexOf(t);this.splice(o,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){const t=this.indexOf(e);t>=0&&this.splice(t,1)}}function Es(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!1}const Fs=Es()||!1,Ae={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Br(r){return Ns(r)&&r.debug}function Ze(r,n,...e){Fs&&(Ae.debug||Br(n)||Br(e[0]))&&console.log(r,n,...e)}function vt(r){return typeof r=="function"}function Ns(r){return typeof r=="object"}function un(r){return Array.isArray(r)}function Ls(r){return typeof r=="string"}function Ms(r){return typeof r=="number"}function zs(r){return Number.isInteger(r)}function Ps(r,n){for(const e of n)if(e in r)return!0;return!1}function Ro(r,n={}){if(un(r))r.forEach(e=>{Ro(e,n)});else if(r)for(const e in r)n[e]===void 0&&(n[e]=r[e]);return n}class kr extends Array{constructor(e,t={}){var n=(...ld)=>(super(...ld),h(this,"onChange"),this);return un(t)?n(...t):Ls(t)?n(t):n(...Object.entries(t).filter(([o,i])=>i).map(([o])=>o)),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){const t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}function Ds(r){const n=[];for(let p=0;pp+(m[i]||0),0));const A=y&&w?p=>{w==="flexStart"?p[u]=0:w==="center"?p[u]=(y-(p[s]||0))/2:w==="flexEnd"&&(p[u]=y-(p[s]||0))}:p=>p;if(x==="flexStart"){let p=0;if(n.forEach(m=>{m[d]=p+(m[a]||0),p+=(m[i]||0)+b+(m[a]||0)+(m[c]||0),A(m)}),r._autosized){const m=p-b;if(m!==r[i])return r[i]=m,!0}}else if(x==="flexEnd"){let p=g;for(let m=e-1;m>=0;m--){const v=n[m];F(v),v[d]=p-(v[i]||0)-(v[c]||0),p-=(v[i]||0)+b+(v[a]||0)+(v[c]||0),A(v)}}else if(x==="center"){let p=(g-(S+b*(e-1)))/2;n.forEach(m=>{m[d]=p,p+=(m[i]||0)+b,A(m)})}else if(x==="spaceBetween"){const p=(g-S)/(e-1);let m=0;n.forEach(v=>{v[d]=m,m+=(v[i]||0)+p,A(v)})}else if(x==="spaceEvenly"){const p=(g-S)/(e+1);let m=p;n.forEach(v=>{v[d]=m,m+=(v[i]||0)+p,A(v)})}return!1}const[lr,Qn]=U(void 0),{animationSettings:Os}=Ae;function Er(r){const n=[];for(const[e,t]of Object.entries(r))n.push({type:e,props:t});return ar("DynamicShader",{effects:n})}function wt(r=""){return{set(n){Ms(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 Us=["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"],Ws=["clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"];class we extends Object{constructor(e){super();h(this,"id");h(this,"debug");h(this,"name");h(this,"lng");h(this,"renderer");h(this,"selected");h(this,"rendered");h(this,"autofocus");h(this,"flexItem");h(this,"_queueDelete");h(this,"forwardFocus");h(this,"_undoStyles");h(this,"_renderProps");h(this,"_effects");h(this,"_parent");h(this,"_shader");h(this,"_style");h(this,"_states");h(this,"_events");h(this,"_animationSettings");h(this,"_width");h(this,"_height");h(this,"_color");h(this,"_borderRadius");h(this,"_border");h(this,"_borderLeft");h(this,"_borderRight");h(this,"_borderTop");h(this,"_borderBottom");h(this,"_autosized");h(this,"_isDirty");h(this,"_animationQueue",[]);h(this,"_animationQueueSettings");h(this,"_animationRunning",!1);h(this,"children");this.name=e,this.rendered=!1,this.autofocus=!1,this._renderProps={x:0,y:0},this.children=new ks(this)}get effects(){return this._effects}set effects(e){this._effects=e,this.rendered&&(this.shader=Er(e))}get parent(){return this._parent}set parent(e){var t;this._parent=e,this.rendered&&this.lng&&(this.lng.parent=(t=e==null?void 0:e.lng)!=null?t:null)}get shader(){return this._shader}set shader(e){un(e)?this._shader=ar(...e):this._shader=e,this._sendToLightning("shader",this._shader)}_sendToLightningAnimatable(e,t){if(this.lng){if(Ae.animationsEnabled&&this.transition&&(this.transition===!0||this.transition[e])){const o=this.transition===!0||this.transition[e]===!0?void 0:this.transition[e];return this.animate({[e]:t},o).start()}this.lng[e]=t}else this._renderProps[e]=t}_sendToLightning(e,t){this.rendered&&this.lng?this.lng[e]=t:this._renderProps[e]=t}animate(e,t){return F(this.lng,"Node must be rendered before animating"),this.lng.animate(e,t||this.animationSettings)}chain(e,t){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),t?this._animationQueueSettings=t:this._animationQueueSettings||(this._animationQueueSettings=t||this.animationSettings),t=t||this._animationQueueSettings,this._animationQueue.push({props:e,animationSettings:t}),this}async start(){let e=this._animationQueue.shift();for(;e;)this._animationRunning=!0,await this.animate(e.props,e.animationSettings).start().waitUntilStopped(),e=this._animationQueue.shift();this._animationRunning=!1,this._animationQueueSettings=void 0}setFocus(){if(this.rendered){if(this.forwardFocus!==void 0)if(vt(this.forwardFocus)){if(this.forwardFocus.call(this,this)!==!1)return}else{const e=typeof this.forwardFocus=="number"?this.forwardFocus:null;if(e!==null&&eQn(this))}else this.autofocus=!0}isTextNode(){return this.name==="text"}_resizeOnTextLoad(){this.lng.on("loaded",(e,t)=>{if(t.type==="text"){const{dimensions:o}=t;this.parent.updateLayout(this,o)}})}getText(){return this.children.map(e=>e.text).join("")}destroy(){var e;this._queueDelete&&((e=this.lng)==null||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){un(e)?this._style=Ro(e):this._style=e;for(const t in this._style)this[t]===void 0&&(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){for(const t of this.children){if(t.id===e)return t;if(t instanceof we){const o=t.searchChildrenById(e);if(o)return o}}}set states(e){this._states=new kr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new kr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||Os}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){var o;this.hasChildren&&(Ze("Layout: ",this),vt(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),this.display==="flex"&&Ds(this)&&((o=this.parent)==null||o.updateLayout()),vt(this.onLayout)&&this.onLayout.call(this,e,t))}_stateChanged(){if(Ze("State Changed: ",this,this.states),this.forwardStates){const t=this.states.slice();this.children.forEach(o=>o.states=t)}const e=this.states;if(this._undoStyles||this.style&&Ps(this.style,e)){this._undoStyles=this._undoStyles||[];const t={};this._undoStyles.forEach(i=>{t[i]=this.style[i]});const o=e.reduce((i,s)=>{const a=this.style[s];return a&&(i={...i,...a}),i},{});this._undoStyles=Object.keys(o),o.transition!==void 0&&(this.transition=o.transition),Object.assign(this,{...t,...o})}}render(){const e=this,t=this.parent;if(!t){console.warn("Parent not set - no node created for: ",this);return}if(!t.rendered){console.warn("Parent not rendered yet: ",this);return}if(this.rendered){console.warn("Node already rendered: ",this);return}t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();let o=e._renderProps;t.lng&&(o.parent=t.lng),e._effects&&(this.shader=Er(e._effects)),e.isTextNode()?(o={...Ae.fontSettings,...o,text:e.getText()},o.contain&&(o.width||(o.width=(t.width||0)-(o.x||0)-(o.marginRight||0),e._width=o.width,e._autosized=!0),o.contain==="both"&&!o.height&&!o.maxLines&&(o.height=(t.height||0)-(o.y||0)-(o.marginBottom||0),e._height=o.height,e._autosized=!0)),Ze("Rendering: ",this,o),e.lng=Le.createTextNode(o),vt(e.onLoad)&&e.lng.on("loaded",e.onLoad),(!e.width||!e.height)&&(e._autosized=!0,e._resizeOnTextLoad())):(o.texture||(isNaN(o.width)&&(o.width=(t.width||0)-(o.x||0),e._width=o.width,e._autosized=!0),isNaN(o.height)&&(o.height=(t.height||0)-(o.y||0),e._height=o.height,e._autosized=!0),!o.color&&!o.src&&(e._color=o.color=0)),Ze("Rendering: ",this,o),e.lng=Le.createNode(o),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,vt(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach(([i,s])=>{var a;(a=e.lng)==null||a.on(i,(c,d)=>s(e,d))}),e.lng.div&&(e.lng.div.solid=e),delete this._renderProps,e.name!=="text"&&e.children.forEach(i=>{i.render?i.render():i.text!==""&&console.warn("TextNode outside of : ",i)}),e.autofocus&&e.setFocus()}}for(const r of Us)Object.defineProperty(we.prototype,r,{get(){var n;return(n=this.lng&&this.lng[r])!=null?n:this["_".concat(r)]},set(n){this["_".concat(r)]=n,this._sendToLightningAnimatable(r,n)}});for(const r of Ws)Object.defineProperty(we.prototype,r,{get(){var n;return(n=this.lng&&this.lng[r])!=null?n:this["_".concat(r)]},set(n){this["_".concat(r)]=n,this._sendToLightning(r,n)}});Object.defineProperties(we.prototype,{borderRadius:{set(r){this._borderRadius=r,this.effects={...this.effects||{},radius:{radius:r}}},get(){return this._borderRadius}},border:wt(),borderLeft:wt("Left"),borderRight:wt("Right"),borderTop:wt("Top"),borderBottom:wt("Bottom")});Object.defineProperties(we.prototype,{linearGradient:{set(r={}){this._linearGradient=r,this.effects={...this.effects||{},linearGradient:r}},get(){return this._linearGradient}}});const N=r=>(()=>{var n=Pt("text");return An(n,r,!1),n})(),M=r=>(()=>{var n=Pt("node");return An(n,r,!1),n})();function Ys({createElement:r,createTextNode:n,isTextNode:e,replaceText:t,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:c,getNextSibling:d}){function u(p,m,v,T){if(v!==void 0&&!T&&(T=[]),typeof m!="function")return g(p,m,T,v);_e(R=>g(p,m(),R,v),T)}function g(p,m,v,T,R){for(;typeof v=="function";)v=v();if(m===v)return v;const I=typeof m,C=T!==void 0;if(I==="string"||I==="number")if(I==="number"&&(m=m.toString()),C){let _=v[0];_&&e(_)?t(_,m):_=n(m),v=x(p,v,T,_)}else v!==""&&typeof v=="string"?t(c(p),v=m):(x(p,v,T,n(m)),v=m);else if(m==null||I==="boolean")v=x(p,v,T);else{if(I==="function")return _e(()=>{let _=m();for(;typeof _=="function";)_=_();v=g(p,_,v,T)}),()=>v;if(Array.isArray(m)){const _=[];if(y(_,m,R))return _e(()=>v=g(p,_,v,T,!0)),()=>v;if(_.length===0){const E=x(p,v,T);if(C)return v=E}else Array.isArray(v)?v.length===0?w(p,_,T):b(p,v,_):v==null||v===""?w(p,_):b(p,C&&v||[c(p)],_);v=_}else{if(Array.isArray(v)){if(C)return v=x(p,v,T,m);x(p,v,null,m)}else v==null||v===""||!c(p)?o(p,m):S(p,m,c(p));v=m}}return v}function y(p,m,v){let T=!1;for(let R=0,I=m.length;Rk-_){const W=m[C];for(;_=0;C--){const _=m[C];if(R!==_){const E=a(_)===p;!I&&!C?E?S(p,R,_):o(p,R,v):E&&i(p,_)}else I=!0}}else o(p,R,v);return[R]}function w(p,m,v){for(let T=0,R=m.length;Tv.children=g(p,m.children,v.children)),_e(()=>m.ref&&m.ref(p)),_e(()=>{for(const R in m){if(R==="children"||R==="ref")continue;const I=m[R];I!==v[R]&&(s(p,R,I,v[R]),v[R]=I)}}),v}return{render(p,m){let v;return ft(T=>{v=T,u(m,p())}),v},insert:u,spread(p,m,v){typeof m=="function"?_e(T=>A(p,m(),T,v)):A(p,m,void 0,v)},createElement:r,createTextNode:n,insertNode:o,setProp(p,m,v,T){return s(p,m,v,T),v},mergeProps:sr,effect:_e,memo:ne,createComponent:Io,use(p,m,v){return le(()=>p(m,v))}}}function $s(r){const n=Ys(r);return n.mergeProps=sr,n}const Hs={createElement(r){return new we(r)},createTextNode(r){return{name:"TextNode",text:r,parent:void 0}},replaceText(r,n){Ze("Replace Text: ",r,n),r.text=n;const e=r.parent;F(e),e.text=e.getText()},setProperty(r,n,e=!0){r[n]=e},insertNode(r,n,e){Ze("INSERT: ",r,n,e),r.children.insert(n,e),n._queueDelete=!1,n instanceof we?r.rendered&&n.render():r.isTextNode()&&(r.text=r.getText())},isTextNode(r){return r.isTextNode()},removeNode(r,n){Ze("REMOVE: ",r,n),r.children.remove(n),n._queueDelete=!0,n instanceof we&&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 Kn;function cr(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Kn=window.history.state._depth}cr();function Gs(r){return{...r,_depth:window.history.state&&window.history.state._depth}}function qs(r,n){let e=!1;return()=>{const t=Kn;cr();const o=t==null?null:Kn-t;if(e){e=!1;return}o&&n(o)?(e=!0,window.history.go(-o)):r()}}const Zs=/^(?:[a-z0-9]+:)?\/\//i,Js=/^\/+|(\/)\/+$/g,No="http://sr";function Rt(r,n=!1){const e=r.replace(Js,"$1");return e?n||/^[?#]/.test(e)?e:"/"+e:""}function on(r,n,e){if(Zs.test(n))return;const t=Rt(r),o=e&&Rt(e);let i="";return!o||n.startsWith("/")?i=t:o.toLowerCase().indexOf(t.toLowerCase())!==0?i=t+o:i=o,(i||"/")+Rt(n,!i)}function ea(r,n){if(r==null)throw new Error(n);return r}function ta(r,n){return Rt(r).replace(/\/*(\*.*)?$/g,"")+Rt(n)}function Lo(r){const n={};return r.searchParams.forEach((e,t)=>{n[t]=e}),n}function na(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=y=>e===void 0?void 0:e[y];for(let y=0;yt.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 ra(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 Mo(r){const n=new Map,e=Mt();return new Proxy({},{get(t,o){return n.has(o)||vo(e,()=>n.set(o,ne(()=>r()[o]))),n.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(r())}})}function zo(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 zo(t).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const oa=100,Po=wo(),Do=wo(),Oo=()=>ea(bo(Po)," and 'use' router primitives can be only used inside a Route."),mt=()=>Oo().navigatorFactory(),dr=()=>Oo().params;function ia(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 Uo(r.path).reduce((c,d)=>{for(const u of zo(d)){const g=ta(n,u);let y=s?g:g.split("/*",1)[0];y=y.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),c.push({...a,originalPath:u,pattern:y,matcher:na(y,!s,r.matchFilters)})}return c},[])}function sa(r,n=0){return{routes:r,score:ra(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 Uo(r){return Array.isArray(r)?r:[r]}function Wo(r,n="",e=[],t=[]){const o=Uo(r);for(let i=0,s=o.length;is.score-i.score)}function Nr(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=ne(()=>t().pathname),i=ne(()=>t().search,!0),s=ne(()=>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:Mo(He(i,()=>Lo(t())))}}let We;function la(r,n,e,t={}){const{signal:[o,i],utils:s={}}=r,a=s.parsePath||(k=>k),c=s.renderPath||(k=>k),d=s.beforeLeave||Fo(),u=on("",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,y]=U(!1),b=async k=>{y(!0);try{await xs(k)}finally{y(!1)}},[x,w]=U(o().value),[S,A]=U(o().state),p=aa(x,S),m=[],v=U([]),T=ne(()=>Nr(n(),p.pathname)),R=Mo(()=>{const k=T(),z={};for(let O=0;Ou,outlet:()=>null,resolvePath(k){return on(u,k)}};return _e(()=>{const{value:k,state:z}=o();le(()=>{k!==x()&&b(()=>{We="native",w(k),A(z),v[1]([])}).then(()=>{We=void 0})})}),{base:I,location:p,params:R,isRouting:g,renderPath:c,parsePath:a,navigatorFactory:_,matches:T,beforeLeave:d,preloadRoute:P,singleFlight:t.singleFlight===void 0?!0:t.singleFlight,submissions:v};function C(k,z,O){le(()=>{if(typeof z=="number"){z&&(s.go?s.go(z):console.warn("Router integration does not support relative routing"));return}const{replace:D,resolve:W,scroll:j,state:se}={replace:!1,resolve:!0,scroll:!0,...O},te=W?k.resolvePath(z):on("",z);if(te===void 0)throw new Error("Path '".concat(z,"' is not a routable path"));if(m.length>=oa)throw new Error("Too many redirects");const de=x();if((te!==de||se!==S())&&!Vs){if(d.confirm(te,O)){const Ce=m.push({value:de,replace:D,scroll:j,state:S()});b(()=>{We="navigate",w(te),A(se),v[1]([])}).then(()=>{m.length===Ce&&(We=void 0,E({value:te,state:se}))})}}})}function _(k){return k=k||bo(Do)||I,(z,O)=>C(k,z,O)}function E(k){const z=m[0];z&&((k.value!==z.value||k.state!==z.state)&&i({...k,replace:z.replace,scroll:z.scroll}),m.length=0)}function P(k,z){const O=Nr(n(),k.pathname),D=We;We="preload";for(let W in O){const{route:j,params:se}=O[W];j.component&&j.component.preload&&j.component.preload();const{load:te}=j;z&&te&&vo(e(),()=>te({params:se,location:{pathname:k.pathname,search:k.search,hash:k.hash,query:Lo(k),state:null,key:""},intent:"preload"}))}We=D}}function ca(r,n,e,t){const{base:o,location:i,params:s}=r,{pattern:a,component:c,load:d}=t().route,u=ne(()=>t().path);c&&c.preload&&c.preload();const g=d?d({params:s,location:i,intent:We||"initial"}):void 0;return{parent:n,pattern:a,path:u,outlet:()=>c?Io(c,{params:s,location:i,data:g,get children(){return e()}}):e(),resolvePath(b){return on(o.path(),b,u())}}}const da=r=>n=>{const{base:e}=n,t=wn(()=>n.children),o=ne(()=>Wo(t(),n.base||""));let i;const s=la(r,o,()=>i,{base:e,singleFlight:n.singleFlight});return r.create&&r.create(s),l(Po.Provider,{value:s,get children(){return l(ha,{routerState:s,get root(){return n.root},get load(){return n.rootLoad},get children(){return[pt(()=>(i=Mt())&&null),l(ua,{routerState:s,get branches(){return o()}})]}})}})};function ha(r){const n=r.routerState.location,e=r.routerState.params,t=ne(()=>r.load&&le(()=>r.load({params:e,location:n,intent:"preload"})));return l(Be,{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 ua(r){const n=[];let e;const t=ne(He(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]=b,c[d]=ca(r.routerState,c[d-1]||r.routerState.base,Lr(()=>t()[d+1]),()=>r.routerState.matches()[d])}))}return n.splice(o.length).forEach(d=>d()),s&&a?s:(e=c[0],c)}));return Lr(()=>t()&&e)()}const Lr=r=>()=>l(Be,{get when(){return r()},keyed:!0,children:n=>l(Do.Provider,{value:n,get children(){return n.outlet()}})}),ue=r=>{const n=wn(()=>r.children);return sr(r,{get children(){return n()}})};function fa([r,n],e,t){return[e?()=>e(r()):r,t?o=>n(t(o)):n]}function ga(r){if(r==="#")return null;try{return document.querySelector(r)}catch(n){return null}}function pa(r){let n=!1;const e=o=>typeof o=="string"?{value:o}:o,t=fa(U(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})),da({signal:t,create:r.create,utils:r.utils})}function ma(r,n,e){return r.addEventListener(n,e),()=>r.removeEventListener(n,e)}function xa(r,n){const e=ga("#".concat(r));e?e.scrollIntoView():n&&window.scrollTo(0,0)}const ya=new Map;function va(r=!0,n=!1,e="/_server"){return t=>{const o=t.base.path(),i=t.navigatorFactory(t.base);let s={};function a(x){return x.namespaceURI==="http://www.w3.org/2000/svg"}function c(x){if(x.defaultPrevented||x.button!==0||x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)return;const w=x.composedPath().find(T=>T instanceof Node&&T.nodeName.toUpperCase()==="A");if(!w||n&&!w.hasAttribute("link"))return;const S=a(w),A=S?w.href.baseVal:w.href;if((S?w.target.baseVal:w.target)||!A&&!w.hasAttribute("state"))return;const m=(w.getAttribute("rel")||"").split(/\s+/);if(w.hasAttribute("download")||m&&m.includes("external"))return;const v=S?new URL(A,document.baseURI):new URL(A);if(!(v.origin!==window.location.origin||o&&v.pathname&&!v.pathname.toLowerCase().startsWith(o.toLowerCase())))return[w,v]}function d(x){const w=c(x);if(!w)return;const[S,A]=w,p=t.parsePath(A.pathname+A.search+A.hash),m=S.getAttribute("state");x.preventDefault(),i(p,{resolve:!1,replace:S.hasAttribute("replace"),scroll:!S.hasAttribute("noscroll"),state:m&&JSON.parse(m)})}function u(x){const w=c(x);if(!w)return;const[S,A]=w;s[A.pathname]||t.preloadRoute(A,S.getAttribute("preload")!=="false")}function g(x){const w=c(x);if(!w)return;const[S,A]=w;s[A.pathname]||(s[A.pathname]=setTimeout(()=>{t.preloadRoute(A,S.getAttribute("preload")!=="false"),delete s[A.pathname]},200))}function y(x){const w=c(x);if(!w)return;const[,S]=w;s[S.pathname]&&(clearTimeout(s[S.pathname]),delete s[S.pathname])}function b(x){let w=x.submitter&&x.submitter.hasAttribute("formaction")?x.submitter.getAttribute("formaction"):x.target.getAttribute("action");if(!w)return;if(!w.startsWith("https://action/")){const A=new URL(w,No);if(w=t.parsePath(A.pathname+A.search),!w.startsWith(e))return}if(x.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const S=ya.get(w);if(S){x.preventDefault();const A=new FormData(x.target);x.submitter&&x.submitter.name&&A.append(x.submitter.name,x.submitter.value),S.call({r:t,f:x.target},A)}}Ks(["click","submit"]),document.addEventListener("click",d),r&&(document.addEventListener("mouseover",g),document.addEventListener("mouseout",y),document.addEventListener("focusin",u),document.addEventListener("touchstart",u)),document.addEventListener("submit",b),Me(()=>{document.removeEventListener("click",d),r&&(document.removeEventListener("mouseover",g),document.removeEventListener("mouseout",y),document.removeEventListener("focusin",u),document.removeEventListener("touchstart",u)),document.removeEventListener("submit",b)})}}function wa(r){const n=r.replace(/^.*?#/,"");if(!n.startsWith("/")){const[,e="/"]=window.location.hash.split("#",2);return"".concat(e,"#").concat(n)}return n}function ba(r){const n=()=>window.location.hash.slice(1),e=Fo();return pa({get:n,set({value:t,replace:o,scroll:i,state:s}){o?window.history.replaceState(Gs(s),"","#"+t):window.location.hash=t;const a=t.indexOf("#"),c=a>=0?t.slice(a+1):"";xa(c,i),cr()},init:t=>ma(window,"hashchange",qs(t,o=>!e.confirm(o&&o<0?o:n()))),create:va(r.preload,r.explicitLinks,r.actionBase),utils:{go:t=>window.history.go(t),renderPath:t=>"#".concat(t),parsePath:wa,beforeLeave:e}})(r)}var Sa=!!Rs,Aa=Sa?r=>Mt()?Me(r):r:Me;function Ca(r,n,e,t){return r.addEventListener(n,e,t),Aa(r.removeEventListener.bind(r,n,e,t))}function Ta(r,n=Mt()){let e=0,t,o;return()=>(e++,Me(()=>{e--,queueMicrotask(()=>{!e&&o&&(o(),o=t=void 0)})}),o||ft(i=>t=r(o=i),n),t)}var _a=Ta(()=>{const[r,n]=U(null);return Ca(window,"keydown",e=>{n(e),setTimeout(()=>n(null))}),r});function Gt(r){return typeof r=="function"}function Ia(r){return Array.isArray(r)}const qt={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},[fn,Ra]=U([]),Ba=r=>{const n=_a();if(r)for(const[e,t]of Object.entries(r))Ia(t)?t.forEach(o=>{qt[o]=e}):qt[t]=e;return $e(He(lr,(e,t,o=[])=>{let i=e;const s=[];for(;i;)i.states.has("focus")||(i.states.add("focus"),Gt(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"),Gt(a.onBlur)&&a.onBlur.call(a,e,t))}),Ra(s),s},{defer:!0})),$e(()=>{const e=n();if(e){const t=qt[e.key]||qt[e.keyCode];le(()=>{const o=fn();let i;for(const s of o){if(i=i||s,t){const a=s["on".concat(t)];if(Gt(a)&&a.call(s,e,s,i)===!0)break}else console.log("Unhandled key event: ".concat(e.key));if(Gt(s.onKeyPress)&&s.onKeyPress.call(s,e,t,s,i)===!0)break}return!1})}}),fn};function Yo(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,y)=>g+(y.width||0),0)+o+i;const d=r.children[0];d&&(d.x=o,d.marginLeft=o);let u=0;r.children.forEach(g=>{g.y=t,g.marginTop=t,u=Math.max(u,g.height||0)}),r.height=u+t+s}}}function ka(r=[]){const n=[];let e;for(e=0;e{setTimeout(n,r)})}function Ea(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 Xn(r,n,e=!0){const t=window.speechSynthesis,o=ka(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 Mr(u)}else if(typeof d=="string"&&d.length){let g=3;for(;a&&g>0;)try{await Ea(d,s,n),g=0}catch(y){if(y instanceof SpeechSynthesisErrorEvent)if(y.error==="network")g--,console.warn("Speech synthesis network error. Retries left: ".concat(g)),await Mr(500*(3-g));else if(y.error==="canceled"||y.error==="interrupted")g=0;else throw new Error("SpeechSynthesisErrorEvent: ".concat(y.error));else throw y}}else if(typeof d=="function"){const u=Xn(d(),n,!1);i.push(u),await u.series}else if(Array.isArray(d)){const u=Xn(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 Zt;function Fa(r,n="en-US"){return Zt&&Zt.cancel(),Zt=Xn(r,n),Zt}var hr=(r,n)=>{let e;const t=()=>clearTimeout(e);return Mt()&&Me(t),Object.assign((...i)=>{e!==void 0&&t(),e=setTimeout(()=>r(...i),n)},{clear:t})};let Vn,Bt=[],Te,Gn=!1;const Na=3e5;function zr(r,n){const e=hr(r,n);let t;const o=i=>{t=i,e(i)};return o.flush=()=>{e.clear(),r(t)},o.clear=e.clear,o}function bt(r){return r.id||r.name}function La(r=[]){if(!oe.onFocusChange||!oe.enabled)return;const n=r.every(i=>!i.loading),e=r.filter(i=>!Bt.includes(i));if(Vn(),!n&&oe.onFocusChange){oe.onFocusChange([]);return}Bt=r.slice(0);const t=[],o=e.reduce((i,s)=>(s.announce?(i.push([bt(s),"Announce",s.announce]),t.push(s.announce)):s.title?(i.push([bt(s),"Title",s.title]),t.push(s.title)):i.push([bt(s),"No Announce",""]),i),[]);if(e.reverse().reduce((i,s)=>(s.announceContext?(i.push([bt(s),"Context",s.announceContext]),t.push(s.announceContext)):i.push([bt(s),"No Context",""]),i),o),oe.debug&&console.table(o),t.length)return oe.speak(t.reduce((i,s)=>i.concat(s),[]))}function Ma(r){if(!Gn)return Te=Fa(r)}const oe={debug:!1,enabled:!0,cancel:function(){Te&&Te.cancel()},clearPrevFocus:function(r=0){Bt=Bt.slice(0,r),Vn()},speak:function(r,{append:n=!1,notification:e=!1}={}){return oe.onFocusChange&&oe.enabled&&(oe.onFocusChange.flush(),n&&Te&&Te.active?Te.append(r):(oe.cancel(),Ma(r)),e&&(Gn=!0,Te==null||Te.series.finally(()=>{Gn=!1,oe.refresh()}).catch(console.error))),Te},refresh:function(r=0){oe.clearPrevFocus(r),oe.onFocusChange&&oe.onFocusChange(le(()=>fn()))},setupTimers:function({focusDebounce:r=400,focusChangeTimeout:n=Na}={}){oe.onFocusChange=zr(La,r),Vn=zr(()=>{Bt=[]},n)}},za=()=>(oe.setupTimers(),$e(He(fn,oe.onFocusChange,{defer:!0})),oe);function Pa(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[Da,Ee]=U(""),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,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAA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5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+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+s4CIEnHAPgugHs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rDzI6yzU7s90EUPNBxtnR4SjwrgGo9EK1Qca8cM4ByU4mkuz++F93ZHELyZX3iW31n+S+sKWZWfNBxkCbNeUq6ekArugo1I0kH1xT8EkBKj1R80HGGkFbtZVkZ3bb2d2r0tUkn1hTh8kBKhB9DMBLnQWfJMjoLFuTZpJsO/ONAB7UUcBLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function Oa(){let r,n,e,t=0;const o=1,i={duration:750,easing:"ease-in-out"},s={alpha:o,color:4294967295};function a(d){if(d.startsWith("#")){r.color=L(d),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=d,t=1;return}if(t===1){n.src=d,t=2,n.alpha=0,n.animate({alpha:o},i).start(),r.animate({alpha:0},i).start();return}t===2&&(r.src=d,t=1,r.alpha=0,r.animate({alpha:o},i).start(),n.animate({alpha:0},i).start())}const c=hr(a,400);return $e(He(Da,d=>{c(d)},{defer:!0})),l(M,{width:1920,height:1080,zIndex:-5,get children(){return[l(M,{ref(d){var u=r;typeof u=="function"?u(d):r=d},style:s}),l(M,{ref(d){var u=n;typeof u=="function"?u(d):n=d},style:s,alpha:0}),l(M,{ref(d){var u=e;typeof u=="function"?u(d):e=d},src:"./assets/hero-mask-inverted.png",get color(){return L(f.color.materialBrand)},width:1920,height:1080})]}})}var Pr,Dr,Or,Ur,Wr,Yr,$r,Hr,jr,Qr,Kr,Xr,Vr,Gr,qr,Zr;const Ua=["focus","disabled"],Wa=["brand","inverse","neutral"];function Y({themeKeys:r,base:n,modes:e,tones:t,themeStyles:o,modeKeys:i=Ua,toneKeys:s=Wa},a=!1){const c=(x,w,S)=>{const A=s.map(p=>{var T,R;const m={};return new Set([].concat.apply([],[(T=x==null?void 0:x[p])!=null?T:{},(R=w==null?void 0:w[p])!=null?R:{}].map(Object.keys))).forEach(I=>{var E;var C,_;i.includes(I)||(m[I]=(E=(C=w==null?void 0:w[p])==null?void 0:C[I])!=null?E:(_=x==null?void 0:x[p])==null?void 0:_[I])}),i.forEach(I=>{var C,_;m[I]={...S[I],...(C=x==null?void 0:x[p])==null?void 0:C[I],...(_=w==null?void 0:w[p])==null?void 0:_[I]}}),[p,m]});return Object.fromEntries(A)},d=(x,w)=>{const S=i.map(p=>[p,{...x==null?void 0:x[p],...w==null?void 0:w[p]}]);return Object.fromEntries(S)},u=(x,w)=>({...x,...w.base}),g=x=>Object.fromEntries(Object.entries(r).filter(([w,S])=>x[S]).map(([w,S])=>[w,x[S]])),y=x=>Object.fromEntries(Object.entries(x).map(([S,A])=>{const p=g(A);return Object.entries(A).filter(([m,v])=>i.includes(m)).forEach(([m,v])=>{p[m]=g(v)}),[S,p]}));return((x,w,S)=>{const A=y(o);a&&console.log(A);const p=u(x,A);a&&console.log(p);const m=d(w,A);a&&console.log(m);const v=c(S,A,m);return a&&console.log(v),{base:{...p,...m},tones:v}})(n,e,t)}function $o(r=0){return(n,e,t,o)=>{if(n.children.length===0)return;const i=n.gap||0,s=n.scroll||"auto",[a,c]=Ya(n),d=n.flexDirection==="row"?n.x:n.y,u=n.flexDirection==="row"?e.x:e.y,g=n.flexDirection==="row"?e.width:e.height,y=t>o?"positive":"negative";let b=d;s==="auto"?n.scrollIndex!=null&&n.scrollIndex>=0?n.selected>=n.scrollIndex&&(y==="positive"?b=d-g-i:b=d+g+i):(Math.abs(d)+cu?b=-u+r:s==="edge"&&y==="positive"&&Math.abs(d)+c{const n=r.filter(e=>typeof e=="function");if(n.length!==0)return function(...e){for(const t of n)if(t.apply(this,e)===!0)return!0}};function Ho(){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];if(!(r instanceof we))return!1;r.setFocus()}function gn(r){return function(){var n,e;const t=this.children.length,o=this.wrap,i=this.selected||0;if(t===0)return!1;if(r==="right"||r==="down")do if(this.selected=(this.selected||0)%t+1,this.selected>=t){if(!o){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)%t-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=t-1}while((e=this.children[this.selected])!=null&&e.skipFocus);if(this.selected===void 0&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;const s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&i!==void 0){const c=this.children[i].selected||0;s.selected=c{const n=gn("up"),e=gn("down");return l(M,Q(r,{get onUp(){return gt(r.onUp,n)},get onDown(){return gt(r.onDown,e)},get selected(){return r.selected||0},forwardFocus:Ho,get onSelectedChanged(){return gt(r.onSelectedChanged,r.scroll!=="none"?$o(r.y):void 0)},get style(){var t;return[...[r.style].flat(),Nn.Container.tones[(t=r.tone)!=null?t:Nn.tone],Nn.Container.base]}}))},{Label:{defaultTone:Zc,...Qo}={styles:{}}}=($r=f)==null?void 0:$r.componentConfig,il={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:Qo},sl={themeKeys:{color:"textColor"},base:{...f.typography.caption1,color:f.color.textInverse},tones:{inverse:{color:f.color.textNeutral},brand:{color:f.color.textNeutral}},themeStyles:Qo};Y(il);Y(sl);const{Rating:{styles:gr,defaultTone:Jc}={styles:{},defaultTone:"neutral"}}=(Hr=f)==null?void 0:Hr.componentConfig,al={themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:f.spacer.sm},toneModes:{},themeStyles:gr},ll={themeKeys:{color:"textColor"},base:{color:f.color.textNeutral,...f.typography.body2},toneModes:{},themeStyles:gr},cl={themeKeys:{color:"color"},base:{height:f.typography.body2.lineHeight,width:f.typography.body2.lineHeight,color:f.color.fillNeutral,marginRight:f.spacer.sm},toneModes:{},themeStyles:gr};Y(al);Y(cl);Y(ll);const{Details:{defaultTone:ed,...Ko}={styles:{}}}=(jr=f)==null?void 0:jr.componentConfig,dl={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:Ko},hl={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:Ko};Y(dl);Y(hl);const{Metadata:{defaultTone:td,...pr}={styles:{}}}=(Qr=f)==null?void 0:Qr.componentConfig,ul={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:pr},fl={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:pr},gl={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:pr};Y(ul);Y(gl);Y(fl);const{ProgressBar:{defaultTone:nd,...Xo}={styles:{}}}=(Kr=f)==null?void 0:Kr.componentConfig,pl={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:Xo},ml={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:Xo};Y(pl);Y(ml);const{Row:{defaultTone:xl,...yl}={styles:{}}}=(Xr=f)==null?void 0:Xr.componentConfig,vl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:f.layout.gutterX,width:f.layout.screenW,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:yl},wl=Y(vl),St={tone:xl,Container:wl},G=r=>{const n=gn("left"),e=gn("right");return l(M,Q(r,{get selected(){return r.selected||0},get onLeft(){return gt(r.onLeft,n)},get onRight(){return gt(r.onRight,e)},forwardFocus:Ho,get onSelectedChanged(){return gt(r.onSelectedChanged,r.scroll!=="none"?$o(r.x):void 0)},get tone(){var t;return(t=r.tone)!=null?t:St.tone},get style(){return[...[r.style].flat(),St.Container.tones[r.tone||St.tone],St.Container.base]},get states(){var t;return(t=r.tone)!=null?t:St.tone}}))},{Keyboard:{defaultTone:rd,...mr}={styles:{}}}=(Vr=f)==null?void 0:Vr.componentConfig,bl={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:f.spacer.md,screenW:f.layout.screenW,marginX:f.layout.marginX,height:100},themeStyles:mr},Sl={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:mr},Al={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:mr};Y(bl);Y(Sl);Y(Al);const{Key:{defaultTone:od,...Vo}={styles:{}}}=(Gr=f)==null?void 0:Gr.componentConfig,Cl={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.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:Vo},Tl={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:Vo};Y(Cl);Y(Tl);const{Tile:{defaultTone:id,...Cn}={styles:{}}}=(qr=f)==null?void 0:qr.componentConfig,{Surface:{defaultSurfaceTone:sd,..._l}={styles:{}}}=(Zr=f)==null?void 0:Zr.componentConfig,Il={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:{..._l,...Cn}},Rl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Cn},Bl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Cn},kl={themeKeys:{},base:{width:f.spacer.lg*5,height:f.spacer.xxl+f.spacer.md},themeStyles:Cn};Y(Il);Y(Rl);Y(Bl);Y(kl);const qn={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:L("#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:L("#424242")},active:{width:328,height:70}}},El="/solid-demo-app/",Fl=[{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 Nl(r){const n=Pa(El+"assets/icons_white.png",Fl);return l(M,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 Jt(r){return l(M,Q(r,{forwardStates:!0,get style(){return qn.NavButton},get children(){return[l(M,{y:-16,get children(){return l(Nl,{scale:.5,get name(){return r.icon}})}}),l(N,{get style(){return{...f.typography.button1,fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}}},get children(){return r.children}})]}}))}function Ll(r){let n;const e=mt();function t(){n.states.add("focus"),this.children.forEach(i=>i.states.add("active")),this.children.selected.setFocus()}function o(){n.states.remove("focus"),this.selected=0,this.children.forEach(i=>i.states.remove("active"))}return[l(ee,Q(r,{onFocus:t,onBlur:o,get style(){return qn.Column},scroll:"none",get children(){return[l(Jt,{onEnter:()=>e("/browse/all"),icon:"trending",children:"Trending"}),l(Jt,{icon:"movie",onEnter:()=>e("/browse/movie"),children:"Movies"}),l(Jt,{icon:"tv",onEnter:()=>e("/browse/tv"),children:"TV"}),l(Jt,{icon:"experiment",onEnter:()=>e("/examples"),children:"Examples"})]}})),l(M,{ref(i){var s=n;typeof s=="function"?s(i):n=i},get style(){return qn.Gradient}})]}const Ml={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},en={x:10,fontSize:36,textColor:L("#ffffff")},tn={fontSize:36,textColor:L("#ffffff")},[zl,Pl]=U(0),[Dl,Ol]=U(0),[Ul,Go]=U(99),[Wl,Yl]=U(0);let Zn=0,Jn=0;const $l=hr(()=>{Jn=0,Zn=0,Go(99)},1e4),Hl=r=>{r&&(Pl(r),Go(n=>Math.min(r,n)),Yl(n=>Math.max(r,n)),Jn+=r,Zn++,Ol(Math.round(Jn/Zn)),$l())};function jl(r){r.renderer.on("fpsUpdate",(n,e)=>{const t=typeof e=="number"?e:e.fps;t>5&&Hl(t)})}const Ql=r=>l(M,Q(r,{style:Ml,get children(){return[l(M,{get children(){return[l(N,{style:en,children:"FPS:"}),l(N,{style:tn,x:94,get children(){return zl().toString()}})]}}),l(M,{x:160,get children(){return[l(N,{style:en,children:"AVG:"}),l(N,{style:tn,x:104,get children(){return Dl().toString()}})]}}),l(M,{x:0,y:40,get children(){return[l(N,{style:en,children:"MIN:"}),l(N,{style:tn,x:94,get children(){return Ul().toString()}})]}}),l(M,{x:160,y:40,get children(){return[l(N,{style:en,children:"MAX:"}),l(N,{style:tn,x:104,get children(){return Wl().toString()}})]}})]}})),Kl=r=>{Ba({Announcer:"a",Menu:"m",Escape:"Escape"});const n=za();n.enabled=!1;const e=mt();let t,o;return je(()=>{jl({renderer:Le})}),l(M,{onAnnouncer:()=>n.enabled=!n.enabled,onLast:()=>history.back(),onMenu:()=>e("/"),style:{width:1920,height:1080},onLeft:()=>{if(t.states.has("focus"))return!1;o=lr(),t.setFocus()},onRight:()=>t.states.has("focus")&&o.setFocus(),get children(){return[l(Oa,{}),l(Ql,{}),pt(()=>r.children),l(Ll,{ref(i){var s=t;typeof s=="function"?s(i):t=i}})]}})},fe={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:L("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:L("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:L("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:L("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,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:L("#0000ff")},peopleBio:{...f.typography.body1,contain:"both",width:1500,height:400}},pn={width:120,height:40,color:L("#000000"),borderRadius:8,border:{width:2,color:L("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:L("#333333")}},transition:{scale:!0,color:!0}},Xl={color:L("#00A699"),height:8,y:2,x:-4,width:pn.width+8},Vl={fontSize:12,y:12,contain:"width",textAlign:"center",color:L("#F6F6F9"),height:pn.height,width:pn.width},mn={container:pn,topBar:Xl,text:Vl},Jr={width:386,height:136,color:L("#715cab"),focus:{color:L("#5a39a2")},disabled:{color:L("#291d43")}},Gl={fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:L("#FFFFFF"),height:Jr.height,width:Jr.width,focus:{fontSize:40},disabled:{color:L("#909090")}};function ql(r){return l(M,Q(r,{get style(){return fe.Thumbnail}}))}function xn(r){const[n,e]=_s(r,["items"]);return l(G,Q(e,{get style(){return fe.Row},get children(){return l(Sn,{get each(){return n.items},children:t=>l(ql,t)})}}))}function Zl(r){return l(M,Q(r,{forwardStates:!0,get style(){return mn.container},get children(){return l(N,{get style(){return mn.text},get children(){return r.children}})}}))}const Jl="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA",ec="https://api.themoviedb.org/3";let qo,Zo;const tc="w185",nc={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Jl}};function kt(r,n=tc){return Zo+n+r}function rc(r,n={}){return qo?er(r,n):Jo().then(()=>er(r,n))}function er(r,n={}){return fetch(ec+r,{...nc,...n}).then(e=>e.json())}function Jo(){return er("/configuration").then(r=>{var n;return qo=r,Zo=(n=r.images)==null?void 0:n.secure_base_url,r})}const tt={get:rc,loadConfig:Jo};function oc(r,n){return r.length>n?r.substring(0,n-3)+"...":r}function ic(r,n=7){let e=[];for(let t=0,o=r.length;t({src:kt(n.poster_path||n.profile_path),tileSrc:kt(n.backdrop_path||n.profile_path,"w300"),backdrop:kt(n.backdrop_path,"w1280"),href:"/entity/".concat(n.media_type||"people","/").concat(n.id),shortTitle:oc(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 Ln=new Map;const nn=new Map;function sc(r){return n=>{const e="/trending/".concat(r,"/week?page=").concat(n);if(Ln.has(e))return Ln.get(e);let t=tt.get(e).then(o=>{let i=o.results.filter(c=>!c.adult),s=(nn.has(r)?nn.get(r):[]).concat(Nt(i)),a=ic(s);return a[a.length-1].length<7?nn.set(r,a.pop()):nn.delete(r),a});return Ln.set(e,t),t}}function ac(r){const[n,e]=U([]),[t,o]=U(1),[i,s]=U(!1),[a]=et(t,r);return $n(()=>{const c=a();c&&ms(()=>{c.length===0&&s(!0),e(d=>[...d,...c])})}),{pages:n,page:t,setPage:o,setPages:e,end:i,setEnd:s}}const Tn=1100,lc={...f.typography.display2,width:Tn,height:58,contain:"both"},cc=r=>l(N,Q(r,{style:lc,get children(){return r.children}})),dc={...f.typography.body1,width:Tn,height:72,contain:"both"},hc={fontSize:20,lineHeight:20},uc=r=>l(N,Q(r,{style:dc,get children(){return r.children}}));function fc(r){return[l(Be,{get when(){return(r==null?void 0:r.rtCrit)&&(r==null?void 0:r.rtCrit)!=="0"},get children(){return[l(M,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),l(N,{style:tr,get children(){return r.rtCrit+"%"}})]}}),l(Be,{get when(){return(r==null?void 0:r.rtFan)&&(r==null?void 0:r.rtFan)!=="0"},get children(){return[l(M,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),l(N,{style:tr,get children(){return r.rtFan+"%"}})]}})]}const gc=r=>(()=>{var n=Pt("node");return Eo(Yo,n,()=>[8,15,13,15]),An(n,Q(r,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),ko(n,l(N,{style:hc,get children(){return r.children}})),n})(),tr=f.typography.body2,pc=r=>l(M,{style:{display:"flex",flexDirection:"row",gap:12,width:Tn,height:48},get children(){return[l(N,{style:tr,get children(){return r.metaText}}),l(Sn,{get each(){return r.badges},children:n=>l(gc,{y:-5,children:n})}),pt(()=>fc(r.reviews))]}}),ei=r=>l(M,Q(r,{style:{display:"flex",flexDirection:"column",width:Tn,height:160,gap:16},get children(){return[l(cc,{get children(){return r.title}}),l(uc,{get children(){return r.description}}),l(pc,{get metaText(){return r.metaText},get badges(){return r.badges},get reviews(){return r.reviews}})]}}));function mc(r){const n=Math.floor(r/60),e=r%60;return n+"h "+(e<10?"0":"")+e+"m"}function eo(r){return r.split("-")[0]}function xc({type:r,id:n}){return tt.get("/".concat(r,"/").concat(n,"/recommendations")).then(({results:e})=>e.length?Nt(e.slice(0,7)):tt.get("/trending/".concat(r,"/week?page=1")).then(({results:t})=>Nt(t.slice(0,7))))}function yc({type:r,id:n}){return tt.get("/".concat(r,"/").concat(n,"/credits")).then(({cast:e})=>Nt(e.slice(0,7)))}function ti({type:r,id:n}){let e=r==="movie"?{rtCrit:86,rtFan:92}:{};return tt.get("/".concat(r,"/").concat(n)).then(t=>({backgroundImage:kt(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:r==="movie"?mc(t.runtime)+" - "+t.release_date:"".concat(eo(t.first_air_date)," - ").concat(eo(t.last_air_date)),reviews:e},...t}))}const to=()=>{const r=dr(),[n,e]=U(0),[t,o]=U();et(t,ti);const[i,s]=U({}),a=mt(),c=yo(()=>0),d=ne(()=>ac(sc(r.filter||"all")));$e(He(lr,y=>{y.backdrop&&Ee(y.backdrop),y.heroContent&&s(y.heroContent)},{defer:!0}));function u(){var b;(b=this.children.selected)==null||b.setFocus(),e((this.y||0)*-1+24);let y=d().pages().length;(y===0||this.parent.selected&&this.parent.selected>=y-2)&&d().setPage(x=>x+1)}function g(){let y=this.children.selected;F(y&&y.href),a(y.href)}return l(Be,{get when(){return d().pages().length},get children(){return[l(ei,Q({y:360,x:150},i)),l(M,{clipping:!0,get style(){return fe.itemsContainer},get children(){return l(ee,{plinko:!0,announce:"All Trending - Week",get y(){return n()},get style(){return fe.Column},get children(){return l(Sn,{get each(){return d().pages()},children:(y,b)=>l(xn,{get autofocus(){return c(b())},items:y,onFocus:u,onEnter:g})})}})}})]}})},vc=()=>{const r=mt(),n=yo(()=>0);function e(){let c=this.children.selected;F(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]=U(4294967295);return l(M,Q(c,{onFocus:()=>g(255),onBlur:()=>g(4294967295),style:d,get children(){return l(M,{x:30,get children(){return[l(N,{y:30,fontSize:84,get color(){return u()},get children(){return c.index}}),l(N,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return u()},get children(){return c.title}}),l(N,{y:200,fontSize:28,width:330,contain:"width",get color(){return u()},get children(){return c.description}})]}})}}))}const[i,s]=U(140);function a(c){s(c.selected*-400+140)}return l(M,{colorTop:1147903743,colorBottom:743406847,get children(){return[l(M,{x:120,get children(){return[l(M,{src:"/assets/solidjs.png",width:101,height:90,y:40}),l(N,{fontSize:90,x:110,y:40,children:"Examples"}),l(M,{y:140,height:1,width:1800,color:3906468351})]}}),l(G,{onSelectedChanged:a,onEnter:e,transition:{x:{delay:20,duration:300}},get x(){return i()},y:300,width:4400,get style(){return fe.Row},justifyContent:"flexStart",gap:40,get children(){return l(Sn,{each:t,children:(c,d)=>l(o,Q({get autofocus(){return n(d())},get index(){return d()}},c))})}})]}})},wc=()=>{const r={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:L("00000000")},e={fontSize:42},t={width:r.width,fontSize:26,contain:"width"},o={fontSize:26};return je(()=>{Ee("#000000")}),l(M,{autofocus:!0,style:r,get children(){return[l(N,{style:e,children:"Title of the Page"}),l(N,{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(M,{style:n,get children(){return[l(N,{style:o,children:"Subline Text"}),l(M,{width:28,height:28,src:"/assets/rt-popcorn.png"}),l(N,{style:o,children:"More Text"})]}})]}})},bc=()=>{const r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:L("00000000")},e={fontSize:42},t={fontSize:26};let o,i;je(()=>{Ee("#000000"),o.animate({x:100},{duration:2e3}).start()});const[s,a]=U(),[c,d]=U();setTimeout(()=>{var A;a("- Inserted -"),(A=i.getChildById("child1"))==null||A.animate({x:600},{duration:2e3}).start()},2e3);const u={width:400,height:300,color:L("#0000ff")},g={color:L("#f54242"),focus:{color:L("#4287f5")}};function y(A){const p=wn(()=>A.children);return l(M,Q(A,{get style(){return[g,A.style,[u]]},get children(){return[l(M,{id:"child1",width:100,height:100,get color(){return L("#ff0000")},y:25,get children(){return[pt(()=>p()),l(M,{id:"subChild",x:150,width:100,height:100,get color(){return L("#00ff00")}}),l(N,{get children(){return A.title}})]}}),l(M,{width:100,height:100,get color(){return L("#ffff00")},y:175,get children(){return p()}})]}}))}const b={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},x={color:L("#cccccc"),focus:{color:L("#000000")}},w={color:L("#ffffff"),focus:{color:L("#f6f6cc")}};function S(A){return console.log("Ref is available: ",A),!0}return l(M,{style:r,get children(){return[l(N,{style:e,children:"Title of the Page"}),l(M,{style:n,get children(){return[l(N,{get children(){return c()}}),l(N,{style:t,get children(){return["Sub ",pt(()=>s())," Text"]}}),l(Be,{get when(){return s()},get children(){return l(M,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),l(N,{style:t,children:"More Text"})]}}),l(y,{autofocus:!0,ref(A){var p=i;typeof p=="function"?p(A):i=A},style:[w,x],get children(){return l(N,{children:"Child Test"})}}),l(M,{ref(A){var p=o;typeof p=="function"?p(A):o=A},style:b,width:100,height:100,get color(){return L("#00ff00")},x:900,y:400,get alpha(){return S(o)?1:.5}})]}})},Sc=()=>{let r,n;const[e,t]=U([]),o={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:L("#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);je(()=>{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(M,{get children(){return[l(N,{style:i,get children(){return e().join("\n")}}),l(M,{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")]]})]}})},Ac=()=>{function r(o,i){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:L("00000000"),gap:26,y:400};function e(o){return l(M,Q(o,{forwardStates:!0,get style(){return mn.container},get children(){return l(N,{get style(){return mn.text},get children(){return o.children}})}}))}const t=o=>(()=>{var i=Pt("node");return Eo(Yo,i,()=>[10,15]),An(i,Q(o,{get style(){return{color:L("#000000be"),borderRadius:8,border:{width:2,color:L("#ffffff")}}}}),!0),ko(i,l(N,{style:{fontSize:20},get children(){return o.children}})),i})();return[l(G,{x:100,y:200,gap:5,style:n,get children(){return[l(t,{children:"HD"}),l(t,{children:"PG13"}),l(t,{children:"NC17"}),l(N,{fontSize:30,children:"I like bananas"}),l(t,{children:"DOLBY"})]}}),l(G,{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"})]}})]},Cc=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:L("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(a){return l(M,Q(a,{style:{width:200,height:100,y:5,color:392801023}}))}const[t,o]=U(50);function i(){var a;(a=this.children.selected)==null||a.setFocus(),o(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const s=50;return l(ee,{x:160,get y(){return t()},gap:30,height:850,get width(){return r.width},get style(){return fe.Column},get children(){return[l(N,{style:n,children:"Flex Start"}),l(G,{gap:s,style:r,onFocus:i,get children(){return[l(e,{autofocus:!0}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex Start - Margin Left"}),l(G,{gap:s,style:r,onFocus:i,get children(){return[l(e,{marginLeft:100}),l(e,{}),l(e,{marginLeft:100}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex End"}),l(G,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex End - Margin Right"}),l(G,{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(N,{style:n,children:"Center - No Margin Support"}),l(G,{gap:s,justifyContent:"center",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Space Between - No Margin Support"}),l(G,{gap:s,justifyContent:"spaceBetween",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Space Evenly - No Margin Support"}),l(G,{gap:s,justifyContent:"spaceEvenly",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}})]}})},Tc=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:L("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(c){return l(M,Q(c,{style:{width:200,height:100,y:5,color:392801023}}))}function t(){return Math.floor(Math.random()*91)+10}const[o,i]=U(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const a=50;return l(ee,{x:160,get y(){return o()},gap:30,height:850,get width(){return r.width},get style(){return fe.Column},get children(){return[l(N,{style:n,children:"Flex Start - AlignItems: center"}),l(G,{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(N,{style:n,children:"Flex Start - Margin Left - AlignItems: flexStart"}),l(G,{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(N,{style:n,children:"Flex End - AlignItems: flexEnd"}),l(G,{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(N,{style:n,children:"Flex End - Margin Right"}),l(G,{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(N,{style:n,children:"Center - No Margin Support"}),l(G,{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(N,{style:n,children:"Space Between - No Margin Support"}),l(G,{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(N,{style:n,children:"Space Evenly - No Margin Support"}),l(G,{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()}})]}})]}})},_c=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:L("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("#4dabf5"),height:850,width:80},e={fontSize:44,y:20,x:150};function t(d){const u={width:o(),height:80,x:5,color:L("#1769aa")};return l(M,Q(d,{style:u}))}function o(){return Math.floor(Math.random()*61)+10}const[i,s]=U(50);function a(){var d;(d=this.children.selected)==null||d.setFocus(),s(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const c=50;return[l(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(G,{gap:c,style:r,onFocus:a,get children(){return[l(ee,{gap:30,style:n,alignItems:"center",get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{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(ee,{gap:c,alignItems:"flexEnd",justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{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(ee,{gap:c,justifyContent:"center",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"spaceBetween",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"spaceEvenly",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Ic=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:L("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("#4dabf5"),height:850,width:60},e={fontSize:44,y:20,x:150};function t(c){const d={width:50,height:80,x:5,color:L("#1769aa")};return l(M,Q(c,{style:d}))}const[o,i]=U(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const a=50;return[l(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(G,{gap:a,style:r,onFocus:s,get children(){return[l(ee,{gap:30,style:n,get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,style:n,onFocus:s,get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{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(ee,{gap:a,justifyContent:"center",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"spaceBetween",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"spaceEvenly",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Rc=()=>{function r(i,s){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:L("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(M,Q(i,{forwardStates:!0,style:e,shader:t,get children(){return l(N,{style:Gl,get children(){return i.children}})}}))}return l(G,{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"})]}})},Bc="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function kc(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?Ec():console.error("Browser not supported!")}async function Ec(){const r=document.getElementById("video"),n=new shaka.Player;await n.attach(r),window.player=n,n.addEventListener("error",Fc);try{await n.load(Bc),console.log("The video has now been loaded!")}catch(e){ni(e)}}function Fc(r){ni(r.detail)}function ni(r){console.error("Error code",r.code,"object",r)}function Nc(){const r=document.getElementById("video");return r.hidden=!1,setTimeout(()=>r.play(),50),r.focus(),r}function Lc(){const r=document.getElementById("video");return r.hidden=!0,r.pause(),r}document.addEventListener("DOMContentLoaded",kc);const Mc=()=>{const r=dr(),n=mt(),[e]=et(()=>({...r}),ti),[t]=et(()=>({...r}),yc),[o]=et(()=>({...r}),xc),[i,s]=U(0);$e(He(e,A=>{Ee(A.backgroundImage)},{defer:!0}));const a=600,c={color:L("#000000"),alpha:0,width:1900,height:890,x:10,y:a,borderRadius:30};function d(){var A;(A=this.children.selected)==null||A.setFocus(),x.y=a,w.y=a,w.alpha=0}function u(){var A;(A=this.children.selected)==null||A.setFocus(),x.y=200,w.y=160,w.alpha=.9}function g(){let A=this.children.selected;F(A&&A.href),n(A.href)}function y(){Lc(),document.getElementsByTagName("canvas")[0].focus(),Qn(S),s(0)}function b(){const A=Nc();Qn(A),s(.9)}let x,w,S;return l(Be,{get when(){return e()},keyed:!0,get children(){return[l(M,{onUp:()=>S.setFocus(),onEscape:y,get children(){return[l(ei,Q({y:360,x:150},()=>e().heroContent)),l(Zl,{autofocus:!0,ref(A){var p=S;typeof p=="function"?p(A):S=A},y:560,x:150,onDown:()=>x.setFocus(),onEnter:b,children:"Watch Trailer"}),l(ee,{ref(A){var p=x;typeof p=="function"?p(A):x=A},y:a,x:140,get style(){return fe.Column},zIndex:5,get children(){return l(Be,{get when(){return pt(()=>!!o())()&&t()},get children(){return[l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Recommendations"}),l(xn,{onFocus:d,onEnter:g,get items(){return o()}}),l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Cast and Crew"}),l(xn,{onFocus:u,onEnter:g,get items(){return t()}})]}})}}),l(M,{ref(A){var p=w;typeof p=="function"?p(A):w=A},style:c,transition:{alpha:!0,y:!0}})]}}),l(M,{get alpha(){return i()},get color(){return L("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function zc({id:r}){return tt.get("/person/".concat(r,"/combined_credits")).then(({cast:n})=>Nt(n.slice(0,7)))}function Pc({id:r}){return tt.get("/person/".concat(r)).then(n=>({backgroundImage:kt(n.profile_path,"original"),heroContent:{title:n.title||n.name,description:n.biography},...n}))}const Dc=()=>{const r=dr(),n=mt(),[e]=et(()=>({...r}),Pc),[t]=et(()=>({...r}),zc);$e(He(e,s=>{Ee(s.backgroundImage)},{defer:!0}));const o={color:L("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){let s=this.children.selected;F(s&&s.href),n(s.href)}return l(Be,{get when(){return e()},keyed:!0,get children(){return[l(M,{x:150,y:200,get style(){return fe.Column},zIndex:3,get children(){return[l(N,{get style(){return f.typography.display2},get children(){return e().name}}),l(N,{get style(){return fe.peopleBio},get children(){return e().biography}})]}}),l(M,{style:o}),l(ee,{y:670,x:140,get style(){return fe.Column},get children(){return l(Be,{get when(){return t()},get children(){return[l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Credits"}),l(xn,{autofocus:!0,onEnter:i,get items(){return t()}})]}})}})]}})},Oc=()=>(()=>{var r=Pt("node");return Qs(r,"style",{width:1920,height:1080,color:868483072}),r})(),Uc=new URL("AppCoreExtensions-CFmx_IUh.js",import.meta.url).href;Ae.debug=!1;Ae.animationsEnabled=!0;Ae.fontSettings.fontFamily="Ubuntu";Ae.fontSettings.color=L("#ffffff");Ae.fontSettings.fontSize=32;Ae.rendererOptions={coreExtensionModule:Uc,fpsUpdateInterval:1e3,enableInspector:!0};js(()=>l(ba,{root:r=>l(Kl,r),get children(){return[l(ue,{path:"",component:to}),l(ue,{path:"examples",component:vc}),l(ue,{path:"browse/:filter",component:to}),l(ue,{path:"text",component:wc}),l(ue,{path:"buttons",component:Ac}),l(ue,{path:"flex",component:Cc}),l(ue,{path:"create",component:bc}),l(ue,{path:"viewport",component:Sc}),l(ue,{path:"flexsize",component:Tc}),l(ue,{path:"flexcolumnsize",component:_c}),l(ue,{path:"flexcolumn",component:Ic}),l(ue,{path:"buttonsmaterial",component:Rc}),l(ue,{path:"entity/people/:id",component:Dc}),l(ue,{path:"entity/:type/:id",component:Mc}),l(ue,{path:"*all",component:Oc})]}}));export{Yc as __vite_legacy_guard}; +//# sourceMappingURL=index-D71SC9OT.js.map diff --git a/assets/index-DdLHrQIy.js.map b/assets/index-D71SC9OT.js.map similarity index 99% rename from assets/index-DdLHrQIy.js.map rename to assets/index-D71SC9OT.js.map index 060c2e6..4a6b1a3 100644 --- a/assets/index-DdLHrQIy.js.map +++ b/assets/index-D71SC9OT.js.map @@ -1 +1 @@ -{"version":3,"mappings":";;;;;;stCAqBO,MAAMA,EAAoB,CAE7B,YAAYC,EAAiB,CAD7BC,EAAA,wBAEI,KAAK,gBAAkBD,CAC1B,CACL,CCHO,MAAME,WAAuCH,EAAoB,CAIpE,YAAYC,EAAiBG,EAAS,SAClC,MAAMH,CAAe,EAJzBC,EAAA,kBAAa,IAAI,KACjBA,EAAA,+BAA0B,IAAI,KAC9BA,EAAA,gBAGI,KAAK,QAAU,CACX,0BAA0BG,EAAAD,EAAQ,2BAAR,KAAAC,EAAoC,IAC9D,+BAA+BC,EAAAF,EAAQ,gCAAR,KAAAE,EAAyC,GACpF,EAGQ,YAAY,IAAM,CACd,MAAMC,EAAM,KAAK,MACXC,EAAc,KAAK,QAAQ,8BACjC,UAAWC,KAAkB,KAAK,wBAC1BF,EAAME,EAAe,WAAaD,IAClC,KAAK,gBAAgBC,EAAe,EAAE,EACtC,KAAK,WAAW,OAAOA,EAAe,EAAE,EACxC,KAAK,wBAAwB,OAAOA,CAAc,EAGtE,EAAW,KAAK,QAAQ,wBAAwB,CAC3C,CACD,gBAAgBC,EAAS,OACrB,MAAMC,GAAYN,EAAAK,EAAQ,UAA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mC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,UAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,EAAKze,MACLye,EAAK,CAACF,aAAc,IAAGve,IACvBye,EAAKze,MACLye,EAAK,IAAAze,EACLye,EAAK,CAACF,aAAc,GAAG,KAAAve,IAGzB6N,GAAM,CACLvb,MACA2oB,eAAgB,SAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,eAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,cAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,YAKhB,ECpJMM,GAAiBA,IAAM,CAC3B,MAAMd,EAAY,CAChBhG,QAAS,OACTgD,eAAgB,cAChB59C,MAAO,KACPrC,EAAG,IACHsC,OAAQ,IACRlC,MAAO88B,EAAS,UAAU,GAGtB8mB,EAAe,CACnB/G,QAAS,OACTC,cAAe,SACf+C,eAAgB,YAChB7/C,MAAO88B,EAAS,SAAS,EACzB56B,OAAQ,IACRD,MAAO,IAGHghD,EAAW,CACfh/C,SAAU,GACVrE,EAAG,GACHD,EAAG,KAGL,SAAS0jD,EAAM3hD,EAAO,CACpB,MAAMo3B,EAAS,CACb72B,MAAO,GACPC,OAAQ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,gBAAiB,EAEnB,EAEA8f,GAAO,IAAAkI,EACJgD,GAAU,CAAC1b,KAAOxqB,GAAKkjC,EAAMuT,GAAQz2C,CAAK,EAAI,IAAA0uB,UAAA,CAAAwU,SAC5CgB,GAAK,CAACtH,KAAI,GAAI6C,UAAW2c,GAAMlZ,IAC/BgB,GAAK,CAACtH,KAAI,WAAY6C,UAAW4d,GAAMna,IACvCgB,GAAK,CAACtH,KAAI,iBAAkB6C,UAAW2c,GAAMlZ,IAC7CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAW4e,GAAQnb,IACrCgB,GAAK,CAACtH,KAAI,UAAW6C,UAAWwhB,GAAW/d,IAC3CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAW6hB,GAAQpe,IACrCgB,GAAK,CAACtH,KAAI,SAAU6C,UAAWkf,GAAUzb,IACzCgB,GAAK,CAACtH,KAAI,WAAY6C,UAAWsgB,GAAY7c,IAC7CgB,GAAK,CAACtH,KAAI,WAAY6C,UAAWqiB,GAAY5e,IAC7CgB,GAAK,CAACtH,KAAI,iBAAkB6C,UAAW6kB,GAAkBphB,IACzDgB,GAAK,CAACtH,KAAI,aAAc6C,UAAWwiB,GAAc/e,IACjDgB,GAAK,CAACtH,KAAI,kBAAmB6C,UAAW8kB,GAAmBrhB,IAC3DgB,GAAK,CAACtH,KAAI,oBAAqB6C,UAAWmkB,GAAM1gB,IAChDgB,GAAK,CAACtH,KAAI,mBAAoB6C,UAAWojB,GAAM3f,IAC/CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAWskB,EAAQ,MAEzC","names":["TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","options","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","v","x","y","w","h","convertColorToRgba","color","a","b","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","node","properties","div","key","driver","target","property","value","receiver","props","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","res","uni","trPropSetterDefaults","state","TextRenderer","stage","propSetters","setter","status","error","renderable","eventName","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","context","ff","ffs","i","n","fontSetting","err","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","j","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","result","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontFamily","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","fontFace","WebTrFontFace","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","results","eff","index","fxClass","uniInfo","p","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","current","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","val","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","name","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","e","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","start","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","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","d","validTypes","keys","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","_H","_G","_J","_I","_K","_M","_L","_O","_N","_P","_R","_Q","_T","_S","_U","textureType","id","desc","shaderType","CoreAnimation","propName","getTimingFunction","startValue","endValue","s","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","child","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","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","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","equalFn","$PROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","root","updateFn","untrack","cleanNode","runUpdates","createSignal","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","setError","track","trigger","setState","loadEnd","completeLoad","read","SuspenseContext","load","refetching","lookup","castError","createSelector","subs","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","createContext","defaultValue","createProvider","useContext","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","FALLBACK","dispose","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","resolveSource","resolveSources","length","mergeProps","sources","proxy","sourcesMap","defined","sourceKeys","definedKeys","splitProps","blocked","k","otherObject","objects","isDefaultDesc","objectIndex","narrowedError","For","fallback","Show","keyed","condition","DEV","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","__super","_key","stateIndexToRemove","calculateFlex","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","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","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","delayedBackgrounds","r$","_ref$","_ref$2","_ref$3","materialBrand","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","lastItem","windowVal","updateLastIndex","currentVal","newVal","size2","direct","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","num","defaultTone$e","themeStyles$d","container$e","defaultTone$d","themeStyles$c","container$d","defaultTone$c","themeStyles$b","container$c","text$6","icon$2","defaultTone$b","themeStyles$a","container$b","content","text$5","defaultTone$a","themeStyles$9","strokeWidth","container$a","icon$1","defaultTone$9","themeStyles$8","container$9","Container$9","styles$9","Column","onUp","onDown","defaultTone$8","themeStyles$7","container$8","text$4","themeStyles$6","defaultTone$7","container$7","text$3","icon","defaultTone$6","themeStyles$5","container$6","text$2","defaultTone$5","themeStyles$4","container$5","titleText","descriptionText","defaultTone$4","themeStyles$3","container$4","progress","defaultTone$3","themeStyles$2","container$3","Container$3","styles$3","Row","onLeft","onRight","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","typography","button1","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","onEnter","Gradient","fpsStyle","fpsLabel","textColor","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","count","totalFps","resetCounter","calcFps","Math","min","max","round","setupFPS","FPSCounter","toString","App","Menu","Escape","announcer","enabled","focusRingRef","navDrawer","lastFocused","onAnnouncer","onLast","history","back","onMenu","has","Button","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","page","setPage","setEnd","contents","blockWidth","HeadlineStyles","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","getReviews","reviews","rtCrit","title","marginRight","MetaTextStyle","rtFan","Badge","borderRadius","border","body2","Metadata","display","flexDirection","metaText","badges","ContentBlock","description","minutesToHMM","minutes","hours","remainingMinutes","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","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","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","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","trailerButton","onEnterTrailer","RowTitle","People","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[58,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,95,97],"sources":["../../../../../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/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/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.2_@lightningjs+solid_sggciuifiwrrln27zkml3bpb3u/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.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":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS 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 */\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 / 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 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 gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\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 `,\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 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) {\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);\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 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 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 { 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 constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\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 // 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 this.emit('loaded', {\n type: 'texture',\n dimensions,\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 }\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 (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 && this.children.length) {\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 } = this.props;\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 });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\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 }\n this.updateScaleRotateTransform();\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 });\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._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 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';\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 }\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 });\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 // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\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';\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 this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\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 }));\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","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 {\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 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 children.push(c);\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._autosized) {\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 { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\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 '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 _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 rendered: boolean;\n autofocus: boolean;\n flexItem?: boolean;\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 private _width?: number;\n private _height?: number;\n private _color?: number | string;\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.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\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.rendered) {\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.rendered && 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.rendered && 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.rendered) {\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.rendered) {\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 isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\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.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\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 node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\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 props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.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 || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\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 node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\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\n node.rendered = true;\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 // clean up after first render;\n delete this._renderProps;\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 }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\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[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = 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.rendered && 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 rootNode.rendered = true;\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 }\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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aHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+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+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXM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50ToCSgZACCVBIvnROgJKBkAIJUEi+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 hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\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 const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n delayedBackgrounds(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;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\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 || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\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 || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n 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 return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n 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))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\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);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n 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 (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (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)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n 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 = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n 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(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), 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 (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, 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 (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ 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 === void 0 ? -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 !== void 0 && 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\n 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\n 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 For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\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 Object.fromEntries(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 = Object.fromEntries(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) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\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, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\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 = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\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 windowVal = 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 windowVal = items.height;\n }\n return [lastItem, windowVal];\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 return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\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}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\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 (this.children[this.selected].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}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\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$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"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 { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\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$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\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$b\n};\nconst text$6 = {\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$b\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$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\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: themeStyles$a\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: themeStyles$a\n};\nconst text$5 = {\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: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\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$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.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$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.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$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\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$9\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$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\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$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.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$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\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$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"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 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$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\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$7\n};\nconst text$4 = {\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$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"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$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\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$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\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$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\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$3, {\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$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\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$5\n};\nconst text$2 = {\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$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"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$1, {\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$1, {\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$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\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$4\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$4\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$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"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$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\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$3\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$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"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$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\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 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$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\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$1\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$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 // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\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.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 themeStyles\n};\nconst text = {\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\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"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 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 && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && 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, {\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 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 { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.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 tone() {\n return props.tone ?? styles.tone;\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;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\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};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d 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 styles$3 as rowStyles,\n scrollToIndex,\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 { 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\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 return (\n <>\n \n navigate(\"/browse/all\")} icon=\"trending\">\n Trending\n \n navigate(\"/browse/movie\")}>\n Movies\n \n navigate(\"/browse/tv\")}>\n TV\n \n navigate(\"/examples\")}>\n Examples\n \n \n \n \n );\n}\n","import { View, Text, hexColor } from \"@lightningjs/solid\";\nimport { createSignal } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n};\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps((prev) => Math.min(fps, prev));\n setMaxFps((prev) => Math.max(fps, prev));\n\n totalFps += fps;\n count++;\n\n setAvgFps(Math.round(totalFps / count));\n\n resetCounter();\n};\n\nexport function setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return (\n \n \n FPS:\n \n {fps().toString()}\n \n \n\n \n AVG:\n \n {avgFps().toString()}\n \n \n\n \n MIN:\n \n {minFps().toString()}\n \n \n\n \n MAX:\n \n {maxFps().toString()}\n \n \n \n );\n};\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } 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;\n Menu: string;\n Escape: string;\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\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \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 marginTop: 20,\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: 20,\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 contain: \"both\",\n width: 1500,\n height: 400,\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 = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: \"both\",\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: \"both\",\n};\n\nconst BadgeStyle = {\n fontSize: 20,\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 = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return (\n \n {props.title}\n {props.description}\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 + \"m\"\n );\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, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\"],\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" - \" + 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\";\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 createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(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 }\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 console.log(\"Ref is available: \", elm);\n return true;\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 } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } 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 = 600;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\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 setActiveElement(trailerButton);\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, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n Watch Trailer\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 { createEffect, createResource, on } 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 createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 1540,\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 return (\n \n \n {data().name}\n {data().biography}\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(\"#ffffff\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 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-DdLHrQIy.js"} \ No newline at end of file +{"version":3,"mappings":";;;;;;stCAqBO,MAAMA,EAAoB,CAE7B,YAAYC,EAAiB,CAD7BC,EAAA,wBAEI,KAAK,gBAAkBD,CAC1B,CACL,CCHO,MAAME,WAAuCH,EAAoB,CAIpE,YAAYC,EAAiBG,EAAS,SAClC,MAAMH,CAAe,EAJzBC,EAAA,kBAAa,IAAI,KACjBA,EAAA,+BAA0B,IAAI,KAC9BA,EAAA,gBAGI,KAAK,QAAU,CACX,0BAA0BG,EAAAD,EAAQ,2BAAR,KAAAC,EAAoC,IAC9D,+BAA+BC,EAAAF,EAAQ,gCAAR,KAAAE,EAAyC,GACpF,EAGQ,YAAY,IAAM,CACd,MAAMC,EAAM,KAAK,MACXC,EAAc,KAAK,QAAQ,8BACjC,UAAWC,KAAkB,KAAK,wBAC1BF,EAAME,EAAe,WAAaD,IAClC,KAAK,gBAAgBC,EAAe,EAAE,EACtC,KAAK,WAAW,OAA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,EAAAte,EACpBye,EAAKze,MACLye,EAAK,CAACH,UAAW,IAAG,EAAAte,EACpBye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACAwsB,WAAU,UACV7D,eAAgB,UAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,UAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,EAAKze,MACLye,EAAK,CAACF,aAAc,IAAGve,IACvBye,EAAKze,MACLye,EAAK,IAAAze,EACLye,EAAK,CAACF,aAAc,GAAG,KAAAve,IAGzB6N,GAAM,CACLvb,MACA2oB,eAAgB,SAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,eAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,cAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,YAKhB,ECpJMM,GAAiBA,IAAM,CAC3B,MAAMd,EAAY,CAChBhG,QAAS,OACTgD,eAAgB,cAChB59C,MAAO,KACPrC,EAAG,IACHsC,OAAQ,IACRlC,MAAO88B,EAAS,UAAU,GAGtB8mB,EAAe,CACnB/G,QAAS,OACTC,cAAe,SACf+C,eAAgB,YAChB7/C,MAAO88B,EAAS,SAAS,EACzB56B,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9C,GAAOE,aAAa9lD,MAAQ88B,EAAS,SAAS,EAC9C8oB,GAAOE,aAAa7hD,SAAW,GAC/B2hD,GAAOG,gBAAkB,CACvBnqC,oBAAqB+pC,GACrBh8B,kBAA4B,IAC5B/M,gBAAiB,EAEnB,EAEA8f,GAAO,IAAAkI,EACJgD,GAAU,CAAC1b,KAAOxqB,GAAKkjC,EAAMuT,GAAQz2C,CAAK,EAAI,IAAA0uB,UAAA,CAAAwU,SAC5CgB,GAAK,CAACtH,KAAI,GAAI6C,UAAW2c,GAAMlZ,IAC/BgB,GAAK,CAACtH,KAAI,WAAY6C,UAAW4d,GAAMna,IACvCgB,GAAK,CAACtH,KAAI,iBAAkB6C,UAAW2c,GAAMlZ,IAC7CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAW4e,GAAQnb,IACrCgB,GAAK,CAACtH,KAAI,UAAW6C,UAAWwhB,GAAW/d,IAC3CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAW6hB,GAAQpe,IACrCgB,GAAK,CAACtH,KAAI,SAAU6C,UAAWkf,GAAUzb,IACzCgB,GAAK,CAACtH,KAAI,WAAY6C,UAAWsgB,GAAY7c,IAC7CgB,GAAK,CAACtH,KAAI,WAAY6C,UAAWqiB,GAAY5e,IAC7CgB,GAAK,CAACtH,KAAI,iBAAkB6C,UAAW6kB,GAAkBphB,IACzDgB,GAAK,CAACtH,KAAI,aAAc6C,UAAWwiB,GAAc/e,IACjDgB,GAAK,CAACtH,KAAI,kBAAmB6C,UAAW8kB,GAAmBrhB,IAC3DgB,GAAK,CAACtH,KAAI,oBAAqB6C,UAAWmkB,GAAM1gB,IAChDgB,GAAK,CAACtH,KAAI,mBAAoB6C,UAAWojB,GAAM3f,IAC/CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAWskB,EAAQ,MAEzC","names":["TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","options","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","v","x","y","w","h","convertColorToRgba","color","a","b","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","node","properties","div","key","driver","target","property","value","receiver","props","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","res","uni","trPropSetterDefaults","state","TextRenderer","stage","propSetters","setter","status","error","renderable","eventName","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","context","ff","ffs","i","n","fontSetting","err","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","j","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","result","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontFamily","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","fontFace","WebTrFontFace","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","results","eff","index","fxClass","uniInfo","p","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","current","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","val","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","name","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","e","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","start","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","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","d","validTypes","keys","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","_H","_G","_J","_I","_K","_M","_L","_O","_N","_P","_R","_Q","_T","_S","_U","textureType","id","desc","shaderType","CoreAnimation","propName","getTimingFunction","startValue","endValue","s","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","child","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","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","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","equalFn","$PROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","root","updateFn","untrack","cleanNode","runUpdates","createSignal","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","setError","track","trigger","setState","loadEnd","completeLoad","read","SuspenseContext","load","refetching","lookup","castError","createSelector","subs","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","createContext","defaultValue","createProvider","useContext","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","FALLBACK","dispose","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","resolveSource","resolveSources","length","mergeProps","sources","proxy","sourcesMap","defined","sourceKeys","definedKeys","splitProps","blocked","k","otherObject","objects","isDefaultDesc","objectIndex","narrowedError","For","fallback","Show","keyed","condition","DEV","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","__super","_key","stateIndexToRemove","calculateFlex","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","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","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","delayedBackgrounds","r$","_ref$","_ref$2","_ref$3","materialBrand","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","lastItem","windowVal","updateLastIndex","currentVal","newVal","size2","direct","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","num","defaultTone$e","themeStyles$d","container$e","defaultTone$d","themeStyles$c","container$d","defaultTone$c","themeStyles$b","container$c","text$6","icon$2","defaultTone$b","themeStyles$a","container$b","content","text$5","defaultTone$a","themeStyles$9","strokeWidth","container$a","icon$1","defaultTone$9","themeStyles$8","container$9","Container$9","styles$9","Column","onUp","onDown","defaultTone$8","themeStyles$7","container$8","text$4","themeStyles$6","defaultTone$7","container$7","text$3","icon","defaultTone$6","themeStyles$5","container$6","text$2","defaultTone$5","themeStyles$4","container$5","titleText","descriptionText","defaultTone$4","themeStyles$3","container$4","progress","defaultTone$3","themeStyles$2","container$3","Container$3","styles$3","Row","onLeft","onRight","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","typography","button1","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","onEnter","Gradient","fpsStyle","fpsLabel","textColor","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","count","totalFps","resetCounter","calcFps","Math","min","max","round","setupFPS","FPSCounter","toString","App","Menu","Escape","announcer","enabled","focusRingRef","navDrawer","lastFocused","onAnnouncer","onLast","history","back","onMenu","has","Button","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","page","setPage","setEnd","contents","blockWidth","HeadlineStyles","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","getReviews","reviews","rtCrit","title","marginRight","MetaTextStyle","rtFan","Badge","borderRadius","border","body2","Metadata","display","flexDirection","metaText","badges","ContentBlock","description","minutesToHMM","minutes","hours","remainingMinutes","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","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","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","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","trailerButton","onEnterTrailer","RowTitle","People","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[58,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,95,97],"sources":["../../../../../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/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/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.2_@lightningjs+solid_sggciuifiwrrln27zkml3bpb3u/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.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":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS 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 */\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 / 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 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 gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\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 `,\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 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) {\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);\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 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 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 { 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 constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\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 // 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 this.emit('loaded', {\n type: 'texture',\n dimensions,\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 }\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 (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 && this.children.length) {\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 } = this.props;\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 });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\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 }\n this.updateScaleRotateTransform();\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 });\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._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 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';\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 }\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 });\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 // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\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';\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 this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\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 }));\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","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 {\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 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 children.push(c);\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._autosized) {\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 { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\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 '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 _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 rendered: boolean;\n autofocus: boolean;\n flexItem?: boolean;\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 private _width?: number;\n private _height?: number;\n private _color?: number | string;\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.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\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.rendered) {\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.rendered && 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.rendered && 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.rendered) {\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.rendered) {\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 isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\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.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\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 node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\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 props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.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 || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\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 node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\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\n node.rendered = true;\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 // clean up after first render;\n delete this._renderProps;\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 }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\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[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = 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.rendered && 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 rootNode.rendered = true;\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 }\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,iVBORw0KGg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EClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+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+kUN0TjEiDGKKB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7yst/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 hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\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 const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n delayedBackgrounds(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;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\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 || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\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 || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n 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 return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n 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))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\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);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n 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 (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (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)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n 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 = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n 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(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), 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 (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, 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 (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ 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 === void 0 ? -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 !== void 0 && 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\n 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\n 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 For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\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 Object.fromEntries(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 = Object.fromEntries(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) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\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, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\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 = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\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 windowVal = 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 windowVal = items.height;\n }\n return [lastItem, windowVal];\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 return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\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}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\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 (this.children[this.selected].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}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\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$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"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 { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\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$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\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$b\n};\nconst text$6 = {\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$b\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$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\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: themeStyles$a\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: themeStyles$a\n};\nconst text$5 = {\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: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\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$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.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$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.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$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\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$9\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$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\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$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.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$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\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$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"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 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$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\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$7\n};\nconst text$4 = {\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$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"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$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\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$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\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$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\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$3, {\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$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\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$5\n};\nconst text$2 = {\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$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"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$1, {\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$1, {\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$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\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$4\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$4\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$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"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$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\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$3\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$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"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$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\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 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$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\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$1\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$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 // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\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.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 themeStyles\n};\nconst text = {\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\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"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 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 && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && 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, {\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 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 { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.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 tone() {\n return props.tone ?? styles.tone;\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;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\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};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d 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 styles$3 as rowStyles,\n scrollToIndex,\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 { 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\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 return (\n <>\n \n navigate(\"/browse/all\")} icon=\"trending\">\n Trending\n \n navigate(\"/browse/movie\")}>\n Movies\n \n navigate(\"/browse/tv\")}>\n TV\n \n navigate(\"/examples\")}>\n Examples\n \n \n \n \n );\n}\n","import { View, Text, hexColor } from \"@lightningjs/solid\";\nimport { createSignal } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n};\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps((prev) => Math.min(fps, prev));\n setMaxFps((prev) => Math.max(fps, prev));\n\n totalFps += fps;\n count++;\n\n setAvgFps(Math.round(totalFps / count));\n\n resetCounter();\n};\n\nexport function setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return (\n \n \n FPS:\n \n {fps().toString()}\n \n \n\n \n AVG:\n \n {avgFps().toString()}\n \n \n\n \n MIN:\n \n {minFps().toString()}\n \n \n\n \n MAX:\n \n {maxFps().toString()}\n \n \n \n );\n};\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } 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;\n Menu: string;\n Escape: string;\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\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \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 marginTop: 20,\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: 20,\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 contain: \"both\",\n width: 1500,\n height: 400,\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 = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: \"both\",\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: \"both\",\n};\n\nconst BadgeStyle = {\n fontSize: 20,\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 = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return (\n \n {props.title}\n {props.description}\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 + \"m\"\n );\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, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\"],\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" - \" + 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\";\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 createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(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 }\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 console.log(\"Ref is available: \", elm);\n return true;\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 } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } 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 = 600;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\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 setActiveElement(trailerButton);\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, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n Watch Trailer\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 { createEffect, createResource, on } 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 createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 1540,\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 return (\n \n \n {data().name}\n {data().biography}\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(\"#ffffff\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 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-D71SC9OT.js"} \ No newline at end of file diff --git a/assets/index-legacy-BVITNsdb.js b/assets/index-legacy-bcLqKdOS.js similarity index 99% rename from assets/index-legacy-BVITNsdb.js rename to assets/index-legacy-bcLqKdOS.js index fc6bdf8..aeaeaea 100644 --- a/assets/index-legacy-BVITNsdb.js +++ b/assets/index-legacy-bcLqKdOS.js @@ -1,2 +1,2 @@ -!function(){var e=["defaultTone"],t=["defaultTone"],r=["defaultTone"],n=["defaultTone"],o=["defaultTone"],i=["defaultTone"],s=["defaultTone"],a=["defaultTone"],l=["defaultTone"],d=["defaultTone"],h=["defaultTone"],u=["defaultTone"],c=["defaultTone"],f=["defaultTone"],p=["defaultSurfaceTone"];function v(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 g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){d=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw o}}return a}}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=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:{},s=i.iterator||"@@iterator",a=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 h(e,t,r,n){var i=t&&t.prototype instanceof x?t:x,s=Object.create(i.prototype),a=new E(n||[]);return o(s,"_invoke",{value:k(e,r,a)}),s}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var c="suspendedStart",f="suspendedYield",p="executing",v="completed",g={};function x(){}function y(){}function b(){}var w={};d(w,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(N([])));A&&A!==r&&n.call(A,s)&&(w=A);var C=b.prototype=x.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,s,a){var l=u(e[o],e,i);if("throw"!==l.type){var d=l.arg,h=d.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(h).then((function(e){d.value=e,s(d)}),(function(e){return r("throw",e,s,a)}))}a(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 k(t,r,n){var o=c;return function(i,s){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw s;return{value:e,done:!0}}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var l=I(a,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=u(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 I(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,I(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=u(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function B(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 R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[s];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 s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),d=n.call(s,"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),R(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;R(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 x(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(d){return void r(d)}a.done?t(l):Promise.resolve(l).then(n,o)}function y(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function s(e){x(i,n,o,s,a,"next",e)}function a(e){x(i,n,o,s,a,"throw",e)}s(void 0)}))}}function b(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 w(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,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function C(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{C=e.a,T=e.i,_=e.g,k=e.c,I=e.W,B=e.E,R=e.b,E=e.d,N=e.e,F=e.f,L=e.m,z=e.h,M=e.j,P=e.T,D=e.k,O=e.l,U=e.S,W=e.B,Y=e.n,j=e.o,H=e.p,Q=e.q,K=e.C,$=e.r,X=e.s,G=e.t,V=e.u,Z=e.v,q=e.w}],execute:function(){var x,J,ee,te=m().mark(Xe),re=document.createElement("style");re.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(re);class ne{constructor(e){S(this,"releaseCallback",void 0),this.releaseCallback=e}}class oe extends ne{constructor(e,t){var r,n;super(e),S(this,"textureMap",new Map),S(this,"zeroReferenceTextureSet",new Set),S(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=A(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(C(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;C(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);n||(this.registerTexture(e),n=this.textureMap.get(r)),C(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;C(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);C(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 ie extends ne{constructor(e){super(e),S(this,"registry",void 0),this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,r;C(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 se={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:ae(e)}},ae=e=>`rgba(${e>>24&255},${e>>16&255},${e>>8&255},${(255&e)/255})`,le={id:"id"};class de{constructor(e,t){var r,n,o,i,s,a;if(S(this,"root",null),S(this,"canvas",null),S(this,"height",1080),S(this,"width",1920),S(this,"scaleX",1),S(this,"scaleY",1),!T()){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!==(s=t.deviceLogicalPixelRatio)&&void 0!==s?s:1,this.scaleY=null!==(a=t.deviceLogicalPixelRatio)&&void 0!==a?a: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,s)=>("start"===i&&this.animateNode(t,e,n,o),Reflect.get(r,i,s))})}: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(se[t]){var n,o=null===(n=se[t])||void 0===n?void 0:n.call(se,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(le[t])e.setAttribute(String(se[t]),String(r));else if("data"!==t);else for(var i in r)e.setAttribute(`data-${i}`,String(r[i]))}}else{var s=r.id;if(1===s)return void this.root.appendChild(e);var a=document.getElementById(s.toString());null==a||a.appendChild(e)}}animateNode(e,t,r,n){var o=n.duration,i=void 0===o?1e3:o,s=n.delay,a=void 0===s?0:s,l=r.x,d=r.y,h=r.width,u=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=`${h}px`,e.style.height=`${u}px`,e.style.opacity=`${f}`,e.style.rotate=`${v}rad`,e.style.scale=`${m}`,e.style.color=ae(x)}),i)}),a)}}var he=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 ue{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){S(this,"priority",1),S(this,"name",""),S(this,"ref",void 0),S(this,"target",void 0),S(this,"passParameters",""),S(this,"declaredUniforms",""),S(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={},s=[],a="",l=this.constructor.uniforms||{};for(var d in l){var h=l[d],u=h.type,c=`${t}_${d}`,f="";h.size&&(f=`[${h.size(o)}]`),s.push(c),a+=`uniform ${u} ${c}${f};`,i[d]={name:c,uniform:l[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static resolveDefaults(e){return{}}static makeEffectKey(e){return!1}}S(ue,"uniforms",{}),S(ue,"methods",void 0),S(ue,"onShaderMask",void 0),S(ue,"onColorize",void 0),S(ue,"onEffectMask",void 0);var ce={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 fe{constructor(e){S(this,"stage",void 0),S(this,"set",void 0),this.stage=e;var t=w(w({},ce),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)})))}}function pe(e,t,r,n,o){return r*(n-1)+("bottom"!==e?.5*t:0)+Math.max(r,t)+(o||0)}class ve{constructor(e,t){S(this,"_canvas",void 0),S(this,"_context",void 0),S(this,"_settings",void 0),S(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,s=(this._settings.lineHeight||o)*t,a=this._settings.w*t,l=this._settings.h*t,d=this._settings.wordWrapWidth*t,h=this._settings.cutSx*t,u=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=a||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,k=this.wrapText(C[C.length-1],d-_,p,v);C[C.length-1]=`${k.l[0]}${this._settings.overflowSuffix}`,T=[k.l.length>1?k.l[1]:""]}else T=[""];var I=S.length,B=0,R=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,h=i.length;dt)for(;s>0&&(a=this._context.measureText(e.substring(0,s)).width+n)>t;)s-=1;else for(;s=n?r:"")}wrapText(e,t,r,n=0){for(var o=e.split(/\r?\n/g),i=[],s=[],a=0;ah?(c>0&&(l.push(d),d=""),d+=u[c],h=t-f-(0===c?n:0)):(h-=p,d+=` ${u[c]}`)}l.push(d),d="",i=i.concat(l),ae+this._context.measureText(r).width+t),0):this._context.measureText(e).width}mergeDefaults(e){return w({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 ge="undefined"==typeof self?globalThis:self,me=(null===(x=ge.document)||void 0===x?void 0:x.fonts)||ge.fonts;var xe=k(0,0,0,0);class ye extends fe{constructor(e){super(e),S(this,"canvas",void 0),S(this,"context",void 0),S(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")),C(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 I}addFontFace(e){C(e instanceof I),me.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new B,canvasPages:void 0,lightning2TextRenderer:new ve(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 me.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,s=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:R(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:s,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 a=e.props,l=a.x,d=a.y,h=a.width,u=a.height,c=a.scrollY,f=a.contain,p=e.visibleWindow,v=e.renderWindow,g=e.canvasPages;if(!p.valid){var m=k(l,d,"none"!==f?l+h:1/0,"both"===f?d+u:1/0,xe);E(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,C=d-c+v.y2;if(b<=p.x1&&S>=p.x2&&w<=p.y1&&C>=p.y2)return void this.setStatus(e,"loaded");Cp.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 T,_,I,B=e.renderInfo.lineHeight*y,N=Math.ceil(c/B),F=N*y,L=F-y,z=F+y;g=[{texture:null===(T=g)||void 0===T?void 0:T[0].texture,lineNumStart:L,lineNumEnd:L+y,valid:!1},{texture:null===(_=g)||void 0===_?void 0:_[1].texture,lineNumStart:F,lineNumEnd:F+y,valid:!1},{texture:null===(I=g)||void 0===I?void 0:I[2].texture,lineNumStart:z,lineNumEnd:z+y,valid:!1}],e.canvasPages=g;var M=N*B;v={x1:0,y1:M-B,x2:h,y2:M+2*B}}e.renderWindow=v,performance.now();var P,D=A(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,s=e.textW,a=void 0===s?0:s,l=e.textH,d=void 0===l?0:l,h=e.renderWindow;if(i&&h){var u=e.props,c=u.x,f=u.y,p=u.scrollY,v=u.contain,g=u.width,m=u.height,x={x:c,y:f,width:"none"!==v?g:a,height:"both"===v?m:d};N({x:0,y:0,width:o.options.appWidth,height:o.options.appHeight},x),C(i,"canvasPages is not defined"),C(h,"renderWindow is not defined");var y,b,w,S,A,T,_=(h.y2-h.y1)/3,k=e.props,I=k.zIndex,B=k.color,R=n*F(B),E=L(4294967295,R);if(i[0].valid)this.stage.renderer.addQuad({alpha:R,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:I,tx:t.tx,ty:t.ty-p+h.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[1].valid)this.stage.renderer.addQuad({alpha:R,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:I,tx:t.tx,ty:t.ty-p+h.y1+_,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[2].valid)this.stage.renderer.addQuad({alpha:R,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===(T=i[2].texture)||void 0===T||null===(T=T.dimensions)||void 0===T?void 0:T.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+h.y1+_+_,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 be extends z{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)}}S(be,"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 / 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 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 we extends z{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"}]}),S(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)}}S(we,"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 Se=new Map,Ae=(e,t)=>{var r=JSON.stringify(e);if(Se.has(r))return Se.get(r);var n=(null!=e?e:[]).map((e=>({type:e.type,props:t[e.type].resolveDefaults(e.props||{})})));return Se.set(r,n),n};class Ce extends z{constructor(e,t,r){var n=Ce.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}}),S(this,"effects",[]),this.effects=n.effects,this.calculateProps=M(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],s=t[i.name],a=null!==(o=e.props)&&void 0!==o?o:{},l=i.uniformInfo;Object.keys(a).forEach((e=>{var t=s.uniforms[e],n=l[e],o=t.validator?t.validator(a[e],a):a[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],a=n.getEffectKey(e.props||{});r[a]=r[a]?++r[a]:1;var l=r[a];1===l&&s.push({key:a,type:e.type,props:e.props});var d=new n({ref:`${a}${1===l?"":l}`,target:a,props:e.props});return o+=d.declaredUniforms,i.push(...Object.values(d.uniformInfo)),d})),l="";null==s||s.forEach((e=>{var r,o=t[e.type],i=o.resolveDefaults(null!==(r=e.props)&&void 0!==r?r:{}),s=[];for(var a in o.methods){var d=a,h=o.methods[a];n[a]&&n[a]!==h&&(d=Ce.resolveMethodDuplicate(a,h,n)),n[d]=h.replace("function",d),s.push({m:a,cm:d})}var u=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;s.forEach((e=>{var t=e.m,r=e.cm,n=new RegExp(`\\$${t}`,"g");u&&(u=u.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}`:"";u&&(l+=`\n float fx_${e.key}_onShaderMask(float shaderMask ${v}) {\n ${u}\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 h in n)d+=n[h];for(var u="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&&(u=`fx_${p.target}_onEffectMask(shaderMask, maskColor, shaderColor${v})`);var m=a[f+1];(void 0===m||t[m.name].onEffectMask)&&(c+=`\n shaderColor = ${u};\n `)}return{effects:a,uniforms:i,fragment:Ce.fragment(o,d,l,c),vertex:Ce.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:Ae(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}`}}S(Ce,"z$__type__Props",void 0),S(Ce,"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 ")),S(Ce,"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 Te extends z{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}}S(Te,"z$__type__Props",void 0),S(Te,"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 _e=new Float32Array([1,0,0,0,1,0,0,0,1]);class ke extends z{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=ke.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=R(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,s;return{transform:null!==(t=e.transform)&&void 0!==t?t:_e,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!==(s=e.debug)&&void 0!==s&&s}}}S(ke,"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 gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\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 Ie extends ue{constructor(...e){super(...e),S(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:null!==(t=e.radius)&&void 0!==t?t:10}}}S(Ie,"z$__type__Props",void 0),S(Ie,"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}}}),S(Ie,"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 "}),S(Ie,"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 "),S(Ie,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Be extends ue{constructor(...e){super(...e),S(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}}}S(Be,"z$__type__Props",void 0),S(Be,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Be,"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 "),S(Be,"onColorize","\n return color;\n ");class Re extends ue{constructor(...e){super(...e),S(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,s=0,a=o;se.map((e=>R(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"}}),S(Re,"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 "}),S(Re,"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 ${J.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Ee extends ue{constructor(...e){super(...e),S(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:null!==(t=e.amount)&&void 0!==t?t:1}}}S(Ee,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),S(Ee,"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 Ne extends ue{constructor(...e){super(...e),S(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}}}S(Ne,"z$__type__Props",void 0),S(Ne,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Ne,"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 "}),S(Ne,"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 "),S(Ne,"onColorize","\n return color;\n ");class Fe extends ue{constructor(...e){super(...e),S(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}}}S(Fe,"z$__type__Props",void 0),S(Fe,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Fe,"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 "}),S(Fe,"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 "),S(Fe,"onColorize","\n return color;\n ");class Le extends ue{constructor(...e){super(...e),S(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}}}S(Le,"z$__type__Props",void 0),S(Le,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Le,"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 "}),S(Le,"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 "),S(Le,"onColorize","\n return color;\n ");class ze extends ue{constructor(...e){super(...e),S(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}}}S(ze,"z$__type__Props",void 0),S(ze,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(ze,"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 "}),S(ze,"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 "),S(ze,"onColorize","\n return color;\n ");class Me extends ue{constructor(...e){super(...e),S(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()}}}S(Me,"z$__type__Props",void 0),S(Me,"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"}}),S(Me,"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 "}),S(Me,"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 Pe extends ue{constructor(...e){super(...e),S(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:null!==(t=e.fade)&&void 0!==t?t:10}}}S(Pe,"z$__type__Props",void 0),S(Pe,"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}}}),S(Pe,"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 De extends ue{constructor(...e){super(...e),S(this,"name","radialGradient")}static getEffectKey(e){return`radialGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n,o,i,s=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],a=e.stops||[];if(0===a.length||a.length!==s.length){for(var l=s.length,d=0,h=a;de.map((e=>R(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"}}),S(De,"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 ${ee.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Oe extends ue{constructor(...e){super(...e),S(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,r,n,o,i,s,a;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!==(s=e.radius)&&void 0!==s?s:1,color:null!==(a=e.color)&&void 0!==a?a:4294967295}}}S(Oe,"z$__type__Props",void 0),S(Oe,"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=>R(e),method:"uniform4fv",type:"vec4"}}),S(Oe,"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 "}),S(Oe,"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 "),S(Oe,"onColorize","\n return color;\n ");class Ue extends ue{constructor(...e){super(...e),S(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}}}S(Ue,"z$__type__Props",void 0),S(Ue,"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}}}),S(Ue,"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 "}),S(Ue,"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 "),S(Ue,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class We{constructor(){S(this,"shCache",new Map),S(this,"shConstructors",{}),S(this,"attachedShader",null),S(this,"effectConstructors",{}),S(this,"renderer",void 0),this.registerShaderType("DefaultShader",be),this.registerShaderType("DefaultShaderBatched",we),this.registerShaderType("RoundedRectangle",Te),this.registerShaderType("DynamicShader",Ce),this.registerShaderType("SdfShader",ke),this.registerEffectType("border",Be),this.registerEffectType("borderBottom",Le),this.registerEffectType("borderLeft",ze),this.registerEffectType("borderRight",Ne),this.registerEffectType("borderTop",Fe),this.registerEffectType("fadeOut",Pe),this.registerEffectType("linearGradient",Re),this.registerEffectType("radialGradient",De),this.registerEffectType("grayscale",Ee),this.registerEffectType("glitch",Me),this.registerEffectType("radius",Ie),this.registerEffectType("radialProgress",Oe),this.registerEffectType("holePunch",Ue)}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=Ce.resolveDefaults(e,this.effectConstructors),r=Ce.makeCacheKey(t,this.effectConstructors);if(r&&this.shCache.has(r))return{shader:this.shCache.get(r),props:t};var n=new Ce(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 Ye{constructor(){S(this,"data",{})}reset(){this.data={}}increment(e){this.data[e]||(this.data[e]=0),this.data[e]++}getData(){return w({},this.data)}}var je=function(){var e=y(m().mark((function e(t){var r,n;return m().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",He(n));case 8:return e.abrupt("return",Qe(n));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),He=function(){var e=y(m().mark((function e(t){var r,n,o,i,s,a,l;return m().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)},s=64,s+=i.bytesOfKeyValueData,a=0;a>2)*(h+3>>2)*8,f=new Uint8Array(r,i.byteOffset+l,c),s.push(f),l+=c,d>>=1,h>>=1;return e.abrupt("return",{data:{glInternalFormat:36196,mipmaps:s,width:a.pixelWidth||0,height:a.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();class Ke extends P{constructor(e,t){super(e),S(this,"props",void 0),this.props=Ke.resolveDefaults(t)}hasAlphaChannel(e){return-1!==e.indexOf("image/png")}getTextureData(){var e=this;return y(m().mark((function t(){var r,n,o,i,s,a,l;return m().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",je(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 s=t.sent,a=null!=o?o:e.hasAlphaChannel(s.type),t.next=23,createImageBitmap(s,{premultiplyAlpha:a?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"});case 23:return t.t0=t.sent,t.t1=a,t.abrupt("return",{data:t.t0,premultiplyAlpha:t.t1});case 28:return(l=new Image).src=n,t.next=32,new Promise(((e,t)=>{l.onload=()=>e(),l.onerror=()=>t(new Error("Failed to load image"))})).catch((e=>{console.error(e)}));case 32:return t.abrupt("return",{data:l,premultiplyAlpha:null==o||o});case 33:case"end":return t.stop()}}),t)})))()}static makeCacheKey(e){var t=Ke.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}}}S(Ke,"z$__type__Props",void 0);class $e{constructor(e,t=0){S(this,"iterator",void 0),S(this,"peekBuffer",[]),S(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 Xe(e,t=0){var r,n;return m().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:B,maxX:I});else if(e>c.length)throw new Error("Unexpected lineCache length");if(32===X.codepoint||10===X.codepoint?-1!==F.codepointIndex&&(F.codepointIndex=-1,H=R):-1===F.codepointIndex&&(F.codepointIndex=X.cluster,F.bufferOffset=N,F.xStart=H),X.mapped){var G=R+X.xOffset+X.width;if("none"!==u&&G>=j&&-1!==F.codepointIndex&&F.xStart>0){if(Y){M=L.shapeText(z,new $e(Xe(n,F.codepointIndex),F.codepointIndex)),N=F.bufferOffset;break}M=L.shapeText(z,new $e(Xe(m,0),0)),R=F.xStart,N=F.bufferOffset,u="none"}else{var V=R+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;h[N++]=V,h[N++]=Z,h[N++]=J,h[N++]=ee,h[N++]=V+X.width,h[N++]=Z,h[N++]=J+te,h[N++]=ee,h[N++]=V,h[N++]=Z+X.height,h[N++]=J,h[N++]=ee+re,h[N++]=V+X.width,h[N++]=Z+X.height,h[N++]=J+te,h[N++]=ee+re}B=Math.max(B,Z+X.height),I=Math.max(I,V+X.width),R+=X.xAdvance}}else if(10===X.codepoint){if(Y)break;M=L.shapeText(z,new $e(Xe(m,0),0)),u="none"}}-1!==P&&(D.push({bufferStart:P,bufferEnd:N}),P=-1),R=0,E+=w,e++,F.codepointIndex=-1,H=0,!v&&"both"===u&&E>f.y2||y&&y.done?W=!1:Y||(W=!1)}if("center"===o)for(var ne="none"===u?I:S,oe=0;oe"number"==typeof e?e:Ze[e]||400;var Je=M((function(e,t,r,n,o){var i,s=qe(r),a=A(e);try{for(a.s();!(i=a.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,h=new Map,u=A(l);try{for(u.s();!(d=u.n()).done;){var c=d.value,f=qe(c.descriptors.weight);if(f===s&&c.descriptors.style===n&&c.descriptors.stretch===o)return c;h.set(f,c)}}catch(v){u.e(v)}finally{u.f()}var p=`TrFontManager: No exact match: '${t} Weight: ${s} Style: ${n} Stretch: ${o}'`;if(console.error(p),400===s&&h.has(500))return h.get(500);if(500===s&&h.has(400))return h.get(400);if(s<400){for(;s>0;){if(h.has(s))return h.get(s);s-=100}s=600}for(;s<1e3;){if(h.has(s))return h.get(s);s+=100}for(s=500;s>0;){if(h.has(s))return h.get(s);s-=100}}}}catch(v){a.e(v)}finally{a.f()}}));class et{constructor(e){S(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 Je(e,r,n,o,i)}}var tt={x:0,y:0,width:0,height:0};class rt extends fe{constructor(e){super(e),S(this,"ssdfFontFamilies",{}),S(this,"msdfFontFamilies",{}),S(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]),S(this,"sdfShader",void 0),S(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&&O(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&O(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 U}addFontFace(e){C(e instanceof U);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 B,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 s=`SdfTextRenderer: Could not resolve font face for family: '${e.props.fontFamily}'`;return console.error(s),void this.setStatus(e,"failed",new Error(s))}t.texture.setRenderableOwner(e,e.isRenderable)}if(t.loaded){C(t.data,"Font face data should be loaded");var a=e.props,l=a.text,d=a.fontSize,h=a.x,u=a.y,c=a.contain,f=a.width,p=a.height,v=a.lineHeight,g=a.verticalAlign,m=a.scrollable,x=a.overflowSuffix,y=a.maxLines,b="both"===c&&m?e.props.scrollY:0,w=e.renderWindow,S=t.data.info.size,A=d/S,T=v/A;e.distanceRange=A*t.data.distanceField.distanceRange;var _=24*l.length,k=e.vertexBuffer;(!k||k.length<_)&&(k=new Float32Array(2*_));var I=e.elementBounds;if(I.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),I.valid=!0),!i&&w.valid){var B=w.screen;if(h+B.x1<=I.x1&&h+B.x2>=I.x2&&u-b+B.y1<=I.y1&&u-b+B.y2>=I.y2)return void this.setStatus(e,"loaded");w.valid=!1,this.setStatus(e,"loading")}var R=e.props,E=R.offsetY,N=R.textAlign;if(!w.valid){if(!O(I,this.rendererBounds))return;Ve(w,h,u,b,v,"both"===c?I.y2-I.y1:0,I,A)}var F=function(e,t,r,n,o,i,s,a,l){var d=Math.min(Math.max(s.firstLineIdx,0),a.length),h=0;"middle"===n?h=(t-e)/2:"bottom"===n&&(h=t-e);var u=o/i+d*t+h;if(!(l&&u>=l/i))return{sdfX:0,sdfY:u,lineIndex:d}}(S,T,0,g,E,A,w,n,r);if(F){var L=e.props.letterSpacing,z=Ge(F.lineIndex,F.sdfX,F.sdfY,l,N,f,p,d,v,L,k,c,n,w.sdf,t,i,m,x,y);e.bufferUploaded=!1,e.bufferNumFloats=z.bufferNumFloats,e.bufferNumQuads=z.bufferNumQuads,e.vertexBuffer=k,e.renderWindow=w,o.lastLayoutNumCharacters=z.layoutNumCharacters,o.bufferSize=k.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){var o,i;if(e.vertexBuffer){var s=this.stage.renderer,a=e.props,l=a.fontSize,d=a.color,h=a.contain,u=a.scrollable,c=a.zIndex,f=a.debug,p="both"===h&&u?e.props.scrollY:0,v=e.textW,g=void 0===v?0:v,m=e.textH,x=void 0===m?0:m,y=e.distanceRange,b=e.vertexBuffer,w=e.bufferUploaded,S=e.trFontFace,A=e.elementBounds,T=e.webGlBuffers;if(!T){var _=s.glw,k=4*Float32Array.BYTES_PER_ELEMENT,I=_.createBuffer();C(I),e.webGlBuffers=new W([{buffer:I,attributes:{a_position:{name:"a_position",size:2,type:_.FLOAT,normalized:!1,stride:k,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:_.FLOAT,normalized:!1,stride:k,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,C(e.webGlBuffers),T=e.webGlBuffers}if(!w){var B,R,E=s.glw,F=null!==(B=null===(R=T)||void 0===R?void 0:R.getBuffer("a_textureCoordinate"))&&void 0!==B?B:null;E.arrayBufferData(F,b,E.STATIC_DRAW),e.bufferUploaded=!0}if(C(S),u&&"both"===h){C(A.valid);var L=Y(A,tt);r.valid?(e.clippingRect.valid=!0,r=N(r,L,e.clippingRect)):(e.clippingRect.valid=!0,r=j(L,e.clippingRect))}var z=new H(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:Q(d,n),size:l/((null===(o=S.data)||void 0===o?void 0:o.info.size)||0),scrollY:p,distanceRange:y,debug:f.sdfShaderDebug},n,r,{height:x,width:g},0,c),M=null===(i=e.trFontFace)||void 0===i?void 0:i.texture;C(M);var P=this.stage.txManager.getCtxTexture(M);z.addTexture(P),z.length=e.bufferNumFloats,z.numQuads=e.bufferNumQuads,s.addRenderOp(z)}}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 et.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 nt(e,t){return ot.apply(this,arguments)}function ot(){return(ot=y(m().mark((function e(t,r){var n,o,i;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Loading core extension",t),e.next=4,he((()=>b.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 K)){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 it(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[s]||(console.warn(`Custom Data value for ${o} is not a boolean, string, or number, it will be ignored`),delete e[o])}}return e}class st extends B{constructor(e,t,r){var n,o,i,s;super(),S(this,"root",null),S(this,"driver",void 0),S(this,"canvas",void 0),S(this,"settings",void 0),S(this,"inspector",null),S(this,"nodes",new Map),S(this,"nextTextureId",1),S(this,"textureTracker",void 0);var a={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!==(s=e.enableInspector)&&void 0!==s&&s};this.settings=a;var l=a.appWidth,d=a.appHeight,h=a.deviceLogicalPixelRatio,u=a.devicePhysicalPixelRatio,c=a.enableInspector,f=e=>{this.driver.releaseTexture(e)},p=a.experimental_FinalizationRegistryTextureUsageTracker&&"function"==typeof FinalizationRegistry;this.textureTracker=p?new ie(f):new oe(f,this.settings.textureCleanupOptions);var v=l*h,g=d*h;this.driver=r;var m,x=document.createElement("canvas");if(this.canvas=x,x.width=v*u,x.height=g*u,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&&!T()&&(this.inspector=new de(x,a))}init(){var e=this;return y(m().mark((function t(){return m().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,s,a,l,d,h,u,c,f,p,v,g,m,x,y,b=null!==(t=e.fontSize)&&void 0!==t?t:16,S=w(w({},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!==(s=e.fontWeight)&&void 0!==s?s:"normal",fontStretch:null!==(a=e.fontStretch)&&void 0!==a?a:"normal",textAlign:null!==(l=e.textAlign)&&void 0!==l?l:"left",contain:null!==(d=e.contain)&&void 0!==d?d:"none",scrollable:null!==(h=e.scrollable)&&void 0!==h&&h,scrollY:null!==(u=e.scrollY)&&void 0!==u?u: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,S):this.driver.createTextNode(S)}resolveNodeDefaults(e){var t,r,n,o,i,s,a,l,d,h,u,c,f,p,v,g,m,x,y,b,w,S,A,C,T,_,k,I,B,R,E,N,F,L,z,M,P,D,O,U,W,Y,j,H,Q,K,$,X=null!==(t=e.color)&&void 0!==t?t:4294967295,G=null!==(r=null!==(n=null!==(o=e.colorTl)&&void 0!==o?o:e.colorTop)&&void 0!==n?n:e.colorLeft)&&void 0!==r?r:X,V=null!==(i=null!==(s=null!==(a=e.colorTr)&&void 0!==a?a:e.colorTop)&&void 0!==s?s:e.colorRight)&&void 0!==i?i:X,Z=null!==(l=null!==(d=null!==(h=e.colorBl)&&void 0!==h?h:e.colorBottom)&&void 0!==d?d:e.colorLeft)&&void 0!==l?l:X,q=null!==(u=null!==(c=null!==(f=e.colorBr)&&void 0!==f?f:e.colorBottom)&&void 0!==c?c:e.colorRight)&&void 0!==u?u:X,J=it(null!==(p=e.data)&&void 0!==p?p:{});return{x:null!==(v=e.x)&&void 0!==v?v:0,y:null!==(g=e.y)&&void 0!==g?g:0,width:null!==(m=e.width)&&void 0!==m?m:0,height:null!==(x=e.height)&&void 0!==x?x:0,alpha:null!==(y=e.alpha)&&void 0!==y?y:1,autosize:null!==(b=e.autosize)&&void 0!==b&&b,clipping:null!==(w=e.clipping)&&void 0!==w&&w,color:X,colorTop:null!==(S=e.colorTop)&&void 0!==S?S:X,colorBottom:null!==(A=e.colorBottom)&&void 0!==A?A:X,colorLeft:null!==(C=e.colorLeft)&&void 0!==C?C:X,colorRight:null!==(T=e.colorRight)&&void 0!==T?T:X,colorBl:Z,colorBr:q,colorTl:G,colorTr:V,zIndex:null!==(_=e.zIndex)&&void 0!==_?_:0,zIndexLocked:null!==(k=e.zIndexLocked)&&void 0!==k?k:0,parent:null!==(I=e.parent)&&void 0!==I?I:null,texture:null!==(B=e.texture)&&void 0!==B?B:null,shader:null!==(R=e.shader)&&void 0!==R?R:null,src:null!==(E=e.src)&&void 0!==E?E:"",scale:null!==(N=e.scale)&&void 0!==N?N:null,scaleX:null!==(F=null!==(L=e.scaleX)&&void 0!==L?L:e.scale)&&void 0!==F?F:1,scaleY:null!==(z=null!==(M=e.scaleY)&&void 0!==M?M:e.scale)&&void 0!==z?z:1,mount:null!==(P=e.mount)&&void 0!==P?P:0,mountX:null!==(D=null!==(O=e.mountX)&&void 0!==O?O:e.mount)&&void 0!==D?D:0,mountY:null!==(U=null!==(W=e.mountY)&&void 0!==W?W:e.mount)&&void 0!==U?U:0,pivot:null!==(Y=e.pivot)&&void 0!==Y?Y:.5,pivotX:null!==(j=null!==(H=e.pivotX)&&void 0!==H?H:e.pivot)&&void 0!==j?j:.5,pivotY:null!==(Q=null!==(K=e.pivotY)&&void 0!==K?K:e.pivot)&&void 0!==Q?Q:.5,rotation:null!==($=e.rotation)&&void 0!==$?$:0,data:J}}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:w(w({},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 at extends B{constructor(e,t,r){super(),S(this,"node",void 0),S(this,"props",void 0),S(this,"settings",void 0),S(this,"propStartValues",{}),S(this,"restoreValues",{}),S(this,"progress",0),S(this,"delayFor",0),S(this,"timingFunction",void 0),S(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=$(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 s=0;s{this.startedResolve=e})))}makeStoppedPromise(){null===this.stoppedResolve&&(this.stoppedPromise=new Promise((e=>{this.stoppedResolve=e})))}started(){C(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){C(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 dt{constructor(e){S(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 ut}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],s=e.data[1]*t.data[0]+e.data[4]*t.data[1]+e.data[7]*t.data[2],a=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],h=e.data[2]*t.data[3]+e.data[5]*t.data[4]+e.data[8]*t.data[5],u=e.data[2]*t.data[6]+e.data[5]*t.data[7]+e.data[8]*t.data[8];return r||(r=new dt),r.data[0]=n,r.data[3]=o,r.data[6]=i,r.data[1]=s,r.data[4]=a,r.data[7]=l,r.data[2]=d,r.data[5]=h,r.data[8]=u,r}static identity(e){return e||(e=new dt),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 dt),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 dt),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 dt),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 dt),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,s=this.data[4]*t-this.data[1]*r;return this.data[0]=n,this.data[3]=o,this.data[1]=i,this.data[4]=s,this}multiply(e){return dt.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 ht,ut=new dt;class ct{constructor(e){S(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,s,a,l){return l||(l=new ct),l.data[0]=e,l.data[2]=r,l.data[4]=o,l.data[6]=s,l.data[1]=t,l.data[3]=n,l.data[5]=i,l.data[7]=a,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"}(ht||(ht={}));var ft,pt=new Map;pt.set(ht.Init,"init"),pt.set(ht.OutOfBounds,"outOfBounds"),pt.set(ht.InBounds,"inBounds"),pt.set(ht.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"}(ft||(ft={}));class vt extends B{constructor(e,t){super(),S(this,"stage",void 0),S(this,"children",[]),S(this,"props",void 0),S(this,"updateType",ft.All),S(this,"globalTransform",void 0),S(this,"scaleRotateTransform",void 0),S(this,"localTransform",void 0),S(this,"renderCoords",void 0),S(this,"renderBound",void 0),S(this,"strictBound",void 0),S(this,"preloadBound",void 0),S(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1}),S(this,"isRenderable",!1),S(this,"renderState",ht.Init),S(this,"worldAlpha",1),S(this,"premultipliedColorTl",0),S(this,"premultipliedColorTr",0),S(this,"premultipliedColorBl",0),S(this,"premultipliedColorBr",0),S(this,"calcZIndex",0),S(this,"onTextureLoaded",((e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})})),S(this,"onTextureFailed",((e,t)=>{this.emit("failed",{type:"texture",error:t})})),S(this,"onTextureFreed",(e=>{this.emit("freed",{type:"texture"})})),this.stage=e,this.props=w(w({},t),{},{parent:null}),this.parent=t.parent,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(ft.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(ft.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){var r=this.stage.renderer.getShaderManager();C(r);var n=r.loadShader(e,t),o=n.shader,i=n.props;this.props.shader=o,this.props.shaderProps=i,this.setUpdateType(ft.IsRenderable)}setUpdateType(e){this.updateType|=e;var t=this.props.parent;!t||t.updateType&ft.Children||t.setUpdateType(ft.Children)}sortChildren(){this.children.sort(((e,t)=>e.calcZIndex-t.calcZIndex))}updateScaleRotateTransform(){this.scaleRotateTransform=dt.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){C(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=dt.translate(e-r+this.props.x,t-n+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(ft.Global)}update(e,t){this.updateType&ft.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(ft.Local)),this.updateType&ft.Local&&(this.updateLocalTransform(),this.setUpdateType(ft.Global));var r=this.props.parent,n=ft.None;this.updateType&ft.Global&&(C(this.localTransform),this.globalTransform=dt.copy((null==r?void 0:r.globalTransform)||this.localTransform,this.globalTransform),r&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(ft.Clipping|ft.RenderState|ft.Children),n|=ft.Global),this.updateType&ft.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(ft.Children),n|=ft.Clipping),this.updateType&ft.WorldAlpha&&(this.worldAlpha=r?r.worldAlpha*this.props.alpha:this.props.alpha,this.setUpdateType(ft.Children|ft.PremultipliedColors|ft.IsRenderable),n|=ft.WorldAlpha),this.updateType&ft.PremultipliedColors&&(this.premultipliedColorTl=L(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=L(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=L(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=L(this.props.colorBr,this.worldAlpha,!0))),this.updateType&ft.RenderState&&(this.updateRenderState(t),this.setUpdateType(ft.IsRenderable)),this.updateType&ft.IsRenderable&&this.updateIsRenderable(),r&&this.updateType&ft.CalculatedZIndex&&(this.calculateZIndex(),r.setUpdateType(ft.ZIndexSortedChildren)),this.updateType&ft.Children&&this.children.length&&this.children.forEach((t=>{t.setUpdateType(n),0!==t.updateType&&t.update(e,this.clippingRect)})),this.updateType&ft.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){C(this.renderBound);var t=e.width||this.stage.root.width,r=e.height||this.stage.root.height;this.strictBound=k(e.x,e.y,e.x+t,e.y+r,this.strictBound);var n=this.stage.boundsMargin;return this.preloadBound=k(e.x-n[3],e.y-n[0],e.x+t+n[1],e.y+r+n[2],this.preloadBound),G(this.renderBound,this.strictBound)?ht.InViewport:G(this.renderBound,this.preloadBound)?ht.InBounds:ht.OutOfBounds}updateRenderState(e){var t=this.checkRenderBounds(e);if(t!==this.renderState){var r=this.renderState;this.renderState=t,r===ht.InViewport&&this.emit("outOfViewport",{previous:r,current:t}),(rht.InBounds&&t===ht.OutOfBounds)&&(this.emit(pt.get(ht.InBounds),{previous:r,current:t}),r=ht.InBounds);var n=pt.get(t);C(n),this.emit(n,{previous:r,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(ht[e]))}updateIsRenderable(){var e;e=!(0===this.worldAlpha||!this.checkRenderProps())&&this.renderState>ht.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;C(r);var n=r.tx,o=r.ty,i=r.ta,s=r.tb,a=r.tc,l=r.td;if(0===s&&0===a){var d=n,h=n+e*i,u=o,c=o+t*l;this.renderCoords=ct.translate(d,u,h,u,h,c,d,c,this.renderCoords)}else this.renderCoords=ct.translate(n,o,n+e*i,o+e*a,n+e*i+t*s,o+e*a+t*l,n+t*s,o+t*l,this.renderCoords)}updateBoundingRect(){var e=this.renderCoords,t=this.globalTransform;C(t),C(e);var r=t.tb,n=t.tc,o=e.x1,i=e.y1,s=e.x3,a=e.y3;if(0===r||0===n)this.renderBound=k(o,i,s,a,this.renderBound);else{var l=e.x2,d=e.x4,h=e.y2,u=e.y4;this.renderBound=k(Math.min(o,l,s,d),Math.min(i,h,a,u),Math.max(o,l,s,d),Math.max(i,h,a,u),this.renderBound)}}calculateClippingRect(e){C(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?N(e,t,t):e.valid&&(j(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(ft.CalculatedZIndex)}))}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(ft.CalculatedZIndex|ft.Children),this.children.forEach((e=>{e.setUpdateType(ft.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);C(-1!==r,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(r,1),t.setUpdateType(ft.Children|ft.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(ft.All),e.setUpdateType(ft.Children|ft.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}var gt=1;function mt(){return gt++}class xt extends B{constructor(e,t,r,n){var o;super(),S(this,"rendererMain",void 0),S(this,"stage",void 0),S(this,"id",void 0),S(this,"coreNode",void 0),S(this,"_children",[]),S(this,"_src",""),S(this,"_parent",null),S(this,"_texture",null),S(this,"_shader",null),S(this,"_data",{}),S(this,"onTextureLoaded",((e,t)=>{this.emit("loaded",t)})),S(this,"onTextureFailed",((e,t)=>{this.emit("failed",t)})),S(this,"onTextureFreed",((e,t)=>{this.emit("freed",t)})),S(this,"onOutOfBounds",((e,t)=>{this.emit("outOfBounds",t)})),S(this,"onInBounds",((e,t)=>{this.emit("inBounds",t)})),S(this,"onOutOfViewport",((e,t)=>{this.emit("outOfViewport",t)})),S(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:mt(),this.coreNode=n||new vt(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}),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._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);C(-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 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=it(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 at(this.coreNode,e,t);return new lt(this.stage.animationManager,r)}}class yt{constructor(){S(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 bt{constructor(e){S(this,"imageWorkersEnabled",!0),S(this,"messageManager",{}),S(this,"workers",[]),S(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 s=g(i,2),a=s[0],l=s[1];delete this.messageManager[r],o?l(new Error(o)):a(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 wt extends P{constructor(e,t){super(e),S(this,"props",void 0),this.props=wt.resolveDefaults(t)}getTextureData(){var e=this;return y(m().mark((function t(){var r,n,o,i,s,a,l;return m().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,s=new Uint8ClampedArray(i),a=0;a{})}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()}))}}class Ct extends B{constructor(e){super(),S(this,"options",void 0),S(this,"animationManager",void 0),S(this,"txManager",void 0),S(this,"txMemManager",void 0),S(this,"fontManager",void 0),S(this,"textRenderers",void 0),S(this,"shManager",void 0),S(this,"renderer",void 0),S(this,"root",void 0),S(this,"boundsMargin",void 0),S(this,"deltaTime",0),S(this,"lastFrameTime",0),S(this,"currentFrameTime",0),S(this,"fpsNumFrames",0),S(this,"fpsElapsedTime",0),S(this,"renderRequested",!1),S(this,"contextSpy",null),this.options=e;var t=e.canvas,r=e.clearColor,n=e.rootId,o=e.debug,i=e.appWidth,s=e.appHeight,a=e.boundsMargin,l=e.enableContextSpy,d=e.numImageWorkers,h=e.txMemByteThreshold;this.txManager=new St(d),this.txMemManager=new At(h),this.shManager=new We,this.animationManager=new yt,this.contextSpy=l?new Ye:null;var u=[0,0,0,0];a&&(u=Array.isArray(a)?a:[a,a,a,a]),this.boundsMargin=u,null!=o&&o.monitorTextureCache&&setInterval((()=>{C(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 q({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 ye(this),sdf:new rt(this)},this.fontManager=new et(this.textRenderers);var c,f,p,v=new vt(this,{id:n,x:0,y:0,width:i,height:s,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});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(),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){C(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}})})),S(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(ft.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(ft.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),C(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){C(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}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 _t extends xt{constructor(e,t,r){super(e,t,r,new Tt(r,{id:mt(),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}))}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 kt{constructor(){S(this,"root",null),S(this,"stage",null),S(this,"rendererMain",null)}init(e,t,r){var n=this;return y(m().mark((function o(){var i;return m().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n.stage=new Ct({rootId:mt(),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,C(n.stage.root),i=new xt(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,nt(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){C(this.rendererMain),C(this.stage);var t=new xt(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}createTextNode(e){C(this.rendererMain),C(this.stage);var t=new _t(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;C(t),t.txManager.removeTextureIdFromCache(e)}getRootNode(){return C(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.")}}var It,Bt=(e,t)=>e===t,Rt=Symbol("solid-proxy"),Et=Symbol("solid-track"),Nt={equals:Bt},Ft=pr,Lt=1,zt=2,Mt={owned:null,cleanups:null,context:null,owner:null},Pt={},Dt=null,Ot=null,Ut=null,Wt=null,Yt=null,jt=0;function Ht(e,t){var r=Ut,n=Dt,o=0===e.length,i=void 0===t?n:t,s=o?Mt:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e((()=>qt((()=>xr(s)))));Dt=s,Ut=null;try{return fr(a,!0)}finally{Ut=r,Dt=n}}function Qt(e,t){var r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Nt,t):Nt).equals||void 0};return[lr.bind(r),e=>("function"==typeof e&&(e=e(r.value)),dr(r,e))]}function Kt(e,t,r){hr(ur(e,t,!0,Lt))}function $t(e,t,r){hr(ur(e,t,!1,Lt))}function Xt(e,t,r){Ft=vr;var n=ur(e,t,!1,Lt);r&&r.render||(n.user=!0),Yt?Yt.push(n):hr(n)}function Gt(e,t,r){r=r?Object.assign({},Nt,r):Nt;var n=ur(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,hr(n),lr.bind(n)}function Vt(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 s=null,a=Pt,l=!1,d="initialValue"in i,h="function"==typeof n&&Gt(n),u=new Set,c=g((i.storage||Qt)(i.initialValue),2),f=c[0],p=c[1],v=g(Qt(void 0),2),m=v[0],x=v[1],y=g(Qt(void 0,{equals:!1}),2),b=y[0],w=y[1],S=g(Qt(d?"ready":"unresolved"),2),C=S[0],T=S[1];function _(e,t,r,n){return s===e&&(s=null,void 0!==n&&(d=!0),e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(n,{value:t}))),a=Pt,function(e,t){fr((()=>{void 0===t&&p((()=>e)),T(void 0!==t?"errored":d?"ready":"unresolved"),x(t);var r,n=A(u.keys());try{for(n.s();!(r=n.n()).done;){r.value.decrement()}}catch(t){n.e(t)}finally{n.f()}u.clear()}),!1)}(t,r)),t}function k(){var e=It,t=f(),r=m();if(void 0!==r&&!s)throw r;return Ut&&!Ut.user&&e&&Kt((()=>{b(),s&&(e.resolved||u.has(e)||(e.increment(),u.add(e)))})),t}function I(e=!0){if(!1===e||!l){l=!1;var t=h?h():n;if(null!=t&&!1!==t){var r,i=a!==Pt?a:qt((()=>o(t,{value:f(),refetching:e})));return(r=i)&&"object"==typeof r&&"then"in r?(s=i,"value"in i?("success"===i.status?_(s,i.value,void 0,t):_(s,void 0,void 0,t),i):(l=!0,queueMicrotask((()=>l=!1)),fr((()=>{T(d?"refreshing":"pending"),w()}),!1),i.then((e=>_(i,e,void 0,t)),(e=>_(i,void 0,yr(e),t))))):(_(s,i,void 0,t),i)}_(s,qt(f))}}return Object.defineProperties(k,{state:{get:()=>C()},error:{get:()=>m()},loading:{get(){var e=C();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return k();var e=m();if(e&&!s)throw e;return f()}}}),h?Kt((()=>I(!1))):I(!1),[k,{refetch:I,mutate:p}]}function Zt(e,t=Bt,r){var n=new Map,o=ur((r=>{var o,i=e(),s=A(n.entries());try{for(s.s();!(o=s.n()).done;){var a=g(o.value,2),l=a[0],d=a[1];if(t(l,i)!==t(l,r)){var h,u=A(d.values());try{for(u.s();!(h=u.n()).done;){var c=h.value;c.state=Lt,c.pure?Wt.push(c):Yt.push(c)}}catch(f){u.e(f)}finally{u.f()}}}}catch(f){s.e(f)}finally{s.f()}return i}),void 0,!0,Lt);return hr(o),e=>{var r,i=Ut;i&&((r=n.get(e))?r.add(i):n.set(e,r=new Set([i])),tr((()=>{r.delete(i),!r.size&&n.delete(e)})));return t(e,o.value)}}function qt(e){if(null===Ut)return e();var t=Ut;Ut=null;try{return e()}finally{Ut=t}}function Jt(e,t,r){var n,o=Array.isArray(e),i=r&&r.defer;return r=>{var s;if(o){s=Array(e.length);for(var a=0;at(s,n,r)));return n=s,l}}function er(e){Xt((()=>qt(e)))}function tr(e){return null===Dt||(null===Dt.cleanups?Dt.cleanups=[e]:Dt.cleanups.push(e)),e}function rr(){return Dt}function nr(e,t){var r=Dt,n=Ut;Dt=e,Ut=null;try{return fr(t,!0)}catch(o){br(o)}finally{Dt=r,Ut=n}}function or(e){var t=Ut,r=Dt;return Promise.resolve().then((()=>{Ut=t,Dt=r,fr(e,!1),Ut=Dt=null}))}function ir(e,t){var r=Symbol("context");return{id:r,Provider:Sr(r),defaultValue:e}}function sr(e){return Dt&&Dt.context&&void 0!==Dt.context[e.id]?Dt.context[e.id]:e.defaultValue}function ar(e){var t=Gt(e),r=Gt((()=>wr(t())));return r.toArray=()=>{var e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function lr(){if(this.sources&&this.state)if(this.state===Lt)hr(this);else{var e=Wt;Wt=null,fr((()=>gr(this)),!1),Wt=e}if(Ut){var t=this.observers?this.observers.length:0;Ut.sources?(Ut.sources.push(this),Ut.sourceSlots.push(t)):(Ut.sources=[this],Ut.sourceSlots=[t]),this.observers?(this.observers.push(Ut),this.observerSlots.push(Ut.sources.length-1)):(this.observers=[Ut],this.observerSlots=[Ut.sources.length-1])}return this.value}function dr(e,t,r){var n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&fr((()=>{for(var t=0;t1e6)throw Wt=[],new Error}),!1)),t}function hr(e){if(e.fn){xr(e);var t=jt;!function(e,t,r){var n,o=Dt,i=Ut;Ut=Dt=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=Lt,e.owned&&e.owned.forEach(xr),e.owned=null),e.updatedAt=r+1,br(s)}finally{Ut=i,Dt=o}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?dr(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}}function ur(e,t,r,n=Lt,o){var i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Dt,context:Dt?Dt.context:null,pure:r};return null===Dt||Dt!==Mt&&(Dt.owned?Dt.owned.push(i):Dt.owned=[i]),i}function cr(e){if(0!==e.state){if(e.state===zt)return gr(e);if(e.suspense&&qt(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===Lt)hr(e);else if(e.state===zt){var n=Wt;Wt=null,fr((()=>gr(e,t[0])),!1),Wt=n}}}function fr(e,t){if(Wt)return e();var r=!1;t||(Wt=[]),Yt?r=!0:Yt=[],jt++;try{var n=e();return function(e){Wt&&(pr(Wt),Wt=null);if(e)return;var t=Yt;Yt=null,t.length&&fr((()=>Ft(t)),!1)}(r),n}catch(o){r||(Yt=null),Wt=null,br(o)}}function pr(e){for(var t=0;t=0;t--)xr(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 yr(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function br(e,t=Dt){throw yr(e)}function wr(e){if("function"==typeof e&&!e.length)return wr(e());if(Array.isArray(e)){for(var t=[],r=0;rr=qt((()=>(Dt.context=w(w({},Dt.context),{},{[e]:t.value}),ar((()=>t.children)))))),void 0),r}}var Ar=Symbol("fallback");function Cr(e){for(var t=0;te(t||{})))}function _r(){return!0}var kr={get:(e,t,r)=>t===Rt?r:e.get(t),has:(e,t)=>t===Rt||e.has(t),set:_r,deleteProperty:_r,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:_r,deleteProperty:_r}),ownKeys:e=>e.keys()};function Ir(e){return(e="function"==typeof e?e():e)?e:{}}function Br(){for(var e=0,t=this.length;e=0;r--){var n=Ir(e[r])[t];if(void 0!==n)return n}},has(t){for(var r=e.length-1;r>=0;r--)if(t in Ir(e[r]))return!0;return!1},keys(){for(var t=[],r=0;r=0;s--){var a=e[s];if(a)for(var l=Object.getOwnPropertyNames(a),d=function(){var e=l[h];if("__proto__"===e||"constructor"===e)return 1;var t=Object.getOwnPropertyDescriptor(a,e);if(i[e]){var r=o[e];r&&(t.get?r.push(t.get.bind(a)):void 0!==t.value&&r.push((()=>t.value)))}else i[e]=t.get?{enumerable:!0,configurable:!0,get:Br.bind(o[e]=[t.get.bind(a)])}:void 0!==t.value?t:void 0},h=l.length-1;h>=0;h--)d()}for(var u={},c=Object.keys(i),f=c.length-1;f>=0;f--){var p=c[f],v=i[p];v&&v.get?Object.defineProperty(u,p,v):u[p]=v?v.value:void 0}return u}var Er=e=>`Stale read from <${e}>.`;function Nr(e){var t="fallback"in e&&{fallback:()=>e.fallback};return Gt(function(e,t,r={}){var n=[],o=[],i=[],s=0,a=t.length>1?[]:null;return tr((()=>Cr(i))),()=>{var l,d,h=e()||[];return h[Et],qt((()=>{var e,t,c,f,p,v,g,m,x,y=h.length;if(0===y)0!==s&&(Cr(i),i=[],n=[],o=[],s=0,a&&(a=[])),r.fallback&&(n=[Ar],o[0]=Ht((e=>(i[0]=e,r.fallback()))),s=1);else if(0===s){for(o=new Array(y),d=0;d=v&&m>=v&&n[g]===h[m];g--,m--)c[m]=o[g],f[m]=i[g],a&&(p[m]=a[g]);for(e=new Map,t=new Array(m+1),d=m;d>=v;d--)x=h[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],a&&(p[d]=a[l]),d=t[d],e.set(x,d)):i[l]();for(d=v;de.each),e.children,t||void 0))}function Fr(e){var t=e.keyed,r=Gt((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return Gt((()=>{var n=r();if(n){var o=e.children;return"function"==typeof o&&o.length>0?qt((()=>o(t?n:()=>{if(!qt(r))throw Er("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}var Lr,zr;function Mr(e={},t="app"){var r=new kt;return Lr=new st(e,t,r),zr=Lr.createShader.bind(Lr),Lr}class Pr extends Array{constructor(e){super(),S(this,"_parent",void 0),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 Dr={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Or(e,t,...r){false}function Ur(e){return"function"==typeof e}function Wr(e){return Array.isArray(e)}function Yr(e,t={}){if(Wr(e))e.forEach((e=>{Yr(e,t)}));else if(e)for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t}class jr extends Array{constructor(e,t={}){return Wr(t)?(super(...t),S(this,"onChange",void 0)):"string"==typeof t?(super(t),S(this,"onChange",void 0)):(super(...Object.entries(t).filter((([e,t])=>t)).map((([e])=>e))),S(this,"onChange",void 0)),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 Hr=g(Qt(void 0),2),Qr=Hr[0],Kr=Hr[1],$r=Dr.animationSettings;function Xr(e){for(var t=[],r=0,n=Object.entries(e);rKr(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 Wr(e)?this._style=Yr(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=A(this.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.id===e)return n;if(n instanceof Vr){var o=n.searchChildrenById(e);if(o)return o}}}catch(i){r.e(i)}finally{r.f()}}set states(e){this._states=new jr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new jr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||$r}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){if(this.hasChildren){var r;if(Or(),Ur(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),"flex"===this.display)if(function(e){for(var t=[],r=0;re+(t[s]||0)),0));var x=f&&g?e=>{"flexStart"===g?e[u]=0:"center"===g?e[u]=(f-(e[a]||0))/2:"flexEnd"===g&&(e[u]=f-(e[a]||0))}:e=>e;if("flexStart"===v){var y=0;if(t.forEach((e=>{e[h]=y+(e[l]||0),y+=(e[s]||0)+p+(e[l]||0)+(e[d]||0),x(e)})),e._autosized){var b=y-p;if(b!==e[s])return e[s]=b,!0}}else if("flexEnd"===v)for(var w=c,S=o-1;S>=0;S--){var A=t[S];C(A),A[h]=w-(A[s]||0)-(A[d]||0),w-=(A[s]||0)+p+(A[l]||0)+(A[d]||0),x(A)}else if("center"===v){var T=(c-(m+p*(o-1)))/2;t.forEach((e=>{e[h]=T,T+=(e[s]||0)+p,x(e)}))}else if("spaceBetween"===v){var _=(c-m)/(o-1),k=0;t.forEach((e=>{e[h]=k,k+=(e[s]||0)+_,x(e)}))}else if("spaceEvenly"===v){var I=(c-m)/(o+1),B=I;t.forEach((e=>{e[h]=B,B+=(e[s]||0)+I,x(e)}))}return!1}(this))null===(r=this.parent)||void 0===r||r.updateLayout();Ur(this.onLayout)&&this.onLayout.call(this,e,t)}}_stateChanged(){if(Or(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=A(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=w(w({},e),r)),e}),{});this._undoStyles=Object.keys(n),void 0!==n.transition&&(this.transition=n.transition),Object.assign(this,w(w({},r),n))}}render(){var e=this,t=this.parent;if(t)if(t.rendered)if(this.rendered)console.warn("Node already rendered: ",this);else{t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();var r=e._renderProps;t.lng&&(r.parent=t.lng),e._effects&&(this.shader=Xr(e._effects)),e.isTextNode()?((r=w(w(w({},Dr.fontSettings),r),{},{text:e.getText()})).contain&&(r.width||(r.width=(t.width||0)-(r.x||0)-(r.marginRight||0),e._width=r.width,e._autosized=!0),"both"!==r.contain||r.height||r.maxLines||(r.height=(t.height||0)-(r.y||0)-(r.marginBottom||0),e._height=r.height,e._autosized=!0)),Or(0,0),e.lng=Lr.createTextNode(r),Ur(e.onLoad)&&e.lng.on("loaded",e.onLoad),e.width&&e.height||(e._autosized=!0,e._resizeOnTextLoad())):(r.texture||(isNaN(r.width)&&(r.width=(t.width||0)-(r.x||0),e._width=r.width,e._autosized=!0),isNaN(r.height)&&(r.height=(t.height||0)-(r.y||0),e._height=r.height,e._autosized=!0),r.color||r.src||(e._color=r.color=0)),Or(0,0),e.lng=Lr.createNode(r),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,Ur(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),delete this._renderProps,"text"!==e.name&&e.children.forEach((e=>{e.render?e.render():""!==e.text&&console.warn("TextNode outside of : ",e)})),e.autofocus&&e.setFocus()}else console.warn("Parent not rendered yet: ",this);else console.warn("Parent not set - no node created for: ",this)}}for(var Zr=function(){var e=Jr[qr];Object.defineProperty(Vr.prototype,e,{get(){var t;return null!==(t=this.lng&&this.lng[e])&&void 0!==t?t:this[`_${e}`]},set(t){this[`_${e}`]=t,this._sendToLightningAnimatable(e,t)}})},qr=0,Jr=["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"];qr{return t=cn("text"),pn(t,e,!1),t;var t},on=e=>{return t=cn("node"),pn(t,e,!1),t;var t};function sn({createElement:e,createTextNode:t,isTextNode:r,replaceText:n,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:l,getNextSibling:d}){function h(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return u(e,t,n,r);$t((n=>u(e,t(),n,r)),n)}function u(e,i,s,a,d){for(;"function"==typeof s;)s=s();if(i===s)return s;var h=typeof i,m=void 0!==a;if("string"===h||"number"===h)if("number"===h&&(i=i.toString()),m){var x=s[0];x&&r(x)?n(x,i):x=t(i),s=p(e,s,a,x)}else""!==s&&"string"==typeof s?n(l(e),s=i):(p(e,s,a,t(i)),s=i);else if(null==i||"boolean"===h)s=p(e,s,a);else{if("function"===h)return $t((()=>{for(var t=i();"function"==typeof t;)t=t();s=u(e,t,s,a)})),()=>s;if(Array.isArray(i)){var y=[];if(c(y,i,d))return $t((()=>s=u(e,y,s,a,!0))),()=>s;if(0===y.length){var b=p(e,s,a);if(m)return s=b}else Array.isArray(s)?0===s.length?v(e,y,a):f(e,s,y):null==s||""===s?v(e,y):f(e,m&&s||[l(e)],y);s=y}else{if(Array.isArray(s)){if(m)return s=p(e,s,a,i);p(e,s,null,i)}else null!=s&&""!==s&&l(e)?g(e,i,l(e)):o(e,i);s=i}}return s}function c(e,r,n){for(var o=!1,i=0,s=r.length;im-h)for(var w=t[l];h=0;c--){var f=r[c];if(h!==f){var p=a(f)===e;u||c?p&&i(e,f):p?g(e,h,f):o(e,h,n)}else u=!0}else o(e,h,n);return[h]}function v(e,t,r){for(var n=0,i=t.length;nr.children=u(e,t.children,r.children))),$t((()=>t.ref&&t.ref(e))),$t((()=>{for(var n in t)if("children"!==n&&"ref"!==n){var o=t[n];o!==r[n]&&(s(e,n,o,r[n]),r[n]=o)}})),r}return{render(e,t){var r;return Ht((n=>{r=n,h(t,e())})),r},insert:h,spread(e,t,r){"function"==typeof t?$t((n=>m(e,t(),n,r))):m(e,t,void 0,r)},createElement:e,createTextNode:t,insertNode:o,setProp:(e,t,r,n)=>(s(e,t,r,n),r),mergeProps:Rr,effect:$t,memo:Gt,createComponent:Tr,use:(e,t,r)=>qt((()=>e(t,r)))}}var an={createElement:e=>new Vr(e),createTextNode:e=>({name:"TextNode",text:e,parent:void 0}),replaceText(e,t){Or(0,0),e.text=t;var r=e.parent;C(r),r.text=r.getText()},setProperty(e,t,r=!0){e[t]=r},insertNode(e,t,r){Or(0,0),e.children.insert(t,r),t._queueDelete=!1,t instanceof Vr?e.rendered&&t.render():e.isTextNode()&&(e.text=e.getText())},isTextNode:e=>e.isTextNode(),removeNode(e,t){Or(0,0),e.children.remove(t),t._queueDelete=!0,t instanceof Vr&&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 wn;function Sn(){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},s=A(e);try{var a=function(){var e=o.value;e.listener(w(w({},i),{},{from:e.location,retry:o=>{o&&(t=!0),e.navigate(r,w(w({},n),{},{resolve:!1}))}}))};for(s.s();!(o=s.n()).done;)a()}catch(l){s.e(l)}finally{s.f()}return!i.defaultPrevented}}}function An(){window.history.state&&null!=window.history.state._depth||window.history.replaceState(w(w({},window.history.state),{},{_depth:window.history.length-1}),""),wn=window.history.state._depth}An();var Cn=/^(?:[a-z0-9]+:)?\/\//i,Tn=/^\/+|(\/)\/+$/g,_n="http://sr";function kn(e,t=!1){var r=e.replace(Tn,"$1");return r?t||/^[?#]/.test(r)?r:"/"+r:""}function In(e,t,r){if(!Cn.test(t)){var n=kn(e),o=r&&kn(r),i="";return((i=!o||t.startsWith("/")?n:0!==o.toLowerCase().indexOf(n.toLowerCase())?n+o:o)||"/")+kn(t,!i)}}function Bn(e){var t={};return e.searchParams.forEach(((e,r)=>{t[r]=e})),t}function Rn(e,t,r){var n=g(e.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),a=s.length;return e=>{var n=e.split("/").filter(Boolean),o=n.length-a;if(o<0||o>0&&void 0===i&&!t)return null;for(var l={path:a?"":"/",params:{}},d=e=>void 0===r?void 0:r[e],h=0;h0===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 Nn(e){var t=new Map,r=rr();return new Proxy({},{get:(n,o)=>(t.has(o)||nr(r,(()=>t.set(o,Gt((()=>e()[o]))))),t.get(o)()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),ownKeys:()=>Reflect.ownKeys(e())})}function Fn(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 Fn(n).reduce(((e,t)=>[...e,...o.map((e=>e+t))]),[])}var Ln,zn=ir(),Mn=ir(),Pn=()=>function(e,t){if(null==e)throw new Error(t);return e}(sr(zn)," and 'use' router primitives can be only used inside a Route."),Dn=()=>Pn().navigatorFactory(),On=()=>Pn().params;function Un(e,t=""){var r=e.component,n=e.load,o=e.children,i=e.info,s=!o||Array.isArray(o)&&!o.length,a={key:e,component:r,load:n,info:i};return Yn(e.path).reduce(((r,n)=>{var o,i,l=A(Fn(n));try{for(l.s();!(o=l.n()).done;){var d=o.value,h=(i=d,kn(t).replace(/\/*(\*.*)?$/g,"")+kn(i)),u=s?h:h.split("/*",1)[0];u=u.split("/").map((e=>e.startsWith(":")||e.startsWith("*")?e:encodeURIComponent(e))).join("/"),r.push(w(w({},a),{},{originalPath:d,pattern:u,matcher:Rn(u,!s,e.matchFilters)}))}}catch(c){l.e(c)}finally{l.f()}return r}),[])}function Wn(e,t=0){return{routes:e,score:1e4*(r=e[e.length-1],n=g(r.pattern.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),s.reduce(((e,t)=>e+(t.startsWith(":")?2:3)),s.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(w(w({},i),{},{route:o}))}return r}};var r,n,o,i,s}function Yn(e){return Array.isArray(e)?e:[e]}function jn(e,t="",r=[],n=[]){for(var o=Yn(e),i=0,s=o.length;it.score-e.score))}function Hn(e,t){for(var r=0,n=e.length;re),h=l.renderPath||(e=>e),u=l.beforeLeave||Sn(),c=In("",n.base||"");if(void 0===c)throw new Error(`${c} is not a valid base path`);c&&!i().value&&s({value:c,replace:!0,scroll:!1});var f=g(Qt(!1),2),p=f[0],v=f[1],x=function(){var e=y(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,or(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)}}(),b=g(Qt(i().value),2),S=b[0],A=b[1],C=g(Qt(i().state),2),T=C[0],_=C[1],k=function(e,t){var r=new URL(_n),n=Gt((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=Gt((()=>n().pathname)),i=Gt((()=>n().search),!0),s=Gt((()=>n().hash));return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return t()},get key(){return""},query:Nn(Jt(i,(()=>Bn(n()))))}}(S,T),I=[],B=Qt([]),R=Gt((()=>Hn(t(),k.pathname))),E=Nn((()=>{for(var e=R(),t={},r=0;rc,outlet:()=>null,resolvePath:e=>In(c,e)};return $t((()=>{var e=i(),t=e.value,r=e.state;qt((()=>{t!==S()&&x((()=>{Ln="native",A(t),_(r),B[1]([])})).then((()=>{Ln=void 0}))}))})),{base:N,location:k,params:E,isRouting:p,renderPath:h,parsePath:d,navigatorFactory:function(e){return e=e||sr(Mn)||N,(t,r)=>function(e,t,r){qt((()=>{if("number"!=typeof t){var n=w({replace:!1,resolve:!0,scroll:!0},r),o=n.replace,i=n.resolve,a=n.scroll,d=n.state,h=i?e.resolvePath(t):In("",t);if(void 0===h)throw new Error(`Path '${t}' is not a routable path`);if(I.length>=100)throw new Error("Too many redirects");var c=S();if((h!==c||d!==T())&&u.confirm(h,r)){var f=I.push({value:c,replace:o,scroll:a,state:T()});x((()=>{Ln="navigate",A(h),_(d),B[1]([])})).then((()=>{var e,t;I.length===f&&(Ln=void 0,e={value:h,state:d},(t=I[0])&&(e.value===t.value&&e.state===t.state||s(w(w({},e),{},{replace:t.replace,scroll:t.scroll})),I.length=0))}))}}else t&&(l.go?l.go(t):console.warn("Router integration does not support relative routing"))}))}(e,t,r)},matches:R,beforeLeave:u,preloadRoute:function(e,n){var o=Hn(t(),e.pathname),i=Ln;Ln="preload";var s=function(){var t=o[a],i=t.route,s=t.params;i.component&&i.component.preload&&i.component.preload();var l=i.load;n&&l&&nr(r(),(()=>l({params:s,location:{pathname:e.pathname,search:e.search,hash:e.hash,query:Bn(e),state:null,key:""},intent:"preload"})))};for(var a in o)s();Ln=i},singleFlight:void 0===n.singleFlight||n.singleFlight,submissions:B}}var Kn=e=>t=>{var r,n=t.base,o=ar((()=>t.children)),i=Gt((()=>jn(o(),t.base||""))),s=Qn(e,i,(()=>r),{base:n,singleFlight:t.singleFlight});return e.create&&e.create(s),un(zn.Provider,{value:s,get children(){return un($n,{routerState:s,get root(){return t.root},get load(){return t.rootLoad},get children(){return[hn((()=>(r=rr())&&null)),un(Xn,{routerState:s,get branches(){return i()}})]}})}})};function $n(e){var t=e.routerState.location,r=e.routerState.params,n=Gt((()=>e.load&&qt((()=>e.load({params:r,location:t,intent:"preload"})))));return un(Fr,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>un(o,{params:r,location:t,get data(){return n()},get children(){return e.children}})})}function Xn(e){var t,r=[],n=Gt(Jt(e.routerState.matches,((o,i,s)=>{for(var a=i&&o.length===i.length,l=[],d=function(t){var d=i&&i[t],h=o[t];s&&d&&h.route.key===d.route.key?l[t]=s[t]:(a=!1,r[t]&&r[t](),Ht((o=>{r[t]=o,l[t]=function(e,t,r,n){var o=e.base,i=e.location,s=e.params,a=n().route,l=a.pattern,d=a.component,h=a.load,u=Gt((()=>n().path));d&&d.preload&&d.preload();var c=h?h({params:s,location:i,intent:Ln||"initial"}):void 0;return{parent:t,pattern:l,path:u,outlet:()=>d?Tr(d,{params:s,location:i,data:c,get children(){return r()}}):r(),resolvePath:e=>In(o.path(),e,u())}}(e.routerState,l[t-1]||e.routerState.base,Gn((()=>n()[t+1])),(()=>e.routerState.matches()[t]))})))},h=0,u=o.length;he())),s&&a?s:(t=l[0],l)})));return Gn((()=>n()&&t))()}var Gn=e=>()=>un(Fr,{get when(){return e()},keyed:!0,children:e=>un(Mn.Provider,{value:e,get children(){return e.outlet()}})}),Vn=e=>{var t=ar((()=>e.children));return Rr(e,{get children(){return t()}})};function Zn(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 qn=new Map;function Jn(e=!0,t=!1,r="/_server"){return n=>{var o=n.base.path(),i=n.navigatorFactory(n.base),s={};function a(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 s=(r.getAttribute("rel")||"").split(/\s+/);if(!(r.hasAttribute("download")||s&&s.includes("external"))){var a=n?new URL(i,document.baseURI):new URL(i);if(!(a.origin!==window.location.origin||o&&a.pathname&&!a.pathname.toLowerCase().startsWith(o.toLowerCase())))return[r,a]}}}}}function l(e){var t=a(e);if(t){var r=g(t,2),o=r[0],s=r[1],l=n.parsePath(s.pathname+s.search+s.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=a(e);if(t){var r=g(t,2),o=r[0],i=r[1];s[i.pathname]||n.preloadRoute(i,"false"!==o.getAttribute("preload"))}}function h(e){var t=a(e);if(t){var r=g(t,2),o=r[0],i=r[1];s[i.pathname]||(s[i.pathname]=setTimeout((()=>{n.preloadRoute(i,"false"!==o.getAttribute("preload")),delete s[i.pathname]}),200))}}function u(e){var t=a(e);if(t){var r=g(t,2)[1];s[r.pathname]&&(clearTimeout(s[r.pathname]),delete s[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,_n);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=qn.get(t);if(i){e.preventDefault();var s=new FormData(e.target);e.submitter&&e.submitter.name&&s.append(e.submitter.name,e.submitter.value),i.call({r:n,f:e.target},s)}}}!function(e,t=window.document){for(var r=t[yn]||(t[yn]=new Set),n=0,o=e.length;n{document.removeEventListener("click",l),e&&(document.removeEventListener("mouseover",h),document.removeEventListener("mouseout",u),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",c)}))}}function eo(e){var t=e.replace(/^.*?#/,"");if(!t.startsWith("/")){var r=g(window.location.hash.split("#",2),2)[1];return`${void 0===r?"/":r}#${t}`}return t}function to(e){var t=()=>window.location.hash.slice(1),r=Sn();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]}(Qt(r(e.get()),{equals:(e,t)=>e.value===t.value}),void 0,(r=>(!t&&e.set(r),r)));return e.init&&tr(e.init(((o=e.get())=>{t=!0,n[1](r(o)),t=!1}))),Kn({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 w(w({},e),{},{_depth:window.history.state&&window.history.state._depth})}(n),"","#"+e):window.location.hash=e;var o=e.indexOf("#");Zn(o>=0?e.slice(o+1):"",r),An()},init:e=>{return n=window,o="hashchange",i=function(e,t){var r=!1;return()=>{var n=wn;An();var o=null==n?null:wn-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:Jn(e.preload,e.explicitLinks,e.actionBase),utils:{go:e=>window.history.go(e),renderPath:e=>`#${e}`,parsePath:eo,beforeLeave:r}})(e)}var ro=tr;function no(e,t=rr()){var r,n,o=0;return()=>(o++,tr((()=>{o--,queueMicrotask((()=>{!o&&n&&(n(),n=r=void 0)}))})),n||Ht((t=>r=e(n=t)),t),r)}var oo=no((()=>{var e,t,r,n,o=g(Qt(null),2),i=o[0],s=o[1];return e=window,t="keydown",r=e=>{s(e),setTimeout((()=>s(null)))},e.addEventListener(t,r,n),ro(e.removeEventListener.bind(e,t,r,n)),i}));function io(e){return"function"==typeof e}var so,ao={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},lo=g(Qt([]),2),ho=lo[0],uo=lo[1],co=e=>{var t=oo();if(e)for(var r=function(){var e,t=g(o[n],2),r=t[0],i=t[1];e=i,Array.isArray(e)?i.forEach((e=>{ao[e]=r})):ao[i]=r},n=0,o=Object.entries(e);n{for(var n=e,o=[];n;)n.states.has("focus")||(n.states.add("focus"),io(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"),io(r.onBlur)&&r.onBlur.call(r,e,t))})),uo(o),o}),{defer:!0})),Xt((()=>{var e=t();if(e){var r=ao[e.key]||ao[e.keyCode];qt((()=>{var t,n=void 0,o=A(ho());try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n=n||i,r){var s=i[`on${r}`];if(io(s)&&!0===s.call(i,e,i,n))break}else console.log(`Unhandled key event: ${e.key}`);if(io(i.onKeyPress)&&!0===i.onKeyPress.call(i,e,r,i,n))break}}catch(a){o.e(a)}finally{o.f()}return!1}))}})),ho};function fo(e,t){var r,n,o,i,s=t();if(Array.isArray(s))if(2===s.length)r=i=s[0],n=o=s[1];else if(3===s.length)r=s[0],n=o=s[1],i=s[2];else{var a=g(s,4);r=a[0],o=a[1],i=a[2],n=a[3]}else r=o=i=n=s;e.onBeforeLayout=(t,s)=>{if(s){e.width=e.children.reduce(((e,t)=>e+(t.width||0)),0)+n+o;var a=e.children[0];a&&(a.x=n,a.marginLeft=n);var l=0;e.children.forEach((e=>{e.y=r,e.marginTop=r,l=Math.max(l,e.height||0)})),e.height=l+r+i}}}function po(e){return new Promise((t=>{setTimeout(t,e)}))}function vo(e,t,r="en-US"){var n=window.speechSynthesis;return new Promise(((o,i)=>{var s=new SpeechSynthesisUtterance(e);s.lang=r,s.onend=()=>{o()},s.onerror=e=>{i(e)},t.push(s),n.speak(s)}))}function go(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,vo(r,s,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,po(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 h=go(r(),t,!1),i.push(h),e.next=53,h.series;case 53:e.next=60;break;case 55:if(!Array.isArray(r)){e.next=60;break}return u=go(r,t,!1),i.push(u),e.next=60,u.series;case 60:e.next=1;break;case 62:return e.prev=62,a=!1,e.finish(62);case 65:case"end":return e.stop()}}),e,null,[[0,,62,65],[20,26]])})))(),get active(){return a},append:e=>{o.push(e)},cancel:()=>{a&&(r&&n.cancel(),i.forEach((e=>{e.cancel()})),a=!1)}}}function mo(e,t="en-US"){return so&&so.cancel(),so=go(e,t)}var xo,yo,bo=(e,t)=>{var r,n=()=>clearTimeout(r);rr()&&tr(n);return Object.assign(((...o)=>{void 0!==r&&n(),r=setTimeout((()=>e(...o)),t)}),{clear:n})},wo=[],So=!1;function Ao(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 Co(e){return e.id||e.name}function To(e=[]){if(_o.onFocusChange&&_o.enabled){var t=e.every((e=>!e.loading)),r=e.filter((e=>!wo.includes(e)));if(xo(),t||!_o.onFocusChange){wo=e.slice(0);var n=[],o=r.reduce(((e,t)=>(t.announce?(e.push([Co(t),"Announce",t.announce]),n.push(t.announce)):t.title?(e.push([Co(t),"Title",t.title]),n.push(t.title)):e.push([Co(t),"No Announce",""]),e)),[]);return r.reverse().reduce(((e,t)=>(t.announceContext?(e.push([Co(t),"Context",t.announceContext]),n.push(t.announceContext)):e.push([Co(t),"No Context",""]),e)),o),_o.debug&&console.table(o),n.length?_o.speak(n.reduce(((e,t)=>e.concat(t)),[])):void 0}_o.onFocusChange([])}}var _o={debug:!1,enabled:!0,cancel:function(){yo&&yo.cancel()},clearPrevFocus:function(e=0){wo=wo.slice(0,e),xo()},speak:function(e,{append:t=!1,notification:r=!1}={}){var n;_o.onFocusChange&&_o.enabled&&(_o.onFocusChange.flush(),t&&yo&&yo.active?yo.append(e):(_o.cancel(),function(e){if(!So)yo=mo(e)}(e)),r&&(So=!0,null===(n=yo)||void 0===n||n.series.finally((()=>{So=!1,_o.refresh()})).catch(console.error)));return yo},refresh:function(e=0){_o.clearPrevFocus(e),_o.onFocusChange&&_o.onFocusChange(qt((()=>ho())))},setupTimers:function({focusDebounce:e=400,focusChangeTimeout:t=3e5}={}){_o.onFocusChange=Ao(To,e),xo=Ao((()=>{wo=[]}),t)}};var ko,Io,Bo,Ro,Eo,No,Fo,Lo,zo,Mo,Po,Do,Oo,Uo,Wo,Yo,jo=g(Qt(""),2),Ho=jo[0],Qo=jo[1],Ko={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//38KiCV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b1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+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+Z8h6t88QJLuXOB5yBAVzjxuVeBa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ByU4mkuz++F93ZHELyZX3iW31n+S+sKWZWfNBxkCbNeUq6ekArugo1I0kH1xT8EkBKj1R80HGGkFbtZVkZ3bb2d2r0tUkn1hTh8kBKhB9DMBLnQWfJMjoLFuTZpJsO/ONAB7UUcBLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function $o(){var e,t,r,n=0,o={duration:750,easing:"ease-in-out"},i={alpha:1,color:4294967295};var s=bo((function(i){return i.startsWith("#")?(e.color=xn(i),e.src="",e.alpha=1,n=1,t.alpha=0,void(r.alpha=0)):(e.color=4294967295,r.alpha=1,0===n?(e.src=i,void(n=1)):1===n?(t.src=i,n=2,t.alpha=0,t.animate({alpha:1},o).start(),void e.animate({alpha:0},o).start()):void(2===n&&(e.src=i,n=1,e.alpha=0,e.animate({alpha:1},o).start(),t.animate({alpha:0},o).start())))}),400);return Xt(Jt(Ho,(e=>{s(e)}),{defer:!0})),un(on,{width:1920,height:1080,zIndex:-5,get children(){return[un(on,{ref(t){"function"==typeof e?e(t):e=t},style:i}),un(on,{ref(e){"function"==typeof t?t(e):t=e},style:i,alpha:0}),un(on,{ref(e){"function"==typeof r?r(e):r=e},src:"./assets/hero-mask-inverted.png",get color(){return xn(Ko.color.materialBrand)},width:1920,height:1080})]}})}var Xo=["focus","disabled"],Go=["brand","inverse","neutral"];function Vo({themeKeys:e,base:t,modes:r,tones:n,themeStyles:o,modeKeys:i=Xo,toneKeys:s=Go},a=!1){var l=t=>Object.fromEntries(Object.entries(e).filter((([e,r])=>t[r])).map((([e,r])=>[e,t[r]])));return((e,t,r)=>{var n,d=(n=o,Object.fromEntries(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]}))));a&&console.log(d);var h=((e,t)=>w(w({},e),t.base))(e,d);a&&console.log(h);var u=((e,t)=>{var r=i.map((r=>[r,w(w({},null==e?void 0:e[r]),null==t?void 0:t[r])]));return Object.fromEntries(r)})(t,d);a&&console.log(u);var c=((e,t,r)=>{var n=s.map((n=>{var o,s,a={};return new Set([].concat.apply([],[null!==(o=null==e?void 0:e[n])&&void 0!==o?o:{},null!==(s=null==t?void 0:t[n])&&void 0!==s?s:{}].map(Object.keys))).forEach((r=>{var o,s,l;i.includes(r)||(a[r]=null!==(l=null==(o=null==t?void 0:t[n])?void 0:o[r])&&void 0!==l?l:null==(s=null==e?void 0:e[n])?void 0:s[r])})),i.forEach((o=>{var i,s;a[o]=w(w(w({},r[o]),null==(i=null==e?void 0:e[n])?void 0:i[o]),null==(s=null==t?void 0:t[n])?void 0:s[o])})),[n,a]}));return Object.fromEntries(n)})(r,d,u);return a&&console.log(c),{base:w(w({},h),u),tones:c}})(t,r,n)}function Zo(e=0){return(t,r,n,o)=>{if(0!==t.children.length){var i=t.gap||0,s=t.scroll||"auto",a=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),l=g(a,2),d=l[0],h=l[1],u="row"===t.flexDirection?t.x:t.y,c="row"===t.flexDirection?r.x:r.y,f="row"===t.flexDirection?r.width:r.height,p=n>o?"positive":"negative",v=u;"auto"===s?null!=t.scrollIndex&&t.scrollIndex>=0?t.selected>=t.scrollIndex&&(v="positive"===p?u-f-i:u+f+i):(Math.abs(u)+hc?v=-c+e:"edge"===s&&"positive"===p&&Math.abs(u)+h{var t=e.filter((e=>"function"==typeof e));if(0!==t.length)return function(...e){var r,n=A(t);try{for(n.s();!(r=n.n()).done;){if(!0===r.value.apply(this,e))return!0}}catch(o){n.e(o)}finally{n.f()}}};function Jo(){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];if(!(e instanceof Vr))return!1;e.setFocus()}function ei(e){return function(){var t,r,n=this.children.length,o=this.wrap,i=this.selected||0;if(0===n)return!1;if("right"===e||"down"===e){do{if(this.selected=(this.selected||0)%n+1,this.selected>=n){if(!o){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)%n-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=n-1}}while(null==(r=this.children[this.selected])?void 0:r.skipFocus);if(void 0===this.selected&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;var s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&void 0!==i){var a=this.children[i].selected||0;s.selected=a{var t=ei("up"),r=ei("down");return un(on,gn(e,{get onUp(){return qo(e.onUp,t)},get onDown(){return qo(e.onDown,r)},get selected(){return e.selected||0},forwardFocus:Jo,get onSelectedChanged(){return qo(e.onSelectedChanged,"none"!==e.scroll?Zo(e.y):void 0)},get style(){var t;return[...[e.style].flat(),Ri.Container.tones[null!==(t=e.tone)&&void 0!==t?t:Ri.tone],Ri.Container.base]}}))},Ni=(null==(Fo=Ko)?void 0:Fo.componentConfig).Label,Fi=void 0===Ni?{styles:{}}:Ni,Li=(Fi.defaultTone,v(Fi,s)),zi={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:Ko.color.textNeutral,padding:[Ko.spacer.md,Ko.spacer.lg],borderRadius:[Ko.radius.md,Ko.radius.md,Ko.radius.md,Ko.radius.none],height:Ko.typography.caption1.lineHeight+Ko.spacer.md,neutral:{backgroundColor:Ko.color.fillNeutral}},tones:{inverse:{color:Ko.color.fillInverse},brand:{color:Ko.color.fillBrand,focus:{color:Ko.color.orange}}},themeStyles:Li},Mi={themeKeys:{color:"textColor"},base:w(w({},Ko.typography.caption1),{},{color:Ko.color.textInverse}),tones:{inverse:{color:Ko.color.textNeutral},brand:{color:Ko.color.textNeutral}},themeStyles:Li};Vo(zi),Vo(Mi);var Pi=(null==(Lo=Ko)?void 0:Lo.componentConfig).Rating,Di=void 0===Pi?{styles:{},defaultTone:"neutral"}:Pi,Oi=Di.styles,Ui=(Di.defaultTone,{themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:Ko.spacer.sm},toneModes:{},themeStyles:Oi}),Wi={themeKeys:{color:"textColor"},base:w({color:Ko.color.textNeutral},Ko.typography.body2),toneModes:{},themeStyles:Oi},Yi={themeKeys:{color:"color"},base:{height:Ko.typography.body2.lineHeight,width:Ko.typography.body2.lineHeight,color:Ko.color.fillNeutral,marginRight:Ko.spacer.sm},toneModes:{},themeStyles:Oi};Vo(Ui),Vo(Yi),Vo(Wi);var ji=(null==(zo=Ko)?void 0:zo.componentConfig).Details,Hi=void 0===ji?{styles:{}}:ji,Qi=(Hi.defaultTone,v(Hi,a)),Ki={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:Ko.spacer.lg,badgeContentSpacing:Ko.spacer.sm,ratingContentSpacing:Ko.spacer.lg},themeStyles:Qi},$i={themeKeys:{color:"textColor"},base:w(w({},Ko.typography.body2),{},{marginRight:Ko.spacer.lg,color:Ko.color.textNeutral}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverse,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutral,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Qi};Vo(Ki),Vo($i);var Xi=(null==(Mo=Ko)?void 0:Mo.componentConfig).Metadata,Gi=void 0===Xi?{styles:{}}:Xi,Vi=(Gi.defaultTone,v(Gi,l)),Zi={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:Ko.alpha.primary},modes:{disabled:{alpha:Ko.alpha.inactive}},themeStyles:Vi},qi={themeKeys:{color:"textColor"},base:w(w({maxLines:1,contain:"width"},Ko.typography.headline3),{},{color:Ko.color.textNeutral}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverse,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutral,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Vi},Ji={themeKeys:{color:"textColor"},base:w(w({contain:"width",maxLines:2},Ko.typography.body2),{},{color:Ko.color.textNeutralSecondary}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverseSecondary,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutralSecondary,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Vi};Vo(Zi),Vo(Ji),Vo(qi);var es=(null==(Po=Ko)?void 0:Po.componentConfig).ProgressBar,ts=void 0===es?{styles:{}}:es,rs=(ts.defaultTone,v(ts,d)),ns={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:Ko.spacer.md,color:Ko.color.fillNeutralTertiary,borderRadius:Ko.radius.xs},tones:{inverse:{color:Ko.color.fillInverseTertiary}},themeStyles:rs},os={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:Ko.radius.xs,color:Ko.color.fillNeutral},tones:{inverse:{color:Ko.color.fillInverse},brand:{color:Ko.color.fillBrand}},themeStyles:rs};Vo(ns),Vo(os);var is=(null==(Do=Ko)?void 0:Do.componentConfig).Row,ss=void 0===is?{styles:{}}:is,as=ss.defaultTone,ls=v(ss,h),ds={tone:as,Container:Vo({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:Ko.layout.gutterX,width:Ko.layout.screenW,itemTransition:w(w({},Ko.animation.standardEntrance),{},{duration:Ko.animation.duration.fast})},themeStyles:ls})},hs=e=>{var t=ei("left"),r=ei("right");return un(on,gn(e,{get selected(){return e.selected||0},get onLeft(){return qo(e.onLeft,t)},get onRight(){return qo(e.onRight,r)},forwardFocus:Jo,get onSelectedChanged(){return qo(e.onSelectedChanged,"none"!==e.scroll?Zo(e.x):void 0)},get tone(){var t;return null!==(t=e.tone)&&void 0!==t?t:ds.tone},get style(){return[...[e.style].flat(),ds.Container.tones[e.tone||ds.tone],ds.Container.base]},get states(){var t;return null!==(t=e.tone)&&void 0!==t?t:ds.tone}}))},us=(null==(Oo=Ko)?void 0:Oo.componentConfig).Keyboard,cs=void 0===us?{styles:{}}:us,fs=(cs.defaultTone,v(cs,u)),ps={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:Ko.spacer.md,screenW:Ko.layout.screenW,marginX:Ko.layout.marginX,height:100},themeStyles:fs},vs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Ko.spacer.md,height:9*Ko.spacer.md,paddingX:Ko.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:Ko.color.fillNeutral,padding:[Ko.spacer.xxxl,Ko.spacer.xl],baseWidth:7*Ko.spacer.md,color:Ko.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Ko.radius.sm},modes:{focus:{color:Ko.color.interactiveNeutralFocus,contentColor:Ko.color.fillInverse},disabled:{color:Ko.color.fillNeutralDisabled,contentColor:Ko.color.fillNeutralDisabled}},tones:{inverse:{color:Ko.color.interactiveInverse,focus:{color:Ko.color.interactiveInverseFocus,contentColor:Ko.color.fillNeutral}},brand:{focus:{contentColor:Ko.color.fillNeutral}}},themeStyles:fs},gs={themeKeys:{color:"textColor"},base:w({textAlign:"left",color:Ko.color.textNeutral},Ko.typography.headline2),modes:{focus:{color:Ko.color.textInverse},disabled:{color:Ko.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Ko.color.textNeutral}}},themeStyles:fs};Vo(ps),Vo(vs),Vo(gs);var ms=(null==(Uo=Ko)?void 0:Uo.componentConfig).Key,xs=void 0===ms?{styles:{}}:ms,ys=(xs.defaultTone,v(xs,c)),bs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Ko.spacer.md,height:9*Ko.spacer.md,paddingX:Ko.spacer.md,contentColor:Ko.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[Ko.spacer.xxxl,Ko.spacer.xl],baseWidth:7*Ko.spacer.md,color:Ko.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Ko.radius.sm},modes:{focus:{color:Ko.color.interactiveNeutralFocus,contentColor:Ko.color.fillInverse},disabled:{color:Ko.color.fillNeutralDisabled,contentColor:Ko.color.fillNeutralDisabled}},tones:{inverse:{color:Ko.color.interactiveInverse,focus:{color:Ko.color.interactiveInverseFocus,contentColor:Ko.color.fillNeutral}},brand:{focus:{contentColor:Ko.color.fillNeutral}}},themeStyles:ys},ws={themeKeys:{color:"textColor"},base:w({textAlign:"left",color:Ko.color.textNeutral},Ko.typography.headline2),modes:{focus:{color:Ko.color.textInverse},disabled:{color:Ko.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Ko.color.textNeutral}}},themeStyles:ys};Vo(bs),Vo(ws);var Ss=(null==(Wo=Ko)?void 0:Wo.componentConfig).Tile,As=void 0===Ss?{styles:{}}:Ss,Cs=(As.defaultTone,v(As,f)),Ts=(null==(Yo=Ko)?void 0:Yo.componentConfig).Surface,_s=void 0===Ts?{styles:{}}:Ts,ks=(_s.defaultSurfaceTone,v(_s,p)),Is={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:Ko.spacer.xl,paddingYBetweenContent:Ko.spacer.md,borderRadius:Ko.radius.md,alpha:Ko.alpha.primary},modes:{disabled:{alpha:Ko.alpha.inactive}},themeStyles:w(w({},ks),Cs)},Bs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Cs},Rs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Cs},Es={themeKeys:{},base:{width:5*Ko.spacer.lg,height:Ko.spacer.xxl+Ko.spacer.md},themeStyles:Cs};Vo(Is),Vo(Bs),Vo(Rs),Vo(Es);var 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:Ko.layout.marginX}},Gradient:{zIndex:99,color:xn("#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:xn("#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=Lr.createTexture("ImageTexture",{src:t}),r.reduce(((e,t)=>{var r=t.x,o=t.y,i=t.width,s=t.height;return e[t.name]=Lr.createTexture("SubTexture",{texture:n,x:r,y:o,width:i,height:s}),e}),{}));return un(on,gn(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 un(on,gn(e,{forwardStates:!0,get style(){return Ns.NavButton},get children(){return[un(on,{y:-16,get children(){return un(zs,{scale:.5,get name(){return e.icon}})}}),un(nn,{get style(){return w(w({},Ko.typography.button1),{},{fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}})},get children(){return e.children}})]}}))}function Ps(e){var t,r=Dn();return[un(Ei,gn(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[un(Ms,{onEnter:()=>r("/browse/all"),icon:"trending",children:"Trending"}),un(Ms,{icon:"movie",onEnter:()=>r("/browse/movie"),children:"Movies"}),un(Ms,{icon:"tv",onEnter:()=>r("/browse/tv"),children:"TV"}),un(Ms,{icon:"experiment",onEnter:()=>r("/examples"),children:"Examples"})]}})),un(on,{ref(e){"function"==typeof t?t(e):t=e},get style(){return Ns.Gradient}})]}var Ds={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},Os={x:10,fontSize:36,textColor:xn("#ffffff")},Us={fontSize:36,textColor:xn("#ffffff")},Ws=g(Qt(0),2),Ys=Ws[0],js=Ws[1],Hs=g(Qt(0),2),Qs=Hs[0],Ks=Hs[1],$s=g(Qt(99),2),Xs=$s[0],Gs=$s[1],Vs=g(Qt(0),2),Zs=Vs[0],qs=Vs[1],Js=0,ea=0,ta=bo((()=>{ea=0,Js=0,Gs(99)}),1e4);function ra(e){e.renderer.on("fpsUpdate",((e,t)=>{var r="number"==typeof t?t:t.fps;r>5&&(e=>{e&&(js(e),Gs((t=>Math.min(e,t))),qs((t=>Math.max(e,t))),ea+=e,Js++,Ks(Math.round(ea/Js)),ta())})(r)}))}var na=e=>un(on,gn(e,{style:Ds,get children(){return[un(on,{get children(){return[un(nn,{style:Os,children:"FPS:"}),un(nn,{style:Us,x:94,get children(){return Ys().toString()}})]}}),un(on,{x:160,get children(){return[un(nn,{style:Os,children:"AVG:"}),un(nn,{style:Us,x:104,get children(){return Qs().toString()}})]}}),un(on,{x:0,y:40,get children(){return[un(nn,{style:Os,children:"MIN:"}),un(nn,{style:Us,x:94,get children(){return Xs().toString()}})]}}),un(on,{x:160,y:40,get children(){return[un(nn,{style:Os,children:"MAX:"}),un(nn,{style:Us,x:104,get children(){return Zs().toString()}})]}})]}})),oa=e=>{co({Announcer:"a",Menu:"m",Escape:"Escape"});var t=(_o.setupTimers(),Xt(Jt(ho,_o.onFocusChange,{defer:!0})),_o);t.enabled=!1;var r,n,o=Dn();return er((()=>{ra({renderer:Lr})})),un(on,{onAnnouncer:()=>t.enabled=!t.enabled,onLast:()=>history.back(),onMenu:()=>o("/"),style:{width:1920,height:1080},onLeft:()=>{if(r.states.has("focus"))return!1;n=Qr(),r.setFocus()},onRight:()=>r.states.has("focus")&&n.setFocus(),get children(){return[un($o,{}),un(na,{}),hn((()=>e.children)),un(Ps,{ref(e){"function"==typeof r?r(e):r=e}})]}})},ia={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:Ko.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:xn("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:xn("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:xn("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:xn("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,width:Ko.layout.screenW-2*Ko.layout.marginX,x:Ko.layout.marginX+Ko.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:xn("#0000ff")},peopleBio:w(w({},Ko.typography.body1),{},{contain:"both",width:1500,height:400})},sa={width:120,height:40,color:xn("#000000"),borderRadius:8,border:{width:2,color:xn("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:xn("#333333")}},transition:{scale:!0,color:!0}},aa={container:sa,topBar:{color:xn("#00A699"),height:8,y:2,x:-4,width:sa.width+8},text:{fontSize:12,y:12,contain:"width",textAlign:"center",color:xn("#F6F6F9"),height:sa.height,width:sa.width}},la=386,da=136,ha=(xn("#715cab"),xn("#5a39a2"),xn("#291d43"),{fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:xn("#FFFFFF"),height:da,width:la,focus:{fontSize:40},disabled:{color:xn("#909090")}});function ua(e){return un(on,gn(e,{get style(){return ia.Thumbnail}}))}function ca(e){var t=function(e,...t){if(Rt 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))},kr)));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)))},kr)),n}var o,i={},s=t.map((()=>({}))),a=A(Object.getOwnPropertyNames(e));try{for(a.s();!(o=a.n()).done;){var l,d=o.value,h=Object.getOwnPropertyDescriptor(e,d),u=!h.get&&!h.set&&h.enumerable&&h.writable&&h.configurable,c=!1,f=0,p=A(t);try{for(p.s();!(l=p.n()).done;)l.value.includes(d)&&(c=!0,u?s[f][d]=h.value:Object.defineProperty(s[f],d,h)),++f}catch(v){p.e(v)}finally{p.f()}c||(u?i[d]=h.value:Object.defineProperty(i,d,h))}}catch(v){a.e(v)}finally{a.f()}return[...s,i]}(e,["items"]),r=g(t,2),n=r[0],o=r[1];return un(hs,gn(o,{get style(){return ia.Row},get children(){return un(Nr,{get each(){return n.items},children:e=>un(ua,e)})}}))}function fa(e){return un(on,gn(e,{forwardStates:!0,get style(){return aa.container},get children(){return un(nn,{get style(){return aa.text},get children(){return e.children}})}}))}var pa,va,ga="https://api.themoviedb.org/3",ma="w185",xa={headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA"}};function ya(e,t=ma){return va+t+e}function ba(e,t={}){return fetch(ga+e,w(w({},xa),t)).then((e=>e.json()))}function wa(){return ba("/configuration").then((e=>{var t;return pa=e,va=null===(t=e.images)||void 0===t?void 0:t.secure_base_url,e}))}var Sa={get:function(e,t={}){return pa?ba(e,t):wa().then((()=>ba(e,t)))},loadConfig:wa};function Aa(e=[]){return e.map((e=>{return{src:ya(e.poster_path||e.profile_path),tileSrc:ya(e.backdrop_path||e.profile_path,"w300"),backdrop:ya(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 Ca=new Map,Ta=new Map;function _a(e){var t=g(Qt([]),2),r=t[0],n=t[1],o=g(Qt(1),2),i=o[0],s=o[1],a=g(Qt(!1),2),l=a[0],d=a[1],h=g(Vt(i,e),1)[0];return Kt((()=>{var e=h();e&&fr((()=>{0===e.length&&d(!0),n((t=>[...t,...e]))}),!1)})),{pages:r,page:i,setPage:s,setPages:n,end:l,setEnd:d}}var ka=1100,Ia=w(w({},Ko.typography.display2),{},{width:ka,height:58,contain:"both"}),Ba=e=>un(nn,gn(e,{style:Ia,get children(){return e.children}})),Ra=w(w({},Ko.typography.body1),{},{width:ka,height:72,contain:"both"}),Ea={fontSize:20,lineHeight:20},Na=e=>un(nn,gn(e,{style:Ra,get children(){return e.children}}));var Fa=e=>{return t=cn("node"),mn(fo,t,(()=>[8,15,13,15])),pn(t,gn(e,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),fn(t,un(nn,{style:Ea,get children(){return e.children}})),t;var t},La=Ko.typography.body2,za=e=>un(on,{style:{display:"flex",flexDirection:"row",gap:12,width:ka,height:48},get children(){return[un(nn,{style:La,get children(){return e.metaText}}),un(Nr,{get each(){return e.badges},children:e=>un(Fa,{y:-5,children:e})}),hn((()=>{return t=e.reviews,[un(Fr,{get when(){return(null==t?void 0:t.rtCrit)&&"0"!==(null==t?void 0:t.rtCrit)},get children(){return[un(on,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),un(nn,{style:La,get children(){return t.rtCrit+"%"}})]}}),un(Fr,{get when(){return(null==t?void 0:t.rtFan)&&"0"!==(null==t?void 0:t.rtFan)},get children(){return[un(on,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),un(nn,{style:La,get children(){return t.rtFan+"%"}})]}})];var t}))]}}),Ma=e=>un(on,gn(e,{style:{display:"flex",flexDirection:"column",width:ka,height:160,gap:16},get children(){return[un(Ba,{get children(){return e.title}}),un(Na,{get children(){return e.description}}),un(za,{get metaText(){return e.metaText},get badges(){return e.badges},get reviews(){return e.reviews}})]}}));function Pa(e){return e.split("-")[0]}function Da({type:e,id:t}){return Sa.get(`/${e}/${t}/recommendations`).then((({results:t})=>t.length?Aa(t.slice(0,7)):Sa.get(`/trending/${e}/week?page=1`).then((({results:e})=>Aa(e.slice(0,7))))))}function Oa({type:e,id:t}){return Sa.get(`/${e}/${t}/credits`).then((({cast:e})=>Aa(e.slice(0,7))))}function Ua({type:e,id:t}){var r="movie"===e?{rtCrit:86,rtFan:92}:{};return Sa.get(`/${e}/${t}`).then((t=>{return w({backgroundImage:ya(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:"movie"===e?(n=t.runtime,o=n%60,Math.floor(n/60)+"h "+(o<10?"0":"")+o+"m - "+t.release_date):`${Pa(t.first_air_date)} - ${Pa(t.last_air_date)}`,reviews:r}},t);var n,o}))}var Wa=()=>{var e=On(),t=g(Qt(0),2),r=t[0],n=t[1],o=g(Qt(),2),i=o[0];o[1];Vt(i,Ua);var s=g(Qt({}),2),a=s[0],l=s[1],d=Dn(),h=Zt((()=>0)),u=Gt((()=>{return _a((t=e.filter||"all",e=>{var r=`/trending/${t}/week?page=${e}`;if(Ca.has(r))return Ca.get(r);var n=Sa.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;n=t-2)&&u().setPage((e=>e+1))}function f(){var e=this.children.selected;C(e&&e.href),d(e.href)}return Xt(Jt(Qr,(e=>{e.backdrop&&Qo(e.backdrop),e.heroContent&&l(e.heroContent)}),{defer:!0})),un(Fr,{get when(){return u().pages().length},get children(){return[un(Ma,gn({y:360,x:150},a)),un(on,{clipping:!0,get style(){return ia.itemsContainer},get children(){return un(Ei,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return ia.Column},get children(){return un(Nr,{get each(){return u().pages()},children:(e,t)=>un(ca,{get autofocus(){return h(t())},items:e,onFocus:c,onEnter:f})})}})}})]}})},Ya=()=>{var e=Dn(),t=Zt((()=>0));function r(){var t=this.children.selected;C(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=g(Qt(4294967295),2),r=t[0],n=t[1];return un(on,gn(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 un(on,{x:30,get children(){return[un(nn,{y:30,fontSize:84,get color(){return r()},get children(){return e.index}}),un(nn,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return r()},get children(){return e.title}}),un(nn,{y:200,fontSize:28,width:330,contain:"width",get color(){return r()},get children(){return e.description}})]}})}}))}var i=g(Qt(140),2),s=i[0],a=i[1];function l(e){a(-400*e.selected+140)}return un(on,{colorTop:1147903743,colorBottom:743406847,get children(){return[un(on,{x:120,get children(){return[un(on,{src:"/assets/solidjs.png",width:101,height:90,y:40}),un(nn,{fontSize:90,x:110,y:40,children:"Examples"}),un(on,{y:140,height:1,width:1800,color:3906468351})]}}),un(hs,{onSelectedChanged:l,onEnter:r,transition:{x:{delay:20,duration:300}},get x(){return s()},y:300,width:4400,get style(){return ia.Row},justifyContent:"flexStart",gap:40,get children(){return un(Nr,{each:n,children:(e,r)=>un(o,gn({get autofocus(){return t(r())},get index(){return r()}},e))})}})]}})},ja=()=>{var e={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("00000000")},t={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:xn("00000000")},r={fontSize:42},n={width:e.width,fontSize:26,contain:"width"},o={fontSize:26};return er((()=>{Qo("#000000")})),un(on,{autofocus:!0,style:e,get children(){return[un(nn,{style:r,children:"Title of the Page"}),un(nn,{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."}),un(on,{style:t,get children(){return[un(nn,{style:o,children:"Subline Text"}),un(on,{width:28,height:28,src:"/assets/rt-popcorn.png"}),un(nn,{style:o,children:"More Text"})]}})]}})},Ha=()=>{var e,t,r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:xn("00000000")},o={fontSize:42},i={fontSize:26};er((()=>{Qo("#000000"),e.animate({x:100},{duration:2e3}).start()}));var s=g(Qt(),2),a=s[0],l=s[1],d=g(Qt(),2),h=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 u={width:400,height:300,color:xn("#0000ff")},c={color:xn("#f54242"),focus:{color:xn("#4287f5")}};function f(e){var t=ar((()=>e.children));return un(on,gn(e,{get style(){return[c,e.style,[u]]},get children(){return[un(on,{id:"child1",width:100,height:100,get color(){return xn("#ff0000")},y:25,get children(){return[hn((()=>t())),un(on,{id:"subChild",x:150,width:100,height:100,get color(){return xn("#00ff00")}}),un(nn,{get children(){return e.title}})]}}),un(on,{width:100,height:100,get color(){return xn("#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:xn("#cccccc"),focus:{color:xn("#000000")}},m={color:xn("#ffffff"),focus:{color:xn("#f6f6cc")}};return un(on,{style:r,get children(){return[un(nn,{style:o,children:"Title of the Page"}),un(on,{style:n,get children(){return[un(nn,{get children(){return h()}}),un(nn,{style:i,get children(){return["Sub ",hn((()=>a()))," Text"]}}),un(Fr,{get when(){return a()},get children(){return un(on,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),un(nn,{style:i,children:"More Text"})]}}),un(f,{autofocus:!0,ref(e){"function"==typeof t?t(e):t=e},style:[m,v],get children(){return un(nn,{children:"Child Test"})}}),un(on,{ref(t){"function"==typeof e?e(t):e=t},style:p,width:100,height:100,get color(){return xn("#00ff00")},x:900,y:400,get alpha(){return t=e,console.log("Ref is available: ",t),1;var t}})]}})},Qa=()=>{var e,t,r=g(Qt([]),2),n=r[0],o=r[1],i={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:xn("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},s={fontSize:32,x:960,y:540,mount:.5,lineheight:52},a=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function l(e,t){o((t=>[...t,e].slice(-4))),console.log(e)}return er((()=>{Qo("#000000"),e.x=910,e.y=490,t=setInterval((()=>{e.rotation=a(-90,90),e.x=a(-300,2220),e.y=a(-300,1380)}),2500)})),tr((()=>{clearInterval(t)})),un(on,{get children(){return[un(nn,{style:s,get children(){return n().join("\n")}}),un(on,{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")]]})]}})},Ka=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:xn("00000000"),gap:26,y:400};function r(e){return un(on,gn(e,{forwardStates:!0,get style(){return aa.container},get children(){return un(nn,{get style(){return aa.text},get children(){return e.children}})}}))}var n=e=>{return t=cn("node"),mn(fo,t,(()=>[10,15])),pn(t,gn(e,{get style(){return{color:xn("#000000be"),borderRadius:8,border:{width:2,color:xn("#ffffff")}}}}),!0),fn(t,un(nn,{style:{fontSize:20},get children(){return e.children}})),t;var t};return[un(hs,{x:100,y:200,gap:5,style:t,get children(){return[un(n,{children:"HD"}),un(n,{children:"PG13"}),un(n,{children:"NC17"}),un(nn,{fontSize:30,children:"I like bananas"}),un(n,{children:"DOLBY"})]}}),un(hs,{x:100,gap:40,style:t,get children(){return[un(r,{autofocus:!0,onEnter:e,children:"TV Shows"}),un(r,{states:{active:!0,disabled:!1},children:"Movies"}),un(r,{states:"active",children:"Sports"}),un(r,{states:"disabled",children:"News"})]}})]},$a=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:xn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return un(on,gn(e,{style:{width:200,height:100,y:5,color:392801023}}))}var n=g(Qt(50),2),o=n[0],i=n[1];function s(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),i(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var a=50;return un(Ei,{x:160,get y(){return o()},gap:30,height:850,get width(){return e.width},get style(){return ia.Column},get children(){return[un(nn,{style:t,children:"Flex Start"}),un(hs,{gap:a,style:e,onFocus:s,get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex Start - Margin Left"}),un(hs,{gap:a,style:e,onFocus:s,get children(){return[un(r,{marginLeft:100}),un(r,{}),un(r,{marginLeft:100}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex End"}),un(hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex End - Margin Right"}),un(hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{marginRight:100}),un(r,{}),un(r,{}),un(r,{marginRight:100})]}}),un(nn,{style:t,children:"Center - No Margin Support"}),un(hs,{gap:a,justifyContent:"center",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Space Between - No Margin Support"}),un(hs,{gap:a,justifyContent:"spaceBetween",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Space Evenly - No Margin Support"}),un(hs,{gap:a,justifyContent:"spaceEvenly",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})},Xa=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:xn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return un(on,gn(e,{style:{width:200,height:100,y:5,color:392801023}}))}function n(){return Math.floor(91*Math.random())+10}var o=g(Qt(50),2),i=o[0],s=o[1];function a(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),s(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var l=50;return un(Ei,{x:160,get y(){return i()},gap:30,height:850,get width(){return e.width},get style(){return ia.Column},get children(){return[un(nn,{style:t,children:"Flex Start - AlignItems: center"}),un(hs,{alignItems:"center",gap:l,style:e,onFocus:a,get children(){return[un(r,{autofocus:!0,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex Start - Margin Left - AlignItems: flexStart"}),un(hs,{gap:l,alignItems:"flexStart",style:e,onFocus:a,get children(){return[un(r,{marginLeft:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{marginLeft:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex End - AlignItems: flexEnd"}),un(hs,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex End - Margin Right"}),un(hs,{gap:l,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{marginRight:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{marginRight:100,get height(){return n()}})]}}),un(nn,{style:t,children:"Center - No Margin Support"}),un(hs,{gap:l,justifyContent:"center",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Space Between - No Margin Support"}),un(hs,{gap:l,justifyContent:"spaceBetween",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Space Evenly - No Margin Support"}),un(hs,{gap:l,justifyContent:"spaceEvenly",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}})]}})},Ga=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:xn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("#4dabf5"),height:850,width:80};function r(e){var t={width:Math.floor(61*Math.random())+10,height:80,x:5,color:xn("#1769aa")};return un(on,gn(e,{style:t}))}var n=g(Qt(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))}er((()=>{Qo("#333333")}));var s=50;return[un(nn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),un(hs,{gap:s,style:e,onFocus:i,get children(){return[un(Ei,{gap:30,style:t,alignItems:"center",get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,style:t,onFocus:i,alignItems:"flexStart",get children(){return[un(r,{marginTop:100}),un(r,{}),un(r,{marginTop:100}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,alignItems:"flexEnd",justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{marginBottom:100}),un(r,{}),un(r,{}),un(r,{marginBottom:100})]}}),un(Ei,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})]},Va=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:xn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("#4dabf5"),height:850,width:60};function r(e){var t={width:50,height:80,x:5,color:xn("#1769aa")};return un(on,gn(e,{style:t}))}var n=g(Qt(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))}er((()=>{Qo("#333333")}));var s=50;return[un(nn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),un(hs,{gap:s,style:e,onFocus:i,get children(){return[un(Ei,{gap:30,style:t,get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,style:t,onFocus:i,get children(){return[un(r,{marginTop:100}),un(r,{}),un(r,{marginTop:100}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{marginBottom:100}),un(r,{}),un(r,{}),un(r,{marginBottom:100})]}}),un(Ei,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})]},Za=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:xn("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 un(on,gn(e,{forwardStates:!0,style:r,shader:n,get children(){return un(nn,{style:ha,get children(){return e.children}})}}))}return un(hs,{style:t,get children(){return[un(o,{autofocus:!0,onEnter:e,children:"Focused"}),un(o,{states:{active:!0,disabled:!1},children:"Normal"}),un(o,{states:"disabled",children:"Disabled"})]}})},qa="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function Ja(){return(Ja=y(m().mark((function e(){var t,r;return m().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",el),e.prev=6,e.next=9,r.load(qa);case 9:console.log("The video has now been loaded!"),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),tl(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function el(e){tl(e.detail)}function tl(e){console.error("Error code",e.code,"object",e)}document.addEventListener("DOMContentLoaded",(function(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?function(){Ja.apply(this,arguments)}():console.error("Browser not supported!")}));var rl=()=>{var e=On(),t=Dn(),r=g(Vt((()=>w({},e)),Ua),1)[0],n=g(Vt((()=>w({},e)),Oa),1)[0],o=g(Vt((()=>w({},e)),Da),1)[0],i=g(Qt(0),2),s=i[0],a=i[1];Xt(Jt(r,(e=>{Qo(e.backgroundImage)}),{defer:!0}));var l,d,h,u=600,c={color:xn("#000000"),alpha:0,width:1900,height:890,x:10,y:u,borderRadius:30};function f(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=u,d.y=u,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;C(e&&e.href),t(e.href)}function m(){var e;(e=document.getElementById("video")).hidden=!0,e.pause(),document.getElementsByTagName("canvas")[0].focus(),Kr(h),a(0)}function x(){var e=function(){var e=document.getElementById("video");return e.hidden=!1,setTimeout((()=>e.play()),50),e.focus(),e}();Kr(e),a(.9)}return un(Fr,{get when(){return r()},keyed:!0,get children(){return[un(on,{onUp:()=>h.setFocus(),onEscape:m,get children(){return[un(Ma,gn({y:360,x:150},(()=>r().heroContent))),un(fa,{autofocus:!0,ref(e){"function"==typeof h?h(e):h=e},y:560,x:150,onDown:()=>l.setFocus(),onEnter:x,children:"Watch Trailer"}),un(Ei,{ref(e){"function"==typeof l?l(e):l=e},y:u,x:140,get style(){return ia.Column},zIndex:5,get children(){return un(Fr,{get when(){return hn((()=>!!o()))()&&n()},get children(){return[un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Recommendations"}),un(ca,{onFocus:f,onEnter:v,get items(){return o()}}),un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Cast and Crew"}),un(ca,{onFocus:p,onEnter:v,get items(){return n()}})]}})}}),un(on,{ref(e){"function"==typeof d?d(e):d=e},style:c,transition:{alpha:!0,y:!0}})]}}),un(on,{get alpha(){return s()},get color(){return xn("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function nl({id:e}){return Sa.get(`/person/${e}/combined_credits`).then((({cast:e})=>Aa(e.slice(0,7))))}function ol({id:e}){return Sa.get(`/person/${e}`).then((e=>w({backgroundImage:ya(e.profile_path,"original"),heroContent:{title:e.title||e.name,description:e.biography}},e)))}var il=()=>{var e=On(),t=Dn(),r=g(Vt((()=>w({},e)),ol),1)[0],n=g(Vt((()=>w({},e)),nl),1)[0];Xt(Jt(r,(e=>{Qo(e.backgroundImage)}),{defer:!0}));var o={color:xn("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){var e=this.children.selected;C(e&&e.href),t(e.href)}return un(Fr,{get when(){return r()},keyed:!0,get children(){return[un(on,{x:150,y:200,get style(){return ia.Column},zIndex:3,get children(){return[un(nn,{get style(){return Ko.typography.display2},get children(){return r().name}}),un(nn,{get style(){return ia.peopleBio},get children(){return r().biography}})]}}),un(on,{style:o}),un(Ei,{y:670,x:140,get style(){return ia.Column},get children(){return un(Fr,{get when(){return n()},get children(){return[un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Credits"}),un(ca,{autofocus:!0,onEnter:i,get items(){return n()}})]}})}})]}})},sl=()=>{return e=cn("node"),vn(e,"style",{width:1920,height:1080,color:868483072}),e;var e},al=new URL("AppCoreExtensions-legacy-BHJ85DAG.js",b.meta.url).href;Dr.debug=!1,Dr.animationsEnabled=!0,Dr.fontSettings.fontFamily="Ubuntu",Dr.fontSettings.color=xn("#ffffff"),Dr.fontSettings.fontSize=32,Dr.rendererOptions={coreExtensionModule:al,fpsUpdateInterval:1e3,enableInspector:!0},dn((()=>un(to,{root:e=>un(oa,e),get children(){return[un(Vn,{path:"",component:Wa}),un(Vn,{path:"examples",component:Ya}),un(Vn,{path:"browse/:filter",component:Wa}),un(Vn,{path:"text",component:ja}),un(Vn,{path:"buttons",component:Ka}),un(Vn,{path:"flex",component:$a}),un(Vn,{path:"create",component:Ha}),un(Vn,{path:"viewport",component:Qa}),un(Vn,{path:"flexsize",component:Xa}),un(Vn,{path:"flexcolumnsize",component:Ga}),un(Vn,{path:"flexcolumn",component:Va}),un(Vn,{path:"buttonsmaterial",component:Za}),un(Vn,{path:"entity/people/:id",component:il}),un(Vn,{path:"entity/:type/:id",component:rl}),un(Vn,{path:"*all",component:sl})]}})))}}}))}(); -//# sourceMappingURL=index-legacy-BVITNsdb.js.map +!function(){var e=["defaultTone"],t=["defaultTone"],r=["defaultTone"],n=["defaultTone"],o=["defaultTone"],i=["defaultTone"],s=["defaultTone"],a=["defaultTone"],l=["defaultTone"],d=["defaultTone"],h=["defaultTone"],u=["defaultTone"],c=["defaultTone"],f=["defaultTone"],p=["defaultSurfaceTone"];function v(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 g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){d=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw o}}return a}}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=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:{},s=i.iterator||"@@iterator",a=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 h(e,t,r,n){var i=t&&t.prototype instanceof x?t:x,s=Object.create(i.prototype),a=new E(n||[]);return o(s,"_invoke",{value:k(e,r,a)}),s}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var c="suspendedStart",f="suspendedYield",p="executing",v="completed",g={};function x(){}function y(){}function b(){}var w={};d(w,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(N([])));A&&A!==r&&n.call(A,s)&&(w=A);var C=b.prototype=x.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,s,a){var l=u(e[o],e,i);if("throw"!==l.type){var d=l.arg,h=d.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(h).then((function(e){d.value=e,s(d)}),(function(e){return r("throw",e,s,a)}))}a(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 k(t,r,n){var o=c;return function(i,s){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw s;return{value:e,done:!0}}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var l=I(a,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=u(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 I(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,I(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=u(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function B(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 R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[s];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 s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),d=n.call(s,"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),R(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;R(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 x(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(d){return void r(d)}a.done?t(l):Promise.resolve(l).then(n,o)}function y(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function s(e){x(i,n,o,s,a,"next",e)}function a(e){x(i,n,o,s,a,"throw",e)}s(void 0)}))}}function b(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 w(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,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function C(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{C=e.a,T=e.i,_=e.g,k=e.c,I=e.W,B=e.E,R=e.b,E=e.d,N=e.e,F=e.f,L=e.m,z=e.h,M=e.j,P=e.T,D=e.k,O=e.l,U=e.S,W=e.B,Y=e.n,j=e.o,H=e.p,Q=e.q,K=e.C,$=e.r,X=e.s,G=e.t,V=e.u,Z=e.v,q=e.w}],execute:function(){var x,J,ee,te=m().mark(Xe),re=document.createElement("style");re.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(re);class ne{constructor(e){S(this,"releaseCallback",void 0),this.releaseCallback=e}}class oe extends ne{constructor(e,t){var r,n;super(e),S(this,"textureMap",new Map),S(this,"zeroReferenceTextureSet",new Set),S(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=A(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(C(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;C(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);n||(this.registerTexture(e),n=this.textureMap.get(r)),C(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;C(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);C(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 ie extends ne{constructor(e){super(e),S(this,"registry",void 0),this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,r;C(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 se={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:ae(e)}},ae=e=>`rgba(${e>>24&255},${e>>16&255},${e>>8&255},${(255&e)/255})`,le={id:"id"};class de{constructor(e,t){var r,n,o,i,s,a;if(S(this,"root",null),S(this,"canvas",null),S(this,"height",1080),S(this,"width",1920),S(this,"scaleX",1),S(this,"scaleY",1),!T()){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!==(s=t.deviceLogicalPixelRatio)&&void 0!==s?s:1,this.scaleY=null!==(a=t.deviceLogicalPixelRatio)&&void 0!==a?a: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,s)=>("start"===i&&this.animateNode(t,e,n,o),Reflect.get(r,i,s))})}: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(se[t]){var n,o=null===(n=se[t])||void 0===n?void 0:n.call(se,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(le[t])e.setAttribute(String(se[t]),String(r));else if("data"!==t);else for(var i in r)e.setAttribute(`data-${i}`,String(r[i]))}}else{var s=r.id;if(1===s)return void this.root.appendChild(e);var a=document.getElementById(s.toString());null==a||a.appendChild(e)}}animateNode(e,t,r,n){var o=n.duration,i=void 0===o?1e3:o,s=n.delay,a=void 0===s?0:s,l=r.x,d=r.y,h=r.width,u=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=`${h}px`,e.style.height=`${u}px`,e.style.opacity=`${f}`,e.style.rotate=`${v}rad`,e.style.scale=`${m}`,e.style.color=ae(x)}),i)}),a)}}var he=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 ue{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){S(this,"priority",1),S(this,"name",""),S(this,"ref",void 0),S(this,"target",void 0),S(this,"passParameters",""),S(this,"declaredUniforms",""),S(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={},s=[],a="",l=this.constructor.uniforms||{};for(var d in l){var h=l[d],u=h.type,c=`${t}_${d}`,f="";h.size&&(f=`[${h.size(o)}]`),s.push(c),a+=`uniform ${u} ${c}${f};`,i[d]={name:c,uniform:l[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static resolveDefaults(e){return{}}static makeEffectKey(e){return!1}}S(ue,"uniforms",{}),S(ue,"methods",void 0),S(ue,"onShaderMask",void 0),S(ue,"onColorize",void 0),S(ue,"onEffectMask",void 0);var ce={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 fe{constructor(e){S(this,"stage",void 0),S(this,"set",void 0),this.stage=e;var t=w(w({},ce),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)})))}}function pe(e,t,r,n,o){return r*(n-1)+("bottom"!==e?.5*t:0)+Math.max(r,t)+(o||0)}class ve{constructor(e,t){S(this,"_canvas",void 0),S(this,"_context",void 0),S(this,"_settings",void 0),S(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,s=(this._settings.lineHeight||o)*t,a=this._settings.w*t,l=this._settings.h*t,d=this._settings.wordWrapWidth*t,h=this._settings.cutSx*t,u=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=a||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,k=this.wrapText(C[C.length-1],d-_,p,v);C[C.length-1]=`${k.l[0]}${this._settings.overflowSuffix}`,T=[k.l.length>1?k.l[1]:""]}else T=[""];var I=S.length,B=0,R=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,h=i.length;dt)for(;s>0&&(a=this._context.measureText(e.substring(0,s)).width+n)>t;)s-=1;else for(;s=n?r:"")}wrapText(e,t,r,n=0){for(var o=e.split(/\r?\n/g),i=[],s=[],a=0;ah?(c>0&&(l.push(d),d=""),d+=u[c],h=t-f-(0===c?n:0)):(h-=p,d+=` ${u[c]}`)}l.push(d),d="",i=i.concat(l),ae+this._context.measureText(r).width+t),0):this._context.measureText(e).width}mergeDefaults(e){return w({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 ge="undefined"==typeof self?globalThis:self,me=(null===(x=ge.document)||void 0===x?void 0:x.fonts)||ge.fonts;var xe=k(0,0,0,0);class ye extends fe{constructor(e){super(e),S(this,"canvas",void 0),S(this,"context",void 0),S(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")),C(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 I}addFontFace(e){C(e instanceof I),me.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new B,canvasPages:void 0,lightning2TextRenderer:new ve(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 me.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,s=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:R(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:s,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 a=e.props,l=a.x,d=a.y,h=a.width,u=a.height,c=a.scrollY,f=a.contain,p=e.visibleWindow,v=e.renderWindow,g=e.canvasPages;if(!p.valid){var m=k(l,d,"none"!==f?l+h:1/0,"both"===f?d+u:1/0,xe);E(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,C=d-c+v.y2;if(b<=p.x1&&S>=p.x2&&w<=p.y1&&C>=p.y2)return void this.setStatus(e,"loaded");Cp.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 T,_,I,B=e.renderInfo.lineHeight*y,N=Math.ceil(c/B),F=N*y,L=F-y,z=F+y;g=[{texture:null===(T=g)||void 0===T?void 0:T[0].texture,lineNumStart:L,lineNumEnd:L+y,valid:!1},{texture:null===(_=g)||void 0===_?void 0:_[1].texture,lineNumStart:F,lineNumEnd:F+y,valid:!1},{texture:null===(I=g)||void 0===I?void 0:I[2].texture,lineNumStart:z,lineNumEnd:z+y,valid:!1}],e.canvasPages=g;var M=N*B;v={x1:0,y1:M-B,x2:h,y2:M+2*B}}e.renderWindow=v,performance.now();var P,D=A(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,s=e.textW,a=void 0===s?0:s,l=e.textH,d=void 0===l?0:l,h=e.renderWindow;if(i&&h){var u=e.props,c=u.x,f=u.y,p=u.scrollY,v=u.contain,g=u.width,m=u.height,x={x:c,y:f,width:"none"!==v?g:a,height:"both"===v?m:d};N({x:0,y:0,width:o.options.appWidth,height:o.options.appHeight},x),C(i,"canvasPages is not defined"),C(h,"renderWindow is not defined");var y,b,w,S,A,T,_=(h.y2-h.y1)/3,k=e.props,I=k.zIndex,B=k.color,R=n*F(B),E=L(4294967295,R);if(i[0].valid)this.stage.renderer.addQuad({alpha:R,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:I,tx:t.tx,ty:t.ty-p+h.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[1].valid)this.stage.renderer.addQuad({alpha:R,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:I,tx:t.tx,ty:t.ty-p+h.y1+_,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[2].valid)this.stage.renderer.addQuad({alpha:R,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===(T=i[2].texture)||void 0===T||null===(T=T.dimensions)||void 0===T?void 0:T.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+h.y1+_+_,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 be extends z{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)}}S(be,"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 / 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 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 we extends z{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"}]}),S(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)}}S(we,"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 Se=new Map,Ae=(e,t)=>{var r=JSON.stringify(e);if(Se.has(r))return Se.get(r);var n=(null!=e?e:[]).map((e=>({type:e.type,props:t[e.type].resolveDefaults(e.props||{})})));return Se.set(r,n),n};class Ce extends z{constructor(e,t,r){var n=Ce.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}}),S(this,"effects",[]),this.effects=n.effects,this.calculateProps=M(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],s=t[i.name],a=null!==(o=e.props)&&void 0!==o?o:{},l=i.uniformInfo;Object.keys(a).forEach((e=>{var t=s.uniforms[e],n=l[e],o=t.validator?t.validator(a[e],a):a[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],a=n.getEffectKey(e.props||{});r[a]=r[a]?++r[a]:1;var l=r[a];1===l&&s.push({key:a,type:e.type,props:e.props});var d=new n({ref:`${a}${1===l?"":l}`,target:a,props:e.props});return o+=d.declaredUniforms,i.push(...Object.values(d.uniformInfo)),d})),l="";null==s||s.forEach((e=>{var r,o=t[e.type],i=o.resolveDefaults(null!==(r=e.props)&&void 0!==r?r:{}),s=[];for(var a in o.methods){var d=a,h=o.methods[a];n[a]&&n[a]!==h&&(d=Ce.resolveMethodDuplicate(a,h,n)),n[d]=h.replace("function",d),s.push({m:a,cm:d})}var u=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;s.forEach((e=>{var t=e.m,r=e.cm,n=new RegExp(`\\$${t}`,"g");u&&(u=u.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}`:"";u&&(l+=`\n float fx_${e.key}_onShaderMask(float shaderMask ${v}) {\n ${u}\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 h in n)d+=n[h];for(var u="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&&(u=`fx_${p.target}_onEffectMask(shaderMask, maskColor, shaderColor${v})`);var m=a[f+1];(void 0===m||t[m.name].onEffectMask)&&(c+=`\n shaderColor = ${u};\n `)}return{effects:a,uniforms:i,fragment:Ce.fragment(o,d,l,c),vertex:Ce.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:Ae(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}`}}S(Ce,"z$__type__Props",void 0),S(Ce,"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 ")),S(Ce,"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 Te extends z{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}}S(Te,"z$__type__Props",void 0),S(Te,"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 _e=new Float32Array([1,0,0,0,1,0,0,0,1]);class ke extends z{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=ke.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=R(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,s;return{transform:null!==(t=e.transform)&&void 0!==t?t:_e,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!==(s=e.debug)&&void 0!==s&&s}}}S(ke,"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 gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\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 Ie extends ue{constructor(...e){super(...e),S(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:null!==(t=e.radius)&&void 0!==t?t:10}}}S(Ie,"z$__type__Props",void 0),S(Ie,"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}}}),S(Ie,"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 "}),S(Ie,"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 "),S(Ie,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Be extends ue{constructor(...e){super(...e),S(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}}}S(Be,"z$__type__Props",void 0),S(Be,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Be,"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 "),S(Be,"onColorize","\n return color;\n ");class Re extends ue{constructor(...e){super(...e),S(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,s=0,a=o;se.map((e=>R(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"}}),S(Re,"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 "}),S(Re,"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 ${J.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Ee extends ue{constructor(...e){super(...e),S(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:null!==(t=e.amount)&&void 0!==t?t:1}}}S(Ee,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),S(Ee,"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 Ne extends ue{constructor(...e){super(...e),S(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}}}S(Ne,"z$__type__Props",void 0),S(Ne,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Ne,"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 "}),S(Ne,"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 "),S(Ne,"onColorize","\n return color;\n ");class Fe extends ue{constructor(...e){super(...e),S(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}}}S(Fe,"z$__type__Props",void 0),S(Fe,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Fe,"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 "}),S(Fe,"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 "),S(Fe,"onColorize","\n return color;\n ");class Le extends ue{constructor(...e){super(...e),S(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}}}S(Le,"z$__type__Props",void 0),S(Le,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Le,"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 "}),S(Le,"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 "),S(Le,"onColorize","\n return color;\n ");class ze extends ue{constructor(...e){super(...e),S(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}}}S(ze,"z$__type__Props",void 0),S(ze,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(ze,"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 "}),S(ze,"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 "),S(ze,"onColorize","\n return color;\n ");class Me extends ue{constructor(...e){super(...e),S(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()}}}S(Me,"z$__type__Props",void 0),S(Me,"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"}}),S(Me,"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 "}),S(Me,"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 Pe extends ue{constructor(...e){super(...e),S(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:null!==(t=e.fade)&&void 0!==t?t:10}}}S(Pe,"z$__type__Props",void 0),S(Pe,"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}}}),S(Pe,"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 De extends ue{constructor(...e){super(...e),S(this,"name","radialGradient")}static getEffectKey(e){return`radialGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n,o,i,s=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],a=e.stops||[];if(0===a.length||a.length!==s.length){for(var l=s.length,d=0,h=a;de.map((e=>R(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"}}),S(De,"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 ${ee.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Oe extends ue{constructor(...e){super(...e),S(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,r,n,o,i,s,a;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!==(s=e.radius)&&void 0!==s?s:1,color:null!==(a=e.color)&&void 0!==a?a:4294967295}}}S(Oe,"z$__type__Props",void 0),S(Oe,"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=>R(e),method:"uniform4fv",type:"vec4"}}),S(Oe,"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 "}),S(Oe,"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 "),S(Oe,"onColorize","\n return color;\n ");class Ue extends ue{constructor(...e){super(...e),S(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}}}S(Ue,"z$__type__Props",void 0),S(Ue,"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}}}),S(Ue,"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 "}),S(Ue,"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 "),S(Ue,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class We{constructor(){S(this,"shCache",new Map),S(this,"shConstructors",{}),S(this,"attachedShader",null),S(this,"effectConstructors",{}),S(this,"renderer",void 0),this.registerShaderType("DefaultShader",be),this.registerShaderType("DefaultShaderBatched",we),this.registerShaderType("RoundedRectangle",Te),this.registerShaderType("DynamicShader",Ce),this.registerShaderType("SdfShader",ke),this.registerEffectType("border",Be),this.registerEffectType("borderBottom",Le),this.registerEffectType("borderLeft",ze),this.registerEffectType("borderRight",Ne),this.registerEffectType("borderTop",Fe),this.registerEffectType("fadeOut",Pe),this.registerEffectType("linearGradient",Re),this.registerEffectType("radialGradient",De),this.registerEffectType("grayscale",Ee),this.registerEffectType("glitch",Me),this.registerEffectType("radius",Ie),this.registerEffectType("radialProgress",Oe),this.registerEffectType("holePunch",Ue)}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=Ce.resolveDefaults(e,this.effectConstructors),r=Ce.makeCacheKey(t,this.effectConstructors);if(r&&this.shCache.has(r))return{shader:this.shCache.get(r),props:t};var n=new Ce(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 Ye{constructor(){S(this,"data",{})}reset(){this.data={}}increment(e){this.data[e]||(this.data[e]=0),this.data[e]++}getData(){return w({},this.data)}}var je=function(){var e=y(m().mark((function e(t){var r,n;return m().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",He(n));case 8:return e.abrupt("return",Qe(n));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),He=function(){var e=y(m().mark((function e(t){var r,n,o,i,s,a,l;return m().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)},s=64,s+=i.bytesOfKeyValueData,a=0;a>2)*(h+3>>2)*8,f=new Uint8Array(r,i.byteOffset+l,c),s.push(f),l+=c,d>>=1,h>>=1;return e.abrupt("return",{data:{glInternalFormat:36196,mipmaps:s,width:a.pixelWidth||0,height:a.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();class Ke extends P{constructor(e,t){super(e),S(this,"props",void 0),this.props=Ke.resolveDefaults(t)}hasAlphaChannel(e){return-1!==e.indexOf("image/png")}getTextureData(){var e=this;return y(m().mark((function t(){var r,n,o,i,s,a,l;return m().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",je(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 s=t.sent,a=null!=o?o:e.hasAlphaChannel(s.type),t.next=23,createImageBitmap(s,{premultiplyAlpha:a?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"});case 23:return t.t0=t.sent,t.t1=a,t.abrupt("return",{data:t.t0,premultiplyAlpha:t.t1});case 28:return(l=new Image).src=n,t.next=32,new Promise(((e,t)=>{l.onload=()=>e(),l.onerror=()=>t(new Error("Failed to load image"))})).catch((e=>{console.error(e)}));case 32:return t.abrupt("return",{data:l,premultiplyAlpha:null==o||o});case 33:case"end":return t.stop()}}),t)})))()}static makeCacheKey(e){var t=Ke.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}}}S(Ke,"z$__type__Props",void 0);class $e{constructor(e,t=0){S(this,"iterator",void 0),S(this,"peekBuffer",[]),S(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 Xe(e,t=0){var r,n;return m().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:B,maxX:I});else if(e>c.length)throw new Error("Unexpected lineCache length");if(32===X.codepoint||10===X.codepoint?-1!==F.codepointIndex&&(F.codepointIndex=-1,H=R):-1===F.codepointIndex&&(F.codepointIndex=X.cluster,F.bufferOffset=N,F.xStart=H),X.mapped){var G=R+X.xOffset+X.width;if("none"!==u&&G>=j&&-1!==F.codepointIndex&&F.xStart>0){if(Y){M=L.shapeText(z,new $e(Xe(n,F.codepointIndex),F.codepointIndex)),N=F.bufferOffset;break}M=L.shapeText(z,new $e(Xe(m,0),0)),R=F.xStart,N=F.bufferOffset,u="none"}else{var V=R+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;h[N++]=V,h[N++]=Z,h[N++]=J,h[N++]=ee,h[N++]=V+X.width,h[N++]=Z,h[N++]=J+te,h[N++]=ee,h[N++]=V,h[N++]=Z+X.height,h[N++]=J,h[N++]=ee+re,h[N++]=V+X.width,h[N++]=Z+X.height,h[N++]=J+te,h[N++]=ee+re}B=Math.max(B,Z+X.height),I=Math.max(I,V+X.width),R+=X.xAdvance}}else if(10===X.codepoint){if(Y)break;M=L.shapeText(z,new $e(Xe(m,0),0)),u="none"}}-1!==P&&(D.push({bufferStart:P,bufferEnd:N}),P=-1),R=0,E+=w,e++,F.codepointIndex=-1,H=0,!v&&"both"===u&&E>f.y2||y&&y.done?W=!1:Y||(W=!1)}if("center"===o)for(var ne="none"===u?I:S,oe=0;oe"number"==typeof e?e:Ze[e]||400;var Je=M((function(e,t,r,n,o){var i,s=qe(r),a=A(e);try{for(a.s();!(i=a.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,h=new Map,u=A(l);try{for(u.s();!(d=u.n()).done;){var c=d.value,f=qe(c.descriptors.weight);if(f===s&&c.descriptors.style===n&&c.descriptors.stretch===o)return c;h.set(f,c)}}catch(v){u.e(v)}finally{u.f()}var p=`TrFontManager: No exact match: '${t} Weight: ${s} Style: ${n} Stretch: ${o}'`;if(console.error(p),400===s&&h.has(500))return h.get(500);if(500===s&&h.has(400))return h.get(400);if(s<400){for(;s>0;){if(h.has(s))return h.get(s);s-=100}s=600}for(;s<1e3;){if(h.has(s))return h.get(s);s+=100}for(s=500;s>0;){if(h.has(s))return h.get(s);s-=100}}}}catch(v){a.e(v)}finally{a.f()}}));class et{constructor(e){S(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 Je(e,r,n,o,i)}}var tt={x:0,y:0,width:0,height:0};class rt extends fe{constructor(e){super(e),S(this,"ssdfFontFamilies",{}),S(this,"msdfFontFamilies",{}),S(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]),S(this,"sdfShader",void 0),S(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&&O(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&O(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 U}addFontFace(e){C(e instanceof U);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 B,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 s=`SdfTextRenderer: Could not resolve font face for family: '${e.props.fontFamily}'`;return console.error(s),void this.setStatus(e,"failed",new Error(s))}t.texture.setRenderableOwner(e,e.isRenderable)}if(t.loaded){C(t.data,"Font face data should be loaded");var a=e.props,l=a.text,d=a.fontSize,h=a.x,u=a.y,c=a.contain,f=a.width,p=a.height,v=a.lineHeight,g=a.verticalAlign,m=a.scrollable,x=a.overflowSuffix,y=a.maxLines,b="both"===c&&m?e.props.scrollY:0,w=e.renderWindow,S=t.data.info.size,A=d/S,T=v/A;e.distanceRange=A*t.data.distanceField.distanceRange;var _=24*l.length,k=e.vertexBuffer;(!k||k.length<_)&&(k=new Float32Array(2*_));var I=e.elementBounds;if(I.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),I.valid=!0),!i&&w.valid){var B=w.screen;if(h+B.x1<=I.x1&&h+B.x2>=I.x2&&u-b+B.y1<=I.y1&&u-b+B.y2>=I.y2)return void this.setStatus(e,"loaded");w.valid=!1,this.setStatus(e,"loading")}var R=e.props,E=R.offsetY,N=R.textAlign;if(!w.valid){if(!O(I,this.rendererBounds))return;Ve(w,h,u,b,v,"both"===c?I.y2-I.y1:0,I,A)}var F=function(e,t,r,n,o,i,s,a,l){var d=Math.min(Math.max(s.firstLineIdx,0),a.length),h=0;"middle"===n?h=(t-e)/2:"bottom"===n&&(h=t-e);var u=o/i+d*t+h;if(!(l&&u>=l/i))return{sdfX:0,sdfY:u,lineIndex:d}}(S,T,0,g,E,A,w,n,r);if(F){var L=e.props.letterSpacing,z=Ge(F.lineIndex,F.sdfX,F.sdfY,l,N,f,p,d,v,L,k,c,n,w.sdf,t,i,m,x,y);e.bufferUploaded=!1,e.bufferNumFloats=z.bufferNumFloats,e.bufferNumQuads=z.bufferNumQuads,e.vertexBuffer=k,e.renderWindow=w,o.lastLayoutNumCharacters=z.layoutNumCharacters,o.bufferSize=k.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){var o,i;if(e.vertexBuffer){var s=this.stage.renderer,a=e.props,l=a.fontSize,d=a.color,h=a.contain,u=a.scrollable,c=a.zIndex,f=a.debug,p="both"===h&&u?e.props.scrollY:0,v=e.textW,g=void 0===v?0:v,m=e.textH,x=void 0===m?0:m,y=e.distanceRange,b=e.vertexBuffer,w=e.bufferUploaded,S=e.trFontFace,A=e.elementBounds,T=e.webGlBuffers;if(!T){var _=s.glw,k=4*Float32Array.BYTES_PER_ELEMENT,I=_.createBuffer();C(I),e.webGlBuffers=new W([{buffer:I,attributes:{a_position:{name:"a_position",size:2,type:_.FLOAT,normalized:!1,stride:k,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:_.FLOAT,normalized:!1,stride:k,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,C(e.webGlBuffers),T=e.webGlBuffers}if(!w){var B,R,E=s.glw,F=null!==(B=null===(R=T)||void 0===R?void 0:R.getBuffer("a_textureCoordinate"))&&void 0!==B?B:null;E.arrayBufferData(F,b,E.STATIC_DRAW),e.bufferUploaded=!0}if(C(S),u&&"both"===h){C(A.valid);var L=Y(A,tt);r.valid?(e.clippingRect.valid=!0,r=N(r,L,e.clippingRect)):(e.clippingRect.valid=!0,r=j(L,e.clippingRect))}var z=new H(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:Q(d,n),size:l/((null===(o=S.data)||void 0===o?void 0:o.info.size)||0),scrollY:p,distanceRange:y,debug:f.sdfShaderDebug},n,r,{height:x,width:g},0,c),M=null===(i=e.trFontFace)||void 0===i?void 0:i.texture;C(M);var P=this.stage.txManager.getCtxTexture(M);z.addTexture(P),z.length=e.bufferNumFloats,z.numQuads=e.bufferNumQuads,s.addRenderOp(z)}}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 et.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 nt(e,t){return ot.apply(this,arguments)}function ot(){return(ot=y(m().mark((function e(t,r){var n,o,i;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Loading core extension",t),e.next=4,he((()=>b.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 K)){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 it(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[s]||(console.warn(`Custom Data value for ${o} is not a boolean, string, or number, it will be ignored`),delete e[o])}}return e}class st extends B{constructor(e,t,r){var n,o,i,s;super(),S(this,"root",null),S(this,"driver",void 0),S(this,"canvas",void 0),S(this,"settings",void 0),S(this,"inspector",null),S(this,"nodes",new Map),S(this,"nextTextureId",1),S(this,"textureTracker",void 0);var a={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!==(s=e.enableInspector)&&void 0!==s&&s};this.settings=a;var l=a.appWidth,d=a.appHeight,h=a.deviceLogicalPixelRatio,u=a.devicePhysicalPixelRatio,c=a.enableInspector,f=e=>{this.driver.releaseTexture(e)},p=a.experimental_FinalizationRegistryTextureUsageTracker&&"function"==typeof FinalizationRegistry;this.textureTracker=p?new ie(f):new oe(f,this.settings.textureCleanupOptions);var v=l*h,g=d*h;this.driver=r;var m,x=document.createElement("canvas");if(this.canvas=x,x.width=v*u,x.height=g*u,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&&!T()&&(this.inspector=new de(x,a))}init(){var e=this;return y(m().mark((function t(){return m().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,s,a,l,d,h,u,c,f,p,v,g,m,x,y,b=null!==(t=e.fontSize)&&void 0!==t?t:16,S=w(w({},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!==(s=e.fontWeight)&&void 0!==s?s:"normal",fontStretch:null!==(a=e.fontStretch)&&void 0!==a?a:"normal",textAlign:null!==(l=e.textAlign)&&void 0!==l?l:"left",contain:null!==(d=e.contain)&&void 0!==d?d:"none",scrollable:null!==(h=e.scrollable)&&void 0!==h&&h,scrollY:null!==(u=e.scrollY)&&void 0!==u?u: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,S):this.driver.createTextNode(S)}resolveNodeDefaults(e){var t,r,n,o,i,s,a,l,d,h,u,c,f,p,v,g,m,x,y,b,w,S,A,C,T,_,k,I,B,R,E,N,F,L,z,M,P,D,O,U,W,Y,j,H,Q,K,$,X=null!==(t=e.color)&&void 0!==t?t:4294967295,G=null!==(r=null!==(n=null!==(o=e.colorTl)&&void 0!==o?o:e.colorTop)&&void 0!==n?n:e.colorLeft)&&void 0!==r?r:X,V=null!==(i=null!==(s=null!==(a=e.colorTr)&&void 0!==a?a:e.colorTop)&&void 0!==s?s:e.colorRight)&&void 0!==i?i:X,Z=null!==(l=null!==(d=null!==(h=e.colorBl)&&void 0!==h?h:e.colorBottom)&&void 0!==d?d:e.colorLeft)&&void 0!==l?l:X,q=null!==(u=null!==(c=null!==(f=e.colorBr)&&void 0!==f?f:e.colorBottom)&&void 0!==c?c:e.colorRight)&&void 0!==u?u:X,J=it(null!==(p=e.data)&&void 0!==p?p:{});return{x:null!==(v=e.x)&&void 0!==v?v:0,y:null!==(g=e.y)&&void 0!==g?g:0,width:null!==(m=e.width)&&void 0!==m?m:0,height:null!==(x=e.height)&&void 0!==x?x:0,alpha:null!==(y=e.alpha)&&void 0!==y?y:1,autosize:null!==(b=e.autosize)&&void 0!==b&&b,clipping:null!==(w=e.clipping)&&void 0!==w&&w,color:X,colorTop:null!==(S=e.colorTop)&&void 0!==S?S:X,colorBottom:null!==(A=e.colorBottom)&&void 0!==A?A:X,colorLeft:null!==(C=e.colorLeft)&&void 0!==C?C:X,colorRight:null!==(T=e.colorRight)&&void 0!==T?T:X,colorBl:Z,colorBr:q,colorTl:G,colorTr:V,zIndex:null!==(_=e.zIndex)&&void 0!==_?_:0,zIndexLocked:null!==(k=e.zIndexLocked)&&void 0!==k?k:0,parent:null!==(I=e.parent)&&void 0!==I?I:null,texture:null!==(B=e.texture)&&void 0!==B?B:null,shader:null!==(R=e.shader)&&void 0!==R?R:null,src:null!==(E=e.src)&&void 0!==E?E:"",scale:null!==(N=e.scale)&&void 0!==N?N:null,scaleX:null!==(F=null!==(L=e.scaleX)&&void 0!==L?L:e.scale)&&void 0!==F?F:1,scaleY:null!==(z=null!==(M=e.scaleY)&&void 0!==M?M:e.scale)&&void 0!==z?z:1,mount:null!==(P=e.mount)&&void 0!==P?P:0,mountX:null!==(D=null!==(O=e.mountX)&&void 0!==O?O:e.mount)&&void 0!==D?D:0,mountY:null!==(U=null!==(W=e.mountY)&&void 0!==W?W:e.mount)&&void 0!==U?U:0,pivot:null!==(Y=e.pivot)&&void 0!==Y?Y:.5,pivotX:null!==(j=null!==(H=e.pivotX)&&void 0!==H?H:e.pivot)&&void 0!==j?j:.5,pivotY:null!==(Q=null!==(K=e.pivotY)&&void 0!==K?K:e.pivot)&&void 0!==Q?Q:.5,rotation:null!==($=e.rotation)&&void 0!==$?$:0,data:J}}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:w(w({},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 at extends B{constructor(e,t,r){super(),S(this,"node",void 0),S(this,"props",void 0),S(this,"settings",void 0),S(this,"propStartValues",{}),S(this,"restoreValues",{}),S(this,"progress",0),S(this,"delayFor",0),S(this,"timingFunction",void 0),S(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=$(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 s=0;s{this.startedResolve=e})))}makeStoppedPromise(){null===this.stoppedResolve&&(this.stoppedPromise=new Promise((e=>{this.stoppedResolve=e})))}started(){C(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){C(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 dt{constructor(e){S(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 ut}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],s=e.data[1]*t.data[0]+e.data[4]*t.data[1]+e.data[7]*t.data[2],a=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],h=e.data[2]*t.data[3]+e.data[5]*t.data[4]+e.data[8]*t.data[5],u=e.data[2]*t.data[6]+e.data[5]*t.data[7]+e.data[8]*t.data[8];return r||(r=new dt),r.data[0]=n,r.data[3]=o,r.data[6]=i,r.data[1]=s,r.data[4]=a,r.data[7]=l,r.data[2]=d,r.data[5]=h,r.data[8]=u,r}static identity(e){return e||(e=new dt),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 dt),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 dt),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 dt),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 dt),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,s=this.data[4]*t-this.data[1]*r;return this.data[0]=n,this.data[3]=o,this.data[1]=i,this.data[4]=s,this}multiply(e){return dt.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 ht,ut=new dt;class ct{constructor(e){S(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,s,a,l){return l||(l=new ct),l.data[0]=e,l.data[2]=r,l.data[4]=o,l.data[6]=s,l.data[1]=t,l.data[3]=n,l.data[5]=i,l.data[7]=a,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"}(ht||(ht={}));var ft,pt=new Map;pt.set(ht.Init,"init"),pt.set(ht.OutOfBounds,"outOfBounds"),pt.set(ht.InBounds,"inBounds"),pt.set(ht.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"}(ft||(ft={}));class vt extends B{constructor(e,t){super(),S(this,"stage",void 0),S(this,"children",[]),S(this,"props",void 0),S(this,"updateType",ft.All),S(this,"globalTransform",void 0),S(this,"scaleRotateTransform",void 0),S(this,"localTransform",void 0),S(this,"renderCoords",void 0),S(this,"renderBound",void 0),S(this,"strictBound",void 0),S(this,"preloadBound",void 0),S(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1}),S(this,"isRenderable",!1),S(this,"renderState",ht.Init),S(this,"worldAlpha",1),S(this,"premultipliedColorTl",0),S(this,"premultipliedColorTr",0),S(this,"premultipliedColorBl",0),S(this,"premultipliedColorBr",0),S(this,"calcZIndex",0),S(this,"onTextureLoaded",((e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})})),S(this,"onTextureFailed",((e,t)=>{this.emit("failed",{type:"texture",error:t})})),S(this,"onTextureFreed",(e=>{this.emit("freed",{type:"texture"})})),this.stage=e,this.props=w(w({},t),{},{parent:null}),this.parent=t.parent,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(ft.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(ft.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){var r=this.stage.renderer.getShaderManager();C(r);var n=r.loadShader(e,t),o=n.shader,i=n.props;this.props.shader=o,this.props.shaderProps=i,this.setUpdateType(ft.IsRenderable)}setUpdateType(e){this.updateType|=e;var t=this.props.parent;!t||t.updateType&ft.Children||t.setUpdateType(ft.Children)}sortChildren(){this.children.sort(((e,t)=>e.calcZIndex-t.calcZIndex))}updateScaleRotateTransform(){this.scaleRotateTransform=dt.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){C(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=dt.translate(e-r+this.props.x,t-n+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(ft.Global)}update(e,t){this.updateType&ft.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(ft.Local)),this.updateType&ft.Local&&(this.updateLocalTransform(),this.setUpdateType(ft.Global));var r=this.props.parent,n=ft.None;this.updateType&ft.Global&&(C(this.localTransform),this.globalTransform=dt.copy((null==r?void 0:r.globalTransform)||this.localTransform,this.globalTransform),r&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(ft.Clipping|ft.RenderState|ft.Children),n|=ft.Global),this.updateType&ft.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(ft.Children),n|=ft.Clipping),this.updateType&ft.WorldAlpha&&(this.worldAlpha=r?r.worldAlpha*this.props.alpha:this.props.alpha,this.setUpdateType(ft.Children|ft.PremultipliedColors|ft.IsRenderable),n|=ft.WorldAlpha),this.updateType&ft.PremultipliedColors&&(this.premultipliedColorTl=L(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=L(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=L(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=L(this.props.colorBr,this.worldAlpha,!0))),this.updateType&ft.RenderState&&(this.updateRenderState(t),this.setUpdateType(ft.IsRenderable)),this.updateType&ft.IsRenderable&&this.updateIsRenderable(),r&&this.updateType&ft.CalculatedZIndex&&(this.calculateZIndex(),r.setUpdateType(ft.ZIndexSortedChildren)),this.updateType&ft.Children&&this.children.length&&this.children.forEach((t=>{t.setUpdateType(n),0!==t.updateType&&t.update(e,this.clippingRect)})),this.updateType&ft.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){C(this.renderBound);var t=e.width||this.stage.root.width,r=e.height||this.stage.root.height;this.strictBound=k(e.x,e.y,e.x+t,e.y+r,this.strictBound);var n=this.stage.boundsMargin;return this.preloadBound=k(e.x-n[3],e.y-n[0],e.x+t+n[1],e.y+r+n[2],this.preloadBound),G(this.renderBound,this.strictBound)?ht.InViewport:G(this.renderBound,this.preloadBound)?ht.InBounds:ht.OutOfBounds}updateRenderState(e){var t=this.checkRenderBounds(e);if(t!==this.renderState){var r=this.renderState;this.renderState=t,r===ht.InViewport&&this.emit("outOfViewport",{previous:r,current:t}),(rht.InBounds&&t===ht.OutOfBounds)&&(this.emit(pt.get(ht.InBounds),{previous:r,current:t}),r=ht.InBounds);var n=pt.get(t);C(n),this.emit(n,{previous:r,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(ht[e]))}updateIsRenderable(){var e;e=!(0===this.worldAlpha||!this.checkRenderProps())&&this.renderState>ht.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;C(r);var n=r.tx,o=r.ty,i=r.ta,s=r.tb,a=r.tc,l=r.td;if(0===s&&0===a){var d=n,h=n+e*i,u=o,c=o+t*l;this.renderCoords=ct.translate(d,u,h,u,h,c,d,c,this.renderCoords)}else this.renderCoords=ct.translate(n,o,n+e*i,o+e*a,n+e*i+t*s,o+e*a+t*l,n+t*s,o+t*l,this.renderCoords)}updateBoundingRect(){var e=this.renderCoords,t=this.globalTransform;C(t),C(e);var r=t.tb,n=t.tc,o=e.x1,i=e.y1,s=e.x3,a=e.y3;if(0===r||0===n)this.renderBound=k(o,i,s,a,this.renderBound);else{var l=e.x2,d=e.x4,h=e.y2,u=e.y4;this.renderBound=k(Math.min(o,l,s,d),Math.min(i,h,a,u),Math.max(o,l,s,d),Math.max(i,h,a,u),this.renderBound)}}calculateClippingRect(e){C(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?N(e,t,t):e.valid&&(j(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(ft.CalculatedZIndex)}))}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(ft.CalculatedZIndex|ft.Children),this.children.forEach((e=>{e.setUpdateType(ft.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);C(-1!==r,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(r,1),t.setUpdateType(ft.Children|ft.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(ft.All),e.setUpdateType(ft.Children|ft.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}var gt=1;function mt(){return gt++}class xt extends B{constructor(e,t,r,n){var o;super(),S(this,"rendererMain",void 0),S(this,"stage",void 0),S(this,"id",void 0),S(this,"coreNode",void 0),S(this,"_children",[]),S(this,"_src",""),S(this,"_parent",null),S(this,"_texture",null),S(this,"_shader",null),S(this,"_data",{}),S(this,"onTextureLoaded",((e,t)=>{this.emit("loaded",t)})),S(this,"onTextureFailed",((e,t)=>{this.emit("failed",t)})),S(this,"onTextureFreed",((e,t)=>{this.emit("freed",t)})),S(this,"onOutOfBounds",((e,t)=>{this.emit("outOfBounds",t)})),S(this,"onInBounds",((e,t)=>{this.emit("inBounds",t)})),S(this,"onOutOfViewport",((e,t)=>{this.emit("outOfViewport",t)})),S(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:mt(),this.coreNode=n||new vt(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}),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._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);C(-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 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=it(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 at(this.coreNode,e,t);return new lt(this.stage.animationManager,r)}}class yt{constructor(){S(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 bt{constructor(e){S(this,"imageWorkersEnabled",!0),S(this,"messageManager",{}),S(this,"workers",[]),S(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 s=g(i,2),a=s[0],l=s[1];delete this.messageManager[r],o?l(new Error(o)):a(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 wt extends P{constructor(e,t){super(e),S(this,"props",void 0),this.props=wt.resolveDefaults(t)}getTextureData(){var e=this;return y(m().mark((function t(){var r,n,o,i,s,a,l;return m().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,s=new Uint8ClampedArray(i),a=0;a{})}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()}))}}class Ct extends B{constructor(e){super(),S(this,"options",void 0),S(this,"animationManager",void 0),S(this,"txManager",void 0),S(this,"txMemManager",void 0),S(this,"fontManager",void 0),S(this,"textRenderers",void 0),S(this,"shManager",void 0),S(this,"renderer",void 0),S(this,"root",void 0),S(this,"boundsMargin",void 0),S(this,"deltaTime",0),S(this,"lastFrameTime",0),S(this,"currentFrameTime",0),S(this,"fpsNumFrames",0),S(this,"fpsElapsedTime",0),S(this,"renderRequested",!1),S(this,"contextSpy",null),this.options=e;var t=e.canvas,r=e.clearColor,n=e.rootId,o=e.debug,i=e.appWidth,s=e.appHeight,a=e.boundsMargin,l=e.enableContextSpy,d=e.numImageWorkers,h=e.txMemByteThreshold;this.txManager=new St(d),this.txMemManager=new At(h),this.shManager=new We,this.animationManager=new yt,this.contextSpy=l?new Ye:null;var u=[0,0,0,0];a&&(u=Array.isArray(a)?a:[a,a,a,a]),this.boundsMargin=u,null!=o&&o.monitorTextureCache&&setInterval((()=>{C(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 q({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 ye(this),sdf:new rt(this)},this.fontManager=new et(this.textRenderers);var c,f,p,v=new vt(this,{id:n,x:0,y:0,width:i,height:s,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});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(),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){C(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}})})),S(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(ft.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(ft.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),C(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){C(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}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 _t extends xt{constructor(e,t,r){super(e,t,r,new Tt(r,{id:mt(),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}))}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 kt{constructor(){S(this,"root",null),S(this,"stage",null),S(this,"rendererMain",null)}init(e,t,r){var n=this;return y(m().mark((function o(){var i;return m().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n.stage=new Ct({rootId:mt(),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,C(n.stage.root),i=new xt(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,nt(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){C(this.rendererMain),C(this.stage);var t=new xt(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}createTextNode(e){C(this.rendererMain),C(this.stage);var t=new _t(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;C(t),t.txManager.removeTextureIdFromCache(e)}getRootNode(){return C(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.")}}var It,Bt=(e,t)=>e===t,Rt=Symbol("solid-proxy"),Et=Symbol("solid-track"),Nt={equals:Bt},Ft=pr,Lt=1,zt=2,Mt={owned:null,cleanups:null,context:null,owner:null},Pt={},Dt=null,Ot=null,Ut=null,Wt=null,Yt=null,jt=0;function Ht(e,t){var r=Ut,n=Dt,o=0===e.length,i=void 0===t?n:t,s=o?Mt:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e((()=>qt((()=>xr(s)))));Dt=s,Ut=null;try{return fr(a,!0)}finally{Ut=r,Dt=n}}function Qt(e,t){var r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Nt,t):Nt).equals||void 0};return[lr.bind(r),e=>("function"==typeof e&&(e=e(r.value)),dr(r,e))]}function Kt(e,t,r){hr(ur(e,t,!0,Lt))}function $t(e,t,r){hr(ur(e,t,!1,Lt))}function Xt(e,t,r){Ft=vr;var n=ur(e,t,!1,Lt);r&&r.render||(n.user=!0),Yt?Yt.push(n):hr(n)}function Gt(e,t,r){r=r?Object.assign({},Nt,r):Nt;var n=ur(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,hr(n),lr.bind(n)}function Vt(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 s=null,a=Pt,l=!1,d="initialValue"in i,h="function"==typeof n&&Gt(n),u=new Set,c=g((i.storage||Qt)(i.initialValue),2),f=c[0],p=c[1],v=g(Qt(void 0),2),m=v[0],x=v[1],y=g(Qt(void 0,{equals:!1}),2),b=y[0],w=y[1],S=g(Qt(d?"ready":"unresolved"),2),C=S[0],T=S[1];function _(e,t,r,n){return s===e&&(s=null,void 0!==n&&(d=!0),e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(n,{value:t}))),a=Pt,function(e,t){fr((()=>{void 0===t&&p((()=>e)),T(void 0!==t?"errored":d?"ready":"unresolved"),x(t);var r,n=A(u.keys());try{for(n.s();!(r=n.n()).done;){r.value.decrement()}}catch(t){n.e(t)}finally{n.f()}u.clear()}),!1)}(t,r)),t}function k(){var e=It,t=f(),r=m();if(void 0!==r&&!s)throw r;return Ut&&!Ut.user&&e&&Kt((()=>{b(),s&&(e.resolved||u.has(e)||(e.increment(),u.add(e)))})),t}function I(e=!0){if(!1===e||!l){l=!1;var t=h?h():n;if(null!=t&&!1!==t){var r,i=a!==Pt?a:qt((()=>o(t,{value:f(),refetching:e})));return(r=i)&&"object"==typeof r&&"then"in r?(s=i,"value"in i?("success"===i.status?_(s,i.value,void 0,t):_(s,void 0,void 0,t),i):(l=!0,queueMicrotask((()=>l=!1)),fr((()=>{T(d?"refreshing":"pending"),w()}),!1),i.then((e=>_(i,e,void 0,t)),(e=>_(i,void 0,yr(e),t))))):(_(s,i,void 0,t),i)}_(s,qt(f))}}return Object.defineProperties(k,{state:{get:()=>C()},error:{get:()=>m()},loading:{get(){var e=C();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return k();var e=m();if(e&&!s)throw e;return f()}}}),h?Kt((()=>I(!1))):I(!1),[k,{refetch:I,mutate:p}]}function Zt(e,t=Bt,r){var n=new Map,o=ur((r=>{var o,i=e(),s=A(n.entries());try{for(s.s();!(o=s.n()).done;){var a=g(o.value,2),l=a[0],d=a[1];if(t(l,i)!==t(l,r)){var h,u=A(d.values());try{for(u.s();!(h=u.n()).done;){var c=h.value;c.state=Lt,c.pure?Wt.push(c):Yt.push(c)}}catch(f){u.e(f)}finally{u.f()}}}}catch(f){s.e(f)}finally{s.f()}return i}),void 0,!0,Lt);return hr(o),e=>{var r,i=Ut;i&&((r=n.get(e))?r.add(i):n.set(e,r=new Set([i])),tr((()=>{r.delete(i),!r.size&&n.delete(e)})));return t(e,o.value)}}function qt(e){if(null===Ut)return e();var t=Ut;Ut=null;try{return e()}finally{Ut=t}}function Jt(e,t,r){var n,o=Array.isArray(e),i=r&&r.defer;return r=>{var s;if(o){s=Array(e.length);for(var a=0;at(s,n,r)));return n=s,l}}function er(e){Xt((()=>qt(e)))}function tr(e){return null===Dt||(null===Dt.cleanups?Dt.cleanups=[e]:Dt.cleanups.push(e)),e}function rr(){return Dt}function nr(e,t){var r=Dt,n=Ut;Dt=e,Ut=null;try{return fr(t,!0)}catch(o){br(o)}finally{Dt=r,Ut=n}}function or(e){var t=Ut,r=Dt;return Promise.resolve().then((()=>{Ut=t,Dt=r,fr(e,!1),Ut=Dt=null}))}function ir(e,t){var r=Symbol("context");return{id:r,Provider:Sr(r),defaultValue:e}}function sr(e){return Dt&&Dt.context&&void 0!==Dt.context[e.id]?Dt.context[e.id]:e.defaultValue}function ar(e){var t=Gt(e),r=Gt((()=>wr(t())));return r.toArray=()=>{var e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function lr(){if(this.sources&&this.state)if(this.state===Lt)hr(this);else{var e=Wt;Wt=null,fr((()=>gr(this)),!1),Wt=e}if(Ut){var t=this.observers?this.observers.length:0;Ut.sources?(Ut.sources.push(this),Ut.sourceSlots.push(t)):(Ut.sources=[this],Ut.sourceSlots=[t]),this.observers?(this.observers.push(Ut),this.observerSlots.push(Ut.sources.length-1)):(this.observers=[Ut],this.observerSlots=[Ut.sources.length-1])}return this.value}function dr(e,t,r){var n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&fr((()=>{for(var t=0;t1e6)throw Wt=[],new Error}),!1)),t}function hr(e){if(e.fn){xr(e);var t=jt;!function(e,t,r){var n,o=Dt,i=Ut;Ut=Dt=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=Lt,e.owned&&e.owned.forEach(xr),e.owned=null),e.updatedAt=r+1,br(s)}finally{Ut=i,Dt=o}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?dr(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}}function ur(e,t,r,n=Lt,o){var i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Dt,context:Dt?Dt.context:null,pure:r};return null===Dt||Dt!==Mt&&(Dt.owned?Dt.owned.push(i):Dt.owned=[i]),i}function cr(e){if(0!==e.state){if(e.state===zt)return gr(e);if(e.suspense&&qt(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===Lt)hr(e);else if(e.state===zt){var n=Wt;Wt=null,fr((()=>gr(e,t[0])),!1),Wt=n}}}function fr(e,t){if(Wt)return e();var r=!1;t||(Wt=[]),Yt?r=!0:Yt=[],jt++;try{var n=e();return function(e){Wt&&(pr(Wt),Wt=null);if(e)return;var t=Yt;Yt=null,t.length&&fr((()=>Ft(t)),!1)}(r),n}catch(o){r||(Yt=null),Wt=null,br(o)}}function pr(e){for(var t=0;t=0;t--)xr(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 yr(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function br(e,t=Dt){throw yr(e)}function wr(e){if("function"==typeof e&&!e.length)return wr(e());if(Array.isArray(e)){for(var t=[],r=0;rr=qt((()=>(Dt.context=w(w({},Dt.context),{},{[e]:t.value}),ar((()=>t.children)))))),void 0),r}}var Ar=Symbol("fallback");function Cr(e){for(var t=0;te(t||{})))}function _r(){return!0}var kr={get:(e,t,r)=>t===Rt?r:e.get(t),has:(e,t)=>t===Rt||e.has(t),set:_r,deleteProperty:_r,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:_r,deleteProperty:_r}),ownKeys:e=>e.keys()};function Ir(e){return(e="function"==typeof e?e():e)?e:{}}function Br(){for(var e=0,t=this.length;e=0;r--){var n=Ir(e[r])[t];if(void 0!==n)return n}},has(t){for(var r=e.length-1;r>=0;r--)if(t in Ir(e[r]))return!0;return!1},keys(){for(var t=[],r=0;r=0;s--){var a=e[s];if(a)for(var l=Object.getOwnPropertyNames(a),d=function(){var e=l[h];if("__proto__"===e||"constructor"===e)return 1;var t=Object.getOwnPropertyDescriptor(a,e);if(i[e]){var r=o[e];r&&(t.get?r.push(t.get.bind(a)):void 0!==t.value&&r.push((()=>t.value)))}else i[e]=t.get?{enumerable:!0,configurable:!0,get:Br.bind(o[e]=[t.get.bind(a)])}:void 0!==t.value?t:void 0},h=l.length-1;h>=0;h--)d()}for(var u={},c=Object.keys(i),f=c.length-1;f>=0;f--){var p=c[f],v=i[p];v&&v.get?Object.defineProperty(u,p,v):u[p]=v?v.value:void 0}return u}var Er=e=>`Stale read from <${e}>.`;function Nr(e){var t="fallback"in e&&{fallback:()=>e.fallback};return Gt(function(e,t,r={}){var n=[],o=[],i=[],s=0,a=t.length>1?[]:null;return tr((()=>Cr(i))),()=>{var l,d,h=e()||[];return h[Et],qt((()=>{var e,t,c,f,p,v,g,m,x,y=h.length;if(0===y)0!==s&&(Cr(i),i=[],n=[],o=[],s=0,a&&(a=[])),r.fallback&&(n=[Ar],o[0]=Ht((e=>(i[0]=e,r.fallback()))),s=1);else if(0===s){for(o=new Array(y),d=0;d=v&&m>=v&&n[g]===h[m];g--,m--)c[m]=o[g],f[m]=i[g],a&&(p[m]=a[g]);for(e=new Map,t=new Array(m+1),d=m;d>=v;d--)x=h[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],a&&(p[d]=a[l]),d=t[d],e.set(x,d)):i[l]();for(d=v;de.each),e.children,t||void 0))}function Fr(e){var t=e.keyed,r=Gt((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return Gt((()=>{var n=r();if(n){var o=e.children;return"function"==typeof o&&o.length>0?qt((()=>o(t?n:()=>{if(!qt(r))throw Er("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}var Lr,zr;function Mr(e={},t="app"){var r=new kt;return Lr=new st(e,t,r),zr=Lr.createShader.bind(Lr),Lr}class Pr extends Array{constructor(e){super(),S(this,"_parent",void 0),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 Dr={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Or(e,t,...r){false}function Ur(e){return"function"==typeof e}function Wr(e){return Array.isArray(e)}function Yr(e,t={}){if(Wr(e))e.forEach((e=>{Yr(e,t)}));else if(e)for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t}class jr extends Array{constructor(e,t={}){return Wr(t)?(super(...t),S(this,"onChange",void 0)):"string"==typeof t?(super(t),S(this,"onChange",void 0)):(super(...Object.entries(t).filter((([e,t])=>t)).map((([e])=>e))),S(this,"onChange",void 0)),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 Hr=g(Qt(void 0),2),Qr=Hr[0],Kr=Hr[1],$r=Dr.animationSettings;function Xr(e){for(var t=[],r=0,n=Object.entries(e);rKr(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 Wr(e)?this._style=Yr(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=A(this.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.id===e)return n;if(n instanceof Vr){var o=n.searchChildrenById(e);if(o)return o}}}catch(i){r.e(i)}finally{r.f()}}set states(e){this._states=new jr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new jr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||$r}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){if(this.hasChildren){var r;if(Or(),Ur(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),"flex"===this.display)if(function(e){for(var t=[],r=0;re+(t[s]||0)),0));var x=f&&g?e=>{"flexStart"===g?e[u]=0:"center"===g?e[u]=(f-(e[a]||0))/2:"flexEnd"===g&&(e[u]=f-(e[a]||0))}:e=>e;if("flexStart"===v){var y=0;if(t.forEach((e=>{e[h]=y+(e[l]||0),y+=(e[s]||0)+p+(e[l]||0)+(e[d]||0),x(e)})),e._autosized){var b=y-p;if(b!==e[s])return e[s]=b,!0}}else if("flexEnd"===v)for(var w=c,S=o-1;S>=0;S--){var A=t[S];C(A),A[h]=w-(A[s]||0)-(A[d]||0),w-=(A[s]||0)+p+(A[l]||0)+(A[d]||0),x(A)}else if("center"===v){var T=(c-(m+p*(o-1)))/2;t.forEach((e=>{e[h]=T,T+=(e[s]||0)+p,x(e)}))}else if("spaceBetween"===v){var _=(c-m)/(o-1),k=0;t.forEach((e=>{e[h]=k,k+=(e[s]||0)+_,x(e)}))}else if("spaceEvenly"===v){var I=(c-m)/(o+1),B=I;t.forEach((e=>{e[h]=B,B+=(e[s]||0)+I,x(e)}))}return!1}(this))null===(r=this.parent)||void 0===r||r.updateLayout();Ur(this.onLayout)&&this.onLayout.call(this,e,t)}}_stateChanged(){if(Or(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=A(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=w(w({},e),r)),e}),{});this._undoStyles=Object.keys(n),void 0!==n.transition&&(this.transition=n.transition),Object.assign(this,w(w({},r),n))}}render(){var e=this,t=this.parent;if(t)if(t.rendered)if(this.rendered)console.warn("Node already rendered: ",this);else{t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();var r=e._renderProps;t.lng&&(r.parent=t.lng),e._effects&&(this.shader=Xr(e._effects)),e.isTextNode()?((r=w(w(w({},Dr.fontSettings),r),{},{text:e.getText()})).contain&&(r.width||(r.width=(t.width||0)-(r.x||0)-(r.marginRight||0),e._width=r.width,e._autosized=!0),"both"!==r.contain||r.height||r.maxLines||(r.height=(t.height||0)-(r.y||0)-(r.marginBottom||0),e._height=r.height,e._autosized=!0)),Or(0,0),e.lng=Lr.createTextNode(r),Ur(e.onLoad)&&e.lng.on("loaded",e.onLoad),e.width&&e.height||(e._autosized=!0,e._resizeOnTextLoad())):(r.texture||(isNaN(r.width)&&(r.width=(t.width||0)-(r.x||0),e._width=r.width,e._autosized=!0),isNaN(r.height)&&(r.height=(t.height||0)-(r.y||0),e._height=r.height,e._autosized=!0),r.color||r.src||(e._color=r.color=0)),Or(0,0),e.lng=Lr.createNode(r),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,Ur(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),delete this._renderProps,"text"!==e.name&&e.children.forEach((e=>{e.render?e.render():""!==e.text&&console.warn("TextNode outside of : ",e)})),e.autofocus&&e.setFocus()}else console.warn("Parent not rendered yet: ",this);else console.warn("Parent not set - no node created for: ",this)}}for(var Zr=function(){var e=Jr[qr];Object.defineProperty(Vr.prototype,e,{get(){var t;return null!==(t=this.lng&&this.lng[e])&&void 0!==t?t:this[`_${e}`]},set(t){this[`_${e}`]=t,this._sendToLightningAnimatable(e,t)}})},qr=0,Jr=["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"];qr{return t=cn("text"),pn(t,e,!1),t;var t},on=e=>{return t=cn("node"),pn(t,e,!1),t;var t};function sn({createElement:e,createTextNode:t,isTextNode:r,replaceText:n,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:l,getNextSibling:d}){function h(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return u(e,t,n,r);$t((n=>u(e,t(),n,r)),n)}function u(e,i,s,a,d){for(;"function"==typeof s;)s=s();if(i===s)return s;var h=typeof i,m=void 0!==a;if("string"===h||"number"===h)if("number"===h&&(i=i.toString()),m){var x=s[0];x&&r(x)?n(x,i):x=t(i),s=p(e,s,a,x)}else""!==s&&"string"==typeof s?n(l(e),s=i):(p(e,s,a,t(i)),s=i);else if(null==i||"boolean"===h)s=p(e,s,a);else{if("function"===h)return $t((()=>{for(var t=i();"function"==typeof t;)t=t();s=u(e,t,s,a)})),()=>s;if(Array.isArray(i)){var y=[];if(c(y,i,d))return $t((()=>s=u(e,y,s,a,!0))),()=>s;if(0===y.length){var b=p(e,s,a);if(m)return s=b}else Array.isArray(s)?0===s.length?v(e,y,a):f(e,s,y):null==s||""===s?v(e,y):f(e,m&&s||[l(e)],y);s=y}else{if(Array.isArray(s)){if(m)return s=p(e,s,a,i);p(e,s,null,i)}else null!=s&&""!==s&&l(e)?g(e,i,l(e)):o(e,i);s=i}}return s}function c(e,r,n){for(var o=!1,i=0,s=r.length;im-h)for(var w=t[l];h=0;c--){var f=r[c];if(h!==f){var p=a(f)===e;u||c?p&&i(e,f):p?g(e,h,f):o(e,h,n)}else u=!0}else o(e,h,n);return[h]}function v(e,t,r){for(var n=0,i=t.length;nr.children=u(e,t.children,r.children))),$t((()=>t.ref&&t.ref(e))),$t((()=>{for(var n in t)if("children"!==n&&"ref"!==n){var o=t[n];o!==r[n]&&(s(e,n,o,r[n]),r[n]=o)}})),r}return{render(e,t){var r;return Ht((n=>{r=n,h(t,e())})),r},insert:h,spread(e,t,r){"function"==typeof t?$t((n=>m(e,t(),n,r))):m(e,t,void 0,r)},createElement:e,createTextNode:t,insertNode:o,setProp:(e,t,r,n)=>(s(e,t,r,n),r),mergeProps:Rr,effect:$t,memo:Gt,createComponent:Tr,use:(e,t,r)=>qt((()=>e(t,r)))}}var an={createElement:e=>new Vr(e),createTextNode:e=>({name:"TextNode",text:e,parent:void 0}),replaceText(e,t){Or(0,0),e.text=t;var r=e.parent;C(r),r.text=r.getText()},setProperty(e,t,r=!0){e[t]=r},insertNode(e,t,r){Or(0,0),e.children.insert(t,r),t._queueDelete=!1,t instanceof Vr?e.rendered&&t.render():e.isTextNode()&&(e.text=e.getText())},isTextNode:e=>e.isTextNode(),removeNode(e,t){Or(0,0),e.children.remove(t),t._queueDelete=!0,t instanceof Vr&&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 wn;function Sn(){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},s=A(e);try{var a=function(){var e=o.value;e.listener(w(w({},i),{},{from:e.location,retry:o=>{o&&(t=!0),e.navigate(r,w(w({},n),{},{resolve:!1}))}}))};for(s.s();!(o=s.n()).done;)a()}catch(l){s.e(l)}finally{s.f()}return!i.defaultPrevented}}}function An(){window.history.state&&null!=window.history.state._depth||window.history.replaceState(w(w({},window.history.state),{},{_depth:window.history.length-1}),""),wn=window.history.state._depth}An();var Cn=/^(?:[a-z0-9]+:)?\/\//i,Tn=/^\/+|(\/)\/+$/g,_n="http://sr";function kn(e,t=!1){var r=e.replace(Tn,"$1");return r?t||/^[?#]/.test(r)?r:"/"+r:""}function In(e,t,r){if(!Cn.test(t)){var n=kn(e),o=r&&kn(r),i="";return((i=!o||t.startsWith("/")?n:0!==o.toLowerCase().indexOf(n.toLowerCase())?n+o:o)||"/")+kn(t,!i)}}function Bn(e){var t={};return e.searchParams.forEach(((e,r)=>{t[r]=e})),t}function Rn(e,t,r){var n=g(e.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),a=s.length;return e=>{var n=e.split("/").filter(Boolean),o=n.length-a;if(o<0||o>0&&void 0===i&&!t)return null;for(var l={path:a?"":"/",params:{}},d=e=>void 0===r?void 0:r[e],h=0;h0===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 Nn(e){var t=new Map,r=rr();return new Proxy({},{get:(n,o)=>(t.has(o)||nr(r,(()=>t.set(o,Gt((()=>e()[o]))))),t.get(o)()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),ownKeys:()=>Reflect.ownKeys(e())})}function Fn(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 Fn(n).reduce(((e,t)=>[...e,...o.map((e=>e+t))]),[])}var Ln,zn=ir(),Mn=ir(),Pn=()=>function(e,t){if(null==e)throw new Error(t);return e}(sr(zn)," and 'use' router primitives can be only used inside a Route."),Dn=()=>Pn().navigatorFactory(),On=()=>Pn().params;function Un(e,t=""){var r=e.component,n=e.load,o=e.children,i=e.info,s=!o||Array.isArray(o)&&!o.length,a={key:e,component:r,load:n,info:i};return Yn(e.path).reduce(((r,n)=>{var o,i,l=A(Fn(n));try{for(l.s();!(o=l.n()).done;){var d=o.value,h=(i=d,kn(t).replace(/\/*(\*.*)?$/g,"")+kn(i)),u=s?h:h.split("/*",1)[0];u=u.split("/").map((e=>e.startsWith(":")||e.startsWith("*")?e:encodeURIComponent(e))).join("/"),r.push(w(w({},a),{},{originalPath:d,pattern:u,matcher:Rn(u,!s,e.matchFilters)}))}}catch(c){l.e(c)}finally{l.f()}return r}),[])}function Wn(e,t=0){return{routes:e,score:1e4*(r=e[e.length-1],n=g(r.pattern.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),s.reduce(((e,t)=>e+(t.startsWith(":")?2:3)),s.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(w(w({},i),{},{route:o}))}return r}};var r,n,o,i,s}function Yn(e){return Array.isArray(e)?e:[e]}function jn(e,t="",r=[],n=[]){for(var o=Yn(e),i=0,s=o.length;it.score-e.score))}function Hn(e,t){for(var r=0,n=e.length;re),h=l.renderPath||(e=>e),u=l.beforeLeave||Sn(),c=In("",n.base||"");if(void 0===c)throw new Error(`${c} is not a valid base path`);c&&!i().value&&s({value:c,replace:!0,scroll:!1});var f=g(Qt(!1),2),p=f[0],v=f[1],x=function(){var e=y(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,or(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)}}(),b=g(Qt(i().value),2),S=b[0],A=b[1],C=g(Qt(i().state),2),T=C[0],_=C[1],k=function(e,t){var r=new URL(_n),n=Gt((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=Gt((()=>n().pathname)),i=Gt((()=>n().search),!0),s=Gt((()=>n().hash));return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return t()},get key(){return""},query:Nn(Jt(i,(()=>Bn(n()))))}}(S,T),I=[],B=Qt([]),R=Gt((()=>Hn(t(),k.pathname))),E=Nn((()=>{for(var e=R(),t={},r=0;rc,outlet:()=>null,resolvePath:e=>In(c,e)};return $t((()=>{var e=i(),t=e.value,r=e.state;qt((()=>{t!==S()&&x((()=>{Ln="native",A(t),_(r),B[1]([])})).then((()=>{Ln=void 0}))}))})),{base:N,location:k,params:E,isRouting:p,renderPath:h,parsePath:d,navigatorFactory:function(e){return e=e||sr(Mn)||N,(t,r)=>function(e,t,r){qt((()=>{if("number"!=typeof t){var n=w({replace:!1,resolve:!0,scroll:!0},r),o=n.replace,i=n.resolve,a=n.scroll,d=n.state,h=i?e.resolvePath(t):In("",t);if(void 0===h)throw new Error(`Path '${t}' is not a routable path`);if(I.length>=100)throw new Error("Too many redirects");var c=S();if((h!==c||d!==T())&&u.confirm(h,r)){var f=I.push({value:c,replace:o,scroll:a,state:T()});x((()=>{Ln="navigate",A(h),_(d),B[1]([])})).then((()=>{var e,t;I.length===f&&(Ln=void 0,e={value:h,state:d},(t=I[0])&&(e.value===t.value&&e.state===t.state||s(w(w({},e),{},{replace:t.replace,scroll:t.scroll})),I.length=0))}))}}else t&&(l.go?l.go(t):console.warn("Router integration does not support relative routing"))}))}(e,t,r)},matches:R,beforeLeave:u,preloadRoute:function(e,n){var o=Hn(t(),e.pathname),i=Ln;Ln="preload";var s=function(){var t=o[a],i=t.route,s=t.params;i.component&&i.component.preload&&i.component.preload();var l=i.load;n&&l&&nr(r(),(()=>l({params:s,location:{pathname:e.pathname,search:e.search,hash:e.hash,query:Bn(e),state:null,key:""},intent:"preload"})))};for(var a in o)s();Ln=i},singleFlight:void 0===n.singleFlight||n.singleFlight,submissions:B}}var Kn=e=>t=>{var r,n=t.base,o=ar((()=>t.children)),i=Gt((()=>jn(o(),t.base||""))),s=Qn(e,i,(()=>r),{base:n,singleFlight:t.singleFlight});return e.create&&e.create(s),un(zn.Provider,{value:s,get children(){return un($n,{routerState:s,get root(){return t.root},get load(){return t.rootLoad},get children(){return[hn((()=>(r=rr())&&null)),un(Xn,{routerState:s,get branches(){return i()}})]}})}})};function $n(e){var t=e.routerState.location,r=e.routerState.params,n=Gt((()=>e.load&&qt((()=>e.load({params:r,location:t,intent:"preload"})))));return un(Fr,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>un(o,{params:r,location:t,get data(){return n()},get children(){return e.children}})})}function Xn(e){var t,r=[],n=Gt(Jt(e.routerState.matches,((o,i,s)=>{for(var a=i&&o.length===i.length,l=[],d=function(t){var d=i&&i[t],h=o[t];s&&d&&h.route.key===d.route.key?l[t]=s[t]:(a=!1,r[t]&&r[t](),Ht((o=>{r[t]=o,l[t]=function(e,t,r,n){var o=e.base,i=e.location,s=e.params,a=n().route,l=a.pattern,d=a.component,h=a.load,u=Gt((()=>n().path));d&&d.preload&&d.preload();var c=h?h({params:s,location:i,intent:Ln||"initial"}):void 0;return{parent:t,pattern:l,path:u,outlet:()=>d?Tr(d,{params:s,location:i,data:c,get children(){return r()}}):r(),resolvePath:e=>In(o.path(),e,u())}}(e.routerState,l[t-1]||e.routerState.base,Gn((()=>n()[t+1])),(()=>e.routerState.matches()[t]))})))},h=0,u=o.length;he())),s&&a?s:(t=l[0],l)})));return Gn((()=>n()&&t))()}var Gn=e=>()=>un(Fr,{get when(){return e()},keyed:!0,children:e=>un(Mn.Provider,{value:e,get children(){return e.outlet()}})}),Vn=e=>{var t=ar((()=>e.children));return Rr(e,{get children(){return t()}})};function Zn(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 qn=new Map;function Jn(e=!0,t=!1,r="/_server"){return n=>{var o=n.base.path(),i=n.navigatorFactory(n.base),s={};function a(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 s=(r.getAttribute("rel")||"").split(/\s+/);if(!(r.hasAttribute("download")||s&&s.includes("external"))){var a=n?new URL(i,document.baseURI):new URL(i);if(!(a.origin!==window.location.origin||o&&a.pathname&&!a.pathname.toLowerCase().startsWith(o.toLowerCase())))return[r,a]}}}}}function l(e){var t=a(e);if(t){var r=g(t,2),o=r[0],s=r[1],l=n.parsePath(s.pathname+s.search+s.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=a(e);if(t){var r=g(t,2),o=r[0],i=r[1];s[i.pathname]||n.preloadRoute(i,"false"!==o.getAttribute("preload"))}}function h(e){var t=a(e);if(t){var r=g(t,2),o=r[0],i=r[1];s[i.pathname]||(s[i.pathname]=setTimeout((()=>{n.preloadRoute(i,"false"!==o.getAttribute("preload")),delete s[i.pathname]}),200))}}function u(e){var t=a(e);if(t){var r=g(t,2)[1];s[r.pathname]&&(clearTimeout(s[r.pathname]),delete s[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,_n);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=qn.get(t);if(i){e.preventDefault();var s=new FormData(e.target);e.submitter&&e.submitter.name&&s.append(e.submitter.name,e.submitter.value),i.call({r:n,f:e.target},s)}}}!function(e,t=window.document){for(var r=t[yn]||(t[yn]=new Set),n=0,o=e.length;n{document.removeEventListener("click",l),e&&(document.removeEventListener("mouseover",h),document.removeEventListener("mouseout",u),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",c)}))}}function eo(e){var t=e.replace(/^.*?#/,"");if(!t.startsWith("/")){var r=g(window.location.hash.split("#",2),2)[1];return`${void 0===r?"/":r}#${t}`}return t}function to(e){var t=()=>window.location.hash.slice(1),r=Sn();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]}(Qt(r(e.get()),{equals:(e,t)=>e.value===t.value}),void 0,(r=>(!t&&e.set(r),r)));return e.init&&tr(e.init(((o=e.get())=>{t=!0,n[1](r(o)),t=!1}))),Kn({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 w(w({},e),{},{_depth:window.history.state&&window.history.state._depth})}(n),"","#"+e):window.location.hash=e;var o=e.indexOf("#");Zn(o>=0?e.slice(o+1):"",r),An()},init:e=>{return n=window,o="hashchange",i=function(e,t){var r=!1;return()=>{var n=wn;An();var o=null==n?null:wn-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:Jn(e.preload,e.explicitLinks,e.actionBase),utils:{go:e=>window.history.go(e),renderPath:e=>`#${e}`,parsePath:eo,beforeLeave:r}})(e)}var ro=tr;function no(e,t=rr()){var r,n,o=0;return()=>(o++,tr((()=>{o--,queueMicrotask((()=>{!o&&n&&(n(),n=r=void 0)}))})),n||Ht((t=>r=e(n=t)),t),r)}var oo=no((()=>{var e,t,r,n,o=g(Qt(null),2),i=o[0],s=o[1];return e=window,t="keydown",r=e=>{s(e),setTimeout((()=>s(null)))},e.addEventListener(t,r,n),ro(e.removeEventListener.bind(e,t,r,n)),i}));function io(e){return"function"==typeof e}var so,ao={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},lo=g(Qt([]),2),ho=lo[0],uo=lo[1],co=e=>{var t=oo();if(e)for(var r=function(){var e,t=g(o[n],2),r=t[0],i=t[1];e=i,Array.isArray(e)?i.forEach((e=>{ao[e]=r})):ao[i]=r},n=0,o=Object.entries(e);n{for(var n=e,o=[];n;)n.states.has("focus")||(n.states.add("focus"),io(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"),io(r.onBlur)&&r.onBlur.call(r,e,t))})),uo(o),o}),{defer:!0})),Xt((()=>{var e=t();if(e){var r=ao[e.key]||ao[e.keyCode];qt((()=>{var t,n=void 0,o=A(ho());try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n=n||i,r){var s=i[`on${r}`];if(io(s)&&!0===s.call(i,e,i,n))break}else console.log(`Unhandled key event: ${e.key}`);if(io(i.onKeyPress)&&!0===i.onKeyPress.call(i,e,r,i,n))break}}catch(a){o.e(a)}finally{o.f()}return!1}))}})),ho};function fo(e,t){var r,n,o,i,s=t();if(Array.isArray(s))if(2===s.length)r=i=s[0],n=o=s[1];else if(3===s.length)r=s[0],n=o=s[1],i=s[2];else{var a=g(s,4);r=a[0],o=a[1],i=a[2],n=a[3]}else r=o=i=n=s;e.onBeforeLayout=(t,s)=>{if(s){e.width=e.children.reduce(((e,t)=>e+(t.width||0)),0)+n+o;var a=e.children[0];a&&(a.x=n,a.marginLeft=n);var l=0;e.children.forEach((e=>{e.y=r,e.marginTop=r,l=Math.max(l,e.height||0)})),e.height=l+r+i}}}function po(e){return new Promise((t=>{setTimeout(t,e)}))}function vo(e,t,r="en-US"){var n=window.speechSynthesis;return new Promise(((o,i)=>{var s=new SpeechSynthesisUtterance(e);s.lang=r,s.onend=()=>{o()},s.onerror=e=>{i(e)},t.push(s),n.speak(s)}))}function go(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,vo(r,s,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,po(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 h=go(r(),t,!1),i.push(h),e.next=53,h.series;case 53:e.next=60;break;case 55:if(!Array.isArray(r)){e.next=60;break}return u=go(r,t,!1),i.push(u),e.next=60,u.series;case 60:e.next=1;break;case 62:return e.prev=62,a=!1,e.finish(62);case 65:case"end":return e.stop()}}),e,null,[[0,,62,65],[20,26]])})))(),get active(){return a},append:e=>{o.push(e)},cancel:()=>{a&&(r&&n.cancel(),i.forEach((e=>{e.cancel()})),a=!1)}}}function mo(e,t="en-US"){return so&&so.cancel(),so=go(e,t)}var xo,yo,bo=(e,t)=>{var r,n=()=>clearTimeout(r);rr()&&tr(n);return Object.assign(((...o)=>{void 0!==r&&n(),r=setTimeout((()=>e(...o)),t)}),{clear:n})},wo=[],So=!1;function Ao(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 Co(e){return e.id||e.name}function To(e=[]){if(_o.onFocusChange&&_o.enabled){var t=e.every((e=>!e.loading)),r=e.filter((e=>!wo.includes(e)));if(xo(),t||!_o.onFocusChange){wo=e.slice(0);var n=[],o=r.reduce(((e,t)=>(t.announce?(e.push([Co(t),"Announce",t.announce]),n.push(t.announce)):t.title?(e.push([Co(t),"Title",t.title]),n.push(t.title)):e.push([Co(t),"No Announce",""]),e)),[]);return r.reverse().reduce(((e,t)=>(t.announceContext?(e.push([Co(t),"Context",t.announceContext]),n.push(t.announceContext)):e.push([Co(t),"No Context",""]),e)),o),_o.debug&&console.table(o),n.length?_o.speak(n.reduce(((e,t)=>e.concat(t)),[])):void 0}_o.onFocusChange([])}}var _o={debug:!1,enabled:!0,cancel:function(){yo&&yo.cancel()},clearPrevFocus:function(e=0){wo=wo.slice(0,e),xo()},speak:function(e,{append:t=!1,notification:r=!1}={}){var n;_o.onFocusChange&&_o.enabled&&(_o.onFocusChange.flush(),t&&yo&&yo.active?yo.append(e):(_o.cancel(),function(e){if(!So)yo=mo(e)}(e)),r&&(So=!0,null===(n=yo)||void 0===n||n.series.finally((()=>{So=!1,_o.refresh()})).catch(console.error)));return yo},refresh:function(e=0){_o.clearPrevFocus(e),_o.onFocusChange&&_o.onFocusChange(qt((()=>ho())))},setupTimers:function({focusDebounce:e=400,focusChangeTimeout:t=3e5}={}){_o.onFocusChange=Ao(To,e),xo=Ao((()=>{wo=[]}),t)}};var ko,Io,Bo,Ro,Eo,No,Fo,Lo,zo,Mo,Po,Do,Oo,Uo,Wo,Yo,jo=g(Qt(""),2),Ho=jo[0],Qo=jo[1],Ko={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,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADg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A8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},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+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMh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easing:"ease-in-out"},i={alpha:1,color:4294967295};var s=bo((function(i){return i.startsWith("#")?(e.color=xn(i),e.src="",e.alpha=1,n=1,t.alpha=0,void(r.alpha=0)):(e.color=4294967295,r.alpha=1,0===n?(e.src=i,void(n=1)):1===n?(t.src=i,n=2,t.alpha=0,t.animate({alpha:1},o).start(),void e.animate({alpha:0},o).start()):void(2===n&&(e.src=i,n=1,e.alpha=0,e.animate({alpha:1},o).start(),t.animate({alpha:0},o).start())))}),400);return Xt(Jt(Ho,(e=>{s(e)}),{defer:!0})),un(on,{width:1920,height:1080,zIndex:-5,get children(){return[un(on,{ref(t){"function"==typeof e?e(t):e=t},style:i}),un(on,{ref(e){"function"==typeof t?t(e):t=e},style:i,alpha:0}),un(on,{ref(e){"function"==typeof r?r(e):r=e},src:"./assets/hero-mask-inverted.png",get color(){return xn(Ko.color.materialBrand)},width:1920,height:1080})]}})}var Xo=["focus","disabled"],Go=["brand","inverse","neutral"];function Vo({themeKeys:e,base:t,modes:r,tones:n,themeStyles:o,modeKeys:i=Xo,toneKeys:s=Go},a=!1){var l=t=>Object.fromEntries(Object.entries(e).filter((([e,r])=>t[r])).map((([e,r])=>[e,t[r]])));return((e,t,r)=>{var n,d=(n=o,Object.fromEntries(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]}))));a&&console.log(d);var h=((e,t)=>w(w({},e),t.base))(e,d);a&&console.log(h);var u=((e,t)=>{var r=i.map((r=>[r,w(w({},null==e?void 0:e[r]),null==t?void 0:t[r])]));return Object.fromEntries(r)})(t,d);a&&console.log(u);var c=((e,t,r)=>{var n=s.map((n=>{var o,s,a={};return new Set([].concat.apply([],[null!==(o=null==e?void 0:e[n])&&void 0!==o?o:{},null!==(s=null==t?void 0:t[n])&&void 0!==s?s:{}].map(Object.keys))).forEach((r=>{var o,s,l;i.includes(r)||(a[r]=null!==(l=null==(o=null==t?void 0:t[n])?void 0:o[r])&&void 0!==l?l:null==(s=null==e?void 0:e[n])?void 0:s[r])})),i.forEach((o=>{var i,s;a[o]=w(w(w({},r[o]),null==(i=null==e?void 0:e[n])?void 0:i[o]),null==(s=null==t?void 0:t[n])?void 0:s[o])})),[n,a]}));return Object.fromEntries(n)})(r,d,u);return a&&console.log(c),{base:w(w({},h),u),tones:c}})(t,r,n)}function Zo(e=0){return(t,r,n,o)=>{if(0!==t.children.length){var i=t.gap||0,s=t.scroll||"auto",a=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),l=g(a,2),d=l[0],h=l[1],u="row"===t.flexDirection?t.x:t.y,c="row"===t.flexDirection?r.x:r.y,f="row"===t.flexDirection?r.width:r.height,p=n>o?"positive":"negative",v=u;"auto"===s?null!=t.scrollIndex&&t.scrollIndex>=0?t.selected>=t.scrollIndex&&(v="positive"===p?u-f-i:u+f+i):(Math.abs(u)+hc?v=-c+e:"edge"===s&&"positive"===p&&Math.abs(u)+h{var t=e.filter((e=>"function"==typeof e));if(0!==t.length)return function(...e){var r,n=A(t);try{for(n.s();!(r=n.n()).done;){if(!0===r.value.apply(this,e))return!0}}catch(o){n.e(o)}finally{n.f()}}};function Jo(){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];if(!(e instanceof Vr))return!1;e.setFocus()}function ei(e){return function(){var t,r,n=this.children.length,o=this.wrap,i=this.selected||0;if(0===n)return!1;if("right"===e||"down"===e){do{if(this.selected=(this.selected||0)%n+1,this.selected>=n){if(!o){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)%n-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=n-1}}while(null==(r=this.children[this.selected])?void 0:r.skipFocus);if(void 0===this.selected&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;var s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&void 0!==i){var a=this.children[i].selected||0;s.selected=a{var t=ei("up"),r=ei("down");return un(on,gn(e,{get onUp(){return qo(e.onUp,t)},get onDown(){return qo(e.onDown,r)},get selected(){return e.selected||0},forwardFocus:Jo,get onSelectedChanged(){return qo(e.onSelectedChanged,"none"!==e.scroll?Zo(e.y):void 0)},get style(){var t;return[...[e.style].flat(),Ri.Container.tones[null!==(t=e.tone)&&void 0!==t?t:Ri.tone],Ri.Container.base]}}))},Ni=(null==(Fo=Ko)?void 0:Fo.componentConfig).Label,Fi=void 0===Ni?{styles:{}}:Ni,Li=(Fi.defaultTone,v(Fi,s)),zi={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:Ko.color.textNeutral,padding:[Ko.spacer.md,Ko.spacer.lg],borderRadius:[Ko.radius.md,Ko.radius.md,Ko.radius.md,Ko.radius.none],height:Ko.typography.caption1.lineHeight+Ko.spacer.md,neutral:{backgroundColor:Ko.color.fillNeutral}},tones:{inverse:{color:Ko.color.fillInverse},brand:{color:Ko.color.fillBrand,focus:{color:Ko.color.orange}}},themeStyles:Li},Mi={themeKeys:{color:"textColor"},base:w(w({},Ko.typography.caption1),{},{color:Ko.color.textInverse}),tones:{inverse:{color:Ko.color.textNeutral},brand:{color:Ko.color.textNeutral}},themeStyles:Li};Vo(zi),Vo(Mi);var Pi=(null==(Lo=Ko)?void 0:Lo.componentConfig).Rating,Di=void 0===Pi?{styles:{},defaultTone:"neutral"}:Pi,Oi=Di.styles,Ui=(Di.defaultTone,{themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:Ko.spacer.sm},toneModes:{},themeStyles:Oi}),Wi={themeKeys:{color:"textColor"},base:w({color:Ko.color.textNeutral},Ko.typography.body2),toneModes:{},themeStyles:Oi},Yi={themeKeys:{color:"color"},base:{height:Ko.typography.body2.lineHeight,width:Ko.typography.body2.lineHeight,color:Ko.color.fillNeutral,marginRight:Ko.spacer.sm},toneModes:{},themeStyles:Oi};Vo(Ui),Vo(Yi),Vo(Wi);var ji=(null==(zo=Ko)?void 0:zo.componentConfig).Details,Hi=void 0===ji?{styles:{}}:ji,Qi=(Hi.defaultTone,v(Hi,a)),Ki={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:Ko.spacer.lg,badgeContentSpacing:Ko.spacer.sm,ratingContentSpacing:Ko.spacer.lg},themeStyles:Qi},$i={themeKeys:{color:"textColor"},base:w(w({},Ko.typography.body2),{},{marginRight:Ko.spacer.lg,color:Ko.color.textNeutral}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverse,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutral,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Qi};Vo(Ki),Vo($i);var Xi=(null==(Mo=Ko)?void 0:Mo.componentConfig).Metadata,Gi=void 0===Xi?{styles:{}}:Xi,Vi=(Gi.defaultTone,v(Gi,l)),Zi={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:Ko.alpha.primary},modes:{disabled:{alpha:Ko.alpha.inactive}},themeStyles:Vi},qi={themeKeys:{color:"textColor"},base:w(w({maxLines:1,contain:"width"},Ko.typography.headline3),{},{color:Ko.color.textNeutral}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverse,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutral,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Vi},Ji={themeKeys:{color:"textColor"},base:w(w({contain:"width",maxLines:2},Ko.typography.body2),{},{color:Ko.color.textNeutralSecondary}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverseSecondary,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutralSecondary,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Vi};Vo(Zi),Vo(Ji),Vo(qi);var es=(null==(Po=Ko)?void 0:Po.componentConfig).ProgressBar,ts=void 0===es?{styles:{}}:es,rs=(ts.defaultTone,v(ts,d)),ns={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:Ko.spacer.md,color:Ko.color.fillNeutralTertiary,borderRadius:Ko.radius.xs},tones:{inverse:{color:Ko.color.fillInverseTertiary}},themeStyles:rs},os={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:Ko.radius.xs,color:Ko.color.fillNeutral},tones:{inverse:{color:Ko.color.fillInverse},brand:{color:Ko.color.fillBrand}},themeStyles:rs};Vo(ns),Vo(os);var is=(null==(Do=Ko)?void 0:Do.componentConfig).Row,ss=void 0===is?{styles:{}}:is,as=ss.defaultTone,ls=v(ss,h),ds={tone:as,Container:Vo({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:Ko.layout.gutterX,width:Ko.layout.screenW,itemTransition:w(w({},Ko.animation.standardEntrance),{},{duration:Ko.animation.duration.fast})},themeStyles:ls})},hs=e=>{var t=ei("left"),r=ei("right");return un(on,gn(e,{get selected(){return e.selected||0},get onLeft(){return qo(e.onLeft,t)},get onRight(){return qo(e.onRight,r)},forwardFocus:Jo,get onSelectedChanged(){return qo(e.onSelectedChanged,"none"!==e.scroll?Zo(e.x):void 0)},get tone(){var t;return null!==(t=e.tone)&&void 0!==t?t:ds.tone},get style(){return[...[e.style].flat(),ds.Container.tones[e.tone||ds.tone],ds.Container.base]},get states(){var t;return null!==(t=e.tone)&&void 0!==t?t:ds.tone}}))},us=(null==(Oo=Ko)?void 0:Oo.componentConfig).Keyboard,cs=void 0===us?{styles:{}}:us,fs=(cs.defaultTone,v(cs,u)),ps={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:Ko.spacer.md,screenW:Ko.layout.screenW,marginX:Ko.layout.marginX,height:100},themeStyles:fs},vs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Ko.spacer.md,height:9*Ko.spacer.md,paddingX:Ko.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:Ko.color.fillNeutral,padding:[Ko.spacer.xxxl,Ko.spacer.xl],baseWidth:7*Ko.spacer.md,color:Ko.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Ko.radius.sm},modes:{focus:{color:Ko.color.interactiveNeutralFocus,contentColor:Ko.color.fillInverse},disabled:{color:Ko.color.fillNeutralDisabled,contentColor:Ko.color.fillNeutralDisabled}},tones:{inverse:{color:Ko.color.interactiveInverse,focus:{color:Ko.color.interactiveInverseFocus,contentColor:Ko.color.fillNeutral}},brand:{focus:{contentColor:Ko.color.fillNeutral}}},themeStyles:fs},gs={themeKeys:{color:"textColor"},base:w({textAlign:"left",color:Ko.color.textNeutral},Ko.typography.headline2),modes:{focus:{color:Ko.color.textInverse},disabled:{color:Ko.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Ko.color.textNeutral}}},themeStyles:fs};Vo(ps),Vo(vs),Vo(gs);var ms=(null==(Uo=Ko)?void 0:Uo.componentConfig).Key,xs=void 0===ms?{styles:{}}:ms,ys=(xs.defaultTone,v(xs,c)),bs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Ko.spacer.md,height:9*Ko.spacer.md,paddingX:Ko.spacer.md,contentColor:Ko.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[Ko.spacer.xxxl,Ko.spacer.xl],baseWidth:7*Ko.spacer.md,color:Ko.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Ko.radius.sm},modes:{focus:{color:Ko.color.interactiveNeutralFocus,contentColor:Ko.color.fillInverse},disabled:{color:Ko.color.fillNeutralDisabled,contentColor:Ko.color.fillNeutralDisabled}},tones:{inverse:{color:Ko.color.interactiveInverse,focus:{color:Ko.color.interactiveInverseFocus,contentColor:Ko.color.fillNeutral}},brand:{focus:{contentColor:Ko.color.fillNeutral}}},themeStyles:ys},ws={themeKeys:{color:"textColor"},base:w({textAlign:"left",color:Ko.color.textNeutral},Ko.typography.headline2),modes:{focus:{color:Ko.color.textInverse},disabled:{color:Ko.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Ko.color.textNeutral}}},themeStyles:ys};Vo(bs),Vo(ws);var Ss=(null==(Wo=Ko)?void 0:Wo.componentConfig).Tile,As=void 0===Ss?{styles:{}}:Ss,Cs=(As.defaultTone,v(As,f)),Ts=(null==(Yo=Ko)?void 0:Yo.componentConfig).Surface,_s=void 0===Ts?{styles:{}}:Ts,ks=(_s.defaultSurfaceTone,v(_s,p)),Is={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:Ko.spacer.xl,paddingYBetweenContent:Ko.spacer.md,borderRadius:Ko.radius.md,alpha:Ko.alpha.primary},modes:{disabled:{alpha:Ko.alpha.inactive}},themeStyles:w(w({},ks),Cs)},Bs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Cs},Rs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Cs},Es={themeKeys:{},base:{width:5*Ko.spacer.lg,height:Ko.spacer.xxl+Ko.spacer.md},themeStyles:Cs};Vo(Is),Vo(Bs),Vo(Rs),Vo(Es);var 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:Ko.layout.marginX}},Gradient:{zIndex:99,color:xn("#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:xn("#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=Lr.createTexture("ImageTexture",{src:t}),r.reduce(((e,t)=>{var r=t.x,o=t.y,i=t.width,s=t.height;return e[t.name]=Lr.createTexture("SubTexture",{texture:n,x:r,y:o,width:i,height:s}),e}),{}));return un(on,gn(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 un(on,gn(e,{forwardStates:!0,get style(){return Ns.NavButton},get children(){return[un(on,{y:-16,get children(){return un(zs,{scale:.5,get name(){return e.icon}})}}),un(nn,{get style(){return w(w({},Ko.typography.button1),{},{fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}})},get children(){return e.children}})]}}))}function Ps(e){var t,r=Dn();return[un(Ei,gn(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[un(Ms,{onEnter:()=>r("/browse/all"),icon:"trending",children:"Trending"}),un(Ms,{icon:"movie",onEnter:()=>r("/browse/movie"),children:"Movies"}),un(Ms,{icon:"tv",onEnter:()=>r("/browse/tv"),children:"TV"}),un(Ms,{icon:"experiment",onEnter:()=>r("/examples"),children:"Examples"})]}})),un(on,{ref(e){"function"==typeof t?t(e):t=e},get style(){return Ns.Gradient}})]}var Ds={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},Os={x:10,fontSize:36,textColor:xn("#ffffff")},Us={fontSize:36,textColor:xn("#ffffff")},Ws=g(Qt(0),2),Ys=Ws[0],js=Ws[1],Hs=g(Qt(0),2),Qs=Hs[0],Ks=Hs[1],$s=g(Qt(99),2),Xs=$s[0],Gs=$s[1],Vs=g(Qt(0),2),Zs=Vs[0],qs=Vs[1],Js=0,ea=0,ta=bo((()=>{ea=0,Js=0,Gs(99)}),1e4);function ra(e){e.renderer.on("fpsUpdate",((e,t)=>{var r="number"==typeof t?t:t.fps;r>5&&(e=>{e&&(js(e),Gs((t=>Math.min(e,t))),qs((t=>Math.max(e,t))),ea+=e,Js++,Ks(Math.round(ea/Js)),ta())})(r)}))}var na=e=>un(on,gn(e,{style:Ds,get children(){return[un(on,{get children(){return[un(nn,{style:Os,children:"FPS:"}),un(nn,{style:Us,x:94,get children(){return Ys().toString()}})]}}),un(on,{x:160,get children(){return[un(nn,{style:Os,children:"AVG:"}),un(nn,{style:Us,x:104,get children(){return Qs().toString()}})]}}),un(on,{x:0,y:40,get children(){return[un(nn,{style:Os,children:"MIN:"}),un(nn,{style:Us,x:94,get children(){return Xs().toString()}})]}}),un(on,{x:160,y:40,get children(){return[un(nn,{style:Os,children:"MAX:"}),un(nn,{style:Us,x:104,get children(){return Zs().toString()}})]}})]}})),oa=e=>{co({Announcer:"a",Menu:"m",Escape:"Escape"});var t=(_o.setupTimers(),Xt(Jt(ho,_o.onFocusChange,{defer:!0})),_o);t.enabled=!1;var r,n,o=Dn();return er((()=>{ra({renderer:Lr})})),un(on,{onAnnouncer:()=>t.enabled=!t.enabled,onLast:()=>history.back(),onMenu:()=>o("/"),style:{width:1920,height:1080},onLeft:()=>{if(r.states.has("focus"))return!1;n=Qr(),r.setFocus()},onRight:()=>r.states.has("focus")&&n.setFocus(),get children(){return[un($o,{}),un(na,{}),hn((()=>e.children)),un(Ps,{ref(e){"function"==typeof r?r(e):r=e}})]}})},ia={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:Ko.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:xn("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:xn("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:xn("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:xn("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,width:Ko.layout.screenW-2*Ko.layout.marginX,x:Ko.layout.marginX+Ko.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:xn("#0000ff")},peopleBio:w(w({},Ko.typography.body1),{},{contain:"both",width:1500,height:400})},sa={width:120,height:40,color:xn("#000000"),borderRadius:8,border:{width:2,color:xn("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:xn("#333333")}},transition:{scale:!0,color:!0}},aa={container:sa,topBar:{color:xn("#00A699"),height:8,y:2,x:-4,width:sa.width+8},text:{fontSize:12,y:12,contain:"width",textAlign:"center",color:xn("#F6F6F9"),height:sa.height,width:sa.width}},la=386,da=136,ha=(xn("#715cab"),xn("#5a39a2"),xn("#291d43"),{fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:xn("#FFFFFF"),height:da,width:la,focus:{fontSize:40},disabled:{color:xn("#909090")}});function ua(e){return un(on,gn(e,{get style(){return ia.Thumbnail}}))}function ca(e){var t=function(e,...t){if(Rt 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))},kr)));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)))},kr)),n}var o,i={},s=t.map((()=>({}))),a=A(Object.getOwnPropertyNames(e));try{for(a.s();!(o=a.n()).done;){var l,d=o.value,h=Object.getOwnPropertyDescriptor(e,d),u=!h.get&&!h.set&&h.enumerable&&h.writable&&h.configurable,c=!1,f=0,p=A(t);try{for(p.s();!(l=p.n()).done;)l.value.includes(d)&&(c=!0,u?s[f][d]=h.value:Object.defineProperty(s[f],d,h)),++f}catch(v){p.e(v)}finally{p.f()}c||(u?i[d]=h.value:Object.defineProperty(i,d,h))}}catch(v){a.e(v)}finally{a.f()}return[...s,i]}(e,["items"]),r=g(t,2),n=r[0],o=r[1];return un(hs,gn(o,{get style(){return ia.Row},get children(){return un(Nr,{get each(){return n.items},children:e=>un(ua,e)})}}))}function fa(e){return un(on,gn(e,{forwardStates:!0,get style(){return aa.container},get children(){return un(nn,{get style(){return aa.text},get children(){return e.children}})}}))}var pa,va,ga="https://api.themoviedb.org/3",ma="w185",xa={headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA"}};function ya(e,t=ma){return va+t+e}function ba(e,t={}){return fetch(ga+e,w(w({},xa),t)).then((e=>e.json()))}function wa(){return ba("/configuration").then((e=>{var t;return pa=e,va=null===(t=e.images)||void 0===t?void 0:t.secure_base_url,e}))}var Sa={get:function(e,t={}){return pa?ba(e,t):wa().then((()=>ba(e,t)))},loadConfig:wa};function Aa(e=[]){return e.map((e=>{return{src:ya(e.poster_path||e.profile_path),tileSrc:ya(e.backdrop_path||e.profile_path,"w300"),backdrop:ya(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 Ca=new Map,Ta=new Map;function _a(e){var t=g(Qt([]),2),r=t[0],n=t[1],o=g(Qt(1),2),i=o[0],s=o[1],a=g(Qt(!1),2),l=a[0],d=a[1],h=g(Vt(i,e),1)[0];return Kt((()=>{var e=h();e&&fr((()=>{0===e.length&&d(!0),n((t=>[...t,...e]))}),!1)})),{pages:r,page:i,setPage:s,setPages:n,end:l,setEnd:d}}var ka=1100,Ia=w(w({},Ko.typography.display2),{},{width:ka,height:58,contain:"both"}),Ba=e=>un(nn,gn(e,{style:Ia,get children(){return e.children}})),Ra=w(w({},Ko.typography.body1),{},{width:ka,height:72,contain:"both"}),Ea={fontSize:20,lineHeight:20},Na=e=>un(nn,gn(e,{style:Ra,get children(){return e.children}}));var Fa=e=>{return t=cn("node"),mn(fo,t,(()=>[8,15,13,15])),pn(t,gn(e,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),fn(t,un(nn,{style:Ea,get children(){return e.children}})),t;var t},La=Ko.typography.body2,za=e=>un(on,{style:{display:"flex",flexDirection:"row",gap:12,width:ka,height:48},get children(){return[un(nn,{style:La,get children(){return e.metaText}}),un(Nr,{get each(){return e.badges},children:e=>un(Fa,{y:-5,children:e})}),hn((()=>{return t=e.reviews,[un(Fr,{get when(){return(null==t?void 0:t.rtCrit)&&"0"!==(null==t?void 0:t.rtCrit)},get children(){return[un(on,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),un(nn,{style:La,get children(){return t.rtCrit+"%"}})]}}),un(Fr,{get when(){return(null==t?void 0:t.rtFan)&&"0"!==(null==t?void 0:t.rtFan)},get children(){return[un(on,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),un(nn,{style:La,get children(){return t.rtFan+"%"}})]}})];var t}))]}}),Ma=e=>un(on,gn(e,{style:{display:"flex",flexDirection:"column",width:ka,height:160,gap:16},get children(){return[un(Ba,{get children(){return e.title}}),un(Na,{get children(){return e.description}}),un(za,{get metaText(){return e.metaText},get badges(){return e.badges},get reviews(){return e.reviews}})]}}));function Pa(e){return e.split("-")[0]}function Da({type:e,id:t}){return Sa.get(`/${e}/${t}/recommendations`).then((({results:t})=>t.length?Aa(t.slice(0,7)):Sa.get(`/trending/${e}/week?page=1`).then((({results:e})=>Aa(e.slice(0,7))))))}function Oa({type:e,id:t}){return Sa.get(`/${e}/${t}/credits`).then((({cast:e})=>Aa(e.slice(0,7))))}function Ua({type:e,id:t}){var r="movie"===e?{rtCrit:86,rtFan:92}:{};return Sa.get(`/${e}/${t}`).then((t=>{return w({backgroundImage:ya(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:"movie"===e?(n=t.runtime,o=n%60,Math.floor(n/60)+"h "+(o<10?"0":"")+o+"m - "+t.release_date):`${Pa(t.first_air_date)} - ${Pa(t.last_air_date)}`,reviews:r}},t);var n,o}))}var Wa=()=>{var e=On(),t=g(Qt(0),2),r=t[0],n=t[1],o=g(Qt(),2),i=o[0];o[1];Vt(i,Ua);var s=g(Qt({}),2),a=s[0],l=s[1],d=Dn(),h=Zt((()=>0)),u=Gt((()=>{return _a((t=e.filter||"all",e=>{var r=`/trending/${t}/week?page=${e}`;if(Ca.has(r))return Ca.get(r);var n=Sa.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;n=t-2)&&u().setPage((e=>e+1))}function f(){var e=this.children.selected;C(e&&e.href),d(e.href)}return Xt(Jt(Qr,(e=>{e.backdrop&&Qo(e.backdrop),e.heroContent&&l(e.heroContent)}),{defer:!0})),un(Fr,{get when(){return u().pages().length},get children(){return[un(Ma,gn({y:360,x:150},a)),un(on,{clipping:!0,get style(){return ia.itemsContainer},get children(){return un(Ei,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return ia.Column},get children(){return un(Nr,{get each(){return u().pages()},children:(e,t)=>un(ca,{get autofocus(){return h(t())},items:e,onFocus:c,onEnter:f})})}})}})]}})},Ya=()=>{var e=Dn(),t=Zt((()=>0));function r(){var t=this.children.selected;C(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=g(Qt(4294967295),2),r=t[0],n=t[1];return un(on,gn(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 un(on,{x:30,get children(){return[un(nn,{y:30,fontSize:84,get color(){return r()},get children(){return e.index}}),un(nn,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return r()},get children(){return e.title}}),un(nn,{y:200,fontSize:28,width:330,contain:"width",get color(){return r()},get children(){return e.description}})]}})}}))}var i=g(Qt(140),2),s=i[0],a=i[1];function l(e){a(-400*e.selected+140)}return un(on,{colorTop:1147903743,colorBottom:743406847,get children(){return[un(on,{x:120,get children(){return[un(on,{src:"/assets/solidjs.png",width:101,height:90,y:40}),un(nn,{fontSize:90,x:110,y:40,children:"Examples"}),un(on,{y:140,height:1,width:1800,color:3906468351})]}}),un(hs,{onSelectedChanged:l,onEnter:r,transition:{x:{delay:20,duration:300}},get x(){return s()},y:300,width:4400,get style(){return ia.Row},justifyContent:"flexStart",gap:40,get children(){return un(Nr,{each:n,children:(e,r)=>un(o,gn({get autofocus(){return t(r())},get index(){return r()}},e))})}})]}})},ja=()=>{var e={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("00000000")},t={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:xn("00000000")},r={fontSize:42},n={width:e.width,fontSize:26,contain:"width"},o={fontSize:26};return er((()=>{Qo("#000000")})),un(on,{autofocus:!0,style:e,get children(){return[un(nn,{style:r,children:"Title of the Page"}),un(nn,{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."}),un(on,{style:t,get children(){return[un(nn,{style:o,children:"Subline Text"}),un(on,{width:28,height:28,src:"/assets/rt-popcorn.png"}),un(nn,{style:o,children:"More Text"})]}})]}})},Ha=()=>{var e,t,r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:xn("00000000")},o={fontSize:42},i={fontSize:26};er((()=>{Qo("#000000"),e.animate({x:100},{duration:2e3}).start()}));var s=g(Qt(),2),a=s[0],l=s[1],d=g(Qt(),2),h=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 u={width:400,height:300,color:xn("#0000ff")},c={color:xn("#f54242"),focus:{color:xn("#4287f5")}};function f(e){var t=ar((()=>e.children));return un(on,gn(e,{get style(){return[c,e.style,[u]]},get children(){return[un(on,{id:"child1",width:100,height:100,get color(){return xn("#ff0000")},y:25,get children(){return[hn((()=>t())),un(on,{id:"subChild",x:150,width:100,height:100,get color(){return xn("#00ff00")}}),un(nn,{get children(){return e.title}})]}}),un(on,{width:100,height:100,get color(){return xn("#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:xn("#cccccc"),focus:{color:xn("#000000")}},m={color:xn("#ffffff"),focus:{color:xn("#f6f6cc")}};return un(on,{style:r,get children(){return[un(nn,{style:o,children:"Title of the Page"}),un(on,{style:n,get children(){return[un(nn,{get children(){return h()}}),un(nn,{style:i,get children(){return["Sub ",hn((()=>a()))," Text"]}}),un(Fr,{get when(){return a()},get children(){return un(on,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),un(nn,{style:i,children:"More Text"})]}}),un(f,{autofocus:!0,ref(e){"function"==typeof t?t(e):t=e},style:[m,v],get children(){return un(nn,{children:"Child Test"})}}),un(on,{ref(t){"function"==typeof e?e(t):e=t},style:p,width:100,height:100,get color(){return xn("#00ff00")},x:900,y:400,get alpha(){return t=e,console.log("Ref is available: ",t),1;var t}})]}})},Qa=()=>{var e,t,r=g(Qt([]),2),n=r[0],o=r[1],i={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:xn("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},s={fontSize:32,x:960,y:540,mount:.5,lineheight:52},a=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function l(e,t){o((t=>[...t,e].slice(-4))),console.log(e)}return er((()=>{Qo("#000000"),e.x=910,e.y=490,t=setInterval((()=>{e.rotation=a(-90,90),e.x=a(-300,2220),e.y=a(-300,1380)}),2500)})),tr((()=>{clearInterval(t)})),un(on,{get children(){return[un(nn,{style:s,get children(){return n().join("\n")}}),un(on,{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")]]})]}})},Ka=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:xn("00000000"),gap:26,y:400};function r(e){return un(on,gn(e,{forwardStates:!0,get style(){return aa.container},get children(){return un(nn,{get style(){return aa.text},get children(){return e.children}})}}))}var n=e=>{return t=cn("node"),mn(fo,t,(()=>[10,15])),pn(t,gn(e,{get style(){return{color:xn("#000000be"),borderRadius:8,border:{width:2,color:xn("#ffffff")}}}}),!0),fn(t,un(nn,{style:{fontSize:20},get children(){return e.children}})),t;var t};return[un(hs,{x:100,y:200,gap:5,style:t,get children(){return[un(n,{children:"HD"}),un(n,{children:"PG13"}),un(n,{children:"NC17"}),un(nn,{fontSize:30,children:"I like bananas"}),un(n,{children:"DOLBY"})]}}),un(hs,{x:100,gap:40,style:t,get children(){return[un(r,{autofocus:!0,onEnter:e,children:"TV Shows"}),un(r,{states:{active:!0,disabled:!1},children:"Movies"}),un(r,{states:"active",children:"Sports"}),un(r,{states:"disabled",children:"News"})]}})]},$a=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:xn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return un(on,gn(e,{style:{width:200,height:100,y:5,color:392801023}}))}var n=g(Qt(50),2),o=n[0],i=n[1];function s(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),i(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var a=50;return un(Ei,{x:160,get y(){return o()},gap:30,height:850,get width(){return e.width},get style(){return ia.Column},get children(){return[un(nn,{style:t,children:"Flex Start"}),un(hs,{gap:a,style:e,onFocus:s,get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex Start - Margin Left"}),un(hs,{gap:a,style:e,onFocus:s,get children(){return[un(r,{marginLeft:100}),un(r,{}),un(r,{marginLeft:100}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex End"}),un(hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex End - Margin Right"}),un(hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{marginRight:100}),un(r,{}),un(r,{}),un(r,{marginRight:100})]}}),un(nn,{style:t,children:"Center - No Margin Support"}),un(hs,{gap:a,justifyContent:"center",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Space Between - No Margin Support"}),un(hs,{gap:a,justifyContent:"spaceBetween",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Space Evenly - No Margin Support"}),un(hs,{gap:a,justifyContent:"spaceEvenly",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})},Xa=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:xn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return un(on,gn(e,{style:{width:200,height:100,y:5,color:392801023}}))}function n(){return Math.floor(91*Math.random())+10}var o=g(Qt(50),2),i=o[0],s=o[1];function a(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),s(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var l=50;return un(Ei,{x:160,get y(){return i()},gap:30,height:850,get width(){return e.width},get style(){return ia.Column},get children(){return[un(nn,{style:t,children:"Flex Start - AlignItems: center"}),un(hs,{alignItems:"center",gap:l,style:e,onFocus:a,get children(){return[un(r,{autofocus:!0,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex Start - Margin Left - AlignItems: flexStart"}),un(hs,{gap:l,alignItems:"flexStart",style:e,onFocus:a,get children(){return[un(r,{marginLeft:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{marginLeft:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex End - AlignItems: flexEnd"}),un(hs,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex End - Margin Right"}),un(hs,{gap:l,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{marginRight:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{marginRight:100,get height(){return n()}})]}}),un(nn,{style:t,children:"Center - No Margin Support"}),un(hs,{gap:l,justifyContent:"center",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Space Between - No Margin Support"}),un(hs,{gap:l,justifyContent:"spaceBetween",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Space Evenly - No Margin Support"}),un(hs,{gap:l,justifyContent:"spaceEvenly",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}})]}})},Ga=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:xn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("#4dabf5"),height:850,width:80};function r(e){var t={width:Math.floor(61*Math.random())+10,height:80,x:5,color:xn("#1769aa")};return un(on,gn(e,{style:t}))}var n=g(Qt(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))}er((()=>{Qo("#333333")}));var s=50;return[un(nn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),un(hs,{gap:s,style:e,onFocus:i,get children(){return[un(Ei,{gap:30,style:t,alignItems:"center",get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,style:t,onFocus:i,alignItems:"flexStart",get children(){return[un(r,{marginTop:100}),un(r,{}),un(r,{marginTop:100}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,alignItems:"flexEnd",justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{marginBottom:100}),un(r,{}),un(r,{}),un(r,{marginBottom:100})]}}),un(Ei,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})]},Va=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:xn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("#4dabf5"),height:850,width:60};function r(e){var t={width:50,height:80,x:5,color:xn("#1769aa")};return un(on,gn(e,{style:t}))}var n=g(Qt(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))}er((()=>{Qo("#333333")}));var s=50;return[un(nn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),un(hs,{gap:s,style:e,onFocus:i,get children(){return[un(Ei,{gap:30,style:t,get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,style:t,onFocus:i,get children(){return[un(r,{marginTop:100}),un(r,{}),un(r,{marginTop:100}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{marginBottom:100}),un(r,{}),un(r,{}),un(r,{marginBottom:100})]}}),un(Ei,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})]},Za=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:xn("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 un(on,gn(e,{forwardStates:!0,style:r,shader:n,get children(){return un(nn,{style:ha,get children(){return e.children}})}}))}return un(hs,{style:t,get children(){return[un(o,{autofocus:!0,onEnter:e,children:"Focused"}),un(o,{states:{active:!0,disabled:!1},children:"Normal"}),un(o,{states:"disabled",children:"Disabled"})]}})},qa="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function Ja(){return(Ja=y(m().mark((function e(){var t,r;return m().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",el),e.prev=6,e.next=9,r.load(qa);case 9:console.log("The video has now been loaded!"),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),tl(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function el(e){tl(e.detail)}function tl(e){console.error("Error code",e.code,"object",e)}document.addEventListener("DOMContentLoaded",(function(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?function(){Ja.apply(this,arguments)}():console.error("Browser not supported!")}));var rl=()=>{var e=On(),t=Dn(),r=g(Vt((()=>w({},e)),Ua),1)[0],n=g(Vt((()=>w({},e)),Oa),1)[0],o=g(Vt((()=>w({},e)),Da),1)[0],i=g(Qt(0),2),s=i[0],a=i[1];Xt(Jt(r,(e=>{Qo(e.backgroundImage)}),{defer:!0}));var l,d,h,u=600,c={color:xn("#000000"),alpha:0,width:1900,height:890,x:10,y:u,borderRadius:30};function f(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=u,d.y=u,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;C(e&&e.href),t(e.href)}function m(){var e;(e=document.getElementById("video")).hidden=!0,e.pause(),document.getElementsByTagName("canvas")[0].focus(),Kr(h),a(0)}function x(){var e=function(){var e=document.getElementById("video");return e.hidden=!1,setTimeout((()=>e.play()),50),e.focus(),e}();Kr(e),a(.9)}return un(Fr,{get when(){return r()},keyed:!0,get children(){return[un(on,{onUp:()=>h.setFocus(),onEscape:m,get children(){return[un(Ma,gn({y:360,x:150},(()=>r().heroContent))),un(fa,{autofocus:!0,ref(e){"function"==typeof h?h(e):h=e},y:560,x:150,onDown:()=>l.setFocus(),onEnter:x,children:"Watch Trailer"}),un(Ei,{ref(e){"function"==typeof l?l(e):l=e},y:u,x:140,get style(){return ia.Column},zIndex:5,get children(){return un(Fr,{get when(){return hn((()=>!!o()))()&&n()},get children(){return[un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Recommendations"}),un(ca,{onFocus:f,onEnter:v,get items(){return o()}}),un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Cast and Crew"}),un(ca,{onFocus:p,onEnter:v,get items(){return n()}})]}})}}),un(on,{ref(e){"function"==typeof d?d(e):d=e},style:c,transition:{alpha:!0,y:!0}})]}}),un(on,{get alpha(){return s()},get color(){return xn("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function nl({id:e}){return Sa.get(`/person/${e}/combined_credits`).then((({cast:e})=>Aa(e.slice(0,7))))}function ol({id:e}){return Sa.get(`/person/${e}`).then((e=>w({backgroundImage:ya(e.profile_path,"original"),heroContent:{title:e.title||e.name,description:e.biography}},e)))}var il=()=>{var e=On(),t=Dn(),r=g(Vt((()=>w({},e)),ol),1)[0],n=g(Vt((()=>w({},e)),nl),1)[0];Xt(Jt(r,(e=>{Qo(e.backgroundImage)}),{defer:!0}));var o={color:xn("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){var e=this.children.selected;C(e&&e.href),t(e.href)}return un(Fr,{get when(){return r()},keyed:!0,get children(){return[un(on,{x:150,y:200,get style(){return ia.Column},zIndex:3,get children(){return[un(nn,{get style(){return Ko.typography.display2},get children(){return r().name}}),un(nn,{get style(){return ia.peopleBio},get children(){return r().biography}})]}}),un(on,{style:o}),un(Ei,{y:670,x:140,get style(){return ia.Column},get children(){return un(Fr,{get when(){return n()},get children(){return[un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Credits"}),un(ca,{autofocus:!0,onEnter:i,get items(){return n()}})]}})}})]}})},sl=()=>{return e=cn("node"),vn(e,"style",{width:1920,height:1080,color:868483072}),e;var e},al=new URL("AppCoreExtensions-legacy-DUknoeiY.js",b.meta.url).href;Dr.debug=!1,Dr.animationsEnabled=!0,Dr.fontSettings.fontFamily="Ubuntu",Dr.fontSettings.color=xn("#ffffff"),Dr.fontSettings.fontSize=32,Dr.rendererOptions={coreExtensionModule:al,fpsUpdateInterval:1e3,enableInspector:!0},dn((()=>un(to,{root:e=>un(oa,e),get children(){return[un(Vn,{path:"",component:Wa}),un(Vn,{path:"examples",component:Ya}),un(Vn,{path:"browse/:filter",component:Wa}),un(Vn,{path:"text",component:ja}),un(Vn,{path:"buttons",component:Ka}),un(Vn,{path:"flex",component:$a}),un(Vn,{path:"create",component:Ha}),un(Vn,{path:"viewport",component:Qa}),un(Vn,{path:"flexsize",component:Xa}),un(Vn,{path:"flexcolumnsize",component:Ga}),un(Vn,{path:"flexcolumn",component:Va}),un(Vn,{path:"buttonsmaterial",component:Za}),un(Vn,{path:"entity/people/:id",component:il}),un(Vn,{path:"entity/:type/:id",component:rl}),un(Vn,{path:"*all",component:sl})]}})))}}}))}(); +//# sourceMappingURL=index-legacy-bcLqKdOS.js.map diff --git a/assets/index-legacy-BVITNsdb.js.map b/assets/index-legacy-bcLqKdOS.js.map similarity index 99% rename from assets/index-legacy-BVITNsdb.js.map rename to assets/index-legacy-bcLqKdOS.js.map index f31c926..1ae933d 100644 --- a/assets/index-legacy-BVITNsdb.js.map +++ b/assets/index-legacy-bcLqKdOS.js.map @@ -1 +1 @@ -{"version":3,"file":"index-legacy-BVITNsdb.js","sources":["../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../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/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","../../../../../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/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.2_@lightningjs+solid_sggciuifiwrrln27zkml3bpb3u/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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS 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 */\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 / 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 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 gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\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 `,\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 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) {\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);\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 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 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 { 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 constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\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 // 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 this.emit('loaded', {\n type: 'texture',\n dimensions,\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 }\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 (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 && this.children.length) {\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 } = this.props;\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 });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\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 }\n this.updateScaleRotateTransform();\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 });\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._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 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';\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 }\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 });\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 // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\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 */\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';\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 this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\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 }));\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","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 {\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 */\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 * 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 '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 _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 rendered: boolean;\n autofocus: boolean;\n flexItem?: boolean;\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 private _width?: number;\n private _height?: number;\n private _color?: number | string;\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.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\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.rendered) {\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.rendered && 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.rendered && 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.rendered) {\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.rendered) {\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 isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\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.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\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 node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\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 props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.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 || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\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 node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\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\n node.rendered = true;\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 // clean up after first render;\n delete this._renderProps;\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 }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\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[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = 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 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 children.push(c);\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._autosized) {\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.rendered && 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 rootNode.rendered = true;\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 }\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;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\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 || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\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 || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n 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 return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n 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))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\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);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n 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 (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (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)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n 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 = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n 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(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), 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 (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, 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 (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ 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 === void 0 ? -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 !== void 0 && 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\n 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\n 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 For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\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 Object.fromEntries(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 = Object.fromEntries(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) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\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, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\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 = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\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 windowVal = 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 windowVal = items.height;\n }\n return [lastItem, windowVal];\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 return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\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}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\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 (this.children[this.selected].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}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\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$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"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 { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\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$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\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$b\n};\nconst text$6 = {\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$b\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$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\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: themeStyles$a\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: themeStyles$a\n};\nconst text$5 = {\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: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\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$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.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$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.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$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\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$9\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$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\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$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.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$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\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$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"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 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$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\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$7\n};\nconst text$4 = {\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$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"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$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\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$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\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$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\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$3, {\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$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\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$5\n};\nconst text$2 = {\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$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"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$1, {\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$1, {\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$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\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$4\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$4\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$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"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$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\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$3\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$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"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$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\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 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$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\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$1\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$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 // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\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.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 themeStyles\n};\nconst text = {\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\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"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 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 && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && 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, {\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 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 { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.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 tone() {\n return props.tone ?? styles.tone;\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;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\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};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d 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 styles$3 as rowStyles,\n scrollToIndex,\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: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BtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+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/KgCCZxCK2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ApElwE4aQwxZp6n3YNxsPyzA7yst/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 hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\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 const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n delayedBackgrounds(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 { 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\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 return (\n <>\n \n navigate(\"/browse/all\")} icon=\"trending\">\n Trending\n \n navigate(\"/browse/movie\")}>\n Movies\n \n navigate(\"/browse/tv\")}>\n TV\n \n navigate(\"/examples\")}>\n Examples\n \n \n \n \n );\n}\n","import { View, Text, hexColor } from \"@lightningjs/solid\";\nimport { createSignal } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n};\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps((prev) => Math.min(fps, prev));\n setMaxFps((prev) => Math.max(fps, prev));\n\n totalFps += fps;\n count++;\n\n setAvgFps(Math.round(totalFps / count));\n\n resetCounter();\n};\n\nexport function setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return (\n \n \n FPS:\n \n {fps().toString()}\n \n \n\n \n AVG:\n \n {avgFps().toString()}\n \n \n\n \n MIN:\n \n {minFps().toString()}\n \n \n\n \n MAX:\n \n {maxFps().toString()}\n \n \n \n );\n};\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } 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;\n Menu: string;\n Escape: string;\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\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \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 marginTop: 20,\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: 20,\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 contain: \"both\",\n width: 1500,\n height: 400,\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 = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: \"both\",\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: \"both\",\n};\n\nconst BadgeStyle = {\n fontSize: 20,\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 = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return (\n \n {props.title}\n {props.description}\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 + \"m\"\n );\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, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\"],\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" - \" + 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\";\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 createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(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 }\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 console.log(\"Ref is available: \", elm);\n return true;\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 } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } 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 = 600;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\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 setActiveElement(trailerButton);\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, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n Watch Trailer\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 { createEffect, createResource, on } 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 createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 1540,\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 return (\n \n \n {data().name}\n {data().biography}\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(\"#ffffff\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 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","TextureUsageTracker","constructor","releaseCallback","_defineProperty","this","ManualCountTextureUsageTracker","options","_options$textureClean","_options$textureClean2","super","Map","Set","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step4","now","Date","thresholdMs","_iterator4","_createForOfIteratorHelper","zeroReferenceTextureSet","s","n","done","textureRefInfo","value","lastUpdate","id","textureMap","delete","err","e","f","registerTexture","texture","_texture$options","textureId","assertTruthy","has","nodeRefCount","set","add","incrementTextureRefCount","_texture$options2","get","txType","props","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","v","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","Error","Math","ceil","appHeight","deviceLogicalPixelRatio","appWidth","root","document","createElement","setRootPosition","body","appendChild","MutationObserver","bind","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","node","properties","div","key","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Proxy","target","property","Reflect","receiver","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","res","u","uni","define","size","push","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","name","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","state","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","_objectSpread","getPropertySetters","Object","freeze","fromEntries","entries","map","setter","requestRender","setStatus","status","error","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","forEach","eventName","off","scheduleUpdateState","updateScheduled","queueMicrotask","updateState","calcHeight","numLines","max","LightningTextTextureRenderer","context","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","fontFace","ffs","i","length","_load","fonts","fontSetting","check","load","catch","then","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","l","split","lines","usedLines","slice","otherLines","measureText","al","j","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","min","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","result","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","undefined","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","WebTrFontFace","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","loaded","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","pop","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step5","_iterator5","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","Array","from","keys","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","results","eff","index","_eff$props","fxClass","uniInfo","p","fxProp","propInfo","validator","isArray","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","values","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","replace","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","$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","val","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","time","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref","_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","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","prev","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","apply","arguments","_ref3","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref4","_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","Promise","resolve","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","start","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","_step6","_iterator6","glyph","mapped","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","weight","resolveFontToUse","familyMapsByPriority","family","weightIn","stretch","_step7","_iterator7","fontFaces","_step8","weightMap","_iterator8","fontFamilyWeight","descriptors","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","_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","d","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","init","_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","_ref5","_ref6","_props$colorTl","_ref7","_ref8","_props$colorTr","_ref9","_ref10","_props$colorBl","_ref11","_ref12","_props$colorBr","_props$data","_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$parent","_props$texture","_props$shader","_props$src2","_props$scale2","_ref13","_props$scaleX","_ref14","_props$scaleY","_props$mount","_ref15","_props$mountX","_ref16","_props$mountY","_props$pivot2","_ref17","_props$pivotX","_ref18","_props$pivotY","_props$rotation2","colorTop","colorLeft","colorRight","colorBottom","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","desc","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","temp","tempMatrix","multiply","a","b","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","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","on","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","children","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","child","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent2","_props$parent3","z","destroy","removeAllListeners","_this$props2","absX","_this$props$parent","_this$props$parent2","absY","_this$props$parent$ab","_this$props$parent3","newParent","oldParent","splice","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","_slicedToArray","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","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","addQuads","render","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i8","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","SuspenseContext","equalFn","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","updateFn","untrack","cleanNode","runUpdates","createSignal","observers","observerSlots","comparator","assign","readSignal","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","user","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","_ref20","storage","initialValue","setValue","_createSignal2","setError","_createSignal3","_createSignal4","track","trigger","_createSignal6","setState","loadEnd","onHydrated","_step9","_iterator9","decrement","clear","completeLoad","read","refetching","lookup","castError","defineProperties","loading","latest","refetch","mutate","createSelector","subs","_step10","_iterator10","_step10$value","_iterator11","_step11","pure","onCleanup","deps","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prevListener","handleError","startTransition","createContext","defaultValue","Provider","createProvider","useContext","memo","resolveChildren","toArray","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","nextValue","updatedAt","runComputation","runTop","suspense","inFallback","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","cause","FALLBACK","dispose","createComponent","Comp","trueFn","propTraps","_","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","definedKeys","defineProperty","narrowedError","For","fallback","list","mapFn","items","disposers","len","indexes","newItems","newIndices","newIndicesNext","tempdisposers","tempIndexes","end","newEnd","item","newLen","disposer","mapper","_createSignal8","mapArray","each","Show","keyed","condition","when","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","_createSignal10","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","rendered","autofocus","_renderProps","_effects","_p$lng","lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationRunning","_animationQueue","_animationQueueSettings","_this5","_callee8","_context9","setFocus","forwardFocus","focusedIndex","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","_iterator15","_step15","found","states","_states","_stateChanged","_animationSettings","_this$parent","onBeforeLayout","display","flexItem","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","_autosized","calculatedSize","toPad","calculateFlex","onLayout","forwardStates","_undoStyles","_step14","_iterator14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_width","marginBottom","_height","onLoad","isNaN","_color","onFail","onCreate","handler","_node$lng","inode","solid","_loop2","_ref21","_i17","_LightningRendererNum","_loop3","_ref22","_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","_ref23","_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","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_step17","_iterator17","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step18","_iterator18","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref24","_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","_step19","finalFocusElm","_iterator19","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","_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","delayedBackgrounds","r$","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","_ref26","_ref27","_a2","_b2","_ref28","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_updateLastIndex","lastItem","windowVal","updateLastIndex","_updateLastIndex2","currentVal","newVal","size2","direct","scrollIndex","abs","chainFunctions","onlyFunctions","func","innerArgs","_step20","_iterator20","onGridFocus","skipFocus","handleNavigation","onSelectedChanged","plinko","num","_ref29$Artwork","Artwork","_ref29$Artwork2","themeStyles$d","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref30$Icon","Icon","_ref30$Icon2","themeStyles$c","_excluded2","inverse","brand","_ref31$Badge","Badge","_ref31$Badge2","themeStyles$b","_excluded3","container$c","text$6","icon$2","_ref32$Button","Button","_ref32$Button2","themeStyles$a","_excluded4","container$b","contentColor","focus","content","text$5","_ref33$Checkbox","Checkbox","_ref33$Checkbox2","themeStyles$9","_excluded5","strokeWidth","container$a","checked","neutral","icon$1","_ref34$Column","Column","_ref34$Column2","defaultTone$9","themeStyles$8","_excluded6","styles$9","Container","itemTransition","onUp","onDown","_props$tone","flat","_ref35$Label","Label","_ref35$Label2","themeStyles$7","_excluded7","container$8","backgroundColor","text$4","_ref36$Rating","Rating","_ref36$Rating2","themeStyles$6","container$7","itemSpacing","toneModes","text$3","_ref37$Details","Details","_ref37$Details2","themeStyles$5","_excluded8","container$6","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$2","_ref38$Metadata","Metadata","_ref38$Metadata2","themeStyles$4","_excluded9","container$5","titleText","descriptionText","_ref39$ProgressBar","ProgressBar","_ref39$ProgressBar2","themeStyles$3","_excluded10","container$4","_ref40$Row","Row","_ref40$Row2","defaultTone$3","themeStyles$2","_excluded11","styles$3","onLeft","onRight","_props$tone2","_props$tone3","_ref41$Keyboard","_ref41$Keyboard2","themeStyles$1","_excluded12","container$2","keySpacing","baseWidth","sizes","paddingX","text$1","_ref42$Key","Key","_ref42$Key2","_excluded13","container$1","_ref43$Tile","Tile","_ref43$Tile2","tileThemeStyles","_excluded14","_ref44$Surface","Surface","_ref44$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded15","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","onEnter","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","totalFps","resetCounter","setupFPS","calcFps","FPSCounter","App","Menu","announcer","navDrawer","lastFocused","onAnnouncer","onLast","back","onMenu","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step12","otherObject","objects","_iterator12","_step13","isDefaultDesc","writable","objectIndex","_iterator13","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","_createSignal32","pages","setPages","_createSignal34","page","setPage","_createSignal36","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","metaText","badges","getReviews","reviews","rtCrit","rtFan","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","backgroundImage","minutes","runtime","remainingMinutes","minutesToHMM","release_date","first_air_date","last_air_date","Browse","_createSignal38","columnY","setcolumnY","_createSignal40","entityProvider","_createSignal42","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal44","setColor","_createSignal46","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal48","insertTest","setInsertTest","_createSignal50","emptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal52","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal54","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal56","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal58","_this$children$select4","_createSignal60","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal62","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","trailerButton","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"y9UAsBiBA,sQCDV,MAAMC,GAETC,WAAAA,CAAYC,GAAiBC,EAAAC,KAAA,uBAAA,GACzBA,KAAKF,gBAAkBA,CAC1B,ECFE,MAAMG,WAAuCL,GAIhDC,WAAAA,CAAYC,EAAiBI,GAAS,IAAAC,EAAAC,EAClCC,MAAMP,GAAiBC,oBAJd,IAAIO,KAAKP,EACIC,KAAA,0BAAA,IAAIO,KAAKR,EAAAC,KAAA,eAAA,GAI/BA,KAAKE,QAAU,CACXM,iCAAwBL,EAAED,EAAQM,gCAAwB,IAAAL,EAAAA,EAAI,IAC9DM,8BAAoE,QAAvCL,EAAEF,EAAQO,qCAA6BL,IAAAA,EAAAA,EAAI,KAI5EM,aAAY,KACR,IAEyDC,EAFnDC,EAAMC,KAAKD,MACXE,EAAcd,KAAKE,QAAQO,8BAA8BM,EAAAC,EAClChB,KAAKiB,yBAAuB,IAAzD,IAAAF,EAAAG,MAAAP,EAAAI,EAAAI,KAAAC,MAA2D,CAAA,IAAhDC,EAAcV,EAAAW,MACjBV,EAAMS,EAAeE,WAAaT,IAClCd,KAAKF,gBAAgBuB,EAAeG,IACpCxB,KAAKyB,WAAWC,OAAOL,EAAeG,IACtCxB,KAAKiB,wBAAwBS,OAAOL,GAE3C,CAAA,CAAAM,MAAAA,GAAAZ,EAAAa,EAAAD,EAAAZ,CAAAA,QAAAA,EAAAc,GACb,IAAW7B,KAAKE,QAAQM,yBACnB,CACDsB,eAAAA,CAAgBC,GAAS,IAAAC,EACfC,EAA2B,QAAlBD,EAAGD,EAAQ7B,eAAO,IAAA8B,OAAA,EAAfA,EAAiBR,GAEnC,GADAU,EAAaD,EAAW,6CACnBjC,KAAKyB,WAAWU,IAAIF,GAAY,CACjC,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1I,KAAI,WAAY+C,UAAWuyB,KAAM3tB,GACvCe,GAAK,CAAC1I,KAAI,iBAAkB+C,UAAWoxB,KAAMxsB,GAC7Ce,GAAK,CAAC1I,KAAI,OAAQ+C,UAAWkzB,KAAQtuB,GACrCe,GAAK,CAAC1I,KAAI,UAAW+C,UAAWm1B,KAAWvwB,GAC3Ce,GAAK,CAAC1I,KAAI,OAAQ+C,UAAWs1B,KAAQ1wB,GACrCe,GAAK,CAAC1I,KAAI,SAAU+C,UAAWwzB,KAAU5uB,GACzCe,GAAK,CAAC1I,KAAI,WAAY+C,UAAWw0B,KAAY5vB,GAC7Ce,GAAK,CAAC1I,KAAI,WAAY+C,UAAW41B,KAAYhxB,GAC7Ce,GAAK,CAAC1I,KAAI,iBAAkB+C,UAAWi5B,KAAkBr0B,GACzDe,GAAK,CAAC1I,KAAI,aAAc+C,UAAWg2B,KAAcpxB,GACjDe,GAAK,CAAC1I,KAAI,kBAAmB+C,UAAWk5B,KAAmBt0B,GAC3De,GAAK,CAAC1I,KAAI,oBAAqB+C,UAAW24B,KAAM/zB,GAChDe,GAAK,CAAC1I,KAAI,mBAAoB+C,UAAWu3B,KAAM3yB,GAC/Ce,GAAK,CAAC1I,KAAI,OAAQ+C,UAAW44B,KAAQ","x_google_ignoreList":[58,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,98,102]} \ No newline at end of file +{"version":3,"file":"index-legacy-bcLqKdOS.js","sources":["../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../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/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","../../../../../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/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.2_@lightningjs+solid_sggciuifiwrrln27zkml3bpb3u/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.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_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","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS 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 */\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 / 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 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 gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\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 `,\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 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) {\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);\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 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 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 { 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 constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\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 // 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 this.emit('loaded', {\n type: 'texture',\n dimensions,\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 }\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 (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 && this.children.length) {\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 } = this.props;\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 });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\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 }\n this.updateScaleRotateTransform();\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 });\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._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 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';\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 }\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 });\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 // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\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 */\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';\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 this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\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 }));\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","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 {\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 */\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 * 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 '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 _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 rendered: boolean;\n autofocus: boolean;\n flexItem?: boolean;\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 private _width?: number;\n private _height?: number;\n private _color?: number | string;\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.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\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.rendered) {\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.rendered && 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.rendered && 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.rendered) {\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.rendered) {\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 isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\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.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\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 node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\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 props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.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 || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\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 node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\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\n node.rendered = true;\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 // clean up after first render;\n delete this._renderProps;\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 }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\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[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = 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 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 children.push(c);\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._autosized) {\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.rendered && 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 rootNode.rendered = true;\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 }\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;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\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 || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\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 || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n 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 return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n 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))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\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);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n 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 (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (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)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n 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 = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n 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(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), 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 (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, 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 (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ 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 === void 0 ? -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 !== void 0 && 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\n 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\n 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 For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\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 Object.fromEntries(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 = Object.fromEntries(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) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\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, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\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 = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\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 windowVal = 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 windowVal = items.height;\n }\n return [lastItem, windowVal];\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 return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\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}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\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 (this.children[this.selected].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}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\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$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"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 { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\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$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\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$b\n};\nconst text$6 = {\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$b\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$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\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: themeStyles$a\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: themeStyles$a\n};\nconst text$5 = {\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: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\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$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.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$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.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$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\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$9\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$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\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$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.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$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\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$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"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 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$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\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$7\n};\nconst text$4 = {\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$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"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$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\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$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\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$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\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$3, {\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$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\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$5\n};\nconst text$2 = {\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$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"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$1, {\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$1, {\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$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\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$4\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$4\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$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"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$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\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$3\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$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"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$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\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 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$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\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$1\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$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 // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\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.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 themeStyles\n};\nconst text = {\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\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"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 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 && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && 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, {\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 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 { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.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 tone() {\n return props.tone ?? styles.tone;\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;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\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};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d 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 styles$3 as rowStyles,\n scrollToIndex,\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/GNEm6YBkvRyANblZ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wwVSEiJ2MKVUBWuzLSLl2HL+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+Uyn7a41k3Q0gMcC2ANgH4CHV1T2Oy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ldAF7nKFr1x+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 hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\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 const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n delayedBackgrounds(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 { 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\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 return (\n <>\n \n navigate(\"/browse/all\")} icon=\"trending\">\n Trending\n \n navigate(\"/browse/movie\")}>\n Movies\n \n navigate(\"/browse/tv\")}>\n TV\n \n navigate(\"/examples\")}>\n Examples\n \n \n \n \n );\n}\n","import { View, Text, hexColor } from \"@lightningjs/solid\";\nimport { createSignal } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n};\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps((prev) => Math.min(fps, prev));\n setMaxFps((prev) => Math.max(fps, prev));\n\n totalFps += fps;\n count++;\n\n setAvgFps(Math.round(totalFps / count));\n\n resetCounter();\n};\n\nexport function setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return (\n \n \n FPS:\n \n {fps().toString()}\n \n \n\n \n AVG:\n \n {avgFps().toString()}\n \n \n\n \n MIN:\n \n {minFps().toString()}\n \n \n\n \n MAX:\n \n {maxFps().toString()}\n \n \n \n );\n};\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } 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;\n Menu: string;\n Escape: string;\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\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \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 marginTop: 20,\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: 20,\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 contain: \"both\",\n width: 1500,\n height: 400,\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 = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: \"both\",\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: \"both\",\n};\n\nconst BadgeStyle = {\n fontSize: 20,\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 = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return (\n \n {props.title}\n {props.description}\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 + \"m\"\n );\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, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\"],\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" - \" + 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\";\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 createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(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 }\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 console.log(\"Ref is available: \", elm);\n return true;\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 } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } 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 = 600;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\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 setActiveElement(trailerButton);\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, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n Watch Trailer\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 { createEffect, createResource, on } 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 createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 1540,\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 return (\n \n \n {data().name}\n {data().biography}\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(\"#ffffff\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 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","TextureUsageTracker","constructor","releaseCallback","_defineProperty","this","ManualCountTextureUsageTracker","options","_options$textureClean","_options$textureClean2","super","Map","Set","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step4","now","Date","thresholdMs","_iterator4","_createForOfIteratorHelper","zeroReferenceTextureSet","s","n","done","textureRefInfo","value","lastUpdate","id","textureMap","delete","err","e","f","registerTexture","texture","_texture$options","textureId","assertTruthy","has","nodeRefCount","set","add","incrementTextureRefCount","_texture$options2","get","txType","props","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","v","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","Error","Math","ceil","appHeight","deviceLogicalPixelRatio","appWidth","root","document","createElement","setRootPosition","body","appendChild","MutationObserver","bind","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","node","properties","div","key","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Proxy","target","property","Reflect","receiver","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","res","u","uni","define","size","push","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","name","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","state","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","_objectSpread","getPropertySetters","Object","freeze","fromEntries","entries","map","setter","requestRender","setStatus","status","error","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","forEach","eventName","off","scheduleUpdateState","updateScheduled","queueMicrotask","updateState","calcHeight","numLines","max","LightningTextTextureRenderer","context","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","fontFace","ffs","i","length","_load","fonts","fontSetting","check","load","catch","then","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","l","split","lines","usedLines","slice","otherLines","measureText","al","j","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","min","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","result","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","undefined","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","WebTrFontFace","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","loaded","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","pop","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step5","_iterator5","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","Array","from","keys","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","results","eff","index","_eff$props","fxClass","uniInfo","p","fxProp","propInfo","validator","isArray","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","values","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","replace","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","$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","val","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","time","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref","_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","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","prev","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","apply","arguments","_ref3","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref4","_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","Promise","resolve","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","start","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","_step6","_iterator6","glyph","mapped","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","weight","resolveFontToUse","familyMapsByPriority","family","weightIn","stretch","_step7","_iterator7","fontFaces","_step8","weightMap","_iterator8","fontFamilyWeight","descriptors","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","_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","d","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","init","_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","_ref5","_ref6","_props$colorTl","_ref7","_ref8","_props$colorTr","_ref9","_ref10","_props$colorBl","_ref11","_ref12","_props$colorBr","_props$data","_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$parent","_props$texture","_props$shader","_props$src2","_props$scale2","_ref13","_props$scaleX","_ref14","_props$scaleY","_props$mount","_ref15","_props$mountX","_ref16","_props$mountY","_props$pivot2","_ref17","_props$pivotX","_ref18","_props$pivotY","_props$rotation2","colorTop","colorLeft","colorRight","colorBottom","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","desc","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","temp","tempMatrix","multiply","a","b","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","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","on","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","children","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","child","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent2","_props$parent3","z","destroy","removeAllListeners","_this$props2","absX","_this$props$parent","_this$props$parent2","absY","_this$props$parent$ab","_this$props$parent3","newParent","oldParent","splice","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","_slicedToArray","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","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","addQuads","render","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i8","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","SuspenseContext","equalFn","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","updateFn","untrack","cleanNode","runUpdates","createSignal","observers","observerSlots","comparator","assign","readSignal","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","user","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","_ref20","storage","initialValue","setValue","_createSignal2","setError","_createSignal3","_createSignal4","track","trigger","_createSignal6","setState","loadEnd","onHydrated","_step9","_iterator9","decrement","clear","completeLoad","read","refetching","lookup","castError","defineProperties","loading","latest","refetch","mutate","createSelector","subs","_step10","_iterator10","_step10$value","_iterator11","_step11","pure","onCleanup","deps","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prevListener","handleError","startTransition","createContext","defaultValue","Provider","createProvider","useContext","memo","resolveChildren","toArray","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","nextValue","updatedAt","runComputation","runTop","suspense","inFallback","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","cause","FALLBACK","dispose","createComponent","Comp","trueFn","propTraps","_","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","definedKeys","defineProperty","narrowedError","For","fallback","list","mapFn","items","disposers","len","indexes","newItems","newIndices","newIndicesNext","tempdisposers","tempIndexes","end","newEnd","item","newLen","disposer","mapper","_createSignal8","mapArray","each","Show","keyed","condition","when","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","_createSignal10","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","rendered","autofocus","_renderProps","_effects","_p$lng","lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationRunning","_animationQueue","_animationQueueSettings","_this5","_callee8","_context9","setFocus","forwardFocus","focusedIndex","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","_iterator15","_step15","found","states","_states","_stateChanged","_animationSettings","_this$parent","onBeforeLayout","display","flexItem","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","_autosized","calculatedSize","toPad","calculateFlex","onLayout","forwardStates","_undoStyles","_step14","_iterator14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_width","marginBottom","_height","onLoad","isNaN","_color","onFail","onCreate","handler","_node$lng","inode","solid","_loop2","_ref21","_i17","_LightningRendererNum","_loop3","_ref22","_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","_ref23","_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","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_step17","_iterator17","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step18","_iterator18","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref24","_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","_step19","finalFocusElm","_iterator19","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","_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","delayedBackgrounds","r$","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","_ref26","_ref27","_a2","_b2","_ref28","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_updateLastIndex","lastItem","windowVal","updateLastIndex","_updateLastIndex2","currentVal","newVal","size2","direct","scrollIndex","abs","chainFunctions","onlyFunctions","func","innerArgs","_step20","_iterator20","onGridFocus","skipFocus","handleNavigation","onSelectedChanged","plinko","num","_ref29$Artwork","Artwork","_ref29$Artwork2","themeStyles$d","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref30$Icon","Icon","_ref30$Icon2","themeStyles$c","_excluded2","inverse","brand","_ref31$Badge","Badge","_ref31$Badge2","themeStyles$b","_excluded3","container$c","text$6","icon$2","_ref32$Button","Button","_ref32$Button2","themeStyles$a","_excluded4","container$b","contentColor","focus","content","text$5","_ref33$Checkbox","Checkbox","_ref33$Checkbox2","themeStyles$9","_excluded5","strokeWidth","container$a","checked","neutral","icon$1","_ref34$Column","Column","_ref34$Column2","defaultTone$9","themeStyles$8","_excluded6","styles$9","Container","itemTransition","onUp","onDown","_props$tone","flat","_ref35$Label","Label","_ref35$Label2","themeStyles$7","_excluded7","container$8","backgroundColor","text$4","_ref36$Rating","Rating","_ref36$Rating2","themeStyles$6","container$7","itemSpacing","toneModes","text$3","_ref37$Details","Details","_ref37$Details2","themeStyles$5","_excluded8","container$6","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$2","_ref38$Metadata","Metadata","_ref38$Metadata2","themeStyles$4","_excluded9","container$5","titleText","descriptionText","_ref39$ProgressBar","ProgressBar","_ref39$ProgressBar2","themeStyles$3","_excluded10","container$4","_ref40$Row","Row","_ref40$Row2","defaultTone$3","themeStyles$2","_excluded11","styles$3","onLeft","onRight","_props$tone2","_props$tone3","_ref41$Keyboard","_ref41$Keyboard2","themeStyles$1","_excluded12","container$2","keySpacing","baseWidth","sizes","paddingX","text$1","_ref42$Key","Key","_ref42$Key2","_excluded13","container$1","_ref43$Tile","Tile","_ref43$Tile2","tileThemeStyles","_excluded14","_ref44$Surface","Surface","_ref44$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded15","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","onEnter","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","totalFps","resetCounter","setupFPS","calcFps","FPSCounter","App","Menu","announcer","navDrawer","lastFocused","onAnnouncer","onLast","back","onMenu","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step12","otherObject","objects","_iterator12","_step13","isDefaultDesc","writable","objectIndex","_iterator13","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","_createSignal32","pages","setPages","_createSignal34","page","setPage","_createSignal36","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","metaText","badges","getReviews","reviews","rtCrit","rtFan","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","backgroundImage","minutes","runtime","remainingMinutes","minutesToHMM","release_date","first_air_date","last_air_date","Browse","_createSignal38","columnY","setcolumnY","_createSignal40","entityProvider","_createSignal42","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal44","setColor","_createSignal46","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal48","insertTest","setInsertTest","_createSignal50","emptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal52","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal54","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal56","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal58","_this$children$select4","_createSignal60","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal62","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","trailerButton","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"y9UAsBiBA,sQCDV,MAAMC,GAETC,WAAAA,CAAYC,GAAiBC,EAAAC,KAAA,uBAAA,GACzBA,KAAKF,gBAAkBA,CAC1B,ECFE,MAAMG,WAAuCL,GAIhDC,WAAAA,CAAYC,EAAiBI,GAAS,IAAAC,EAAAC,EAClCC,MAAMP,GAAiBC,oBAJd,IAAIO,KAAKP,EACIC,KAAA,0BAAA,IAAIO,KAAKR,EAAAC,KAAA,eAAA,GAI/BA,KAAKE,QAAU,CACXM,iCAAwBL,EAAED,EAAQM,gCAAwB,IAAAL,EAAAA,EAAI,IAC9DM,8BAAoE,QAAvCL,EAAEF,EAAQO,qCAA6BL,IAAAA,EAAAA,EAAI,KAI5EM,aAAY,KACR,IAEyDC,EAFnDC,EAAMC,KAAKD,MACXE,EA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W24B,KAAM/zB,GAChDe,GAAK,CAAC1I,KAAI,mBAAoB+C,UAAWu3B,KAAM3yB,GAC/Ce,GAAK,CAAC1I,KAAI,OAAQ+C,UAAW44B,KAAQ","x_google_ignoreList":[58,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,98,102]} \ No newline at end of file diff --git a/index.html b/index.html index f01f957..5cfc95a 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ Solid Demo - - + + @@ -28,6 +28,6 @@ > - +