blue-chestnut-solar-expert 0.0.63 → 0.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/eraser-icon_19.cjs.entry.js +1 -1
- package/dist/cjs/{lerc-Cg9Ef4kN.js → lerc-CweSdQV9.js} +3 -3
- package/dist/cjs/{lerc-Cg9Ef4kN.js.map → lerc-CweSdQV9.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-widget.cjs.entry.js +2 -2
- package/dist/cjs/loading-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/loading-widget.entry.cjs.js.map +1 -1
- package/dist/cjs/stencil-library.cjs.js +1 -1
- package/dist/collection/components/map-draw/map-draw.js +16 -47
- package/dist/collection/components/map-draw/map-draw.js.map +1 -1
- package/dist/collection/components/map-draw/map-selector.js +3 -3
- package/dist/collection/components/map-draw/polygon-buttons.js +1 -1
- package/dist/collection/components/map-draw/polygon-information.js +18 -11
- package/dist/collection/components/map-draw/polygon-information.js.map +1 -1
- package/dist/collection/components/map-draw/tool-box.js +3 -3
- package/dist/collection/components/map-draw/tutorial-component.js +3 -3
- package/dist/collection/components/settings/settings.js +8 -8
- package/dist/collection/components/solar-expert/solar-expert.js +3 -1
- package/dist/collection/components/solar-expert/solar-expert.js.map +1 -1
- package/dist/collection/components/solar-system-form/solar-system-form.js +37 -38
- package/dist/collection/components/solar-system-form/solar-system-form.js.map +1 -1
- package/dist/collection/components/widgets/loading-widget.js +1 -1
- package/dist/collection/output.css +17 -52
- package/dist/collection/types/lang.js.map +1 -1
- package/dist/collection/utils/lang/english.js +1 -0
- package/dist/collection/utils/lang/english.js.map +1 -1
- package/dist/collection/utils/lang/german.js +1 -0
- package/dist/collection/utils/lang/german.js.map +1 -1
- package/dist/collection/utils/lang/spanish.js +1 -0
- package/dist/collection/utils/lang/spanish.js.map +1 -1
- package/dist/collection/utils/solar.js +1 -0
- package/dist/collection/utils/solar.js.map +1 -1
- package/dist/components/eraser-icon.js +1 -1
- package/dist/components/house-icon.js +1 -1
- package/dist/components/icon-selector.js +1 -1
- package/dist/components/loading-widget.js +2 -2
- package/dist/components/loading-widget.js.map +1 -1
- package/dist/components/map-draw.js +1 -1
- package/dist/components/map-selector.js +1 -1
- package/dist/components/marker-icon.js +1 -1
- package/dist/components/move-icon.js +1 -1
- package/dist/components/octagon-minus-icon.js +1 -1
- package/dist/components/p-BJLO76Yi.js +40 -0
- package/dist/components/p-BJLO76Yi.js.map +1 -0
- package/dist/components/p-BXoz2zXG.js +47 -0
- package/dist/components/p-BXoz2zXG.js.map +1 -0
- package/dist/components/{p-BsvvtnQe.js → p-B_6Ue-UQ.js} +5 -2
- package/dist/components/p-B_6Ue-UQ.js.map +1 -0
- package/dist/components/p-C5QieOat.js +114 -0
- package/dist/components/p-C5QieOat.js.map +1 -0
- package/dist/components/{p-kbMAsJ_s.js → p-CCG3fXg3.js} +45 -43
- package/dist/components/p-CCG3fXg3.js.map +1 -0
- package/dist/components/p-CE2V-avM.js +623 -0
- package/dist/components/p-CE2V-avM.js.map +1 -0
- package/dist/components/p-CL74Q4VR.js +40 -0
- package/dist/components/p-CL74Q4VR.js.map +1 -0
- package/dist/components/p-CN8xBdHM.js +76 -0
- package/dist/components/p-CN8xBdHM.js.map +1 -0
- package/dist/components/{p-CIfpd0H7.js → p-Cl7aThVr.js} +38 -68
- package/dist/components/p-Cl7aThVr.js.map +1 -0
- package/dist/components/p-D8w3bTPO.js +40 -0
- package/dist/components/p-D8w3bTPO.js.map +1 -0
- package/dist/components/p-DBwr8xSB.js +40 -0
- package/dist/components/p-DBwr8xSB.js.map +1 -0
- package/dist/components/p-DDmNiupX.js +121 -0
- package/dist/components/p-DDmNiupX.js.map +1 -0
- package/dist/components/{p-UhBaEaSb.js → p-DRV0Pmhs.js} +3 -3
- package/dist/components/{p-UhBaEaSb.js.map → p-DRV0Pmhs.js.map} +1 -1
- package/dist/components/p-DTXeHbuh.js +40 -0
- package/dist/components/p-DTXeHbuh.js.map +1 -0
- package/dist/components/p-FdEV2qPo.js +40 -0
- package/dist/components/p-FdEV2qPo.js.map +1 -0
- package/dist/components/p-Ooow0N-g.js +89 -0
- package/dist/components/p-Ooow0N-g.js.map +1 -0
- package/dist/components/p-P28NBglk.js +86 -0
- package/dist/components/p-P28NBglk.js.map +1 -0
- package/dist/components/p-QhOsRYRe.js +163 -0
- package/dist/components/p-QhOsRYRe.js.map +1 -0
- package/dist/components/p-Umz6nJIv.js +40 -0
- package/dist/components/p-Umz6nJIv.js.map +1 -0
- package/dist/components/p-waOPoUcA.js +40 -0
- package/dist/components/p-waOPoUcA.js.map +1 -0
- package/dist/components/polygon-buttons.js +1 -1
- package/dist/components/polygon-information.js +1 -1
- package/dist/components/search-icon.js +1 -1
- package/dist/components/settings-icon.js +1 -1
- package/dist/components/settings-modal.js +1 -1
- package/dist/components/solar-expert.js +23 -21
- package/dist/components/solar-expert.js.map +1 -1
- package/dist/components/solar-system-form.js +1 -1
- package/dist/components/toast-notification.js +1 -1
- package/dist/components/tool-box.js +1 -1
- package/dist/components/tutorial-component.js +1 -1
- package/dist/components/undo-icon.js +1 -1
- package/dist/esm/eraser-icon_19.entry.js +1 -1
- package/dist/esm/{lerc-D1ySec2h.js → lerc-D7wRie33.js} +3 -3
- package/dist/esm/{lerc-D1ySec2h.js.map → lerc-D7wRie33.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-widget.entry.js +2 -2
- package/dist/esm/loading-widget.entry.js.map +1 -1
- package/dist/esm/stencil-library.js +1 -1
- package/dist/stencil-library/loading-widget.entry.esm.js.map +1 -1
- package/dist/stencil-library/{p-ea3fd08c.entry.js → p-05a58ef0.entry.js} +2 -2
- package/dist/stencil-library/{p-r7aBltoS.js → p-CcRwkRDp.js} +4 -4
- package/dist/stencil-library/{p-r7aBltoS.js.map → p-CcRwkRDp.js.map} +1 -1
- package/dist/stencil-library/p-D3ZsxpeN.js +2 -0
- package/dist/stencil-library/p-D3ZsxpeN.js.map +1 -0
- package/dist/stencil-library/p-ab0f2031.entry.js +2 -0
- package/dist/stencil-library/p-ab0f2031.entry.js.map +1 -0
- package/dist/stencil-library/stencil-library.esm.js +1 -1
- package/dist/types/components/map-draw/map-draw.d.ts +1 -4
- package/dist/types/components/map-draw/polygon-information.d.ts +1 -0
- package/dist/types/types/lang.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/p-6t2i7GOy.js +0 -163
- package/dist/components/p-6t2i7GOy.js.map +0 -1
- package/dist/components/p-B2W-WTcd.js +0 -47
- package/dist/components/p-B2W-WTcd.js.map +0 -1
- package/dist/components/p-Bl-OxMMK.js +0 -40
- package/dist/components/p-Bl-OxMMK.js.map +0 -1
- package/dist/components/p-BsvvtnQe.js.map +0 -1
- package/dist/components/p-BzU0ssT8.js +0 -40
- package/dist/components/p-BzU0ssT8.js.map +0 -1
- package/dist/components/p-C241_R3r.js +0 -623
- package/dist/components/p-C241_R3r.js.map +0 -1
- package/dist/components/p-CBoVsYa-.js +0 -40
- package/dist/components/p-CBoVsYa-.js.map +0 -1
- package/dist/components/p-CIfpd0H7.js.map +0 -1
- package/dist/components/p-CuNvbl9l.js +0 -40
- package/dist/components/p-CuNvbl9l.js.map +0 -1
- package/dist/components/p-CuhV6w4i.js +0 -40
- package/dist/components/p-CuhV6w4i.js.map +0 -1
- package/dist/components/p-CwFdd3zn.js +0 -86
- package/dist/components/p-CwFdd3zn.js.map +0 -1
- package/dist/components/p-D3H70xDr.js +0 -40
- package/dist/components/p-D3H70xDr.js.map +0 -1
- package/dist/components/p-DIii3RoN.js +0 -76
- package/dist/components/p-DIii3RoN.js.map +0 -1
- package/dist/components/p-DPHbqum8.js +0 -114
- package/dist/components/p-DPHbqum8.js.map +0 -1
- package/dist/components/p-DXQvpFgv.js +0 -114
- package/dist/components/p-DXQvpFgv.js.map +0 -1
- package/dist/components/p-DnjGygv7.js +0 -89
- package/dist/components/p-DnjGygv7.js.map +0 -1
- package/dist/components/p-DxfT4KzX.js +0 -40
- package/dist/components/p-DxfT4KzX.js.map +0 -1
- package/dist/components/p-gYPKei39.js +0 -40
- package/dist/components/p-gYPKei39.js.map +0 -1
- package/dist/components/p-kbMAsJ_s.js.map +0 -1
- package/dist/stencil-library/p-Tmp2o-vp.js +0 -2
- package/dist/stencil-library/p-Tmp2o-vp.js.map +0 -1
- package/dist/stencil-library/p-c2c69c28.entry.js +0 -2
- package/dist/stencil-library/p-c2c69c28.entry.js.map +0 -1
- /package/dist/stencil-library/{p-ea3fd08c.entry.js.map → p-05a58ef0.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon-information.js","sourceRoot":"","sources":["../../../src/components/map-draw/polygon-information.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAOtD,MAAM,OAAO,kBAAkB;IAE3B,cAAc,CAAU;IAExB,cAAc,CAAqB;IAEnC,mBAAmB,CAAyB;IAE5C,iBAAiB,CAAyB;IAE1C,oBAAoB,CAAa;IAEjC,cAAc,CAAa;IAE3B,WAAW,CAAS;IAEpB,MAAM;QACF,MAAM,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtD,oCAAoC;QAEpC,OAAO,CACH,4DACI,KAAK,EAAC,yEAAyE,EAC/E,KAAK,EAAE;gBACH,MAAM,EAAE,+BAA+B;aAC1C;YAED,4DAAK,KAAK,EAAC,kDAAkD;gBACzD,2DAAI,KAAK,EAAC,wCAAwC,IAC7C,CAAC,CAAC,OAAO,CAAC,WAAW,CACrB;gBACL,wEACI,oBAAoB,EAAE,IAAI,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\r\nimport { Polygon } from \"harmonia-types\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { state } from \"../../store\";\r\nimport { azimuthToCardinal } from \"../../utils/utils\";\r\n\r\n@Component({\r\n tag: \"polygon-information\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class PolygonInformation {\r\n @Prop()\r\n currentPolygon: Polygon;\r\n @Prop()\r\n numberOfPanels: number | undefined;\r\n @Prop()\r\n handleAzimuthChange: (event: Event) => void;\r\n @Prop()\r\n handlePitchChange: (event: Event) => void;\r\n @Prop()\r\n calculateSolarPanels: () => void;\r\n @Prop()\r\n markAsFlatRoof: () => void;\r\n @Prop()\r\n currentTool: string;\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n // console.log(this.currentPolygon);\r\n\r\n return (\r\n <div\r\n class=\"flex gap-4 flex-row justify-center items-center w-full rounded-4xl pb-2\"\r\n style={{\r\n border: \"1px solid var(--color-border)\",\r\n }}\r\n >\r\n <div class=\"w-full bg-primary rounded-4xl p-3 text-secondary\">\r\n <h3 class=\"text-lg font-semibold mb-4 text-center\">\r\n {t.mapDraw.information}\r\n </h3>\r\n <polygon-buttons\r\n calculateSolarPanels={this.calculateSolarPanels}\r\n markAsFlatRoof={this.markAsFlatRoof}\r\n currentTool={this.currentTool}\r\n />\r\n {this.currentPolygon?.area\r\n ? (\r\n <div class=\"space-y-4\">\r\n <div>\r\n <div class=\"grid grid-cols-2 gap-2\">\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.area}\r\n </h4>\r\n <p class=\"text-lg\">\r\n {this.currentPolygon\r\n ?.area\r\n .toFixed(2)} m²\r\n </p>\r\n </div>\r\n <div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.panels}\r\n </h4>\r\n <p class=\"text-lg\">\r\n {this.numberOfPanels ?? 0}\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.azimuth}\r\n </h4>\r\n <div class=\"flex gap-2 flex-row justify-start bg-muted rounded-4xl p-2\">\r\n <input\r\n class=\"text-lg w-full\"\r\n onKeyDown={(e) => {\r\n if (e.key === \"Enter\") {\r\n this.handleAzimuthChange(\r\n e,\r\n );\r\n (e.target as HTMLInputElement)\r\n .blur();\r\n }\r\n }}\r\n value={this.currentPolygon\r\n ?.azimuth ?? 0}\r\n />\r\n ({azimuthToCardinal(\r\n this.currentPolygon.azimuth,\r\n )})\r\n </div>\r\n {!state.isIOS && (\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"360\"\r\n class=\"input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted\"\r\n value={this.currentPolygon\r\n ?.azimuth ?? 0}\r\n onInput={(e) => {\r\n this.handleAzimuthChange(e);\r\n }}\r\n />\r\n )}\r\n </div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted pl-2\">\r\n {t.mapDraw.pitch}\r\n </h4>\r\n <div class=\"flex gap-2 flex-row justify-start bg-muted rounded-4xl p-2\">\r\n <input\r\n class=\"text-lg w-full\"\r\n onKeyDown={(e) => {\r\n if (e.key === \"Enter\") {\r\n this.handlePitchChange(\r\n e,\r\n );\r\n (e.target as HTMLInputElement)\r\n .blur();\r\n }\r\n }}\r\n value={this.currentPolygon\r\n ?.pitch ?? 0}\r\n />\r\n °\r\n </div>\r\n {!state.isIOS && (\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"90\"\r\n class=\"input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted\"\r\n value={this.currentPolygon\r\n ?.pitch ?? 0}\r\n onInput={(e) => {\r\n this.handlePitchChange(e);\r\n }}\r\n />\r\n )}\r\n </div>\r\n </div>\r\n )\r\n : (\r\n <p class=\"text-text-secondary text-center\">\r\n {t.mapDraw.noPolygonSelected}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"polygon-information.js","sourceRoot":"","sources":["../../../src/components/map-draw/polygon-information.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAOtD,MAAM,OAAO,kBAAkB;IAE3B,cAAc,CAAU;IAExB,cAAc,CAAqB;IAEnC,mBAAmB,CAAyB;IAE5C,iBAAiB,CAAyB;IAE1C,oBAAoB,CAAa;IAEjC,cAAc,CAAa;IAE3B,WAAW,CAAS;IAEZ,iBAAiB,CAAC,OAAe;QACrC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;IAC5C,CAAC;IAED,MAAM;QACF,MAAM,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtD,oCAAoC;QAEpC,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AI,CAAC,KAAK,CACb,IAAI,CAAC,cAAc;wCACf,EAAE,KAAK;wCACP,CAAC,CACR,EACD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;wCACX,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;oCAC9B,CAAC,GACH,CACL,CACC,CACJ,CACJ,CACT;oBACD,CAAC,CAAC,CACE,SAAG,KAAK,EAAC,iCAAiC,IACrC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAC5B,CACP,CACH,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\r\nimport { Polygon } from \"harmonia-types\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { state } from \"../../store\";\r\nimport { azimuthToCardinal } from \"../../utils/utils\";\r\n\r\n@Component({\r\n tag: \"polygon-information\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class PolygonInformation {\r\n @Prop()\r\n currentPolygon: Polygon;\r\n @Prop()\r\n numberOfPanels: number | undefined;\r\n @Prop()\r\n handleAzimuthChange: (event: Event) => void;\r\n @Prop()\r\n handlePitchChange: (event: Event) => void;\r\n @Prop()\r\n calculateSolarPanels: () => void;\r\n @Prop()\r\n markAsFlatRoof: () => void;\r\n @Prop()\r\n currentTool: string;\r\n\r\n private getDisplayAzimuth(azimuth: number): number {\r\n return (Math.round(azimuth) + 90) % 360;\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n // console.log(this.currentPolygon);\r\n\r\n return (\r\n <div\r\n class=\"flex gap-4 flex-row justify-center items-center w-full rounded-4xl pb-2\"\r\n style={{\r\n border: \"1px solid var(--color-border)\",\r\n }}\r\n >\r\n <div class=\"w-full bg-primary rounded-4xl p-3 text-secondary\">\r\n <h3 class=\"text-lg font-semibold mb-4 text-center\">\r\n {t.mapDraw.information}\r\n </h3>\r\n <polygon-buttons\r\n calculateSolarPanels={this.calculateSolarPanels}\r\n markAsFlatRoof={this.markAsFlatRoof}\r\n currentTool={this.currentTool}\r\n />\r\n {this.currentPolygon?.area\r\n ? (\r\n <div class=\"space-y-4\">\r\n <div>\r\n <div class=\"grid grid-cols-2 gap-2\">\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.area}\r\n </h4>\r\n <p class=\"text-lg\">\r\n {this.currentPolygon\r\n ?.area\r\n .toFixed(0)} m²\r\n </p>\r\n </div>\r\n <div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.panels}\r\n </h4>\r\n <p class=\"text-lg\">\r\n {this.numberOfPanels ?? 0}\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.azimuth}\r\n </h4>\r\n <div class=\"flex gap-2 flex-row justify-start bg-muted rounded-4xl p-2\">\r\n <input\r\n class=\"text-lg w-full\"\r\n onKeyDown={(e) => {\r\n if (e.key === \"Enter\") {\r\n this.handleAzimuthChange(\r\n e,\r\n );\r\n (e.target as HTMLInputElement)\r\n .blur();\r\n }\r\n }}\r\n value={this.getDisplayAzimuth(\r\n this.currentPolygon\r\n ?.azimuth ??\r\n 0,\r\n )}\r\n />\r\n ({azimuthToCardinal(\r\n this.getDisplayAzimuth(\r\n this.currentPolygon.azimuth,\r\n ),\r\n )})\r\n </div>\r\n {!state.isIOS && (\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"360\"\r\n step=\"1\"\r\n class=\"input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted\"\r\n value={this.getDisplayAzimuth(\r\n this.currentPolygon\r\n ?.azimuth ??\r\n 0,\r\n )}\r\n onInput={(e) => {\r\n this.handleAzimuthChange(e);\r\n }}\r\n />\r\n )}\r\n </div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted md:pl-2\">\r\n {t.mapDraw.pitch}\r\n </h4>\r\n <div class=\"flex gap-2 flex-row justify-start bg-muted rounded-4xl p-2\">\r\n <input\r\n class=\"text-lg w-full\"\r\n onKeyDown={(e) => {\r\n if (e.key === \"Enter\") {\r\n this.handlePitchChange(\r\n e,\r\n );\r\n (e.target as HTMLInputElement)\r\n .blur();\r\n }\r\n }}\r\n value={Math.round(\r\n this.currentPolygon\r\n ?.pitch ??\r\n 0,\r\n )}\r\n />\r\n °\r\n </div>\r\n {!state.isIOS && (\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"90\"\r\n step=\"1\"\r\n class=\"input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted\"\r\n value={Math.round(\r\n this.currentPolygon\r\n ?.pitch ??\r\n 0,\r\n )}\r\n onInput={(e) => {\r\n this.handlePitchChange(e);\r\n }}\r\n />\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n : (\r\n <p class=\"text-text-secondary text-center\">\r\n {t.mapDraw.noPolygonSelected}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -9,7 +9,7 @@ export class ToolBox {
|
|
|
9
9
|
render() {
|
|
10
10
|
const t = getLanguageStrings(state.settings.language);
|
|
11
11
|
const undoToolStrings = t.mapDraw.tools[undoTool.name];
|
|
12
|
-
return (h("div", { key: '
|
|
12
|
+
return (h("div", { key: 'e94d293934925254e8113349f12d9a5e22e0cbdb', class: "flex gap-1 sm:gap-4 rounded-4xl bg-primary pt-3 pl-3 pr-3 flex-wrap justify-center w-full text-xs" }, tools.map((tool) => {
|
|
13
13
|
const toolStrings = t.mapDraw.tools[tool.name];
|
|
14
14
|
return (h("button", { class: `px-3 py-2 rounded-4xl transition-colors duration-200 ${this.currentTool.name === tool.name
|
|
15
15
|
? "bg-secondary hover:bg-secondary/80"
|
|
@@ -19,9 +19,9 @@ export class ToolBox {
|
|
|
19
19
|
: "var(--color-primary-foreground)",
|
|
20
20
|
border: "1px solid var(--color-border)",
|
|
21
21
|
}, "aria-label": toolStrings.ariaLabel, title: toolStrings.explanation, onClick: () => this.onToolSelect(tool) }, h("div", { class: "flex items-center gap-1 flex-col" }, h("icon-selector", { name: tool.icon }), h("span", null, toolStrings.name))));
|
|
22
|
-
}), h("button", { key: '
|
|
22
|
+
}), h("button", { key: '500a34954e8d1ae4d2ab2083881287700db8cdd0', class: `px-3 py-2 rounded-4xl transition-colors duration-200 bg-primary hover:bg-muted text-primary-foreground focus:border-2 focus:border-secondary`, style: {
|
|
23
23
|
border: "1px solid var(--color-border)",
|
|
24
|
-
}, "aria-label": undoToolStrings.ariaLabel, title: undoToolStrings.explanation, onClick: () => this.undoCallback() }, h("div", { key: '
|
|
24
|
+
}, "aria-label": undoToolStrings.ariaLabel, title: undoToolStrings.explanation, onClick: () => this.undoCallback() }, h("div", { key: '9969b9c6385c876ea285c74161da6b4968c60137', class: "flex items-center gap-1 flex-col" }, h("undo-icon", { key: '1ec057295769ee14cb4d230c2b9938bd5a698e69' }), h("span", { key: '902320295d8d8a27ac95608cda564f6b193a43f2' }, undoToolStrings.name)))));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "tool-box"; }
|
|
27
27
|
static get originalStyleUrls() {
|
|
@@ -45,11 +45,11 @@ export class TutorialComponent {
|
|
|
45
45
|
const tutorialDescription = this.description ||
|
|
46
46
|
t.mapDraw.tutorial.description;
|
|
47
47
|
const videoSrc = this.videoSource || "/assets/videos/tutorial1.mp4";
|
|
48
|
-
return (h("div", { key: '
|
|
48
|
+
return (h("div", { key: '4d8eadf62e91dedb62771ea581da55e41fef8ba6', class: "fixed inset-0 z-50 flex items-center justify-center p-4" }, h("div", { key: 'f98a839567a9ea9fd9e4583b129904a544b5815a', class: "absolute inset-0", style: {
|
|
49
49
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
50
|
-
} }), h("div", { key: '
|
|
50
|
+
} }), h("div", { key: 'e454645b2f39aec48b001bc0347ef7043116b59a', class: "relative z-10 w-full max-w-2xl max-h-full overflow-y-auto" }, h("div", { key: '346bc5df81beb2c52ae52e8d08f91f572549ed99', class: "flex flex-col gap-4 bg-primary rounded-4xl p-6" }, h("div", { key: 'ea42d2e74d6c366f020a0278f4c2db4946f91082', class: "w-full text-center space-y-4" }, h("h2", { key: 'a333c82a5893b1ca389486b9b2406ab61bd040b3', class: "text-2xl font-bold text-secondary" }, tutorialTitle), h("p", { key: '1f93f58abb1fed9576f12184cb21c7b5879f5f86', class: "text-text-secondary" }, tutorialDescription)), h("div", { key: '67a59580d90d5e1371d6077e31e283b4aa78e7b6', class: "flex items-start justify-center bg-primary rounded-4xl" }, h("div", { key: '0b323406964ed2a2363d9d5eb06c8739fc49c979', class: "relative flex items-center justify-center rounded-4xl bg-secondary overflow-hidden w-64 h-64" }, this.isLoading && (h("div", { key: '5d7db35fd3798ddf92e6a7d35cd69c9d1fd9ecb0', class: "absolute inset-0 flex items-center justify-center z-10" }, h("span", { key: '34d8524c3ec0a8c7ea90baa2cb0848d6ad649c21', class: "text-text-secondary" }, t.mapDraw.loading, ".".repeat(this.dotCount)))), h("video", { key: '9d936982efbfe0be018b29b3f14c235841847b5d', class: "w-full h-full object-contain rounded-4xl pointer-events-none", autoplay: true, muted: true, loop: true, playsinline: true, onLoadStart: this.handleVideoLoadStart, onCanPlay: this.handleVideoCanPlay, style: {
|
|
51
51
|
aspectRatio: "1/1",
|
|
52
|
-
} }, h("source", { key: '
|
|
52
|
+
} }, h("source", { key: '4c7a97c3cbf02eefb40aa05da6fa0abd716fa6ab', src: videoSrc, type: "video/mp4" }), "Your browser does not support the video tag."))), h("div", { key: 'ebad42931128c694d7ddfbd9908dc5ef27e7e649', class: "w-full flex justify-center" }, h("button", { key: 'ec11a758e0ff9bd6ae728a857d03a8bbba77bbcd', onClick: this.handleCloseTutorial, class: "px-6 py-3 bg-tertiary text-white rounded-lg font-medium hover:bg-tertiary/80 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-tertiary focus:ring-offset-0" }, t.mapDraw.tutorial.understood))))));
|
|
53
53
|
}
|
|
54
54
|
static get is() { return "tutorial-component"; }
|
|
55
55
|
static get originalStyleUrls() {
|
|
@@ -31,14 +31,14 @@ export class SettingsModal {
|
|
|
31
31
|
};
|
|
32
32
|
render() {
|
|
33
33
|
const t = getLanguageStrings(state.settings.language);
|
|
34
|
-
return (h("div", { key: '
|
|
35
|
-
.value) }, h("option", { key: '
|
|
36
|
-
"en" }, "English"), h("option", { key: '
|
|
37
|
-
"es" }, "Espa\u00F1ol"), h("option", { key: '
|
|
38
|
-
"de" }, "Deutsch"))), h("div", { key: '
|
|
39
|
-
.value)) })), h("div", { key: '
|
|
40
|
-
.value)) })), h("div", { key: '
|
|
41
|
-
.value)) }))), h("div", { key: '
|
|
34
|
+
return (h("div", { key: 'f8adde9c8ec92d9d2caca001d4358b18ef6dcf22', class: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50" }, h("div", { key: 'f86948becd9cbb35699cc7cdb1b740c61c5a92be', class: "bg-primary rounded-4xl p-6 w-full max-w-md" }, h("div", { key: 'dc629294bd72ac8793437f088db6ead138444389', class: "flex justify-between items-center mb-6" }, h("h2", { key: '5275b04e13886fde9ad977e44098e915fe6702c0', class: "text-xl font-semibold" }, "Settings"), h("button", { key: 'd0954c45456b41892e6511490c70bcb23bc27e78', class: "p-2 hover:bg-hover rounded-full transition-colors", onClick: this.handleClose }, h("svg", { key: 'e173c9534276c991321515f0aa167431b0f0608a', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("line", { key: '8975863f8837563fc49f9f0cb5efa733503b6992', x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { key: 'c6b7e15639ad9ff113c1357f42078eb8f11a17f8', x1: "6", y1: "6", x2: "18", y2: "18" })))), h("div", { key: '2fd90d727eb23c803e1dc8bac4143d41e3e2bde1', class: "space-y-4" }, h("div", { key: '7f866dc7351eee4483286c97406648f9c41a995a' }, h("h3", { key: '5f67f8e1f8c1d2998a7a4a463b6166095ebf35e9', class: "text-sm font-medium text-text-muted mb-1" }, "Debug Information"), h("p", { key: 'f7d22c9b296bbd68d08053642210c41993b54a04', class: "text-sm text-text-muted mb-1" }, "state: ", JSON.stringify(state, null, 2)), h("p", { key: '2ba352667ead4c79194688088afaf48e82e8b88f', class: "text-sm text-text-muted mb-1" }, navigator.userAgent), h("p", { key: 'ee8418f9442c9f0fb8b526bced2787321304e243', class: "text-sm text-text-muted mb-1" }, navigator.userAgent.indexOf("Safari")), h("p", { key: '928da60fdd93e326f3b0c6233228d0ecb0b7461f', class: "text-sm text-text-muted mb-1" }, "maxTouchPoints: ", navigator.maxTouchPoints), h("p", { key: '27d8913514c45e44a607a97538dc47a1754a1263', class: "text-sm text-text-muted mb-1" }, "iPhone: ", navigator.userAgent.indexOf("iPhone")), h("p", { key: 'ad0155fff5ee858cb338661cf4039c97381029d1', class: "text-sm text-text-muted mb-1" }, "Mac OS: ", navigator.userAgent.indexOf("Mac OS"))), h("div", { key: 'bab9021c0c22ab656b75ea5ea3321dd45ba209b0' }, h("label", { key: '1411e069e5acf902f960c9130b06e862ff53685f', class: "block text-sm font-medium text-text-muted mb-1" }, t.settings.language), h("select", { key: '0312d7334c9f7bb619a7480d0776cba287fb580d', class: "w-full bg-muted rounded-4xl p-2", onInput: (e) => this.handleInputChange("language", e.target
|
|
35
|
+
.value) }, h("option", { key: 'cd80c13fa677be9ca05690f576b1efb1c433f269', value: "en", selected: this.tempSettings.language ===
|
|
36
|
+
"en" }, "English"), h("option", { key: '874acf8419b05629157f6467faad007be40c0de8', value: "es", selected: this.tempSettings.language ===
|
|
37
|
+
"es" }, "Espa\u00F1ol"), h("option", { key: '489d41d87fcbdfce1f4dd7f436e5015ddce75681', value: "de", selected: this.tempSettings.language ===
|
|
38
|
+
"de" }, "Deutsch"))), h("div", { key: '1cf1f983c2f49d3df1642667c93e637277cca1d1' }, h("label", { key: '858efaf32c6d82f2e4aa89437d8fd6f123f357d8', class: "block text-sm font-medium text-text-muted mb-1" }, t.settings.rowSpacing), h("input", { key: '17b7e31de97cd5c2f5c6f4e57f8fd565b093fda9', type: "number", class: "w-full bg-muted rounded-4xl p-2", value: this.tempSettings.rowSpacing, onInput: (e) => this.handleInputChange("rowSpacing", parseFloat(e.target
|
|
39
|
+
.value)) })), h("div", { key: '527179b5c712ec4d6b3994e6fb961a3a7b630c07' }, h("label", { key: 'f6f0654291f3b1c30b213da3c788e2dc46ca0621', class: "block text-sm font-medium text-text-muted mb-1" }, t.settings.columnSpacing), h("input", { key: 'e9fd2507ad7b1be2571effeef376599acc70898e', type: "number", class: "w-full bg-muted rounded-4xl p-2", value: this.tempSettings.columnSpacing, onInput: (e) => this.handleInputChange("columnSpacing", parseFloat(e.target
|
|
40
|
+
.value)) })), h("div", { key: '57b0482cec138051d14c79150a6abd706af9b087' }, h("label", { key: '0cd3d56a354a4da3d5612ceec5b681b3fb0b8957', class: "block text-sm font-medium text-text-muted mb-1" }, t.settings.borderInset), h("input", { key: '596eb5aa465a8dedf0b230c426639720574654a9', type: "number", class: "w-full bg-muted rounded-4xl p-2", value: this.tempSettings.borderInset, onInput: (e) => this.handleInputChange("borderInset", parseFloat(e.target
|
|
41
|
+
.value)) }))), h("div", { key: '7cda03ddb1ddbd7c0fc665b3163435622a97d6fd', class: "flex justify-end gap-4 mt-6" }, h("button", { key: '599f77090826bf664ab39137237542ece58aa5fd', class: "px-4 py-2 bg-surface rounded-4xl hover:bg-surface-hover transition-colors", onClick: this.handleClose }, "Cancel"), h("button", { key: 'c1c8b7ff81aea710e265bdab96c9bd4e5f0e1dac', class: "px-4 py-2 bg-secondary text-muted rounded-4xl hover:bg-text-secondary transition-colors", onClick: this.handleSave }, "Save Changes")))));
|
|
42
42
|
}
|
|
43
43
|
static get is() { return "settings-modal"; }
|
|
44
44
|
static get originalStyleUrls() {
|
|
@@ -101,6 +101,8 @@ export class SolarExpert {
|
|
|
101
101
|
return;
|
|
102
102
|
this.autocomplete = new places.Autocomplete(this.inputElement);
|
|
103
103
|
this.autocomplete.addListener("place_changed", () => {
|
|
104
|
+
state.latitude = null;
|
|
105
|
+
state.longitude = null;
|
|
104
106
|
const place = this.autocomplete?.getPlace();
|
|
105
107
|
this.latitude = place?.geometry?.location?.lat() ?? 0;
|
|
106
108
|
this.longitude = place?.geometry?.location?.lng() ?? 0;
|
|
@@ -121,7 +123,7 @@ export class SolarExpert {
|
|
|
121
123
|
}
|
|
122
124
|
render() {
|
|
123
125
|
const t = getLanguageStrings(this.language);
|
|
124
|
-
return (h("div", { key: '
|
|
126
|
+
return (h("div", { key: '550ceedbc1a7e5f71f2fdea4ab2066080ca55bee', class: "flex flex-col w-full h-full p-3 m-auto", id: "solar-calculator" }, this.showMapSelector
|
|
125
127
|
? (h("map-selector", { "api-key": this.apiKey, language: this.language }))
|
|
126
128
|
: (h(h.Fragment, null, h("div", { class: "pb-2 flex flex-col sm:flex-row gap-2 sm:gap-4 items-stretch w-full" }, h("div", { class: "relative flex-1 sm:flex-3" }, h("div", { class: "absolute left-3 top-0 h-full flex items-center text-muted-foreground pointer-events-none" }, h("search-icon", null)), h("input", { ref: (el) => this.inputElement = el, type: "text", placeholder: t.solarExpert
|
|
127
129
|
.searchPlaceholder, class: "w-full pl-10 pr-4 py-2 border border-border rounded-4xl focus:ring-secondary bg-muted text-muted-foreground h-full" })), h("button", { onClick: () => this.handleChooseOnMap(), class: "flex-1 pl-4 pr-4 py-2 border border-border bg-muted rounded-4xl focus:ring-secondary hover:bg-surface-hover" }, t.mapSelector.chooseOnMap)), (state.latitude === null ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solar-expert.js","sourceRoot":"","sources":["../../../src/components/solar-expert/solar-expert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAe,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAQ5E,MAAM,OAAO,WAAW;IAEpB,EAAE,CAAe;IAGjB,MAAM,GAAW,GAAG,CAAC,mBAAmB,CAAC;IAEzC,QAAQ,GAAa,IAAI,CAAC;IAE1B,WAAW,GAAgC,IAAI,CAAC;IAChD,IAAI;IACJ,iCAAiC;IACjC,mCAAmC;IACnC,kCAAkC;IAClC,+BAA+B;IAC/B,+BAA+B;IAC/B,yCAAyC;IACzC,uCAAuC;IACvC,iCAAiC;IACjC,oCAAoC;IACpC,2CAA2C;IAC3C,6CAA6C;IAC7C,4CAA4C;IAC5C,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0F;4BACjG,sBAAe,CACb;wBACN,aACI,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,EACnC,IAAI,EAAC,MAAM,EACX,WAAW,EAAE,CAAC,CAAC,WAAW;iCACrB,iBAAiB,EACtB,KAAK,EAAC,oHAAoH,GAC5H,CACA;oBACN,cACI,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,EACvC,KAAK,EAAC,6GAA6G,IAElH,CAAC,CAAC,WAAW,CAAC,WAAW,CACrB,CACP;gBACL,CAAC,KAAK,CAAC,QAAQ,KAAK,IAAI;oBACrB,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC,IAAI,CAC7B,WAAK,KAAK,EAAC,aAAa;oBACpB,SAAG,KAAK,EAAC,2FAA2F,IAC/F,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAC5B,CACF,CACT;gBACD,gBACI,MAAM,EAAE,IAAI,CAAC,MAAM,GACrB,CACH,CACN,CACH,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Element, Env, h, Prop, State, Watch } from \"@stencil/core\";\r\nimport { Loader } from \"@googlemaps/js-api-loader\";\r\nimport { Language } from \"../../types/lang\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { onChange, state } from \"../../store\";\r\nimport { ColorScheme, DEFAULT_COLOR_SCHEME } from \"../../config\";\r\nimport { applyThemeGlobally, applyThemeToElement } from \"../../utils/theme\";\r\n\r\n@Component({\r\n tag: \"solar-expert\",\r\n shadow: false,\r\n styleUrl: \"../../output.css\",\r\n assetsDirs: [\"assets\"],\r\n})\r\nexport class SolarExpert {\r\n @Element()\r\n el!: HTMLElement;\r\n\r\n @Prop()\r\n apiKey: string = Env.GOOGLE_MAPS_API_KEY;\r\n @Prop()\r\n language: Language = \"en\";\r\n @Prop()\r\n colorScheme: Partial<ColorScheme> | null = null;\r\n // {\r\n // primary: \"hsl(0 0% 100%)\",\r\n // secondary: \"hsl(0 0% 100%)\",\r\n // tertiary: \"hsl(0 0% 100%)\",\r\n // muted: \"hsl(0 0% 100%)\",\r\n // error: \"hsl(0 0% 100%)\",\r\n // // secondary: \"hsl(180 100% 25%)\",\r\n // // tertiary: \"hsl(24 100% 18%)\",\r\n // // muted: \"hsl(0 0% 85%)\",\r\n // // error: \"hsl(240 75% 29%)\",\r\n // primaryForeground: \"hsl(0 0% 100%)\",\r\n // secondaryForeground: \"hsl(0 0% 100%)\",\r\n // tertiaryForeground: \"hsl(0 0% 100%)\",\r\n // mutedForeground: \"hsl(0 0% 100%)\",\r\n // errorForeground: \"hsl(0 0% 100%)\",\r\n // surface: \"hsl(0 0% 100%)\",\r\n // surfaceHover: \"hsl(0 0% 100%)\",\r\n // surfaceActive: \"hsl(0 0% 100%)\",\r\n // // Text colors\r\n // textMuted: \"hsl(0 0% 100%)\",\r\n // textSecondary: \"hsl(0 0% 100%)\",\r\n // textPlaceholder: \"hsl(0 0% 100%)\",\r\n // // Border colors\r\n // border: \"hsl(0 0% 100%)\",\r\n // borderLight: \"hsl(0 0% 100%)\",\r\n // // Status colors\r\n // success: \"hsl(0 0% 100%)\",\r\n // info: \"hsl(0 0% 100%)\",\r\n // // Interactive colors\r\n // hover: \"hsl(0 0% 100%)\",\r\n // hoverDark: \"hsl(0 0% 100%)\",\r\n // overlay: \"hsl(0 0% 100%)\",\r\n // tooltip: \"hsl(0 0% 100%)\",\r\n // };\r\n\r\n @State()\r\n latitude: number | null = 40.581614;\r\n @State()\r\n longitude: number | null = -4.128423;\r\n @State()\r\n isLoaded: boolean = false;\r\n @State()\r\n autocomplete: google.maps.places.Autocomplete | null = null;\r\n @State()\r\n place: google.maps.places.PlaceResult | null = null;\r\n @State()\r\n showMapSelector: boolean = false;\r\n\r\n private inputElement?: HTMLInputElement;\r\n\r\n componentWillLoad() {\r\n state.isMobile =\r\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i\r\n .test(navigator.userAgent) || window.innerWidth < 768;\r\n this.loadGoogleMapsScript();\r\n onChange(\"latitude\", () => {\r\n if (this.showMapSelector) {\r\n this.showMapSelector = false;\r\n this.scrollToMapDraw();\r\n }\r\n });\r\n state.settings.language = this.language;\r\n\r\n const isIPhone = navigator.userAgent.indexOf(\"iPhone\") != -1;\r\n const isMac = navigator.userAgent.indexOf(\"Mac OS\") != -1;\r\n\r\n state.isIOS = isIPhone || isMac;\r\n if (!this.colorScheme) {\r\n applyThemeToElement(this.el, DEFAULT_COLOR_SCHEME);\r\n applyThemeGlobally(DEFAULT_COLOR_SCHEME);\r\n }\r\n this.applyTheme();\r\n }\r\n\r\n @Watch(\"colorScheme\")\r\n colorSchemeChanged() {\r\n this.applyTheme();\r\n }\r\n\r\n private applyTheme() {\r\n if (this.colorScheme) {\r\n // Apply theme globally for non-shadow components\r\n applyThemeGlobally(this.colorScheme);\r\n // Apply theme to this component's Shadow DOM host element\r\n applyThemeToElement(this.el, this.colorScheme);\r\n }\r\n }\r\n\r\n private async loadGoogleMapsScript() {\r\n try {\r\n const loader = new Loader({\r\n apiKey: this.apiKey,\r\n libraries: [\"places\", \"maps\", \"marker\"],\r\n });\r\n\r\n const places = await loader.importLibrary(\"places\");\r\n this.isLoaded = true;\r\n this.initializeAutocomplete(places);\r\n } catch (error) {\r\n console.error(\"Error loading Google Maps: \", error);\r\n }\r\n }\r\n\r\n private initializeAutocomplete(\r\n places: google.maps.PlacesLibrary,\r\n ) {\r\n if (!this.inputElement || !this.isLoaded) return;\r\n this.autocomplete = new places.Autocomplete(this.inputElement);\r\n\r\n this.autocomplete.addListener(\"place_changed\", () => {\r\n const place = this.autocomplete?.getPlace();\r\n this.latitude = place?.geometry?.location?.lat() ?? 0;\r\n this.longitude = place?.geometry?.location?.lng() ?? 0;\r\n state.latitude = this.latitude;\r\n state.longitude = this.longitude;\r\n state.location = place?.name ?? null;\r\n\r\n this.scrollToMapDraw();\r\n });\r\n }\r\n\r\n private scrollToMapDraw() {\r\n const mapDrawElement = this.el.querySelector(\"map-draw\");\r\n if (mapDrawElement) {\r\n mapDrawElement.scrollIntoView({ behavior: \"smooth\" });\r\n }\r\n }\r\n\r\n private handleChooseOnMap() {\r\n this.showMapSelector = true;\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(this.language);\r\n return (\r\n <div\r\n class=\"flex flex-col w-full h-full p-3 m-auto\"\r\n id=\"solar-calculator\"\r\n >\r\n {this.showMapSelector\r\n ? (\r\n <map-selector\r\n api-key={this.apiKey}\r\n language={this.language}\r\n />\r\n )\r\n : (\r\n <>\r\n <div class=\"pb-2 flex flex-col sm:flex-row gap-2 sm:gap-4 items-stretch w-full\">\r\n <div class=\"relative flex-1 sm:flex-3\">\r\n <div class=\"absolute left-3 top-0 h-full flex items-center text-muted-foreground pointer-events-none\">\r\n <search-icon />\r\n </div>\r\n <input\r\n ref={(el) => this.inputElement = el}\r\n type=\"text\"\r\n placeholder={t.solarExpert\r\n .searchPlaceholder}\r\n class=\"w-full pl-10 pr-4 py-2 border border-border rounded-4xl focus:ring-secondary bg-muted text-muted-foreground h-full\"\r\n />\r\n </div>\r\n <button\r\n onClick={() => this.handleChooseOnMap()}\r\n class=\"flex-1 pl-4 pr-4 py-2 border border-border bg-muted rounded-4xl focus:ring-secondary hover:bg-surface-hover\"\r\n >\r\n {t.mapSelector.chooseOnMap}\r\n </button>\r\n </div>\r\n {(state.latitude === null ||\r\n state.longitude === null) && (\r\n <div class=\"w-full pb-2\">\r\n <p class=\"text-text-muted text-center flex items-center justify-center rounded-4xl px-4 py-2 w-full\">\r\n {t.mapDraw.noAddressSelected}\r\n </p>\r\n </div>\r\n )}\r\n <map-draw\r\n apiKey={this.apiKey}\r\n />\r\n </>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|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C,6GAA6G,IAElH,CAAC,CAAC,WAAW,CAAC,WAAW,CACrB,CACP;gBACL,CAAC,KAAK,CAAC,QAAQ,KAAK,IAAI;oBACrB,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC,IAAI,CAC7B,WAAK,KAAK,EAAC,aAAa;oBACpB,SAAG,KAAK,EAAC,2FAA2F,IAC/F,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAC5B,CACF,CACT;gBACD,gBACI,MAAM,EAAE,IAAI,CAAC,MAAM,GACrB,CACH,CACN,CACH,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Element, Env, h, Prop, State, Watch } from \"@stencil/core\";\r\nimport { Loader } from \"@googlemaps/js-api-loader\";\r\nimport { Language } from \"../../types/lang\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { onChange, state } from \"../../store\";\r\nimport { ColorScheme, DEFAULT_COLOR_SCHEME } from \"../../config\";\r\nimport { applyThemeGlobally, applyThemeToElement } from \"../../utils/theme\";\r\n\r\n@Component({\r\n tag: \"solar-expert\",\r\n shadow: false,\r\n styleUrl: \"../../output.css\",\r\n assetsDirs: [\"assets\"],\r\n})\r\nexport class SolarExpert {\r\n @Element()\r\n el!: HTMLElement;\r\n\r\n @Prop()\r\n apiKey: string = Env.GOOGLE_MAPS_API_KEY;\r\n @Prop()\r\n language: Language = \"en\";\r\n @Prop()\r\n colorScheme: Partial<ColorScheme> | null = null;\r\n // {\r\n // primary: \"hsl(0 0% 100%)\",\r\n // secondary: \"hsl(0 0% 100%)\",\r\n // tertiary: \"hsl(0 0% 100%)\",\r\n // muted: \"hsl(0 0% 100%)\",\r\n // error: \"hsl(0 0% 100%)\",\r\n // // secondary: \"hsl(180 100% 25%)\",\r\n // // tertiary: \"hsl(24 100% 18%)\",\r\n // // muted: \"hsl(0 0% 85%)\",\r\n // // error: \"hsl(240 75% 29%)\",\r\n // primaryForeground: \"hsl(0 0% 100%)\",\r\n // secondaryForeground: \"hsl(0 0% 100%)\",\r\n // tertiaryForeground: \"hsl(0 0% 100%)\",\r\n // mutedForeground: \"hsl(0 0% 100%)\",\r\n // errorForeground: \"hsl(0 0% 100%)\",\r\n // surface: \"hsl(0 0% 100%)\",\r\n // surfaceHover: \"hsl(0 0% 100%)\",\r\n // surfaceActive: \"hsl(0 0% 100%)\",\r\n // // Text colors\r\n // textMuted: \"hsl(0 0% 100%)\",\r\n // textSecondary: \"hsl(0 0% 100%)\",\r\n // textPlaceholder: \"hsl(0 0% 100%)\",\r\n // // Border colors\r\n // border: \"hsl(0 0% 100%)\",\r\n // borderLight: \"hsl(0 0% 100%)\",\r\n // // Status colors\r\n // success: \"hsl(0 0% 100%)\",\r\n // info: \"hsl(0 0% 100%)\",\r\n // // Interactive colors\r\n // hover: \"hsl(0 0% 100%)\",\r\n // hoverDark: \"hsl(0 0% 100%)\",\r\n // overlay: \"hsl(0 0% 100%)\",\r\n // tooltip: \"hsl(0 0% 100%)\",\r\n // };\r\n\r\n @State()\r\n latitude: number | null = 40.581614;\r\n @State()\r\n longitude: number | null = -4.128423;\r\n @State()\r\n isLoaded: boolean = false;\r\n @State()\r\n autocomplete: google.maps.places.Autocomplete | null = null;\r\n @State()\r\n place: google.maps.places.PlaceResult | null = null;\r\n @State()\r\n showMapSelector: boolean = false;\r\n\r\n private inputElement?: HTMLInputElement;\r\n\r\n componentWillLoad() {\r\n state.isMobile =\r\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i\r\n .test(navigator.userAgent) || window.innerWidth < 768;\r\n this.loadGoogleMapsScript();\r\n onChange(\"latitude\", () => {\r\n if (this.showMapSelector) {\r\n this.showMapSelector = false;\r\n this.scrollToMapDraw();\r\n }\r\n });\r\n state.settings.language = this.language;\r\n\r\n const isIPhone = navigator.userAgent.indexOf(\"iPhone\") != -1;\r\n const isMac = navigator.userAgent.indexOf(\"Mac OS\") != -1;\r\n\r\n state.isIOS = isIPhone || isMac;\r\n if (!this.colorScheme) {\r\n applyThemeToElement(this.el, DEFAULT_COLOR_SCHEME);\r\n applyThemeGlobally(DEFAULT_COLOR_SCHEME);\r\n }\r\n this.applyTheme();\r\n }\r\n\r\n @Watch(\"colorScheme\")\r\n colorSchemeChanged() {\r\n this.applyTheme();\r\n }\r\n\r\n private applyTheme() {\r\n if (this.colorScheme) {\r\n // Apply theme globally for non-shadow components\r\n applyThemeGlobally(this.colorScheme);\r\n // Apply theme to this component's Shadow DOM host element\r\n applyThemeToElement(this.el, this.colorScheme);\r\n }\r\n }\r\n\r\n private async loadGoogleMapsScript() {\r\n try {\r\n const loader = new Loader({\r\n apiKey: this.apiKey,\r\n libraries: [\"places\", \"maps\", \"marker\"],\r\n });\r\n\r\n const places = await loader.importLibrary(\"places\");\r\n this.isLoaded = true;\r\n this.initializeAutocomplete(places);\r\n } catch (error) {\r\n console.error(\"Error loading Google Maps: \", error);\r\n }\r\n }\r\n\r\n private initializeAutocomplete(\r\n places: google.maps.PlacesLibrary,\r\n ) {\r\n if (!this.inputElement || !this.isLoaded) return;\r\n this.autocomplete = new places.Autocomplete(this.inputElement);\r\n\r\n this.autocomplete.addListener(\"place_changed\", () => {\r\n state.latitude = null;\r\n state.longitude = null;\r\n const place = this.autocomplete?.getPlace();\r\n this.latitude = place?.geometry?.location?.lat() ?? 0;\r\n this.longitude = place?.geometry?.location?.lng() ?? 0;\r\n state.latitude = this.latitude;\r\n state.longitude = this.longitude;\r\n state.location = place?.name ?? null;\r\n\r\n this.scrollToMapDraw();\r\n });\r\n }\r\n\r\n private scrollToMapDraw() {\r\n const mapDrawElement = this.el.querySelector(\"map-draw\");\r\n if (mapDrawElement) {\r\n mapDrawElement.scrollIntoView({ behavior: \"smooth\" });\r\n }\r\n }\r\n\r\n private handleChooseOnMap() {\r\n this.showMapSelector = true;\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(this.language);\r\n return (\r\n <div\r\n class=\"flex flex-col w-full h-full p-3 m-auto\"\r\n id=\"solar-calculator\"\r\n >\r\n {this.showMapSelector\r\n ? (\r\n <map-selector\r\n api-key={this.apiKey}\r\n language={this.language}\r\n />\r\n )\r\n : (\r\n <>\r\n <div class=\"pb-2 flex flex-col sm:flex-row gap-2 sm:gap-4 items-stretch w-full\">\r\n <div class=\"relative flex-1 sm:flex-3\">\r\n <div class=\"absolute left-3 top-0 h-full flex items-center text-muted-foreground pointer-events-none\">\r\n <search-icon />\r\n </div>\r\n <input\r\n ref={(el) => this.inputElement = el}\r\n type=\"text\"\r\n placeholder={t.solarExpert\r\n .searchPlaceholder}\r\n class=\"w-full pl-10 pr-4 py-2 border border-border rounded-4xl focus:ring-secondary bg-muted text-muted-foreground h-full\"\r\n />\r\n </div>\r\n <button\r\n onClick={() => this.handleChooseOnMap()}\r\n class=\"flex-1 pl-4 pr-4 py-2 border border-border bg-muted rounded-4xl focus:ring-secondary hover:bg-surface-hover\"\r\n >\r\n {t.mapSelector.chooseOnMap}\r\n </button>\r\n </div>\r\n {(state.latitude === null ||\r\n state.longitude === null) && (\r\n <div class=\"w-full pb-2\">\r\n <p class=\"text-text-muted text-center flex items-center justify-center rounded-4xl px-4 py-2 w-full\">\r\n {t.mapDraw.noAddressSelected}\r\n </p>\r\n </div>\r\n )}\r\n <map-draw\r\n apiKey={this.apiKey}\r\n />\r\n </>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -122,8 +122,7 @@ export class SolarSystemForm {
|
|
|
122
122
|
this.autonomy = result.autonomy * 100;
|
|
123
123
|
this.totalEnergyConsumption = result.totalEnergyConsumptionDay * 365;
|
|
124
124
|
// Calculate total energy production based on compensation and rate
|
|
125
|
-
this.totalEnergyProduction =
|
|
126
|
-
(result.compensationPerDay / this.compensationRate) * 365;
|
|
125
|
+
this.totalEnergyProduction = result.totalEnergyProduction * 365;
|
|
127
126
|
}
|
|
128
127
|
componentWillLoad() {
|
|
129
128
|
this.updateSystemConfigs();
|
|
@@ -246,13 +245,13 @@ export class SolarSystemForm {
|
|
|
246
245
|
// Reusable style objects
|
|
247
246
|
const borderStyle = { border: "1px solid var(--color-border)" };
|
|
248
247
|
const errorBorderStyle = { border: "1px solid var(--color-error)" };
|
|
249
|
-
return (h("div", { key: '
|
|
248
|
+
return (h("div", { key: '311a75f162c9b3d2bf0b3d4b1f46309404a4a66e', class: "flex flex-col justify-center items-center w-full h-full pt-4" // style={{
|
|
250
249
|
,
|
|
251
250
|
// display: (Object.keys(this.systemConfigs).length === 0)
|
|
252
251
|
// ? "none"
|
|
253
252
|
// : "flex",
|
|
254
253
|
// }}
|
|
255
|
-
id: "solar-system-form" }, h("h1", { key: '
|
|
254
|
+
id: "solar-system-form" }, h("h1", { key: 'db6fea28762915920105844e13a4f0d83a15034a', class: "text-2xl font-bold text-secondary mb-4 w-full" }, t.solarSystemForm.title), h("div", { key: '8f5fd44e0e0636662d4847ad99f695b79dcffb9c', class: "w-full bg-primary rounded-4xl space-y-6" }, h("div", { key: '6e67ca2315b60382e1962c31402c90b185af23d8', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'f68e091bc2b5ddb81cd2c1688f0c1ecfe77d8da9', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.systemInformation), h("div", { key: '8e7e789c7ea7ced4d6dff3fdba3219aa67107670', class: "flex flex-col sm:flex-row gap-4" }, h("div", { key: 'e969707b3b3f33511e8bf2675fc1a0001494d54b', class: "flex-1 bg-muted rounded-4xl p-4 space-y-3" }, h("div", { key: 'e87643a1d0ab7311735d480ebd1b84aef6c7c786', class: "flex items-center justify-between" }, h("label", { key: 'bfe9ceed374b5e9ff960ebc9f5e4d7cd6af3c753', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.numberOfPanels), !this.isIOS()
|
|
256
255
|
? (h("input", { type: "number", class: "w-20 px-3 py-1 rounded-full bg-muted text-muted-foreground text-right", value: this.numberOfPanels, readOnly: true }))
|
|
257
256
|
: (h("input", { type: "number", min: "1", max: this.maxPanels, class: "w-20 px-3 py-1 rounded-full focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground text-center", style: borderStyle, value: this.numberOfPanels, onInput: (e) => {
|
|
258
257
|
const value = parseInt(e.target
|
|
@@ -264,34 +263,34 @@ export class SolarSystemForm {
|
|
|
264
263
|
value;
|
|
265
264
|
this.recalculate();
|
|
266
265
|
}
|
|
267
|
-
} }))), !this.isIOS() && (h("input", { key: '
|
|
266
|
+
} }))), !this.isIOS() && (h("input", { key: 'cc83c205d13a0b5ec5aef34cfd1a60859bbc377a', type: "range", min: "1", max: this.maxPanels, step: "1", class: "input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted", value: this.numberOfPanels, onInput: (e) => {
|
|
268
267
|
this.numberOfPanels = parseInt(e.target
|
|
269
268
|
.value);
|
|
270
269
|
this.recalculate();
|
|
271
|
-
} }))), h("div", { key: '
|
|
272
|
-
this.numberOfPanels).toFixed(1), " kWp"))))), h("div", { key: '
|
|
270
|
+
} }))), h("div", { key: 'f325c5937603ebd211deb1cf3ae017364e296b26', class: "flex-1 bg-muted rounded-4xl p-4" }, h("div", { key: 'a62d362a9145ef8d16adc49f152961d161c4e7e2', class: "flex items-center justify-between" }, h("label", { key: '6931eef558eb8621da14badde66436003f5d12f1', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.panelPeakPower), h("span", { key: 'd72415ae3276ee7dfa5b53e899fc242c907a558f', class: "text-text-muted" }, this.panelPeakPower.toFixed(2), " kW")), h("div", { key: 'a6abf916d0cb7dbe9c31c4aa1b359c4a1fcdc3f5', class: "flex items-center justify-between mt-4" }, h("span", { key: 'bff9b4cd1fbcfd048ae9396e991e0c8a196616bc', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.totalSystemPeakPower), h("span", { key: '7838d7af86c7ecb57aaa8c503991024772ccdf54', class: "font-bold text-text-muted" }, (DEFAULT_SOLAR_PANEL_TYPE.kWattPeak *
|
|
271
|
+
this.numberOfPanels).toFixed(1), " kWp"))))), h("div", { key: 'd9c706b013801443a5b817e0e02630f9cee9cbab', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'afb88035523779fbc5de4756249ba92dbddef200', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.householdConsumptionTitle), h("div", { key: '98c8e30e7e585c5a247be0e686f792724d4b7bfe', class: "grid grid-rows-2 gap-0" }, h("div", { key: '86c02c113b3539c5afb353587d375483ad533f62', class: "grid grid-cols-2 gap-4" }, h("label", { key: '15938439fe3051b67e12c10c021511096e361893', class: "block text-sm font-medium text-text-muted" }, t.solarSystemForm.annualConsumption), h("label", { key: '7541d87d9cbc63c054d5cdbd7b0f7abb27fc9761', class: "block text-sm font-medium text-text-muted" }, t.solarSystemForm.consumptionProfileTitle)), h("div", { key: '38684b748e232d6af285e61ce9a335e10c0d023b', class: "grid grid-cols-2 gap-4" }, h("input", { key: 'cac666a72ba7fe3da002ff7a97eaed6c7995aa20', type: "number", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground", style: borderStyle, value: this.householdConsumption, onInput: (e) => {
|
|
273
272
|
this.householdConsumption = parseInt(e.target
|
|
274
273
|
.value);
|
|
275
274
|
this.recalculate();
|
|
276
|
-
} }), h("select", { key: '
|
|
275
|
+
} }), h("select", { key: 'a2a0c25c560253412736f94a004ee0552faab64e', class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground", style: borderStyle, onChange: (e) => {
|
|
277
276
|
this.consumptionProfile =
|
|
278
277
|
e.target
|
|
279
278
|
.value;
|
|
280
279
|
this.recalculate();
|
|
281
|
-
} }, h("option", { key: '
|
|
280
|
+
} }, h("option", { key: '727866d2da3557657e1bd770a4a4bbb247406dac', value: "mostly_at_home", selected: this.consumptionProfile ===
|
|
282
281
|
"mostly_at_home" }, t.solarSystemForm.consumptionProfiles
|
|
283
|
-
.mostlyAtHome), h("option", { key: '
|
|
282
|
+
.mostlyAtHome), h("option", { key: '8bc3ed0c0ac3770bad515d1f46964e9cd27a8ef3', value: "mostly_away", selected: this.consumptionProfile ===
|
|
284
283
|
"mostly_away" }, t.solarSystemForm.consumptionProfiles
|
|
285
|
-
.mostlyAway))))), h("div", { key: '
|
|
284
|
+
.mostlyAway))))), h("div", { key: '4e44d5396ae94949e8239beeeb7a0a636c2c8472', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: '1727e2228faf014143958328c1e7b538ab0f67f9', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.additionalComponents.title), h("div", { key: '4ff16de6af482a139e9fec5cabf8bc78a7c47f95', class: "flex flex-col gap-4" }, h("div", { key: '27992331cc4fb1c16a1f1328b70c8e4aded0ab92', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: '6150dc9f6abbc97abc0f3e5ae44b2e8602ee42d2', class: "flex items-center justify-between" }, h("div", { key: 'b0e16b75c60a64e2a6a3d309519860fee1d26276', class: "flex items-center gap-2" }, h("input", { key: 'cc63c3fb3857ac03751a316be5707557aa93ff1a', type: "checkbox", id: "heatPump", class: "w-4 h-4 accent-tertiary border-border rounded-full focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.heatPump > 0, onChange: (e) => {
|
|
286
285
|
this.heatPump =
|
|
287
286
|
e.target
|
|
288
287
|
.checked
|
|
289
288
|
? 100
|
|
290
289
|
: 0;
|
|
291
290
|
this.recalculate();
|
|
292
|
-
} }), h("label", { key: '
|
|
291
|
+
} }), h("label", { key: 'c32094e4e1121e9e6085fee481aa293bdef2eec2', htmlFor: "heatPump", class: "text-text-muted" }, t.solarSystemForm
|
|
293
292
|
.additionalComponents
|
|
294
|
-
.heatPump)), (this.heatPump > 0 && !this.isIOS()) && (h("span", { key: '
|
|
293
|
+
.heatPump)), (this.heatPump > 0 && !this.isIOS()) && (h("span", { key: '045bebcf61f9c60665d5093a920914caf3c16e2e', class: "text-text-muted" }, this.heatPump, " m\u00B2"))), this.heatPump > 0 && (h("div", { key: 'd68c70c1134f3efd4319e7ad54d0b7f3b159fd5d', class: "flex flex-col gap-2" }, this.isIOS()
|
|
295
294
|
? (h("div", { class: "flex items-center gap-2" }, h("input", { type: "number", min: "10", max: "300", step: "10", class: "flex-1 px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.heatPump, onInput: (e) => {
|
|
296
295
|
const value = parseInt(e.target
|
|
297
296
|
.value);
|
|
@@ -307,45 +306,45 @@ export class SolarSystemForm {
|
|
|
307
306
|
parseInt(e.target
|
|
308
307
|
.value);
|
|
309
308
|
this.recalculate();
|
|
310
|
-
} }))))), h("div", { key: '
|
|
309
|
+
} }))))), h("div", { key: '3402972a0d31a544bed7bbbf7dbe42299b7b66d5', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: 'b23ef38c61b55df0cb10b1a6ea2091dc9a1c3369', class: "flex items-center justify-between" }, h("div", { key: '9c065d24ba5257de49c4565d5d5c3eff72c98ecf', class: "flex items-center gap-2" }, h("input", { key: '35e60291e50c74722f96b7cb29861dfc9a73695a', type: "checkbox", id: "electricCar", class: "w-4 h-4 accent-tertiary border-border rounded focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.electricCar, onChange: (e) => {
|
|
311
310
|
this.electricCar =
|
|
312
311
|
e.target
|
|
313
312
|
.checked;
|
|
314
313
|
this.recalculate();
|
|
315
|
-
} }), h("label", { key: '
|
|
314
|
+
} }), h("label", { key: 'c07c96918e94336b73627b453d6ebf7df2de752a', htmlFor: "electricCar", class: "text-text-muted" }, t.solarSystemForm
|
|
316
315
|
.additionalComponents
|
|
317
|
-
.electricCar))), this.electricCar && (h("div", { key: '
|
|
316
|
+
.electricCar))), this.electricCar && (h("div", { key: 'c8f52e9a0382fd90beba9161007de12fc68f1243', class: "flex flex-col gap-2" }, h("div", { key: 'c18810ddb896191e91ac1a9ab8d75cbe45a1e34a', class: "grid grid-cols-2 gap-4" }, h("label", { key: '7b6cf7fc61fff0379dae3a3ba6125d2dff648f43', class: "text-sm text-text-muted" }, t.solarSystemForm
|
|
318
317
|
.additionalComponents
|
|
319
|
-
.chargingTime), h("label", { key: '
|
|
318
|
+
.chargingTime), h("label", { key: '6fb22cf041d293e1ca3c9059d8d5f7044dec2e15', class: "text-sm text-text-muted" }, t.solarSystemForm
|
|
320
319
|
.additionalComponents
|
|
321
|
-
.kilometersPerYear)), h("div", { key: '
|
|
320
|
+
.kilometersPerYear)), h("div", { key: '05e1f9a986bd2c7607019ee9c0a83e30f0eef548', class: "grid grid-cols-2 gap-4" }, h("select", { key: '9112adffaa66ab2a8c0432caf76dfd2244de7fa0', class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", onChange: (e) => {
|
|
322
321
|
this.electricCarChargingTime =
|
|
323
322
|
e.target
|
|
324
323
|
.value;
|
|
325
324
|
this.recalculate();
|
|
326
|
-
}, style: borderStyle }, h("option", { key: '
|
|
325
|
+
}, style: borderStyle }, h("option", { key: '67bec333b8a190edc43a90424df590d3abb5024a', value: "day", selected: this
|
|
327
326
|
.electricCarChargingTime ===
|
|
328
327
|
"day" }, t.solarSystemForm
|
|
329
328
|
.additionalComponents
|
|
330
|
-
.chargingTimeDay), h("option", { key: '
|
|
329
|
+
.chargingTimeDay), h("option", { key: 'd996c506dc54d4495fc019fc3191ccd00b515788', value: "night", selected: this
|
|
331
330
|
.electricCarChargingTime ===
|
|
332
331
|
"night" }, t.solarSystemForm
|
|
333
332
|
.additionalComponents
|
|
334
|
-
.chargingTimeNight)), h("input", { key: '
|
|
333
|
+
.chargingTimeNight)), h("input", { key: '5add5ab3deb8d0db82127793ee5dac7fcc4a93b7', type: "number", min: "1000", max: "50000", step: "1000", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", value: this.kmDrivenPerYear, onInput: (e) => {
|
|
335
334
|
this.kmDrivenPerYear =
|
|
336
335
|
parseInt(e.target
|
|
337
336
|
.value);
|
|
338
337
|
this.recalculate();
|
|
339
|
-
}, style: borderStyle }))))), h("div", { key: '
|
|
338
|
+
}, style: borderStyle }))))), h("div", { key: '041fc0246af12eb78111569c884bd20614c37322', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: 'e4ebee64adf842e629e5a1e250cfd65821eb7dbc', class: "flex items-center justify-between" }, h("div", { key: 'dac660c6e7663d4cde45757d2641aef1c0c2b835', class: "flex items-center gap-2" }, h("input", { key: 'db51aab5ce13c52db32f5ff4426bc5876cd26cc6', type: "checkbox", id: "battery", class: "w-4 h-4 accent-tertiary border-border rounded-full focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.battery > 0, onChange: (e) => {
|
|
340
339
|
this.battery =
|
|
341
340
|
e.target
|
|
342
341
|
.checked
|
|
343
342
|
? 5
|
|
344
343
|
: 0;
|
|
345
344
|
this.recalculate();
|
|
346
|
-
} }), h("label", { key: '
|
|
345
|
+
} }), h("label", { key: 'c4178834ed11cd595bbf7a5a33a6c53c24e4b0f0', htmlFor: "battery", class: "text-text-muted" }, t.solarSystemForm
|
|
347
346
|
.additionalComponents
|
|
348
|
-
.battery)), (this.battery > 0 && !this.isIOS()) && (h("span", { key: '
|
|
347
|
+
.battery)), (this.battery > 0 && !this.isIOS()) && (h("span", { key: '8026f5753a7b0ccc9f65b05f8d8ff8ab006cf0e9', class: "text-text-muted" }, this.battery, " kWh"))), this.battery > 0 && (h("div", { key: '331ec7827bae37177faeb3e956086acf954a0d7d', class: "flex flex-col gap-2" }, this.isIOS()
|
|
349
348
|
? (h("div", { class: "flex items-center gap-2" }, h("input", { type: "number", min: "1", max: "20", step: "1", class: "flex-1 px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", value: this.battery, onInput: (e) => {
|
|
350
349
|
const value = parseInt(e.target
|
|
351
350
|
.value);
|
|
@@ -360,52 +359,52 @@ export class SolarSystemForm {
|
|
|
360
359
|
this.battery = parseInt(e.target
|
|
361
360
|
.value);
|
|
362
361
|
this.recalculate();
|
|
363
|
-
} }))))))), h("div", { key: '
|
|
362
|
+
} }))))))), h("div", { key: '4be5a459e2750973741d60888bc4e3c6ab255016', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'c48c733e3431048476ef816b0e5bdd5baeac072c', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.electricityCostsTitle), h("div", { key: '148b904319ff9e37cff886e307925f5ceed5214b', style: {
|
|
364
363
|
display: "grid",
|
|
365
364
|
gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))",
|
|
366
365
|
gap: "1rem",
|
|
367
|
-
} }, h("div", { key: '
|
|
366
|
+
} }, h("div", { key: '44dca317fe36f8b595cd2e0db43a047b79da028d' }, h("label", { key: 'af429b76716c987a36bd80328e7a6cbda115a758', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.electricityPrice), h("input", { key: '69f82fc1bf29d648da35147827934cb954e7c15f', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.electricityPrice.toFixed(2), onInput: (e) => {
|
|
368
367
|
this.electricityPrice = parseFloat(e.target
|
|
369
368
|
.value);
|
|
370
369
|
this.recalculate();
|
|
371
|
-
} })), h("div", { key: '
|
|
370
|
+
} })), h("div", { key: '556e7cac0f6eb84c712f32fb865236c117b0c850' }, h("label", { key: '8c01e4b3617b42e0c08f7c70df0bf6bd5f9a1e36', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.compensationRate), h("input", { key: '40e3f63d65fd85f95fcd872f9a6cec1a6765329c', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.compensationRate.toFixed(2), onInput: (e) => {
|
|
372
371
|
this.compensationRate = parseFloat(e.target
|
|
373
372
|
.value);
|
|
374
373
|
this.recalculate();
|
|
375
|
-
} })), h("div", { key: '
|
|
374
|
+
} })), h("div", { key: '5995e5ebbafe4c5c11c57c4000a6dbe91b06afd6' }, h("label", { key: '0f69d8930ca657fae719a98d042256c91d0cbd46', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.annualPriceIncrease), h("input", { key: '3c8b0670ce258ab44f5af28b94a922d81d32f793', type: "number", step: "0.1", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.annualPriceIncrease.toFixed(1), onInput: (e) => {
|
|
376
375
|
this.annualPriceIncrease = parseFloat(e.target
|
|
377
376
|
.value);
|
|
378
377
|
this.recalculate();
|
|
379
|
-
} })))), h("div", { key: '
|
|
378
|
+
} })))), h("div", { key: '32450c874314588fc2864bf4bc6b659c45767224', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'dfc1a170e86411517c465535077da5c7aacc0c3d', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.resultsTitle), h("div", { key: '464e5e32dbfda19d75f161a4cae4dd854196897a', class: "bg-muted rounded-4xl p-4" }, h("div", { key: '1c7af874a19f1463e8155c8adf678e36a10aadfa', class: "flex flex-col sm:flex-row sm:items-center justify-between" }, h("span", { key: 'caf0cc0319bb343b969e1fb53d25c51c8dd3364c', class: "text-text-muted" }, t.solarSystemForm.autonomy), h("span", { key: 'f103cc8d1d244c4075e8dfb965fae75a128605ee', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.autonomy > 100
|
|
380
379
|
? "100"
|
|
381
|
-
: this.formatEuropeanNumber(this.autonomy, 1), "%")), h("div", { key: '
|
|
382
|
-
.solarSystemForm.year)), h("div", { key: '
|
|
383
|
-
.monetaryBenefit20Years)), h("span", { key: '
|
|
380
|
+
: this.formatEuropeanNumber(this.autonomy, 1), "%")), h("div", { key: '6b315c64fc618a5625bdf18f95807b1810fe7d02', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("span", { key: '4d9622101eaf087b28c8e446071f0dd19b537f82', class: "text-text-muted" }, t.solarSystemForm.totalEnergyConsumption), h("span", { key: '42cb8b45c2a47670a685a55e090a32e33a6ea7e8', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.totalEnergyConsumption, 0), " kWh/", t.solarSystemForm.year)), h("div", { key: 'ad73d33a4744424e62577ca61fe99a07c724a8e7', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("span", { key: 'a10a292f89d2d9b8ae0c53470fdd2a0959db662b', class: "text-text-muted" }, t.solarSystemForm.totalEnergyProduction), h("span", { key: '022d2b3e88a804c0412d199b60092b338cc5a096', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.totalEnergyProduction, 0), " kWh/", t.solarSystemForm.year)), h("div", { key: 'bd2f4c86276c958989c2e9f306b2b3fc9ad11c16', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: 'c23ffe0f98b85a0dc1a12faa81c3e6ed6728326f', class: "flex items-center gap-2" }, h("span", { key: '6bcd71b98de340cd3b963c03c7f81f154a591b0c', class: "text-text-muted" }, t.solarSystemForm.costSavings)), h("span", { key: 'b8a533e06fd8a16af4889a300962a2625dfbb414', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.costSavings), "\u20AC/", t
|
|
381
|
+
.solarSystemForm.year)), h("div", { key: '66b123f86982e0c700485d08145e48d5f11f416a', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: '78d0529ad89f93678fe1770b06bb762e36598c36', class: "flex items-center gap-2" }, h("span", { key: 'bc4c266678fe3d9ba9e74105a39fa1e806afcf11', class: "text-text-muted" }, t.solarSystemForm.compensation20Years)), h("span", { key: '82942abbb9e6c6466a897e3a6d7506a25a6e1cfa', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.compensation20Years), "\u20AC")), h("div", { key: 'b6bbec34158fe9cbee87d0f09137a2eee8413859', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: 'c53e4100aabd7666c31c992d475ceb93e0659bf6', class: "flex items-center gap-2" }, h("span", { key: '17e278b24e677d980bb0ed06b4d70ae9ed4bd43d', class: "text-text-muted" }, t.solarSystemForm
|
|
382
|
+
.monetaryBenefit20Years)), h("span", { key: '04620169c1f1e0d9f06a6a009e041d596102676b', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.savedCosts20Years), "\u20AC")))), h("div", { key: 'a973dd649f27c0a4c465ce62e197e8c1c6923e7c', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'c804251249a2a826d54c6f1ff253b985e52ebf93', class: "text-lg font-semibold text-secondary" }, t.solarSystemForm.requestOffer), h("div", { key: 'cc7ffe567ea55ae096f22574423629523186d849', style: {
|
|
384
383
|
display: "grid",
|
|
385
384
|
gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))",
|
|
386
385
|
gap: "1rem",
|
|
387
|
-
} }, h("div", { key: '
|
|
386
|
+
} }, h("div", { key: '2d484636c1b4d742ea2449ad9dd1c94dd396f324' }, h("label", { key: 'f668d8fd583b87ffc87fc878e90daf97d0065e34', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.name), h("input", { key: 'cf0954936ec766a5721be89c2a8dd1a21495e2da', type: "text", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.nameError
|
|
388
387
|
? errorBorderStyle
|
|
389
388
|
: borderStyle, value: this.name, onInput: (e) => {
|
|
390
389
|
this.name =
|
|
391
390
|
e.target
|
|
392
391
|
.value;
|
|
393
392
|
this.validateForm();
|
|
394
|
-
}, placeholder: "Your name" }), this.nameError && (h("p", { key: '
|
|
393
|
+
}, placeholder: "Your name" }), this.nameError && (h("p", { key: 'e78085692549c91360110eec20dd03ed173030bd', class: "text-error text-sm mt-1" }, this.nameError))), h("div", { key: 'd5fa2f82e546bbaa4516fb83cd91dfde556b7632' }, h("label", { key: '273f77ed86813e4de109a22b5064b0ca18ec7283', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.email), h("input", { key: '6ec96604898b4f1ff0e68c7b0e74e95c67e91a33', type: "email", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.emailError
|
|
395
394
|
? errorBorderStyle
|
|
396
395
|
: borderStyle, value: this.email, onInput: (e) => {
|
|
397
396
|
this.email =
|
|
398
397
|
e.target
|
|
399
398
|
.value;
|
|
400
399
|
this.validateForm();
|
|
401
|
-
}, placeholder: "your.email@example.com" }), this.emailError && (h("p", { key: '
|
|
400
|
+
}, placeholder: "your.email@example.com" }), this.emailError && (h("p", { key: 'f8f2deb4849f570a3ad1fb57705a9dc8f625e285', class: "text-error text-sm mt-1" }, this.emailError))), h("div", { key: 'fd790363ec794d7de01a62a947c208301c760d1f' }, h("label", { key: 'e8f9181e7f09831d4dc9ca2416d36c52d775e086', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.phone), h("input", { key: '993cbdee6308406cef97bb37242f95d0692b92d3', type: "tel", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.phoneError
|
|
402
401
|
? errorBorderStyle
|
|
403
402
|
: borderStyle, value: this.phone, onInput: (e) => {
|
|
404
403
|
this.phone =
|
|
405
404
|
e.target
|
|
406
405
|
.value;
|
|
407
406
|
this.validateForm();
|
|
408
|
-
}, placeholder: "+34 123 456 789" }), this.phoneError && (h("p", { key: '
|
|
407
|
+
}, placeholder: "+34 123 456 789" }), this.phoneError && (h("p", { key: 'b6f4e2fcc3408d8872786e0e73143afc47bc3340', class: "text-error text-sm mt-1" }, this.phoneError)))), h("div", { key: '23e5cfe888637f9ed46262ff36a935266fe11e1c', class: "flex flex-col items-center gap-4" }, h("button", { key: 'e8df6756b1e9c6881b239e992550600605201f15', onClick: () => this.handleRequestOffer(), disabled: !this.name.trim() ||
|
|
409
408
|
!this.email.trim() || !!this.nameError ||
|
|
410
409
|
!!this.emailError || !!this.phoneError ||
|
|
411
410
|
this.isSubmitting, class: `px-6 py-3 rounded-4xl transition-colors duration-200 flex items-center gap-2 ${this.isSubmitting
|
|
@@ -414,9 +413,9 @@ export class SolarSystemForm {
|
|
|
414
413
|
color: this.isSubmitting
|
|
415
414
|
? "var(--color-text-muted)"
|
|
416
415
|
: "#ffffff",
|
|
417
|
-
} }, this.isSubmitting && (h("div", { key: '
|
|
416
|
+
} }, this.isSubmitting && (h("div", { key: 'd519b1d5f66bcc30b695e8ae10396a809710b112', class: "w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin" })), this.isSubmitting
|
|
418
417
|
? t.solarSystemForm.sending
|
|
419
|
-
: t.solarSystemForm.requestOfferButton), this.submitMessage && (h("div", { key: '
|
|
418
|
+
: t.solarSystemForm.requestOfferButton), this.submitMessage && (h("div", { key: '33241fd401bd5ce53631573b04cc1a52a463f955', class: `text-sm px-4 py-2 rounded-4xl ${this.submitSuccess
|
|
420
419
|
? "bg-success/10 text-success border border-success/20"
|
|
421
420
|
: "bg-error/10 text-error border border-error/20"}` }, this.submitMessage)))))));
|
|
422
421
|
}
|