blue-chestnut-solar-expert 0.0.20 → 0.0.22
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.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/eraser-icon_16.cjs.entry.js +92 -55
- package/dist/cjs/eraser-icon_16.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-widget.cjs.entry.js +1 -1
- package/dist/cjs/stencil-library.cjs.js +1 -1
- package/dist/collection/components/map-draw/polygon-buttons.js +2 -3
- package/dist/collection/components/map-draw/polygon-buttons.js.map +1 -1
- package/dist/collection/components/solar-expert/solar-expert.js +3 -16
- package/dist/collection/components/solar-expert/solar-expert.js.map +1 -1
- package/dist/collection/components/solar-system-form/solar-system-form.js +85 -37
- 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/store.js +1 -0
- package/dist/collection/store.js.map +1 -1
- package/dist/collection/types/lang.js.map +1 -1
- package/dist/collection/utils/geometry/fitting.js +0 -228
- package/dist/collection/utils/geometry/fitting.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/components/loading-widget.js +1 -1
- package/dist/components/map-draw.js +1 -1
- package/dist/components/map-selector.js +1 -1
- package/dist/components/{p-CmFUQbz_.js → p-CTYaeZhp.js} +88 -40
- package/dist/components/p-CTYaeZhp.js.map +1 -0
- package/dist/components/{p-CPLDlLfb.js → p-CaedRXrz.js} +8 -8
- package/dist/components/p-CaedRXrz.js.map +1 -0
- package/dist/components/{p-DPfpDV5e.js → p-CvYS8YPD.js} +3 -3
- package/dist/components/{p-DPfpDV5e.js.map → p-CvYS8YPD.js.map} +1 -1
- package/dist/components/{p-CwVUc6Hq.js → p-DlAht76f.js} +6 -2
- package/dist/components/p-DlAht76f.js.map +1 -0
- package/dist/components/{p-CRnyqUKc.js → p-DufgH4Gd.js} +5 -6
- package/dist/components/p-DufgH4Gd.js.map +1 -0
- package/dist/components/{p-BxEeUA4s.js → p-G74Ln5vx.js} +3 -3
- package/dist/components/{p-BxEeUA4s.js.map → p-G74Ln5vx.js.map} +1 -1
- package/dist/components/{p-C-_6TJs5.js → p-bu76_2XI.js} +3 -3
- package/dist/components/{p-C-_6TJs5.js.map → p-bu76_2XI.js.map} +1 -1
- package/dist/components/{p-Bq1PVegq.js → p-oY2qkchz.js} +3 -3
- package/dist/components/{p-Bq1PVegq.js.map → p-oY2qkchz.js.map} +1 -1
- package/dist/components/polygon-buttons.js +1 -1
- package/dist/components/polygon-information.js +1 -1
- package/dist/components/settings-modal.js +1 -1
- package/dist/components/solar-expert.js +11 -24
- package/dist/components/solar-expert.js.map +1 -1
- package/dist/components/solar-system-form.js +1 -1
- package/dist/components/tool-box.js +1 -1
- package/dist/esm/eraser-icon.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.js.map +1 -1
- package/dist/esm/eraser-icon_16.entry.js +92 -55
- package/dist/esm/eraser-icon_16.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-widget.entry.js +1 -1
- package/dist/esm/stencil-library.js +1 -1
- package/dist/stencil-library/api-E7GpMOpJ.js.map +1 -0
- package/dist/stencil-library/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/stencil-library/config-BV_PiZGS.js.map +1 -0
- package/dist/stencil-library/decoder-DSavpK4g.js.map +1 -0
- package/dist/stencil-library/deflate-BNIZ2wXt.js.map +1 -0
- package/dist/stencil-library/eraser-icon.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.esm.js.map +1 -1
- package/dist/stencil-library/index-DZjEuBrX.js.map +1 -0
- package/dist/stencil-library/index-DimvNaNS.js.map +1 -0
- package/dist/stencil-library/index.esm.js.map +1 -1
- package/dist/stencil-library/jpeg-B79KZkPY.js.map +1 -0
- package/dist/stencil-library/lerc-B-ZLzzvM.js.map +1 -0
- package/dist/stencil-library/lzw-1xg7uPVo.js.map +1 -0
- package/dist/stencil-library/p-62debd50.entry.js +2 -0
- package/dist/stencil-library/p-62debd50.entry.js.map +1 -0
- package/dist/stencil-library/{p-56f8bd65.entry.js → p-c4c3bbee.entry.js} +2 -2
- package/dist/stencil-library/packbits-0MTMkUGE.js.map +1 -0
- package/dist/stencil-library/pako.esm-BdkEMvj8.js.map +1 -0
- package/dist/stencil-library/raw-W8mxtLfl.js.map +1 -0
- package/dist/stencil-library/solar-expert.entry.esm.js.map +1 -0
- package/dist/stencil-library/solar-expert.entry.js +92 -0
- package/dist/{components/p-CRnyqUKc.js.map → stencil-library/solar-expert.entry.js.map} +1 -1
- package/dist/stencil-library/stencil-library.esm.js +1 -1
- package/dist/stencil-library/stencil-library.esm.js.map +1 -1
- package/dist/stencil-library/store-DUpvKmRV.js.map +1 -0
- package/dist/stencil-library/tools-DU7Muwzb.js.map +1 -0
- package/dist/stencil-library/utils-CTW6J-87.js.map +1 -0
- package/dist/stencil-library/webimage-CLeW6JHT.js.map +1 -0
- package/dist/types/components/solar-expert/solar-expert.d.ts +0 -1
- package/dist/types/components/solar-system-form/solar-system-form.d.ts +2 -0
- package/dist/types/store.d.ts +1 -0
- package/dist/types/types/lang.d.ts +1 -0
- package/dist/types/utils/geometry/fitting.d.ts +0 -23
- package/package.json +1 -1
- package/dist/components/p-CPLDlLfb.js.map +0 -1
- package/dist/components/p-CmFUQbz_.js.map +0 -1
- package/dist/components/p-CwVUc6Hq.js.map +0 -1
- package/dist/stencil-library/p-1e2ddc82.entry.js +0 -2
- package/dist/stencil-library/p-1e2ddc82.entry.js.map +0 -1
- /package/dist/stencil-library/{p-56f8bd65.entry.js.map → p-c4c3bbee.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solar-system-form.js","sourceRoot":"","sources":["../../../src/components/solar-system-form/solar-system-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EACH,gCAAgC,EAChC,QAAQ,GACX,MAAM,mCAAmC,CAAC;AAO3C,MAAM,OAAO,eAAe;IAExB,aAAa,GAA2C,EAAE,CAAC;IAE3D,YAAY,GAA8B,EAAE,CAAC;IAE7C,mBAAmB,GAA8B,EAAE,CAAC;IAGpD,oBAAoB,GAAW,IAAI,CAAC;IAEpC,kBAAkB,GAAqC,gBAAgB,CAAC;IAExE,gBAAgB,GAAW,GAAG,CAAC;IAE/B,gBAAgB,GAAW,IAAI,CAAC;IAEhC,mBAAmB,GAAW,CAAC,CAAC;IAEhC,QAAQ,GAAW,CAAC,CAAC;IAErB,WAAW,GAAW,CAAC,CAAC;IAExB,cAAc,GAAW,CAAC,CAAC;IAE3B,cAAc,GAAW,GAAG,CAAC,CAAC,eAAe;IAE7C,IAAI,GAAW,EAAE,CAAC;IAElB,KAAK,GAAW,EAAE,CAAC;IAEnB,SAAS,GAAW,EAAE,CAAC;IAEvB,UAAU,GAAW,EAAE,CAAC;IAEx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CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State, Watch } from \"@stencil/core\";\r\nimport { DEFAULT_SOLAR_PANEL_TYPE } from \"../../config\";\r\nimport { SolarPanelSystemPart } from \"../../utils/geometry/fitting\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { Polygon } from \"../../types/shapes\";\r\nimport { state } from \"../../store\";\r\nimport { SimulationConfig } from \"../../utils/simulation/types\";\r\nimport {\r\n generateElectricCarChargingHours,\r\n simulate,\r\n} from \"../../utils/simulation/simulation\";\r\n\r\n@Component({\r\n tag: \"solar-system-form\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class SolarSystemForm {\r\n @Prop()\r\n systemConfigs: { [id: string]: SolarPanelSystemPart } = {};\r\n @Prop()\r\n roofPolygons: { [id: string]: Polygon } = {};\r\n @Prop()\r\n obstructionPolygons: { [id: string]: Polygon } = {};\r\n\r\n @State()\r\n householdConsumption: number = 4500;\r\n @State()\r\n consumptionProfile: \"mostly_at_home\" | \"mostly_away\" = \"mostly_at_home\";\r\n @State()\r\n electricityPrice: number = 0.3;\r\n @State()\r\n compensationRate: number = 0.07;\r\n @State()\r\n annualPriceIncrease: number = 2;\r\n @State()\r\n autonomy: number = 0;\r\n @State()\r\n costSavings: number = 0;\r\n @State()\r\n numberOfPanels: number = 5;\r\n @State()\r\n panelPeakPower: number = 0.4; // kW per panel\r\n @State()\r\n name: string = \"\";\r\n @State()\r\n email: string = \"\";\r\n @State()\r\n nameError: string = \"\";\r\n @State()\r\n emailError: string = \"\";\r\n @State()\r\n electricCar: boolean = false;\r\n @State()\r\n electricCarChargingTime: \"day\" | \"night\" = \"day\";\r\n @State()\r\n heatPump: number = 0;\r\n @State()\r\n battery: number = 0;\r\n\r\n @State()\r\n compensation25Years: number = 0;\r\n @State()\r\n savedCosts25Years: number = 0;\r\n @State()\r\n maxPanels: number = 5;\r\n\r\n @Watch(\"systemConfigs\")\r\n updateSystemConfigs() {\r\n if (Object.keys(this.systemConfigs).length === 0) {\r\n this.numberOfPanels = 0;\r\n this.maxPanels = 0;\r\n return;\r\n }\r\n this.numberOfPanels = Object.keys(this.systemConfigs).reduce(\r\n (acc, curr) =>\r\n acc + this.systemConfigs[curr].positionedPanels.length,\r\n 0,\r\n );\r\n this.maxPanels = Object.keys(this.systemConfigs).reduce(\r\n (acc, curr) =>\r\n acc + this.systemConfigs[curr].positionedPanels.length,\r\n 0,\r\n );\r\n\r\n this.panelPeakPower =\r\n Object.entries(this.systemConfigs)[0][1].positionedPanels[0].panel\r\n .kWattPeak;\r\n\r\n this.recalculate();\r\n }\r\n\r\n private recalculate() {\r\n const simulationConfig: SimulationConfig = {\r\n general: {\r\n simulationYears: 25,\r\n },\r\n householdConsumption: {\r\n consumptionProfile: this.consumptionProfile,\r\n winterConsumptionFactor: 1.2,\r\n summerConsumptionFactor: 0.8,\r\n averageConsumption: this.householdConsumption / 365,\r\n },\r\n electricityPrice: {\r\n purchase: this.electricityPrice,\r\n sell: this.compensationRate,\r\n increase: this.annualPriceIncrease / 100,\r\n },\r\n solarSystem: {\r\n numberOfPanels: this.numberOfPanels,\r\n panelType: DEFAULT_SOLAR_PANEL_TYPE,\r\n pitch: 30,\r\n },\r\n batteryKWh: this.battery,\r\n solarRadiation: {\r\n winterFactor: 0.2,\r\n summerFactor: 0.6,\r\n },\r\n heatPump: {\r\n m2: this.heatPump,\r\n },\r\n electricCar: this.electricCar\r\n ? {\r\n averageKilometersPerDay: 50,\r\n consumptionkWhPer100km: 17,\r\n batteryKWh: 20,\r\n chargingHours: this.electricCarChargingTime === \"day\"\r\n ? generateElectricCarChargingHours(6, 18)\r\n : generateElectricCarChargingHours(18, 6),\r\n }\r\n : undefined,\r\n };\r\n\r\n const result = simulate(simulationConfig);\r\n\r\n this.compensation25Years = result.compensationPerDay * 365 * 25;\r\n this.savedCosts25Years = result.byYearSavedCosts.reduce(\r\n (acc, curr) => acc + curr,\r\n 0,\r\n );\r\n this.costSavings = result.compensationPerDay * 365;\r\n this.autonomy = result.autonomy * 100;\r\n }\r\n\r\n componentWillLoad() {\r\n this.updateSystemConfigs();\r\n }\r\n\r\n private validateForm(): boolean {\r\n let isValid = true;\r\n const t = getLanguageStrings(state.settings.language);\r\n\r\n // Validate name\r\n if (!this.name.trim()) {\r\n this.nameError = t.solarSystemForm.nameError;\r\n isValid = false;\r\n } else {\r\n this.nameError = \"\";\r\n }\r\n\r\n // Validate email\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n if (!this.email.trim()) {\r\n this.emailError = t.solarSystemForm.emailError;\r\n isValid = false;\r\n } else if (!emailRegex.test(this.email)) {\r\n this.emailError = t.solarSystemForm.validEmailError;\r\n isValid = false;\r\n } else {\r\n this.emailError = \"\";\r\n }\r\n\r\n return isValid;\r\n }\r\n\r\n private handleRequestOffer() {\r\n if (!this.validateForm()) {\r\n return;\r\n }\r\n // Here you can implement the logic to handle the offer request\r\n console.log(\"Requesting offer for: \", {\r\n name: this.name,\r\n email: this.email,\r\n systemConfig: this.systemConfigs,\r\n consumption: this.householdConsumption,\r\n autonomy: this.autonomy,\r\n costSavings: this.costSavings,\r\n roofPolygons: this.roofPolygons,\r\n obstructionPolygons: this.obstructionPolygons,\r\n });\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n return (\r\n <div\r\n class=\"flex flex-col justify-center items-center w-full h-full pt-4\" // style={{\r\n // display: (Object.keys(this.systemConfigs).length === 0)\r\n // ? \"none\"\r\n // : \"flex\",\r\n // }}\r\n id=\"solar-system-form\"\r\n >\r\n <h1 class=\"text-2xl font-bold text-[#271200] mb-4 w-full\">\r\n {t.solarSystemForm.title}\r\n </h1>\r\n\r\n <div class=\"w-full bg-[#f3ebda] rounded-4xl p-6 space-y-6\">\r\n {/* System Info Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.systemInformation}\r\n </h2>\r\n <div class=\"grid grid-rows-3 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.numberOfPanels}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.panelPeakPower}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.numberOfPanels}\r\n readOnly\r\n />\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.panelPeakPower}\r\n readonly\r\n />\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <div class=\"w-full pt-2\">\r\n <input\r\n type=\"range\"\r\n min=\"1\"\r\n max={this.maxPanels}\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-white\"\r\n value={this.numberOfPanels}\r\n onInput={(e) => {\r\n this.numberOfPanels = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"bg-white rounded-4xl p-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.totalSystemPeakPower}\r\n </span>\r\n <span class=\"text-xl font-bold text-[#271200]\">\r\n {(DEFAULT_SOLAR_PANEL_TYPE.kWattPeak *\r\n this.numberOfPanels).toFixed(1)} kW\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n {/* Household Consumption Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.householdConsumptionTitle}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600\">\r\n {t.solarSystemForm.annualConsumption}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600\">\r\n {t.solarSystemForm.consumptionProfileTitle}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.householdConsumption}\r\n onInput={(e) => {\r\n this.householdConsumption = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n <select\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n onChange={(e) => {\r\n this.consumptionProfile =\r\n (e.target as HTMLSelectElement)\r\n .value as\r\n | \"mostly_at_home\"\r\n | \"mostly_away\";\r\n this.recalculate();\r\n }}\r\n >\r\n <option\r\n value=\"mostly_at_home\"\r\n selected={this.consumptionProfile ===\r\n \"mostly_at_home\"}\r\n >\r\n {t.solarSystemForm.consumptionProfiles\r\n .mostlyAtHome}\r\n </option>\r\n <option\r\n value=\"mostly_away\"\r\n selected={this.consumptionProfile ===\r\n \"mostly_away\"}\r\n >\r\n {t.solarSystemForm.consumptionProfiles\r\n .mostlyAway}\r\n </option>\r\n </select>\r\n </div>\r\n </div>\r\n {\r\n /* <div class=\"mt-4 h-48\">\r\n <canvas ref={(el) => this.chartRef = el}></canvas>\r\n </div> */\r\n }\r\n </div>\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.additionalComponents.title}\r\n </h2>\r\n <div class=\"flex flex-col gap-4\">\r\n {/* Heat Pump Section */}\r\n <div class=\"flex flex-col bg-white rounded-4xl p-4 gap-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <div class=\"flex items-center gap-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"heatPump\"\r\n class=\"w-4 h-4 accent-[#964500] border-gray-300 rounded-full focus:ring-[#964500] focus:ring-offset-0 focus:ring-2\"\r\n checked={this.heatPump > 0}\r\n onChange={(e) => {\r\n this.heatPump =\r\n (e.target as HTMLInputElement)\r\n .checked\r\n ? 100\r\n : 0;\r\n this.recalculate();\r\n }}\r\n />\r\n <label\r\n htmlFor=\"heatPump\"\r\n class=\"text-gray-600\"\r\n >\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .heatPump}\r\n </label>\r\n </div>\r\n {this.heatPump > 0 && (\r\n <span class=\"text-gray-600\">\r\n {this.heatPump} m²\r\n </span>\r\n )}\r\n </div>\r\n {this.heatPump > 0 && (\r\n <div class=\"flex flex-col gap-2\">\r\n <input\r\n type=\"range\"\r\n min=\"10\"\r\n max=\"300\"\r\n step=\"10\"\r\n class=\"input-slider 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-white\"\r\n value={this.heatPump}\r\n onInput={(e) => {\r\n this.heatPump = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Electric Car Section */}\r\n <div class=\"flex flex-col bg-white rounded-4xl p-4 gap-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <div class=\"flex items-center gap-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"electricCar\"\r\n class=\"w-4 h-4 accent-[#964500] border-gray-300 rounded focus:ring-[#964500] focus:ring-offset-0 focus:ring-2\"\r\n checked={this.electricCar}\r\n onChange={(e) => {\r\n this.electricCar =\r\n (e.target as HTMLInputElement)\r\n .checked;\r\n this.recalculate();\r\n }}\r\n />\r\n <label\r\n htmlFor=\"electricCar\"\r\n class=\"text-gray-600\"\r\n >\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .electricCar}\r\n </label>\r\n </div>\r\n </div>\r\n {this.electricCar && (\r\n <div class=\"flex flex-col gap-2\">\r\n <label class=\"text-sm text-gray-600\">\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .chargingTime}\r\n </label>\r\n <select\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n onChange={(e) => {\r\n this.electricCarChargingTime =\r\n (e.target as HTMLSelectElement)\r\n .value as\r\n | \"day\"\r\n | \"night\";\r\n this.recalculate();\r\n }}\r\n >\r\n <option\r\n value=\"day\"\r\n selected={this\r\n .electricCarChargingTime ===\r\n \"day\"}\r\n >\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .chargingTimeDay}\r\n </option>\r\n <option\r\n value=\"night\"\r\n selected={this\r\n .electricCarChargingTime ===\r\n \"night\"}\r\n >\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .chargingTimeNight}\r\n </option>\r\n </select>\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Battery Section */}\r\n <div class=\"flex flex-col bg-white rounded-4xl p-4 gap-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <label class=\"text-gray-600\">\r\n {t.solarSystemForm.additionalComponents\r\n .battery}\r\n </label>\r\n <span class=\"text-gray-600\">\r\n {this.battery} kWh\r\n </span>\r\n </div>\r\n <div class=\"flex flex-col gap-2\">\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"20\"\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-white\"\r\n value={this.battery}\r\n onInput={(e) => {\r\n this.battery = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Electricity Price and Compensation Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.electricityCostsTitle}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-3 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.electricityPrice}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.compensationRate}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.annualPriceIncrease}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-3 gap-4\">\r\n <input\r\n type=\"number\"\r\n step=\"0.01\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.electricityPrice.toFixed(2)}\r\n onInput={(e) => {\r\n this.electricityPrice = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n <input\r\n type=\"number\"\r\n step=\"0.01\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.compensationRate.toFixed(2)}\r\n onInput={(e) => {\r\n this.compensationRate = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n <input\r\n type=\"number\"\r\n step=\"0.1\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.annualPriceIncrease.toFixed(1)}\r\n onInput={(e) => {\r\n this.annualPriceIncrease = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Results Section */}\r\n <div class=\"space-y-4 pt-4 border-t border-gray-200\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.resultsTitle}\r\n </h2>\r\n <div class=\"bg-white rounded-4xl p-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.autonomy}\r\n </span>\r\n <span class=\"text-xl font-bold text-[#271200]\">\r\n {this.autonomy > 100\r\n ? \"100\"\r\n : this.autonomy.toFixed(1)}%\r\n </span>\r\n </div>\r\n <div class=\"flex items-center justify-between mt-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.costSavings}\r\n </span>\r\n <div class=\"relative group\">\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n class=\"h-5 w-5 text-gray-400 cursor-help\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n >\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n <div class=\"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-64 p-2 bg-gray-800 text-white text-sm rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none\">\r\n {t.solarSystemForm\r\n .savingsDisclaimer}\r\n </div>\r\n </div>\r\n </div>\r\n <span class=\"text-xl font-bold text-green-600\">\r\n {this.costSavings.toFixed(2)}€/{t\r\n .solarSystemForm.year}\r\n </span>\r\n </div>\r\n <div class=\"flex items-center justify-between mt-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-gray-600\">\r\n Einspeisevergütung 25 Jahre\r\n </span>\r\n </div>\r\n <span class=\"text-xl font-bold text-green-600\">\r\n {this.compensation25Years.toFixed(2)}€\r\n </span>\r\n </div>\r\n <div class=\"flex items-center justify-between mt-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-gray-600\">\r\n Geldwerter Vorteil 25 Jahre\r\n </span>\r\n </div>\r\n <span class=\"text-xl font-bold text-green-600\">\r\n {this.savedCosts25Years.toFixed(2)}€\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Contact Information Section */}\r\n <div class=\"space-y-4 pt-4 border-t border-gray-200\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.requestOffer}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.name}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.email}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"text\"\r\n class={`w-full px-4 py-2 rounded-4xl border ${\r\n this.nameError\r\n ? \"border-red-500\"\r\n : \"border-gray-300\"\r\n } focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`}\r\n value={this.name}\r\n onInput={(e) => {\r\n this.name =\r\n (e.target as HTMLInputElement)\r\n .value;\r\n this.validateForm();\r\n }}\r\n placeholder=\"Your name\"\r\n />\r\n {this.nameError && (\r\n <p class=\"text-red-500 text-sm mt-1\">\r\n {this.nameError}\r\n </p>\r\n )}\r\n <input\r\n type=\"email\"\r\n class={`w-full px-4 py-2 rounded-4xl border ${\r\n this.emailError\r\n ? \"border-red-500\"\r\n : \"border-gray-300\"\r\n } focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`}\r\n value={this.email}\r\n onInput={(e) => {\r\n this.email =\r\n (e.target as HTMLInputElement)\r\n .value;\r\n this.validateForm();\r\n }}\r\n placeholder=\"your.email@example.com\"\r\n />\r\n {this.emailError && (\r\n <p class=\"text-red-500 text-sm mt-1\">\r\n {this.emailError}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n <div class=\"flex justify-center\">\r\n <button\r\n onClick={() => this.handleRequestOffer()}\r\n disabled={!this.name.trim() ||\r\n !this.email.trim() || !!this.nameError ||\r\n !!this.emailError}\r\n class=\"px-4 py-2 bg-[#271200] rounded-4xl hover:bg-[#964500] transition-colors duration-200\"\r\n style={{ color: \"white\" }}\r\n >\r\n {t.solarSystemForm.requestOfferButton}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"solar-system-form.js","sourceRoot":"","sources":["../../../src/components/solar-system-form/solar-system-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0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EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oCACX,IAAI,CAAC,KAAK;wCACL,CAAC,CAAC,MAA2B;6CACzB,KAAK,CAAC;oCACf,IAAI,CAAC,YAAY,EAAE,CAAC;gCACxB,CAAC,EACD,WAAW,EAAC,wBAAwB,GACtC;4BACD,IAAI,CAAC,UAAU,IAAI,CAChB,0DAAG,KAAK,EAAC,2BAA2B,IAC/B,IAAI,CAAC,UAAU,CAChB,CACP,CACC,CACJ;oBACN,4DAAK,KAAK,EAAC,qBAAqB;wBAC5B,+DACI,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,EACxC,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gCACvB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS;gCACtC,CAAC,CAAC,IAAI,CAAC,UAAU,EACrB,KAAK,EAAC,sFAAsF,EAC5F,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAExB,CAAC,CAAC,eAAe,CAAC,kBAAkB,CAChC,CACP,CACJ,CACJ,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State, Watch } from \"@stencil/core\";\r\nimport { DEFAULT_SOLAR_PANEL_TYPE } from \"../../config\";\r\nimport { SolarPanelSystemPart } from \"../../utils/geometry/fitting\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { Polygon } from \"../../types/shapes\";\r\nimport { state } from \"../../store\";\r\nimport { SimulationConfig } from \"../../utils/simulation/types\";\r\nimport {\r\n generateElectricCarChargingHours,\r\n simulate,\r\n} from \"../../utils/simulation/simulation\";\r\n\r\n@Component({\r\n tag: \"solar-system-form\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class SolarSystemForm {\r\n @Prop()\r\n systemConfigs: { [id: string]: SolarPanelSystemPart } = {};\r\n @Prop()\r\n roofPolygons: { [id: string]: Polygon } = {};\r\n @Prop()\r\n obstructionPolygons: { [id: string]: Polygon } = {};\r\n\r\n @State()\r\n householdConsumption: number = 4500;\r\n @State()\r\n consumptionProfile: \"mostly_at_home\" | \"mostly_away\" = \"mostly_at_home\";\r\n @State()\r\n electricityPrice: number = 0.3;\r\n @State()\r\n compensationRate: number = 0.07;\r\n @State()\r\n annualPriceIncrease: number = 2;\r\n @State()\r\n autonomy: number = 0;\r\n @State()\r\n costSavings: number = 0;\r\n @State()\r\n numberOfPanels: number = 5;\r\n @State()\r\n panelPeakPower: number = 0.4; // kW per panel\r\n @State()\r\n name: string = \"\";\r\n @State()\r\n email: string = \"\";\r\n @State()\r\n nameError: string = \"\";\r\n @State()\r\n emailError: string = \"\";\r\n @State()\r\n electricCar: boolean = false;\r\n @State()\r\n electricCarChargingTime: \"day\" | \"night\" = \"day\";\r\n @State()\r\n heatPump: number = 0;\r\n @State()\r\n battery: number = 0;\r\n\r\n @State()\r\n compensation25Years: number = 0;\r\n @State()\r\n savedCosts25Years: number = 0;\r\n @State()\r\n maxPanels: number = 5;\r\n @State()\r\n kmDrivenPerYear: number = 10000;\r\n\r\n @Watch(\"systemConfigs\")\r\n updateSystemConfigs() {\r\n if (Object.keys(this.systemConfigs).length === 0) {\r\n this.numberOfPanels = 0;\r\n this.maxPanels = 0;\r\n return;\r\n }\r\n this.numberOfPanels = Object.keys(this.systemConfigs).reduce(\r\n (acc, curr) =>\r\n acc + this.systemConfigs[curr].positionedPanels.length,\r\n 0,\r\n );\r\n this.maxPanels = Object.keys(this.systemConfigs).reduce(\r\n (acc, curr) =>\r\n acc + this.systemConfigs[curr].positionedPanels.length,\r\n 0,\r\n );\r\n\r\n this.panelPeakPower =\r\n Object.entries(this.systemConfigs)[0][1].positionedPanels[0].panel\r\n .kWattPeak;\r\n\r\n this.recalculate();\r\n }\r\n\r\n private recalculate() {\r\n const simulationConfig: SimulationConfig = {\r\n general: {\r\n simulationYears: 25,\r\n },\r\n householdConsumption: {\r\n consumptionProfile: this.consumptionProfile,\r\n winterConsumptionFactor: 1.2,\r\n summerConsumptionFactor: 0.8,\r\n averageConsumption: this.householdConsumption / 365,\r\n },\r\n electricityPrice: {\r\n purchase: this.electricityPrice,\r\n sell: this.compensationRate,\r\n increase: this.annualPriceIncrease / 100,\r\n },\r\n solarSystem: {\r\n numberOfPanels: this.numberOfPanels,\r\n panelType: DEFAULT_SOLAR_PANEL_TYPE,\r\n pitch: 30,\r\n },\r\n batteryKWh: this.battery,\r\n solarRadiation: {\r\n winterFactor: 0.2,\r\n summerFactor: 0.6,\r\n },\r\n heatPump: {\r\n m2: this.heatPump,\r\n },\r\n electricCar: this.electricCar\r\n ? {\r\n averageKilometersPerDay: this.kmDrivenPerYear / 365,\r\n consumptionkWhPer100km: 17,\r\n batteryKWh: 20,\r\n chargingHours: this.electricCarChargingTime === \"day\"\r\n ? generateElectricCarChargingHours(6, 18)\r\n : generateElectricCarChargingHours(18, 6),\r\n }\r\n : undefined,\r\n };\r\n\r\n const result = simulate(simulationConfig);\r\n\r\n this.compensation25Years = result.compensationPerDay * 365 * 25;\r\n this.savedCosts25Years = result.byYearSavedCosts.reduce(\r\n (acc, curr) => acc + curr,\r\n 0,\r\n );\r\n this.costSavings = result.compensationPerDay * 365;\r\n this.autonomy = result.autonomy * 100;\r\n }\r\n\r\n componentWillLoad() {\r\n this.updateSystemConfigs();\r\n }\r\n\r\n private validateForm(): boolean {\r\n let isValid = true;\r\n const t = getLanguageStrings(state.settings.language);\r\n\r\n // Validate name\r\n if (!this.name.trim()) {\r\n this.nameError = t.solarSystemForm.nameError;\r\n isValid = false;\r\n } else {\r\n this.nameError = \"\";\r\n }\r\n\r\n // Validate email\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n if (!this.email.trim()) {\r\n this.emailError = t.solarSystemForm.emailError;\r\n isValid = false;\r\n } else if (!emailRegex.test(this.email)) {\r\n this.emailError = t.solarSystemForm.validEmailError;\r\n isValid = false;\r\n } else {\r\n this.emailError = \"\";\r\n }\r\n\r\n return isValid;\r\n }\r\n\r\n private handleRequestOffer() {\r\n if (!this.validateForm()) {\r\n return;\r\n }\r\n // Here you can implement the logic to handle the offer request\r\n console.log(\"Requesting offer for: \", {\r\n name: this.name,\r\n email: this.email,\r\n systemConfig: this.systemConfigs,\r\n consumption: this.householdConsumption,\r\n autonomy: this.autonomy,\r\n costSavings: this.costSavings,\r\n roofPolygons: this.roofPolygons,\r\n obstructionPolygons: this.obstructionPolygons,\r\n });\r\n }\r\n\r\n private isIOS(): boolean {\r\n return state.isIOS;\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n return (\r\n <div\r\n class=\"flex flex-col justify-center items-center w-full h-full pt-4\" // style={{\r\n // display: (Object.keys(this.systemConfigs).length === 0)\r\n // ? \"none\"\r\n // : \"flex\",\r\n // }}\r\n id=\"solar-system-form\"\r\n >\r\n <h1 class=\"text-2xl font-bold text-[#271200] mb-4 w-full\">\r\n {t.solarSystemForm.title}\r\n </h1>\r\n\r\n <div class=\"w-full bg-[#f3ebda] rounded-4xl p-6 space-y-6\">\r\n {/* System Info Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.systemInformation}\r\n </h2>\r\n <div class=\"grid grid-rows-3 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.numberOfPanels}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.panelPeakPower}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n {!this.isIOS()\r\n ? (\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.numberOfPanels}\r\n readOnly\r\n />\r\n )\r\n : (\r\n <input\r\n type=\"number\"\r\n min=\"1\"\r\n max={this.maxPanels}\r\n class=\"flex-1 px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.numberOfPanels}\r\n onInput={(e) => {\r\n const value = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n if (\r\n value >= 1 &&\r\n value <=\r\n this.maxPanels\r\n ) {\r\n this.numberOfPanels = value;\r\n this.recalculate();\r\n }\r\n }}\r\n />\r\n )}\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.panelPeakPower}\r\n readonly\r\n />\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <div class=\"w-full pt-2\">\r\n {!this.isIOS() &&\r\n (\r\n <input\r\n type=\"range\"\r\n min=\"1\"\r\n max={this.maxPanels}\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-white\"\r\n value={this.numberOfPanels}\r\n onInput={(e) => {\r\n this.numberOfPanels =\r\n parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"bg-white rounded-4xl p-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.totalSystemPeakPower}\r\n </span>\r\n <span class=\"text-xl font-bold text-[#271200]\">\r\n {(DEFAULT_SOLAR_PANEL_TYPE.kWattPeak *\r\n this.numberOfPanels).toFixed(1)} kW\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n {/* Household Consumption Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.householdConsumptionTitle}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600\">\r\n {t.solarSystemForm.annualConsumption}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600\">\r\n {t.solarSystemForm.consumptionProfileTitle}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"number\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.householdConsumption}\r\n onInput={(e) => {\r\n this.householdConsumption = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n <select\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n onChange={(e) => {\r\n this.consumptionProfile =\r\n (e.target as HTMLSelectElement)\r\n .value as\r\n | \"mostly_at_home\"\r\n | \"mostly_away\";\r\n this.recalculate();\r\n }}\r\n >\r\n <option\r\n value=\"mostly_at_home\"\r\n selected={this.consumptionProfile ===\r\n \"mostly_at_home\"}\r\n >\r\n {t.solarSystemForm.consumptionProfiles\r\n .mostlyAtHome}\r\n </option>\r\n <option\r\n value=\"mostly_away\"\r\n selected={this.consumptionProfile ===\r\n \"mostly_away\"}\r\n >\r\n {t.solarSystemForm.consumptionProfiles\r\n .mostlyAway}\r\n </option>\r\n </select>\r\n </div>\r\n </div>\r\n {\r\n /* <div class=\"mt-4 h-48\">\r\n <canvas ref={(el) => this.chartRef = el}></canvas>\r\n </div> */\r\n }\r\n </div>\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.additionalComponents.title}\r\n </h2>\r\n <div class=\"flex flex-col gap-4\">\r\n {/* Heat Pump Section */}\r\n <div class=\"flex flex-col bg-white rounded-4xl p-4 gap-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <div class=\"flex items-center gap-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"heatPump\"\r\n class=\"w-4 h-4 accent-[#964500] border-gray-300 rounded-full focus:ring-[#964500] focus:ring-offset-0 focus:ring-2\"\r\n checked={this.heatPump > 0}\r\n onChange={(e) => {\r\n this.heatPump =\r\n (e.target as HTMLInputElement)\r\n .checked\r\n ? 100\r\n : 0;\r\n this.recalculate();\r\n }}\r\n />\r\n <label\r\n htmlFor=\"heatPump\"\r\n class=\"text-gray-600\"\r\n >\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .heatPump}\r\n </label>\r\n </div>\r\n {(this.heatPump > 0 && !this.isIOS()) && (\r\n <span class=\"text-gray-600\">\r\n {this.heatPump} m²\r\n </span>\r\n )}\r\n </div>\r\n {this.heatPump > 0 && (\r\n <div class=\"flex flex-col gap-2\">\r\n {this.isIOS()\r\n ? (\r\n <div class=\"flex items-center gap-2\">\r\n <input\r\n type=\"number\"\r\n min=\"10\"\r\n max=\"300\"\r\n step=\"10\"\r\n class=\"flex-1 px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.heatPump}\r\n onInput={(e) => {\r\n const value =\r\n parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n if (\r\n value >= 10 &&\r\n value <= 300\r\n ) {\r\n this.heatPump =\r\n value;\r\n this.recalculate();\r\n }\r\n }}\r\n />\r\n <span class=\"text-sm text-gray-600\">\r\n m²\r\n </span>\r\n </div>\r\n )\r\n : (\r\n <input\r\n type=\"range\"\r\n min=\"10\"\r\n max=\"300\"\r\n step=\"10\"\r\n class=\"input-slider 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-white\"\r\n value={this.heatPump}\r\n onInput={(e) => {\r\n this.heatPump =\r\n parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Electric Car Section */}\r\n <div class=\"flex flex-col bg-white rounded-4xl p-4 gap-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <div class=\"flex items-center gap-2\">\r\n <input\r\n type=\"checkbox\"\r\n id=\"electricCar\"\r\n class=\"w-4 h-4 accent-[#964500] border-gray-300 rounded focus:ring-[#964500] focus:ring-offset-0 focus:ring-2\"\r\n checked={this.electricCar}\r\n onChange={(e) => {\r\n this.electricCar =\r\n (e.target as HTMLInputElement)\r\n .checked;\r\n this.recalculate();\r\n }}\r\n />\r\n <label\r\n htmlFor=\"electricCar\"\r\n class=\"text-gray-600\"\r\n >\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .electricCar}\r\n </label>\r\n </div>\r\n </div>\r\n {this.electricCar && (\r\n <div class=\"flex flex-col gap-2\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"text-sm text-gray-600\">\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .chargingTime}\r\n </label>\r\n <label class=\"text-sm text-gray-600\">\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .kilometersPerYear}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <select\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n onChange={(e) => {\r\n this.electricCarChargingTime =\r\n (e.target as HTMLSelectElement)\r\n .value as\r\n | \"day\"\r\n | \"night\";\r\n this.recalculate();\r\n }}\r\n >\r\n <option\r\n value=\"day\"\r\n selected={this\r\n .electricCarChargingTime ===\r\n \"day\"}\r\n >\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .chargingTimeDay}\r\n </option>\r\n <option\r\n value=\"night\"\r\n selected={this\r\n .electricCarChargingTime ===\r\n \"night\"}\r\n >\r\n {t.solarSystemForm\r\n .additionalComponents\r\n .chargingTimeNight}\r\n </option>\r\n </select>\r\n <input\r\n type=\"number\"\r\n min=\"1000\"\r\n max=\"50000\"\r\n step=\"1000\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.kmDrivenPerYear}\r\n onInput={(e) => {\r\n this.kmDrivenPerYear =\r\n parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Battery Section */}\r\n <div class=\"flex flex-col bg-white rounded-4xl p-4 gap-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <label class=\"text-gray-600\">\r\n {t.solarSystemForm.additionalComponents\r\n .battery}\r\n </label>\r\n {!this.isIOS() && (\r\n <span class=\"text-gray-600\">\r\n {this.battery} kWh\r\n </span>\r\n )}\r\n </div>\r\n <div class=\"flex flex-col gap-2\">\r\n {this.isIOS()\r\n ? (\r\n <div class=\"flex items-center gap-2\">\r\n <input\r\n type=\"number\"\r\n min=\"0\"\r\n max=\"20\"\r\n step=\"1\"\r\n class=\"flex-1 px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.battery}\r\n onInput={(e) => {\r\n const value = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n if (\r\n value >= 0 &&\r\n value <= 20\r\n ) {\r\n this.battery =\r\n value;\r\n this.recalculate();\r\n }\r\n }}\r\n placeholder=\"Battery capacity\"\r\n />\r\n <span class=\"text-sm text-gray-600\">\r\n kWh\r\n </span>\r\n </div>\r\n )\r\n : (\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"20\"\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-white\"\r\n value={this.battery}\r\n onInput={(e) => {\r\n this.battery = parseInt(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Electricity Price and Compensation Section */}\r\n <div class=\"space-y-4\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.electricityCostsTitle}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-3 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.electricityPrice}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.compensationRate}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.annualPriceIncrease}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-3 gap-4\">\r\n <input\r\n type=\"number\"\r\n step=\"0.01\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.electricityPrice.toFixed(2)}\r\n onInput={(e) => {\r\n this.electricityPrice = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n <input\r\n type=\"number\"\r\n step=\"0.01\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.compensationRate.toFixed(2)}\r\n onInput={(e) => {\r\n this.compensationRate = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n <input\r\n type=\"number\"\r\n step=\"0.1\"\r\n class=\"w-full px-4 py-2 rounded-4xl border border-gray-300 focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white\"\r\n value={this.annualPriceIncrease.toFixed(1)}\r\n onInput={(e) => {\r\n this.annualPriceIncrease = parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n );\r\n this.recalculate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Results Section */}\r\n <div class=\"space-y-4 pt-4 border-t border-gray-200\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.resultsTitle}\r\n </h2>\r\n <div class=\"bg-white rounded-4xl p-4\">\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.autonomy}\r\n </span>\r\n <span class=\"text-xl font-bold text-[#271200]\">\r\n {this.autonomy > 100\r\n ? \"100\"\r\n : this.autonomy.toFixed(1)}%\r\n </span>\r\n </div>\r\n <div class=\"flex items-center justify-between mt-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-gray-600\">\r\n {t.solarSystemForm.costSavings}\r\n </span>\r\n <div class=\"relative group\">\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n class=\"h-5 w-5 text-gray-400 cursor-help\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n >\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n <div class=\"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-64 p-2 bg-gray-800 text-white text-sm rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none\">\r\n {t.solarSystemForm\r\n .savingsDisclaimer}\r\n </div>\r\n </div>\r\n </div>\r\n <span class=\"text-xl font-bold text-green-600\">\r\n {this.costSavings.toFixed(2)}€/{t\r\n .solarSystemForm.year}\r\n </span>\r\n </div>\r\n <div class=\"flex items-center justify-between mt-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-gray-600\">\r\n Einspeisevergütung 25 Jahre\r\n </span>\r\n </div>\r\n <span class=\"text-xl font-bold text-green-600\">\r\n {this.compensation25Years.toFixed(2)}€\r\n </span>\r\n </div>\r\n <div class=\"flex items-center justify-between mt-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span class=\"text-gray-600\">\r\n Geldwerter Vorteil 25 Jahre\r\n </span>\r\n </div>\r\n <span class=\"text-xl font-bold text-green-600\">\r\n {this.savedCosts25Years.toFixed(2)}€\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Contact Information Section */}\r\n <div class=\"space-y-4 pt-4 border-t border-gray-200\">\r\n <h2 class=\"text-lg font-semibold text-[#271200]\">\r\n {t.solarSystemForm.requestOffer}\r\n </h2>\r\n <div class=\"grid grid-rows-2 gap-0\">\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.name}\r\n </label>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.solarSystemForm.email}\r\n </label>\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <input\r\n type=\"text\"\r\n class={`w-full px-4 py-2 rounded-4xl border ${\r\n this.nameError\r\n ? \"border-red-500\"\r\n : \"border-gray-300\"\r\n } focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`}\r\n value={this.name}\r\n onInput={(e) => {\r\n this.name =\r\n (e.target as HTMLInputElement)\r\n .value;\r\n this.validateForm();\r\n }}\r\n placeholder=\"Your name\"\r\n />\r\n {this.nameError && (\r\n <p class=\"text-red-500 text-sm mt-1\">\r\n {this.nameError}\r\n </p>\r\n )}\r\n <input\r\n type=\"email\"\r\n class={`w-full px-4 py-2 rounded-4xl border ${\r\n this.emailError\r\n ? \"border-red-500\"\r\n : \"border-gray-300\"\r\n } focus:ring-2 focus:ring-[#964500] focus:border-transparent bg-white`}\r\n value={this.email}\r\n onInput={(e) => {\r\n this.email =\r\n (e.target as HTMLInputElement)\r\n .value;\r\n this.validateForm();\r\n }}\r\n placeholder=\"your.email@example.com\"\r\n />\r\n {this.emailError && (\r\n <p class=\"text-red-500 text-sm mt-1\">\r\n {this.emailError}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n <div class=\"flex justify-center\">\r\n <button\r\n onClick={() => this.handleRequestOffer()}\r\n disabled={!this.name.trim() ||\r\n !this.email.trim() || !!this.nameError ||\r\n !!this.emailError}\r\n class=\"px-4 py-2 bg-[#271200] rounded-4xl hover:bg-[#964500] transition-colors duration-200\"\r\n style={{ color: \"white\" }}\r\n >\r\n {t.solarSystemForm.requestOfferButton}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export class LoadingWidget {
|
|
3
3
|
render() {
|
|
4
|
-
return (h("div", { key: '
|
|
4
|
+
return (h("div", { key: '90187981b5843b365c5f8bf66c575f31d4fa5cca', class: "absolute flex items-center justify-center bg-white bg-opacity-75 z-20 pt-7 rounded-4xl" }, h("div", { key: 'c98e2aa7f46344897cbeeb85cabb8d962fb0f138', class: "animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-[#271200]" })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "loading-widget"; }
|
|
7
7
|
static get originalStyleUrls() {
|
package/dist/collection/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqB7C,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAG,WAAW,CAAQ;IACzC,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,EAAE;IAChB,QAAQ,EAAE;QACN,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,CAAC;QACb,aAAa,EAAE,CAAC;QAChB,WAAW,EAAE,GAAG;QAChB,qBAAqB,EAAE,EAAE;KAC5B;IACD,eAAe,EAAE,CAAC;IAClB,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,KAAK;CACf,CAAC,CAAC;AAEH,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3B,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;IAC5B,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;AAC5B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;IAC/B,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3B,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;IAClC,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3B,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAC,CAAC","sourcesContent":["import { createStore } from \"@stencil/store\";\r\nimport { Language } from \"./components\";\r\n\r\nexport interface Settings {\r\n language: Language;\r\n rowSpacing: number;\r\n columnSpacing: number;\r\n borderInset: number;\r\n heatPumpM2Consumption: number;\r\n}\r\n\r\nexport interface State {\r\n latitude: number | null;\r\n longitude: number | null;\r\n radiusMeters: number;\r\n settings: Settings;\r\n settingsVersion: number;\r\n isMobile: boolean;\r\n isIOS: boolean;\r\n}\r\n\r\nconst {state, onChange} = createStore<State>({\r\n latitude: null,\r\n longitude: null,\r\n radiusMeters: 15,\r\n settings: {\r\n language: \"en\",\r\n rowSpacing: 1,\r\n columnSpacing: 1,\r\n borderInset: 0.1,\r\n heatPumpM2Consumption: 85,\r\n },\r\n settingsVersion: 1,\r\n isMobile: false,\r\n isIOS: false,\r\n});\r\n\r\nonChange(\"latitude\", (value) => {\r\n state.latitude = value;\r\n});\r\n\r\nonChange(\"longitude\", (value) => {\r\n state.longitude = value;\r\n});\r\n\r\nonChange(\"radiusMeters\", (value) => {\r\n state.radiusMeters = value;\r\n});\r\n\r\nonChange(\"settings\", (value) => {\r\n state.settings = value;\r\n});\r\n\r\nonChange(\"settingsVersion\", (value) => {\r\n state.settingsVersion = value;\r\n});\r\n\r\nonChange(\"isMobile\", (value) => {\r\n state.isMobile = value;\r\n});\r\n\r\nexport {state, onChange};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../../src/types/lang.ts"],"names":[],"mappings":"","sourcesContent":["export type Language = \"en\" | \"es\" | \"de\";\r\n\r\nexport interface LanguageStrings {\r\n settings: {\r\n language: string;\r\n rowSpacing: string;\r\n columnSpacing: string;\r\n borderInset: string;\r\n },\r\n mapSelector: {\r\n explanation: string;\r\n radius: string;\r\n accept: string;\r\n chooseOnMap: string;\r\n }\r\n solarExpert: {\r\n searchPlaceholder: string;\r\n },\r\n solarSystemForm: {\r\n title: string;\r\n year: string;\r\n systemInformation: string;\r\n numberOfPanels: string;\r\n panelPeakPower: string;\r\n totalSystemPeakPower: string;\r\n electricityPrice: string;\r\n compensationRate: string;\r\n autonomy: string;\r\n costSavings: string;\r\n householdConsumptionTitle: string;\r\n consumptionProfileTitle: string;\r\n electricityCostsTitle: string;\r\n compensationRateTitle: string;\r\n resultsTitle: string;\r\n savingsDisclaimer: string;\r\n annualConsumption: string;\r\n name: string;\r\n email: string;\r\n nameError: string;\r\n emailError: string;\r\n consumptionProfiles: {\r\n mostlyAtHome: string;\r\n mostlyAway: string;\r\n },\r\n chart: {\r\n consumption: string;\r\n production: string;\r\n consumptionProfile: string;\r\n relativeConsumption: string;\r\n hourOfDay: string;\r\n },\r\n validEmailError: string;\r\n requestOffer: string;\r\n requestOfferButton: string;\r\n additionalComponents: {\r\n title: string;\r\n heatPump: string;\r\n electricCar: string;\r\n battery: string;\r\n chargingTime: string;\r\n chargingTimeDay: string;\r\n chargingTimeNight: string;\r\n },\r\n annualPriceIncrease: string;\r\n costSavings25Years: string;\r\n\r\n },\r\n mapDraw: {\r\n instructions: {\r\n show: string;\r\n hide: string;\r\n parts: {\r\n roof: string;\r\n obstruction: string;\r\n delete: string;\r\n move: string;\r\n end: string;\r\n }\r\n },\r\n noPolygonSelected: string;\r\n noAddressSelected: string;\r\n information: string;\r\n calculateSolarPanels: string;\r\n markRoofEdge: string;\r\n panels: string;\r\n area: string;\r\n azimuth: string;\r\n pitch: string;\r\n tools: {\r\n roof: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n },\r\n obstruction: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n },\r\n delete: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n },\r\n move: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n },\r\n undo: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n }\r\n }\r\n }\r\n}"]}
|
|
1
|
+
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../../src/types/lang.ts"],"names":[],"mappings":"","sourcesContent":["export type Language = \"en\" | \"es\" | \"de\";\r\n\r\nexport interface LanguageStrings {\r\n settings: {\r\n language: string;\r\n rowSpacing: string;\r\n columnSpacing: string;\r\n borderInset: string;\r\n },\r\n mapSelector: {\r\n explanation: string;\r\n radius: string;\r\n accept: string;\r\n chooseOnMap: string;\r\n }\r\n solarExpert: {\r\n searchPlaceholder: string;\r\n },\r\n solarSystemForm: {\r\n title: string;\r\n year: string;\r\n systemInformation: string;\r\n numberOfPanels: string;\r\n panelPeakPower: string;\r\n totalSystemPeakPower: string;\r\n electricityPrice: string;\r\n compensationRate: string;\r\n autonomy: string;\r\n costSavings: string;\r\n householdConsumptionTitle: string;\r\n consumptionProfileTitle: string;\r\n electricityCostsTitle: string;\r\n compensationRateTitle: string;\r\n resultsTitle: string;\r\n savingsDisclaimer: string;\r\n annualConsumption: string;\r\n name: string;\r\n email: string;\r\n nameError: string;\r\n emailError: string;\r\n consumptionProfiles: {\r\n mostlyAtHome: string;\r\n mostlyAway: string;\r\n },\r\n chart: {\r\n consumption: string;\r\n production: string;\r\n consumptionProfile: string;\r\n relativeConsumption: string;\r\n hourOfDay: string;\r\n },\r\n validEmailError: string;\r\n requestOffer: string;\r\n requestOfferButton: string;\r\n additionalComponents: {\r\n title: string;\r\n heatPump: string;\r\n electricCar: string;\r\n battery: string;\r\n chargingTime: string;\r\n chargingTimeDay: string;\r\n chargingTimeNight: string;\r\n kilometersPerYear: string;\r\n },\r\n annualPriceIncrease: string;\r\n costSavings25Years: string;\r\n\r\n },\r\n mapDraw: {\r\n instructions: {\r\n show: string;\r\n hide: string;\r\n parts: {\r\n roof: string;\r\n obstruction: string;\r\n delete: string;\r\n move: string;\r\n end: string;\r\n }\r\n },\r\n noPolygonSelected: string;\r\n noAddressSelected: string;\r\n information: string;\r\n calculateSolarPanels: string;\r\n markRoofEdge: string;\r\n panels: string;\r\n area: string;\r\n azimuth: string;\r\n pitch: string;\r\n tools: {\r\n roof: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n },\r\n obstruction: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n },\r\n delete: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n },\r\n move: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n },\r\n undo: {\r\n name: string;\r\n explanation: string;\r\n ariaLabel: string;\r\n }\r\n }\r\n }\r\n}"]}
|
|
@@ -202,234 +202,6 @@ export function matchSegments(segments, roof) {
|
|
|
202
202
|
}
|
|
203
203
|
return { matches, map };
|
|
204
204
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Fits panels to a roof polygon.
|
|
207
|
-
*
|
|
208
|
-
* Starts with positioning a solar panel row (a rectangle with the height of the solar panel and the width in the direction of the perpendicular of
|
|
209
|
-
* the azimuth of the roof) at each corner of the roof.
|
|
210
|
-
* For each corner there are four possible cases (the width is the width of the whole roof in the direction of the perpendicular of the azimuth):
|
|
211
|
-
* 1. The row has height of the solar panel height and sits below the point in the direction of the azimuth of the roof.
|
|
212
|
-
* 2. The row has height of the solar panel height and sits above the point in the direction of the azimuth of the roof.
|
|
213
|
-
* 3. The row has the height of the solar panel width (solar panels are rotated) and sits below the point in the direction of the azimuth of the roof.
|
|
214
|
-
* 4. The row has the height of the solar panel width (solar panels are rotated) and sits above the point in the direction of the azimuth of the roof.
|
|
215
|
-
*
|
|
216
|
-
* For each of these cases the function then places the solar panel rows directly above and below the current row.
|
|
217
|
-
*
|
|
218
|
-
* after the function has positioned all the rows it places the solar panels in the spaces between the rows.
|
|
219
|
-
* For each of the four scenarios of each corner the number of panels are counted and the optimal placement is chosen.
|
|
220
|
-
*
|
|
221
|
-
* @param roof - The roof polygon.
|
|
222
|
-
* @param panelType - The type of panel to fit.
|
|
223
|
-
* @param borderOffset - The offset of the panel from the border of the roof. If negative, the panel can be partially overhanging the roof.
|
|
224
|
-
* @param azimuth - The azimuth of the roof.
|
|
225
|
-
* @returns The positioned panels.
|
|
226
|
-
*/
|
|
227
|
-
export function fitPanelsToRoof(roof, panelType, borderOffset = 0, azimuth = 0) {
|
|
228
|
-
if (!roof || !panelType || !roof.points || !roof.details) {
|
|
229
|
-
return [];
|
|
230
|
-
}
|
|
231
|
-
console.log(borderOffset, azimuth);
|
|
232
|
-
return [];
|
|
233
|
-
// const minX = Math.min(...roof.points.map(p => p.x));
|
|
234
|
-
// const maxX = Math.max(...roof.points.map(p => p.x));
|
|
235
|
-
// const minY = Math.min(...roof.points.map(p => p.y));
|
|
236
|
-
// const maxY = Math.max(...roof.points.map(p => p.y));
|
|
237
|
-
// const projectedRoof = projectPolygon(roof, azimuth);
|
|
238
|
-
// const projectedOffsetRoof = offsetPolygon(projectedRoof);
|
|
239
|
-
// const segments = segmentPolygon(projectedOffsetRoof.polygon);
|
|
240
|
-
// const {matches, map} = matchSegments(segments, projectedOffsetRoof.polygon);
|
|
241
|
-
// const matchesMap: Record<string, LineSegment[]> = {};
|
|
242
|
-
// for (const match of matches) {
|
|
243
|
-
// matchesMap[match.segment] = match.matchedSegments.map(segment => map[segment]);
|
|
244
|
-
// }
|
|
245
|
-
// let panels: PositionedSolarPanel[] = [];
|
|
246
|
-
// let undidPanels: PositionedSolarPanel[] = [];
|
|
247
|
-
// for (const segment of segments) {
|
|
248
|
-
// if (segment.type === "outer") {
|
|
249
|
-
// continue;
|
|
250
|
-
// }
|
|
251
|
-
// const matches = matchesMap[`${segment.start.x}-${segment.start.y}-${segment.end.x}-${segment.end.y}`];
|
|
252
|
-
// if (!matches || matches.length === 0) {
|
|
253
|
-
// continue;
|
|
254
|
-
// }
|
|
255
|
-
// // Combine segments until we reach panel height
|
|
256
|
-
// let combinedSegments: Array<Array<LineSegment>> = [[segment]];
|
|
257
|
-
// let currentHeight = 0;
|
|
258
|
-
// let currentMatches = matches;
|
|
259
|
-
// // while (currentHeight < panelType.heightMeters && currentMatches.length > 0) {
|
|
260
|
-
// // const nextSegment = currentMatches[0];
|
|
261
|
-
// // combinedSegments.push(nextSegment);
|
|
262
|
-
// // currentHeight += Math.abs(nextSegment.start.y - segment.start.y);
|
|
263
|
-
// // currentMatches = matchesMap[`${nextSegment.start.x}-${nextSegment.start.y}-${nextSegment.end.x}-${nextSegment.end.y}`] || [];
|
|
264
|
-
// // }
|
|
265
|
-
// if (currentHeight < panelType.heightMeters) {
|
|
266
|
-
// continue;
|
|
267
|
-
// }
|
|
268
|
-
// // Calculate minimum width
|
|
269
|
-
// // let minEnd = Math.max(...combinedSegments.map(s => s.end.x));
|
|
270
|
-
// // let maxStart = Math.min(...combinedSegments.map(s => s.start.x));
|
|
271
|
-
// // let width = minEnd - maxStart;
|
|
272
|
-
// // if (width >= panelType.widthMeters) {
|
|
273
|
-
// // // Find highest segment for starting position
|
|
274
|
-
// // const highestSegment = combinedSegments.reduce((prev, curr) =>
|
|
275
|
-
// // curr.start.y < prev.start.y ? curr : prev
|
|
276
|
-
// // );
|
|
277
|
-
// // // Place panels in a grid
|
|
278
|
-
// // const panelSpacing = panelType.widthMeters + borderOffset;
|
|
279
|
-
// // const rowSpacing = panelType.heightMeters + borderOffset;
|
|
280
|
-
// // let currentX = maxStart;
|
|
281
|
-
// // let currentY = highestSegment.start.y;
|
|
282
|
-
// // while (currentX + panelType.widthMeters <= minEnd) {
|
|
283
|
-
// // while (currentY + panelType.heightMeters <= highestSegment.start.y + currentHeight) {
|
|
284
|
-
// // const panelCenter = {
|
|
285
|
-
// // x: currentX + panelType.widthMeters / 2,
|
|
286
|
-
// // y: currentY + panelType.heightMeters / 2
|
|
287
|
-
// // };
|
|
288
|
-
// // if (isPointInPolygon(panelCenter, projectedOffsetRoof.polygon)) {
|
|
289
|
-
// // panels.push({
|
|
290
|
-
// // panel: panelType,
|
|
291
|
-
// // pixelPosition: panelCenter
|
|
292
|
-
// // });
|
|
293
|
-
// // }
|
|
294
|
-
// // currentY += rowSpacing;
|
|
295
|
-
// // }
|
|
296
|
-
// // currentX += panelSpacing;
|
|
297
|
-
// // currentY = highestSegment.start.y;
|
|
298
|
-
// // }
|
|
299
|
-
// // }
|
|
300
|
-
// }
|
|
301
|
-
// for (const panel of panels) {
|
|
302
|
-
// const undoOffset = {
|
|
303
|
-
// x: panel.pixelPosition.x + projectedOffsetRoof.offset.x,
|
|
304
|
-
// y: panel.pixelPosition.y + projectedOffsetRoof.offset.y,
|
|
305
|
-
// };
|
|
306
|
-
// const projectedPanel = projectPoint(undoOffset, azimuth);
|
|
307
|
-
// undidPanels.push({
|
|
308
|
-
// panel: panel.panel,
|
|
309
|
-
// pixelPosition: projectedPanel,
|
|
310
|
-
// });
|
|
311
|
-
// }
|
|
312
|
-
// return panels;
|
|
313
|
-
// project the polygon points such that the azimuth is 0 degrees
|
|
314
|
-
// this means that the solar panel are aligned perfectly with the coordinate system
|
|
315
|
-
//
|
|
316
|
-
// 1. below point and height is height
|
|
317
|
-
// for each point do the following
|
|
318
|
-
// draw a line along the y-axis of the projected coordinate system (this is the perpendicular of the azimuth)
|
|
319
|
-
// find all the intersection of that line with the roof polygon
|
|
320
|
-
// get all points that are within the height of the solar panel in the direction of the azimuth
|
|
321
|
-
//
|
|
322
|
-
// for each point generate a line along the y-axis of the projected coordinate system (this is the perpendicular of the azimuth)
|
|
323
|
-
// find all points on that line that intersect with the roof polygon bounds
|
|
324
|
-
// if the number of points is even
|
|
325
|
-
//
|
|
326
|
-
// const positionedPanels: PositionedSolarPanel[] = [];
|
|
327
|
-
// let bestPanelCount = 0;
|
|
328
|
-
// let bestPanelArrangement: PositionedSolarPanel[] = [];
|
|
329
|
-
// // Get roof details
|
|
330
|
-
// const { azimuth } = roof.details;
|
|
331
|
-
// const perpendicularAzimuth = (azimuth + 90) % 360;
|
|
332
|
-
// for (const point of roof.points) {
|
|
333
|
-
// const row = createPanelRow(point, false, false);
|
|
334
|
-
// positionedPanels.push(...row);
|
|
335
|
-
// }
|
|
336
|
-
// Helper function to create a panel row
|
|
337
|
-
// const createPanelRow = (startPoint: Point, isRotated: boolean, isAbove: boolean): PositionedSolarPanel[] => {
|
|
338
|
-
// const rowPanels: PositionedSolarPanel[] = [];
|
|
339
|
-
// const panelWidth = isRotated ? panelType.heightMeters : panelType.widthMeters;
|
|
340
|
-
// const panelHeight = isRotated ? panelType.widthMeters : panelType.heightMeters;
|
|
341
|
-
// // Calculate row direction based on azimuth
|
|
342
|
-
// const rowAngle = perpendicularAzimuth * (Math.PI / 180);
|
|
343
|
-
// const rowDirX = Math.cos(rowAngle);
|
|
344
|
-
// const rowDirY = Math.sin(rowAngle);
|
|
345
|
-
// // Calculate panel spacing direction based on azimuth
|
|
346
|
-
// const panelAngle = azimuth * (Math.PI / 180);
|
|
347
|
-
// const panelDirX = Math.cos(panelAngle);
|
|
348
|
-
// const panelDirY = Math.sin(panelAngle);
|
|
349
|
-
// // Calculate row width (distance from start to end of roof in perpendicular direction)
|
|
350
|
-
// let maxRowWidth = 0;
|
|
351
|
-
// for (const point of roof.points) {
|
|
352
|
-
// const dx = point.x - startPoint.x;
|
|
353
|
-
// const dy = point.y - startPoint.y;
|
|
354
|
-
// const width = Math.abs(dx * rowDirX + dy * rowDirY);
|
|
355
|
-
// maxRowWidth = Math.max(maxRowWidth, width);
|
|
356
|
-
// }
|
|
357
|
-
// // Place panels along the row
|
|
358
|
-
// const numPanels = Math.floor(maxRowWidth / panelWidth);
|
|
359
|
-
// for (let i = 0; i < numPanels; i++) {
|
|
360
|
-
// const panelX = startPoint.x + i * panelWidth * rowDirX;
|
|
361
|
-
// const panelY = startPoint.y + i * panelWidth * rowDirY;
|
|
362
|
-
// // Check if panel center is within roof polygon
|
|
363
|
-
// const panelCenter = {
|
|
364
|
-
// x: panelX + (panelWidth / 2) * rowDirX + (panelHeight / 2) * panelDirX,
|
|
365
|
-
// y: panelY + (panelWidth / 2) * rowDirY + (panelHeight / 2) * panelDirY
|
|
366
|
-
// };
|
|
367
|
-
// if (isPointInPolygon(panelCenter, roof)) {
|
|
368
|
-
// rowPanels.push({
|
|
369
|
-
// panel: panelType,
|
|
370
|
-
// pixelPosition: {
|
|
371
|
-
// x: panelCenter.x,
|
|
372
|
-
// y: panelCenter.y
|
|
373
|
-
// }
|
|
374
|
-
// });
|
|
375
|
-
// }
|
|
376
|
-
// }
|
|
377
|
-
// return rowPanels;
|
|
378
|
-
// };
|
|
379
|
-
// // Try each corner and arrangement
|
|
380
|
-
// for (const corner of roof.points) {
|
|
381
|
-
// // Try all four arrangements for this corner
|
|
382
|
-
// const arrangements = [
|
|
383
|
-
// { isRotated: false, isAbove: false },
|
|
384
|
-
// { isRotated: false, isAbove: true },
|
|
385
|
-
// { isRotated: true, isAbove: false },
|
|
386
|
-
// { isRotated: true, isAbove: true }
|
|
387
|
-
// ];
|
|
388
|
-
// for (const arrangement of arrangements) {
|
|
389
|
-
// const currentPanels: PositionedSolarPanel[] = [];
|
|
390
|
-
// const { isRotated, isAbove } = arrangement;
|
|
391
|
-
// // Create initial row
|
|
392
|
-
// const initialRow = createPanelRow(corner, isRotated, isAbove);
|
|
393
|
-
// currentPanels.push(...initialRow);
|
|
394
|
-
// // Add rows above and below
|
|
395
|
-
// const panelHeight = isRotated ? panelType.widthMeters : panelType.heightMeters;
|
|
396
|
-
// const rowSpacing = panelHeight + borderOffset;
|
|
397
|
-
// // Calculate direction for adding rows
|
|
398
|
-
// const rowAngle = azimuth * (Math.PI / 180);
|
|
399
|
-
// const rowDirX = Math.cos(rowAngle);
|
|
400
|
-
// const rowDirY = Math.sin(rowAngle);
|
|
401
|
-
// // Add rows in both directions
|
|
402
|
-
// let rowOffset = rowSpacing;
|
|
403
|
-
// while (true) {
|
|
404
|
-
// const newRowPoint = {
|
|
405
|
-
// x: corner.x + rowOffset * rowDirX,
|
|
406
|
-
// y: corner.y + rowOffset * rowDirY
|
|
407
|
-
// };
|
|
408
|
-
// const newRow = createPanelRow(newRowPoint, isRotated, isAbove);
|
|
409
|
-
// if (newRow.length === 0) break;
|
|
410
|
-
// currentPanels.push(...newRow);
|
|
411
|
-
// rowOffset += rowSpacing;
|
|
412
|
-
// }
|
|
413
|
-
// rowOffset = -rowSpacing;
|
|
414
|
-
// while (true) {
|
|
415
|
-
// const newRowPoint = {
|
|
416
|
-
// x: corner.x + rowOffset * rowDirX,
|
|
417
|
-
// y: corner.y + rowOffset * rowDirY
|
|
418
|
-
// };
|
|
419
|
-
// const newRow = createPanelRow(newRowPoint, isRotated, isAbove);
|
|
420
|
-
// if (newRow.length === 0) break;
|
|
421
|
-
// currentPanels.push(...newRow);
|
|
422
|
-
// rowOffset -= rowSpacing;
|
|
423
|
-
// }
|
|
424
|
-
// // Update best arrangement if this one has more panels
|
|
425
|
-
// if (currentPanels.length > bestPanelCount) {
|
|
426
|
-
// bestPanelCount = currentPanels.length;
|
|
427
|
-
// bestPanelArrangement = currentPanels;
|
|
428
|
-
// }
|
|
429
|
-
// }
|
|
430
|
-
// }
|
|
431
|
-
// return bestPanelArrangement;
|
|
432
|
-
}
|
|
433
205
|
/**
|
|
434
206
|
* Uses the bounding box of the roof and the roof segment bounding boxes to find the best fitting roof segment.
|
|
435
207
|
* @param roof the roof shape
|