@crystaldesign/diva-web-planner-react 26.11.0-beta.24 → 26.11.0-beta.26
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/build/esm/{Planner2DGrid-90b0b2a9.js → Planner2DGrid-20c5b046.js} +1 -1
- package/build/esm/{Planner3DImage-28657013.js → Planner3DImage-963b8118.js} +1 -1
- package/build/esm/{UnlockCard-3f4735b2.js → UnlockCard-28ebea4a.js} +1 -1
- package/build/esm/{index-7f6f1b6b.js → index-03ed7ea9.js} +5 -5
- package/build/esm/{index-df454423.js → index-056d96ed.js} +1 -1
- package/build/esm/{index-3964358a.js → index-071aca22.js} +1 -1
- package/build/esm/{index-e767e0d1.js → index-07895859.js} +1 -1
- package/build/esm/{index-aae35537.js → index-09ed48f9.js} +1 -1
- package/build/esm/{index-13908246.js → index-0a869e92.js} +2 -2
- package/build/esm/{index-04664096.js → index-0ae0436c.js} +1 -1
- package/build/esm/{index-5ce2f921.js → index-0b21ec16.js} +1 -1
- package/build/esm/{index-2504847e.js → index-0c567215.js} +66 -66
- package/build/esm/{index-0a53e583.js → index-0e03aa5d.js} +3 -3
- package/build/esm/{index-fdc1cd3c.js → index-11836f02.js} +5 -5
- package/build/esm/{index-05ec5456.js → index-11bd063b.js} +18 -18
- package/build/esm/{index-ddbf8330.js → index-1360f4f8.js} +3 -3
- package/build/esm/{index-44b596df.js → index-145afcdc.js} +2 -2
- package/build/esm/{index-65360616.js → index-15aae412.js} +101 -101
- package/build/esm/{index-d06a14dc.js → index-161b062f.js} +1 -1
- package/build/esm/{index-272415ce.js → index-16ae56dd.js} +1 -1
- package/build/esm/{index-8ee4175f.js → index-17910d15.js} +5 -5
- package/build/esm/{index-89a5bec9.js → index-18047614.js} +1 -1
- package/build/esm/{index-72ee1983.js → index-1aa870c6.js} +287 -233
- package/build/esm/{index-a85ea9d9.js → index-1b697982.js} +1 -1
- package/build/esm/{index-1835dddc.js → index-1bc369ff.js} +2 -2
- package/build/esm/{index-ef1abce5.js → index-1d8f03ca.js} +1 -1
- package/build/esm/{index-705b3b54.js → index-1d91e221.js} +1 -1
- package/build/esm/{index-a5b09047.js → index-1f269832.js} +5 -5
- package/build/esm/{index-9a25ac85.js → index-1fbf326a.js} +2 -2
- package/build/esm/{index-68993d98.js → index-21a8cda4.js} +1 -1
- package/build/esm/{index-1218ff75.js → index-21fe7b83.js} +1 -1
- package/build/esm/{index-9a7d0111.js → index-2268c934.js} +1 -1
- package/build/esm/{index-60ad7ed4.js → index-22ea69d3.js} +3 -3
- package/build/esm/{index-4dc2e098.js → index-231b7aac.js} +1 -1
- package/build/esm/{index-33ce2722.js → index-23b90612.js} +4 -4
- package/build/esm/{index-2e4dfaff.js → index-24906e34.js} +3 -3
- package/build/esm/{index-7ed4c41e.js → index-250aeb6a.js} +1 -1
- package/build/esm/{index-5c2d2107.js → index-2518c8e1.js} +71 -71
- package/build/esm/{index-fca70154.js → index-262131d4.js} +1 -1
- package/build/esm/{index-b24b2138.js → index-271ae2b2.js} +1 -1
- package/build/esm/{index-49757a8f.js → index-28dff3b4.js} +8 -8
- package/build/esm/{index-39484e30.js → index-2b22abc6.js} +1 -1
- package/build/esm/{index-2198f950.js → index-2bad91ff.js} +1 -1
- package/build/esm/{index-549b36e2.js → index-2e3f56ee.js} +1 -1
- package/build/esm/{index-49fc16cb.js → index-2e9350fa.js} +1 -1
- package/build/esm/{index-ab67e0fd.js → index-32077171.js} +19 -19
- package/build/esm/{index-97dd4545.js → index-325675d2.js} +1 -1
- package/build/esm/{index-ed85825f.js → index-3268b005.js} +1 -1
- package/build/esm/{index-84b299d6.js → index-3376b4d2.js} +5 -5
- package/build/esm/{index-73ff216a.js → index-33ebf4e7.js} +68 -68
- package/build/esm/{index-57c7e4b5.js → index-3454c76f.js} +1 -1
- package/build/esm/{index-ab484a17.js → index-34b43653.js} +1 -1
- package/build/esm/{index-33f96c00.js → index-354e1397.js} +1 -1
- package/build/esm/{index-50a4df67.js → index-3584de09.js} +3 -3
- package/build/esm/{index-8206408d.js → index-38316cc6.js} +1 -1
- package/build/esm/{index-fd3c7294.js → index-3d918648.js} +2 -2
- package/build/esm/{index-2b56d780.js → index-44f6c726.js} +1 -1
- package/build/esm/{index-c6392fa9.js → index-4588241d.js} +1 -1
- package/build/esm/{index-ad6e733c.js → index-47c29746.js} +3 -3
- package/build/esm/{index-3567cd34.js → index-4cd10932.js} +85 -85
- package/build/esm/{index-66de6a0b.js → index-4d5ac4ea.js} +6 -6
- package/build/esm/{index-b1054a03.js → index-4e25c6c1.js} +1 -1
- package/build/esm/{index-2a47f172.js → index-4f9b299a.js} +1 -1
- package/build/esm/{index-8573dbf4.js → index-4ffaea54.js} +3 -3
- package/build/esm/{index-d83af9ce.js → index-509a60eb.js} +90 -90
- package/build/esm/{index-62f57622.js → index-50df77eb.js} +1 -1
- package/build/esm/{index-50d5f4c5.js → index-52f4b555.js} +68 -68
- package/build/esm/{index-4f872377.js → index-53230069.js} +1 -1
- package/build/esm/{index-5da75e9a.js → index-54770292.js} +1 -1
- package/build/esm/{index-3d1b156f.js → index-55a09697.js} +5 -5
- package/build/esm/{index-becc5b76.js → index-5785c421.js} +1 -1
- package/build/esm/{index-1eda72f9.js → index-580ffbbd.js} +1 -1
- package/build/esm/{index-07de7393.js → index-587d7977.js} +1 -1
- package/build/esm/{index-859f0bb8.js → index-5b4e3190.js} +67 -67
- package/build/esm/{index-ad92fd09.js → index-5d2ff884.js} +1 -1
- package/build/esm/{index-43998f39.js → index-5e8646d5.js} +4 -4
- package/build/esm/{index-ad036a50.js → index-5f971317.js} +8 -8
- package/build/esm/{index-8621ba87.js → index-6092085b.js} +1 -1
- package/build/esm/{index-bd23079a.js → index-61544edf.js} +2 -2
- package/build/esm/{index-6bef7985.js → index-621a65be.js} +1 -1
- package/build/esm/{index-8c957291.js → index-626c282f.js} +1 -1
- package/build/esm/{index-a7496ea1.js → index-64f6e7e9.js} +2 -2
- package/build/esm/{index-df7347d9.js → index-656384fc.js} +5 -5
- package/build/esm/{index-65bed696.js → index-6634baf8.js} +5 -5
- package/build/esm/{index-a9ad56ce.js → index-681a3ac1.js} +3 -3
- package/build/esm/{index-c18aab5c.js → index-68e2afd4.js} +69 -69
- package/build/esm/{index-20014561.js → index-68f75004.js} +76 -76
- package/build/esm/{index-22389ed8.js → index-69435dfb.js} +1 -1
- package/build/esm/{index-a037c82b.js → index-6a41ff47.js} +1 -1
- package/build/esm/{index-8c986037.js → index-6a9b502c.js} +3 -3
- package/build/esm/{index-064a58a8.js → index-6b2638d8.js} +3 -3
- package/build/esm/{index-9e9f53c2.js → index-6b8425a0.js} +1 -1
- package/build/esm/{index-dcd805e9.js → index-6c18e276.js} +1 -1
- package/build/esm/{index-e5f412ac.js → index-6d9152b4.js} +3 -3
- package/build/esm/{index-73f8600d.js → index-6de11acc.js} +1 -1
- package/build/esm/{index-8da362e7.js → index-6de12718.js} +91 -91
- package/build/esm/{index-38012daa.js → index-774ad5c8.js} +1 -1
- package/build/esm/{index-b2e0a2a1.js → index-78ea8dcd.js} +65 -65
- package/build/esm/{index-c99ee01a.js → index-79ebe021.js} +3 -3
- package/build/esm/{index-73522d77.js → index-7a3dcaeb.js} +2 -2
- package/build/esm/{index-9ad37044.js → index-7a7902b5.js} +2 -2
- package/build/esm/{index-f9162546.js → index-7e138981.js} +1 -1
- package/build/esm/{index-1228f6d8.js → index-7e1de7aa.js} +1 -1
- package/build/esm/{index-39458526.js → index-7e4e4da0.js} +1 -1
- package/build/esm/{index-6485628e.js → index-7f0a74ca.js} +1 -1
- package/build/esm/{index-d5b82d9f.js → index-8023e085.js} +1 -1
- package/build/esm/{index-3cb7cf48.js → index-82fe51e2.js} +2 -2
- package/build/esm/{index-13eba10c.js → index-830c9243.js} +1 -1
- package/build/esm/{index-211856e0.js → index-837b24bc.js} +2 -2
- package/build/esm/{index-20bc3775.js → index-83ad51ac.js} +1 -1
- package/build/esm/{index-98a74c16.js → index-83afb562.js} +1 -1
- package/build/esm/{index-0e3bf26d.js → index-84bc582b.js} +5 -5
- package/build/esm/{index-8888ff80.js → index-84ded0d1.js} +1 -1
- package/build/esm/{index-1744c06c.js → index-851d1230.js} +65 -65
- package/build/esm/{index-8063c96d.js → index-85adbebc.js} +4 -4
- package/build/esm/{index-d5081d20.js → index-867bf97f.js} +1 -1
- package/build/esm/{index-c99d015b.js → index-8722c682.js} +20 -20
- package/build/esm/{index-8a59028d.js → index-894b68fc.js} +3 -3
- package/build/esm/{index-65f10148.js → index-894c98d9.js} +1 -1
- package/build/esm/{index-2cf61d00.js → index-89ce5aba.js} +1 -1
- package/build/esm/{index-02d964f2.js → index-8a689b86.js} +70 -70
- package/build/esm/{index-ea08c6de.js → index-8a8a7712.js} +1 -1
- package/build/esm/{index-271c9d9c.js → index-8b6d8852.js} +2 -2
- package/build/esm/{index-c05657b8.js → index-8bb54a75.js} +3 -3
- package/build/esm/{index-106a5856.js → index-8e022f05.js} +1 -1
- package/build/esm/{index-67ec2f5b.js → index-9309725d.js} +1 -1
- package/build/esm/{index-77c705e2.js → index-93988d3f.js} +2 -2
- package/build/esm/{index-7821be68.js → index-955f8cda.js} +5 -5
- package/build/esm/{index-cb5f8635.js → index-967e548a.js} +1 -1
- package/build/esm/{index-e8a4059f.js → index-99d1264a.js} +1 -1
- package/build/esm/{index-123ce416.js → index-9a36c481.js} +4 -4
- package/build/esm/{index-88842a4d.js → index-a157cf05.js} +13 -13
- package/build/esm/{index-d698061d.js → index-a2a3bf06.js} +1 -1
- package/build/esm/{index-e9898803.js → index-a3af5509.js} +2 -2
- package/build/esm/{index-07e3a28c.js → index-a5d47255.js} +2 -2
- package/build/esm/{index-24e2c9c9.js → index-a5ffce93.js} +2 -2
- package/build/esm/{index-f70555bd.js → index-a671525b.js} +1 -1
- package/build/esm/{index-ab4b4cb8.js → index-a6bd85d7.js} +89 -89
- package/build/esm/{index-13909b62.js → index-a6bebcfd.js} +3 -3
- package/build/esm/{index-ddc68a29.js → index-a765cb7d.js} +2 -2
- package/build/esm/{index-8e2a4f06.js → index-a7a4d87d.js} +2 -2
- package/build/esm/{index-9d2e27c1.js → index-a851e0d3.js} +1 -1
- package/build/esm/{index-22129d0b.js → index-ac2a2988.js} +1 -1
- package/build/esm/{index-9f4291ed.js → index-ad33df04.js} +84 -84
- package/build/esm/{index-a41aa14b.js → index-ad516df4.js} +1 -1
- package/build/esm/{index-5f5e67be.js → index-aeaf3cd3.js} +1 -1
- package/build/esm/{index-93e88012.js → index-b0498a14.js} +87 -87
- package/build/esm/{index-ad13b6fc.js → index-b0e755ba.js} +3 -3
- package/build/esm/{index-a91e9654.js → index-b185e53f.js} +1 -1
- package/build/esm/{index-85e0b5aa.js → index-b1c33a0a.js} +1 -1
- package/build/esm/{index-d829c70f.js → index-b252f8f5.js} +1 -1
- package/build/esm/{index-3d163534.js → index-b4c8f315.js} +4 -4
- package/build/esm/{index-f7feac8d.js → index-b4ec3856.js} +2 -2
- package/build/esm/{index-f691c6e8.js → index-b6f5fbff.js} +8 -8
- package/build/esm/{index-ef359752.js → index-b772fc46.js} +100 -100
- package/build/esm/{index-76047a52.js → index-b82dd4c0.js} +1 -1
- package/build/esm/{index-5f9f2b96.js → index-b8655009.js} +2 -2
- package/build/esm/{index-00d11115.js → index-b8a541de.js} +73 -73
- package/build/esm/{index-eddc2d8c.js → index-b9dcc7e7.js} +1 -1
- package/build/esm/{index-0876ef9d.js → index-ba51f858.js} +2 -2
- package/build/esm/{index-73fa2cb7.js → index-bb77b073.js} +7 -7
- package/build/esm/{index-5c0d278a.js → index-bc13f663.js} +15 -15
- package/build/esm/{index-c3198b88.js → index-bded6e15.js} +3 -3
- package/build/esm/{index-9cde92a8.js → index-be8ac18d.js} +1 -1
- package/build/esm/{index-2df35005.js → index-be94ce73.js} +2 -2
- package/build/esm/{index-d9774535.js → index-becc298e.js} +66 -66
- package/build/esm/{index-a719f387.js → index-bf9cf203.js} +1 -1
- package/build/esm/{index-5993cf4b.js → index-bfdd7c58.js} +1 -1
- package/build/esm/{index-b07c2a2c.js → index-c0e684e4.js} +1 -1
- package/build/esm/{index-efd1e97a.js → index-c1668664.js} +1 -1
- package/build/esm/{index-66a6a18d.js → index-c17e62c7.js} +1 -1
- package/build/esm/{index-968e5dc1.js → index-c3b01a1c.js} +1 -1
- package/build/esm/{index-d9100a6f.js → index-c3c7027b.js} +1 -1
- package/build/esm/{index-85c5d4eb.js → index-c5ce766b.js} +2 -2
- package/build/esm/{index-1d5baa3b.js → index-c8c0e594.js} +2 -2
- package/build/esm/{index-ef505e6e.js → index-c9802001.js} +1 -1
- package/build/esm/{index-78c7d4ae.js → index-ca04122c.js} +2 -2
- package/build/esm/{index-4cab5cbf.js → index-caa4d2e7.js} +18 -18
- package/build/esm/{index-433182bc.js → index-ceb4cb33.js} +1 -1
- package/build/esm/{index-fa8ac48e.js → index-d09dea68.js} +1 -1
- package/build/esm/{index-e5759f7d.js → index-d256dece.js} +1 -1
- package/build/esm/{index-5831525e.js → index-d2d6c32a.js} +1 -1
- package/build/esm/{index-747a1a0d.js → index-d35ad0e8.js} +1 -1
- package/build/esm/{index-e8a45d13.js → index-d3aea8a8.js} +1 -1
- package/build/esm/{index-f17b5e41.js → index-d4a870b1.js} +1 -1
- package/build/esm/{index-3f967ab7.js → index-d75b71ee.js} +18 -18
- package/build/esm/{index-0a2fbce8.js → index-d8b3c6ad.js} +1 -1
- package/build/esm/{index-9eaa57b1.js → index-da72bba6.js} +1 -1
- package/build/esm/{index-fd418d94.js → index-dc7daad0.js} +7 -1
- package/build/esm/{index-0ec61a56.js → index-dd0a2de8.js} +1 -1
- package/build/esm/{index-81925f76.js → index-dd355e40.js} +2 -2
- package/build/esm/{index-830447ef.js → index-de66d32f.js} +90 -90
- package/build/esm/{index-20a02afb.js → index-e3e0af0f.js} +2 -2
- package/build/esm/{index-95d16f7e.js → index-e4595a0f.js} +2 -2
- package/build/esm/{index-223d941a.js → index-e547111b.js} +17 -17
- package/build/esm/{index-18556074.js → index-e5c3a1fe.js} +2 -2
- package/build/esm/{index-e971f57c.js → index-e66623f8.js} +2 -2
- package/build/esm/{index-0da8e4f5.js → index-e7d957d6.js} +1 -1
- package/build/esm/{index-a4b879c2.js → index-e8002f60.js} +1 -1
- package/build/esm/{index-42f2a415.js → index-e97939ee.js} +5 -5
- package/build/esm/{index-afd04cc2.js → index-eb0bb1e5.js} +2 -2
- package/build/esm/{index-0c8051ed.js → index-ec8adaa2.js} +1 -1
- package/build/esm/{index-b12de26e.js → index-ed1c44e1.js} +18 -18
- package/build/esm/{index-beb68489.js → index-efb2928c.js} +2 -2
- package/build/esm/{index-d63d7688.js → index-efccc9fa.js} +1 -1
- package/build/esm/{index-3a751e91.js → index-f1ae909d.js} +5 -5
- package/build/esm/{index-373b7273.js → index-f1bf3911.js} +3 -3
- package/build/esm/{index-cc14ced5.js → index-f341bb0b.js} +6 -6
- package/build/esm/{index-a937a019.js → index-f34a5f13.js} +3 -3
- package/build/esm/{index-e27608a7.js → index-f4b3d18f.js} +5 -5
- package/build/esm/{index-bb347706.js → index-f5c48b77.js} +1 -1
- package/build/esm/{index-e5e1e1e1.js → index-f666a1df.js} +22 -22
- package/build/esm/{index-9f6f568f.js → index-f6c27d46.js} +21 -21
- package/build/esm/{index-e497d62f.js → index-f8cb8f09.js} +73 -73
- package/build/esm/{index-88ed1db7.js → index-fac02142.js} +1 -1
- package/build/esm/{index-7f58c94e.js → index-fb01e8ea.js} +1 -1
- package/build/esm/{index-5ba34b19.js → index-fb5786c3.js} +1 -1
- package/build/esm/{index-f32bfafc.js → index-fc5959ed.js} +7 -7
- package/build/esm/{index-9aa458c5.js → index-fdb7442b.js} +1 -1
- package/build/esm/{index-feb5a4a4.js → index-fe9af47e.js} +25 -25
- package/build/esm/{index-eef9c61f.js → index-ff2d1bf7.js} +70 -70
- package/build/esm/{index-c185167d.js → index-ff8e5fb4.js} +1 -1
- package/build/esm/{index-d2a71f57.js → index-ffe2e843.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.module-07458b83.js → index.module-0be7735d.js} +1 -1
- package/build/esm/{index.module-c9d42cc7.js → index.module-179362f0.js} +1 -1
- package/build/esm/{index.module-88b6990a.js → index.module-2c4d6a59.js} +1 -1
- package/build/esm/{index.module-5128abcd.js → index.module-6a014562.js} +1 -1
- package/build/esm/{index.module-cf367203.js → index.module-7a32c549.js} +1 -1
- package/build/esm/{index.module-4bbdd455.js → index.module-9ee5691b.js} +1 -1
- package/build/esm/{index.module-86ecbbdf.js → index.module-c23ccfad.js} +1 -1
- package/build/esm/{index.module-27f96c80.js → index.module-def2ac3d.js} +1 -1
- package/build/esm/{useCustomDimensions-79359314.js → useCustomDimensions-6556c942.js} +1 -1
- package/build/esm/{ussIsSticky-016ed6ab.js → ussIsSticky-3beef963.js} +1 -1
- package/build/types/web-planner-react/src/components/Product/ProductCenter/PlannerRTVNext/index.d.ts.map +1 -1
- package/build/types/web-planner-react/src/model/index.d.ts.map +1 -1
- package/build/types/web-planner-react/src/utils/rtvNext.d.ts +12 -0
- package/build/types/web-planner-react/src/utils/rtvNext.d.ts.map +1 -1
- package/build/umd/7118.diva-web-planner-react.umd.min.js +1 -1
- package/build/umd/7909.diva-web-planner-react.umd.min.js +1 -1
- package/build/umd/9715.diva-web-planner-react.umd.min.js +1 -1
- package/build/umd/diva-web-planner-react.umd.min.js +1 -1
- package/build/umd/report.html +1 -1
- package/package.json +10 -9
|
@@ -2,15 +2,15 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
3
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
4
4
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
5
|
-
import { s as styleInject, u as useViewHandler, P as PricePreview, G as GenericToolTip } from './index-
|
|
5
|
+
import { s as styleInject, u as useViewHandler, P as PricePreview, G as GenericToolTip } from './index-1aa870c6.js';
|
|
6
6
|
import classnames from 'classnames';
|
|
7
7
|
import { observer } from 'mobx-react-lite';
|
|
8
8
|
import { useState } from 'react';
|
|
9
9
|
import { useDivaCore } from '@crystaldesign/diva-core';
|
|
10
10
|
import { useHover, useLayer } from 'react-laag';
|
|
11
|
-
import MetaData from './index-
|
|
12
|
-
import SubTabGroup from './index-
|
|
13
|
-
import InfoIcon from './index-
|
|
11
|
+
import MetaData from './index-b82dd4c0.js';
|
|
12
|
+
import SubTabGroup from './index-68e2afd4.js';
|
|
13
|
+
import InfoIcon from './index-83ad51ac.js';
|
|
14
14
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
15
15
|
import 'react-dynamic-multi-render';
|
|
16
16
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -26,83 +26,83 @@ import 'flat';
|
|
|
26
26
|
import 'react-switch';
|
|
27
27
|
import 'react-countup';
|
|
28
28
|
import 'react-collapsible';
|
|
29
|
-
import './index-
|
|
30
|
-
import './index-
|
|
31
|
-
import './index-
|
|
29
|
+
import './index-b9dcc7e7.js';
|
|
30
|
+
import './index-5b4e3190.js';
|
|
31
|
+
import './index-8722c682.js';
|
|
32
32
|
import 'sift';
|
|
33
|
-
import './index-
|
|
34
|
-
import './index-
|
|
35
|
-
import './index-
|
|
36
|
-
import './index-
|
|
37
|
-
import './index.module-
|
|
38
|
-
import './index-
|
|
33
|
+
import './index-83afb562.js';
|
|
34
|
+
import './index-a2a3bf06.js';
|
|
35
|
+
import './index-53230069.js';
|
|
36
|
+
import './index-23b90612.js';
|
|
37
|
+
import './index.module-6a014562.js';
|
|
38
|
+
import './index-16ae56dd.js';
|
|
39
39
|
import '@mui/icons-material/Block';
|
|
40
40
|
import '@mui/icons-material/Warning';
|
|
41
|
-
import './index-
|
|
41
|
+
import './index-5f971317.js';
|
|
42
42
|
import 'react-dropdown';
|
|
43
|
-
import './index-
|
|
43
|
+
import './index-11836f02.js';
|
|
44
44
|
import '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
45
|
-
import './index-
|
|
46
|
-
import './index-
|
|
47
|
-
import './index-
|
|
45
|
+
import './index-93988d3f.js';
|
|
46
|
+
import './index-38316cc6.js';
|
|
47
|
+
import './index-b4ec3856.js';
|
|
48
48
|
import '@crystaldesign/content-box';
|
|
49
|
-
import './index-
|
|
50
|
-
import './index-
|
|
51
|
-
import './index-
|
|
52
|
-
import './index-
|
|
49
|
+
import './index-271ae2b2.js';
|
|
50
|
+
import './index-0b21ec16.js';
|
|
51
|
+
import './index-7e138981.js';
|
|
52
|
+
import './index-1fbf326a.js';
|
|
53
53
|
import 'swiper/react';
|
|
54
54
|
import 'swiper/modules';
|
|
55
|
-
import './UnlockCard-
|
|
56
|
-
import './index-
|
|
57
|
-
import './index-
|
|
58
|
-
import './index-
|
|
59
|
-
import './index-
|
|
60
|
-
import './index-
|
|
61
|
-
import './index-
|
|
62
|
-
import './index.module-
|
|
63
|
-
import './index-
|
|
64
|
-
import './index-
|
|
65
|
-
import './index-
|
|
66
|
-
import './index-
|
|
67
|
-
import './index-
|
|
68
|
-
import './index.module-
|
|
69
|
-
import './index-
|
|
70
|
-
import './index-
|
|
71
|
-
import './index-
|
|
72
|
-
import './index-
|
|
73
|
-
import './index-
|
|
74
|
-
import './index-
|
|
75
|
-
import './index-
|
|
76
|
-
import './index-
|
|
77
|
-
import './index-
|
|
78
|
-
import './index-
|
|
79
|
-
import './index-
|
|
80
|
-
import './index-
|
|
55
|
+
import './UnlockCard-28ebea4a.js';
|
|
56
|
+
import './index-b4c8f315.js';
|
|
57
|
+
import './index-fe9af47e.js';
|
|
58
|
+
import './index-c9802001.js';
|
|
59
|
+
import './index-161b062f.js';
|
|
60
|
+
import './index-7e1de7aa.js';
|
|
61
|
+
import './index-e97939ee.js';
|
|
62
|
+
import './index.module-9ee5691b.js';
|
|
63
|
+
import './index-ad516df4.js';
|
|
64
|
+
import './index-c3c7027b.js';
|
|
65
|
+
import './index-ec8adaa2.js';
|
|
66
|
+
import './index-867bf97f.js';
|
|
67
|
+
import './index-681a3ac1.js';
|
|
68
|
+
import './index.module-c23ccfad.js';
|
|
69
|
+
import './index-7a7902b5.js';
|
|
70
|
+
import './index-830c9243.js';
|
|
71
|
+
import './index-3584de09.js';
|
|
72
|
+
import './index-dd0a2de8.js';
|
|
73
|
+
import './index-55a09697.js';
|
|
74
|
+
import './index-3376b4d2.js';
|
|
75
|
+
import './index-6d9152b4.js';
|
|
76
|
+
import './index-0e03aa5d.js';
|
|
77
|
+
import './index-580ffbbd.js';
|
|
78
|
+
import './index-24906e34.js';
|
|
79
|
+
import './index-250aeb6a.js';
|
|
80
|
+
import './index-84ded0d1.js';
|
|
81
81
|
import 'rc-slider';
|
|
82
|
-
import './index-
|
|
83
|
-
import './index-
|
|
84
|
-
import './index-
|
|
85
|
-
import './index-
|
|
86
|
-
import './index-
|
|
82
|
+
import './index-bded6e15.js';
|
|
83
|
+
import './index-e3e0af0f.js';
|
|
84
|
+
import './index-61544edf.js';
|
|
85
|
+
import './index-11bd063b.js';
|
|
86
|
+
import './index-6a41ff47.js';
|
|
87
87
|
import 'react-confetti-explosion';
|
|
88
|
-
import './index-
|
|
89
|
-
import './index-
|
|
90
|
-
import './index-
|
|
88
|
+
import './index-f1ae909d.js';
|
|
89
|
+
import './index-b0e755ba.js';
|
|
90
|
+
import './index-2bad91ff.js';
|
|
91
91
|
import 'react-qr-code';
|
|
92
|
-
import './index-
|
|
93
|
-
import './useCustomDimensions-
|
|
94
|
-
import './index-
|
|
95
|
-
import './ussIsSticky-
|
|
96
|
-
import './index-
|
|
97
|
-
import './index-
|
|
98
|
-
import './index-
|
|
99
|
-
import './index.module-
|
|
100
|
-
import './index-
|
|
101
|
-
import './index-
|
|
102
|
-
import './index-
|
|
103
|
-
import './index-
|
|
104
|
-
import './index-
|
|
105
|
-
import './index-
|
|
92
|
+
import './index-4588241d.js';
|
|
93
|
+
import './useCustomDimensions-6556c942.js';
|
|
94
|
+
import './index-18047614.js';
|
|
95
|
+
import './ussIsSticky-3beef963.js';
|
|
96
|
+
import './index-b6f5fbff.js';
|
|
97
|
+
import './index-bb77b073.js';
|
|
98
|
+
import './index-22ea69d3.js';
|
|
99
|
+
import './index.module-179362f0.js';
|
|
100
|
+
import './index-b185e53f.js';
|
|
101
|
+
import './index-e4595a0f.js';
|
|
102
|
+
import './index-8a8a7712.js';
|
|
103
|
+
import './index-54770292.js';
|
|
104
|
+
import './index-becc298e.js';
|
|
105
|
+
import './index-774ad5c8.js';
|
|
106
106
|
|
|
107
107
|
var accItem = "AccItem-2APRQ";
|
|
108
108
|
var wcSize = "wcSize-dO69R";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
-
import { u as useViewHandler } from './index-
|
|
3
|
+
import { u as useViewHandler } from './index-1aa870c6.js';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { observer } from 'mobx-react-lite';
|
|
6
6
|
import 'react';
|
package/build/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
export { A as AnalyzerComponentsProvider, G as GenericToolTip, M as MissingAnalyzerComponent, f as PlannerMsgItem, S as SettingsItemHeader, T as ToggleElement, V as ViewHandlerProvider, W as WebPlannerReact,
|
|
2
|
+
export { A as AnalyzerComponentsProvider, G as GenericToolTip, M as MissingAnalyzerComponent, f as PlannerMsgItem, S as SettingsItemHeader, T as ToggleElement, V as ViewHandlerProvider, W as WebPlannerReact, j as default, a as useAnalyzerComponents, c as usePlannerUIHandler, u as useViewHandler } from './index-1aa870c6.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@crystaldesign/diva-core';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
|
-
import { u as useViewHandler } from './index-
|
|
2
|
+
import { u as useViewHandler } from './index-1aa870c6.js';
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
|
|
5
5
|
var useCustomDimensions = function useCustomDimensions() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/Product/ProductCenter/PlannerRTVNext/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqC,MAAM,OAAO,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/Product/ProductCenter/PlannerRTVNext/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqC,MAAM,OAAO,CAAC;;;;AAspB1D,wBAAwC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/model/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/model/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAEhG,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAOhD,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,aAAa,EAAE,sBAAsB,CAAC;IACtC,SAAS,EAAE,OAAO,CAAC;CACpB;AAWD,eAAO,MAAM,mBAAmB,2CAA4C,KAAK,sBAsXhF,CAAC;AAEF,eAAO,MAAM,cAAc,uBAM1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,gDAM/B,CAAC"}
|
|
@@ -6,4 +6,16 @@
|
|
|
6
6
|
* never consults `getAllowRTV()`, so no AR/RTV catalog configuration is required or implied.
|
|
7
7
|
*/
|
|
8
8
|
export declare const rtvNextParamActive: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Registers a visible planner instance that runs the rtv-next viewer; returns the unregister.
|
|
11
|
+
* While any is live, {@link rtvNextActiveOnPage} makes hidden sibling planners defer their boot.
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerRtvNextViewer(): () => void;
|
|
14
|
+
/**
|
|
15
|
+
* True while an rtv-next viewer is (or will be) live on this page. The catalog switch
|
|
16
|
+
* (`DIVA3D_USE_RTV_NEXT`) only resolves after the visible planner's catalog load, so a hidden
|
|
17
|
+
* planner that mounts in the same instant still boots — this covers the `?rtv-next` boots and
|
|
18
|
+
* every instance mounted after the visible viewer is up.
|
|
19
|
+
*/
|
|
20
|
+
export declare function rtvNextActiveOnPage(): boolean;
|
|
9
21
|
//# sourceMappingURL=rtvNext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rtvNext.d.ts","sourceRoot":"","sources":["../../../../../src/utils/rtvNext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SAA+F,CAAC"}
|
|
1
|
+
{"version":3,"file":"rtvNext.d.ts","sourceRoot":"","sources":["../../../../../src/utils/rtvNext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SAA+F,CAAC;AAK/H;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,IAAI,CAQlD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 7118.diva-web-planner-react.umd.min.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkCrystaldesignDivaWebPlannerReact=self.webpackChunkCrystaldesignDivaWebPlannerReact||[]).push([[7118],{79837:(t,r,o)=>{o.d(r,{d:()=>a});var a="autoPlaceDrag"},57118:(t,r,o)=>{o.r(r),o.d(r,{default:()=>O});var a=o(12952),i=o(80248),l=o(9204),c=o(32699),d=o(87363),u=o(9420),v=o(88683),p=o(95729),g=o.n(p),h=o(62052),m=o(79837),y=o(34988),b=o(84658),P=o(50747),S=o.n(P);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var a=0,i=function F(){};return{s:i,n:function n(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return c=t.done,t},e:function e(t){d=!0,l=t},f:function f(){try{c||null==o.return||o.return()}finally{if(d)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,a=Array(r);o<r;o++)a[o]=t[o];return a}function ownKeys(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,a)}return o}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(o),!0).forEach((function(r){(0,i.Z)(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}var I=(0,v.getLogger)("Planner","CreateImageShot"),x={width:3840,height:2160,formats:["png"],jpegQuality:.92,settleFrames:60,stableMs:800,cameraPadding:1.25};function blobToDataUrl(t){return new Promise((function(r,o){var a=new FileReader;a.onload=function(){return r(a.result)},a.onerror=function(){var t;return o(null!==(t=a.error)&&void 0!==t?t:new Error("Failed to read image blob"))},a.readAsDataURL(t)}))}function reencodeJpeg(t,r){return _reencodeJpeg.apply(this,arguments)}function _reencodeJpeg(){return(_reencodeJpeg=(0,b.Z)(S().mark((function _callee2(t,r){var o,a,i;return S().wrap((function _callee2$(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,createImageBitmap(t);case 2:if(o=l.sent,(a=document.createElement("canvas")).width=o.width,a.height=o.height,i=a.getContext("2d")){l.next=9;break}throw new Error("2D canvas context unavailable for JPEG encoding");case 9:return i.fillStyle="#ffffff",i.fillRect(0,0,a.width,a.height),i.drawImage(o,0,0),o.close(),l.abrupt("return",a.toDataURL("image/jpeg",r));case 14:case"end":return l.stop()}}),_callee2)})))).apply(this,arguments)}var w=o(47514);function PlannerRTVNext_ownKeys(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,a)}return o}function PlannerRTVNext_objectSpread(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?PlannerRTVNext_ownKeys(Object(o),!0).forEach((function(r){(0,i.Z)(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):PlannerRTVNext_ownKeys(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}function PlannerRTVNext_createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function PlannerRTVNext_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return PlannerRTVNext_arrayLikeToArray(t,r);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?PlannerRTVNext_arrayLikeToArray(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var a=0,i=function F(){};return{s:i,n:function n(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return c=t.done,t},e:function e(t){d=!0,l=t},f:function f(){try{c||null==o.return||o.return()}finally{if(d)throw l}}}}function PlannerRTVNext_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,a=Array(r);o<r;o++)a[o]=t[o];return a}var A=new Set(["PLANNER","ACC_PLANNER","PLANNER_2.0"]),D=new Set(["AVO","AVU","AVC","AVN","AVS"]),E={};function buildScene2D(t){var r,o=null===(r=t.divaWebPlanner.getCatalogData())||void 0===r?void 0:r.plan2DFontUrl,i=t.viewPlannerHandler.plannedElementsDict;if(!i||0===i.size)return{isPoolPlanning:!1};var l=function getDimensionConfigs(t){var r,o;return null!==(o=null===(r=t.divaWebPlanner.getCatalogData())||void 0===r?void 0:r.dimensionConfig2D)&&void 0!==o?o:E}(t),c=!1,d=[],u=1/0,v=1/0,p=-1/0,g=-1/0;if(i.forEach((function(r,o){var a,i=PlannerRTVNext_createForOfIteratorHelper(r);try{var h=function _loop(){var r,i,h,m,y,b=a.value,P=b.getWorldPosCenter(),S=null!==(r=b.getGlobalWidth())&&void 0!==r?r:0,I=null!==(i=b.getGlobalDepth())&&void 0!==i?i:0,x=b.getSVGData(),w=b.getHeightOLT(),A=b.getIsDockedAccessoire(),E=[],O=[],T=PlannerRTVNext_createForOfIteratorHelper(b.getAllDockingPoints());try{for(T.s();!(y=T.n()).done;){var R=y.value;O.push({dpId:R.DpId,type:R.Type,localOffset:[R.LocalWorldPos.x-S/2,R.LocalWorldPos.z-I/2],rotDeg:R.RotDeg,isDocking:R.IsDocking,onElementId:R.OnElementId,number:R.HasNumber?R.Number:void 0}),D.has(R.Type)&&(R.IsDocking&&A||E.push({dpId:R.DpId,localOffset:[R.LocalWorldPos.x-S/2,R.LocalWorldPos.z-I/2],iconRotDeg:R.RotDeg,isDocking:R.IsDocking,onElementId:R.OnElementId}))}}catch(t){T.e(t)}finally{T.f()}var k=b.getRotDeg()*Math.PI/180,C=Math.cos(k),_=Math.sin(k),j=function toLocalOutline(t){return t.map((function(t){var r=t.x-P.x,o=t.y-P.z;return[r*C+o*_,-r*_+o*C]}))},N=b.getOLTPolygonWorldPos(),V=b.getOLFPolygonWorldPos(),L=N.length>0||V.length>0?PlannerRTVNext_objectSpread(PlannerRTVNext_objectSpread({},N.length>0?{olt:j(N)}:{}),V.length>0?{olf:j(V)}:{}):void 0,M=l[b.ArticleCodex];null!=M&&(c=!0);var H=function resolveText(r){return function resolveOptionPlaceholders(t,r,o){var a;return o&&o.includes("{")&&null!==(a=t.divaWebPlanner.convertTemplateToCodex(r,o))&&void 0!==a?a:o}(t,b.getBasketId(),r)},G=null==M?void 0:M.dimensionConfig,B=G&&[G.widthPrefix,G.widthPostfix,G.depthPrefix,G.depthPostfix].some((function(t){return null==t?void 0:t.includes("{")}))?PlannerRTVNext_objectSpread(PlannerRTVNext_objectSpread({},G),{},{widthPrefix:H(G.widthPrefix),widthPostfix:H(G.widthPostfix),depthPrefix:H(G.depthPrefix),depthPostfix:H(G.depthPostfix)}):G,W=null!=M&&null!==(h=M.annotations)&&void 0!==h&&h.some((function(t){return t.text.includes("{")}))?M.annotations.map((function(t){var r;return PlannerRTVNext_objectSpread(PlannerRTVNext_objectSpread({},t),{},{text:null!==(r=H(t.text))&&void 0!==r?r:t.text})})):null==M?void 0:M.annotations;d.push({name:"Element".concat(b.getElementId()),setId:o,elementId:b.getElementId(),position:[P.x,P.z],pivotOffset:[0,0],rotation:b.getRotDeg(),width:S,depth:I,svgDataUrl:x?"data:image/svg+xml;base64,".concat(btoa(unescape(encodeURIComponent(x)))):void 0,height:w>0?w:void 0,dockingButtons:E.length>0?E:void 0,dockingPointsDebug:O.length>0?O:void 0,outlinesDebug:L,zLayer:null!==(m=null==M?void 0:M.zLayer)&&void 0!==m?m:b.getLayer(),opacity:null==M?void 0:M.opacity,dimensionConfig:B,annotations:W});var U=S/2,z=I/2;u=Math.min(u,P.x-U),p=Math.max(p,P.x+U),v=Math.min(v,P.z-z),g=Math.max(g,P.z+z)};for(i.s();!(a=i.n()).done;)h()}catch(t){i.e(t)}finally{i.f()}})),0===d.length)return{isPoolPlanning:c};var h=function buildDockingGroups(t){var r=new Map;function find(t){for(var o=t;r.get(o)!==o;)o=r.get(o);for(var a=t;a!==o;){var i=r.get(a);r.set(a,o),a=i}return o}function union(t,o){var a=find(t),i=find(o);a!==i&&r.set(a,i)}t.forEach((function(t){var o,a=PlannerRTVNext_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var i=o.value,l=i.getElementId();r.has(l)||r.set(l,l);var c,d=PlannerRTVNext_createForOfIteratorHelper(i.getDockingPoints());try{for(d.s();!(c=d.n()).done;){var u=c.value;if(u.IsDocking&&null!=u.OnElementId){var v=u.OnElementId;r.has(v)||r.set(v,v),union(l,v)}}}catch(t){d.e(t)}finally{d.f()}}}catch(t){a.e(t)}finally{a.f()}}));var o,i=new Map,l=PlannerRTVNext_createForOfIteratorHelper(r.keys());try{for(l.s();!(o=l.n()).done;){var c=o.value,d=find(c),u=i.get(d);u||(u=[],i.set(d,u)),u.push(c)}}catch(t){l.e(t)}finally{l.f()}return(0,a.Z)(i.values()).filter((function(t){return t.length>1}))}(i);return{scene2d:PlannerRTVNext_objectSpread(PlannerRTVNext_objectSpread({elements:d,boundingBox:{x:(u+p)/2,z:(v+g)/2,width:p-u,depth:g-v}},o?{fontUrl:o}:{}),h.length>0?{dockingGroups:h}:{}),isPoolPlanning:c}}function resolveAccessoryTargets(t,r){var o,a,i,l,c=null===(o=t.settingsState.plannedPlacesOnGrids)||void 0===o?void 0:o.find((function(t){var o;return(null!==(o=t.elementId)&&void 0!==o?o:"").replace(/^E/,"")===r.parentElementKey}));if(!c)return null;for(var d=0,u=Object.keys(c.grids);d<u.length;d++){var v=u[d],p=c.grids[v];if(p.idx===r.gridId){l=v;var g=p.accessories.find((function(t){return t.index===r.cellIdx}));if(g){a=g.basketId,i=g.articleCodex;break}}}return{parentBasketId:c.basketId,accBasketId:a,accCodex:i,gridName:l}}const O=(0,u.Pi)((function PlannerRTVNext(){var t,r,o,a,i,u,P,D=(0,l.NP)(),E=(0,c.Qv)(),O=(0,v.useDivaCore)(),T=O.state,R=T.apiConfig,k=T.jwt,C=O.actions;(0,d.useEffect)((function(){(0,h.JB)("rtv: PlannerRTVNext mounted")}),[]);var _=(0,d.useRef)(D.hqRenderScript);(0,d.useEffect)((function(){D.hqRenderScript!==_.current&&(_.current=D.hqRenderScript,D.hqRenderScript&&C.toggleLoading("RTV_Assembling",!1,!0))}),[D.hqRenderScript,C]);var j=(0,d.useMemo)((function(){return{onElementSelected:function onElementSelected(t,r){D.viewPlannerHandler.onElementSelected(t,r)},onElementDeselected:function onElementDeselected(){D.viewPlannerHandler.onClearElementSelection()},updatePlannerTrans:function updatePlannerTrans(t,r,o,a,i,l,c,d){D.divaWebPlanner.updatePlannerTrans(t,r,{x:o.x,y:o.y,z:o.z},a,i,l,c,d)},getDockSnapPreview:function getDockSnapPreview(t,r,o,a){return D.divaWebPlanner.getDockSnapPreview(r,o,a)},onElementDeleted:function onElementDeleted(t,r){D.viewPlannerHandler.onElementDeleted(t,r)},onElementCopy:function onElementCopy(t,r,o){return D.viewPlannerHandler.onElementCopy(t,r,o)},onDockingPointInteraction:function onDockingPointInteraction(t,r,o,a,i){return D.viewPlannerHandler.onDockingPointInteraction(t,r,o,a,i)},onAccessoryPlace:function onAccessoryPlace(t,r,o,a){D.paletteViewHandler.addAccessorieOnShelfPlannerView(t,r,o,a)},onAccessoryDragOver:function onAccessoryDragOver(t){D.settingsState.setDraggedAccessoryHasTarget(t)},onAccessorySelect:function onAccessorySelect(t){var r=resolveAccessoryTargets(D,t);r&&D.paletteViewHandler.selectShelfAccessorie(r.accCodex,r.accBasketId)},onAccessoryDeselect:function onAccessoryDeselect(){D.paletteViewHandler.selectShelfAccessorie(void 0)},onAccessoryDelete:function onAccessoryDelete(t){var r=resolveAccessoryTargets(D,t);r&&D.paletteViewHandler.deleteAccessorieOnShelfPlannerView(t.gridId,t.cellIdx,r.parentBasketId)},onAccessoryMoveStart:function onAccessoryMoveStart(t){var r=resolveAccessoryTargets(D,t);if(r&&r.accBasketId&&r.gridName)return D.divaWebPlanner.getFreeToMovePlacesOnGrids(r.gridName,r.accBasketId,!0)},onAccessoryMove:function onAccessoryMove(t,r){var o=resolveAccessoryTargets(D,t);if(o&&o.accBasketId){var a=r.articleCodex&&r.articleCodex!==o.accCodex?r.articleCodex:void 0;D.divaWebPlanner.moveShelfItemToGrid(o.accBasketId,r.parentBasketId,r.gridName,r.cellIdx,a)}},onSceneReady:function onSceneReady(){(0,h.JB)("rtv: onSceneReady"),C.toggleLoading("RTV_Assembling",!1,!1)}}}),[D.viewPlannerHandler,D.divaWebPlanner,D,C]),N=D.productState.rtvSelectedElementId,V=D.isParentViewVisible,L=D.productState.doShowRTV,M=D.productState.doShow3DComb,H=D.productState.doShowGrid,G="CREATE_IMAGE"===D.configState.initMode,B=!V||!L&&!M&&!H&&!G,W=B?void 0:buildScene2D(D),U=null==W?void 0:W.scene2d,z=null!==(t=null==W?void 0:W.isPoolPlanning)&&void 0!==t&&t,J=null!==(r=null===(o=D.divaWebPlanner.getCatalogData())||void 0===o?void 0:o.rtvPreset)&&void 0!==r?r:p.WHITE_ROOM_PRESET;if(function useCreateImageShot(t,r,o){var a="CREATE_IMAGE"===t.configState.initMode,i=(0,d.useRef)(!1),l=a&&r?r.elements.map((function(t){return"".concat(t.elementId,":").concat(t.width,"x").concat(t.depth,"@").concat(t.position[0],",").concat(t.position[1])})).join("|"):"";(0,d.useEffect)((function(){if(a&&l&&!i.current){var r=_objectSpread(_objectSpread(_objectSpread({},x),o.createImage),t.configState.createImageConfig),c=window.setTimeout((0,b.Z)(S().mark((function _callee(){var o,a,l,c,d,u,v,g,h,m,b;return S().wrap((function _callee$(P){for(;;)switch(P.prev=P.next){case 0:if(!i.current){P.next=2;break}return P.abrupt("return");case 2:return i.current=!0,P.prev=3,a={id:"plan-2d",viewMode:"2d",showGrid:!1,showDimensionLines:!0,showPosNr:!1,environment:_objectSpread(_objectSpread(_objectSpread(_objectSpread({},(0,p.emitConfig)(p.ENVIRONMENT_CONFIG,p.useRTVStore.getState().resolvedEnvironment)),r.dimensionLineUnit?{dimensionLineUnit:r.dimensionLineUnit}:{}),void 0!==r.dimensionLineHideUnit?{dimensionLineHideUnit:r.dimensionLineHideUnit}:{}),r.dimensionLineColor?{dimensionLineColor:r.dimensionLineColor}:{}),resolution:{width:r.width,height:r.height},camera:{padding:r.cameraPadding},format:"png",settleFrames:r.settleFrames},P.next=7,p.useRTVStore.getState().captureShots({shots:[a]});case 7:if(l=P.sent,c=(0,y.Z)(l,1),d=c[0]){P.next=12;break}throw new Error("captureShots returned no result");case 12:u=[],v=_createForOfIteratorHelper(r.formats),P.prev=14,v.s();case 16:if((g=v.n()).done){P.next=31;break}if("jpeg"!==(h=g.value)){P.next=24;break}return P.next=21,reencodeJpeg(d.blob,r.jpegQuality);case 21:P.t0=P.sent,P.next=27;break;case 24:return P.next=26,blobToDataUrl(d.blob);case 26:P.t0=P.sent;case 27:m=P.t0,u.push({format:h,dataUrl:m,width:d.width,height:d.height});case 29:P.next=16;break;case 31:P.next=36;break;case 33:P.prev=33,P.t1=P.catch(14),v.e(P.t1);case 36:return P.prev=36,v.f(),P.finish(36);case 39:null===(o=t.actions)||void 0===o||o.onEvent({type:"planImageCreated",data:{images:u}}),P.next=47;break;case 42:P.prev=42,P.t2=P.catch(3),I.warn("CREATE_IMAGE capture failed",P.t2),i.current=!1,null===(b=t.actions)||void 0===b||b.onEvent({type:"planImageFailed",data:{message:P.t2 instanceof Error?P.t2.message:String(P.t2)}});case 47:case"end":return P.stop()}}),_callee,null,[[3,42],[14,33,36,39]])}))),r.stableMs);return function(){return window.clearTimeout(c)}}}),[a,l,t,o])}(D,U,J),B)return null;var K=H||G?"2d":"3d",q=null===(a=D.tabGroupState.curTabGroup)||void 0===a?void 0:a.type,Z=null!=q&&A.has(q),$=D.productState.rtvFocusElementId,Q=z||D.productState.doShow3DDimensionLines,X=function buildElementsInfoFromArticles(t){for(var r,o,a,i,l,c=new Map,d=t.settingsState.articleInfos,u=t.viewPlannerHandler.plannedElementsDict,v=t.productState.rtvSelectedElementId,p="SHELFPLANNER"===(null===(r=t.tabGroupState.curTabGroup)||void 0===r?void 0:r.type),g=null!=(l=null===(i=t.tabGroupState.curTabGroup)||void 0===i?void 0:i.type)&&A.has(l),h=null===(o=t.divaWebPlanner.getCatalogData())||void 0===o?void 0:o.elementCopyAVLR,m=null===(a=t.tabGroupState.curOption)||void 0===a?void 0:a.codex,y=null!=h&&(g||Array.isArray(h)&&null!=m&&h.includes(m)),b=function resolveState(t,r,o){return o?p||r?"selectable":"unselectable":p?"active":void 0!==t&&v===t?"selected":r?"active":"selectable"},P=new Map,S=0,I=Object.keys(d);S<I.length;S++){var x=d[I[S]];void 0!==x.elementId&&P.set(x.elementId,{setId:x.setId,posNr:String(x.posNr),isActive:x.isActive,canDelete:x.isActive,isShelfAccessoire:!!x.isShelfAccessoire,shelfElementId:x.shelfElementId})}u&&u.forEach((function(t,r){var o,a=PlannerRTVNext_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var i,l,d,u=o.value,v=u.getElementId(),p=u.getParentElementId(),g=P.get(v),h="BOX"===u.getPlannerType(),m=void 0,S=void 0,I=void 0,x=void 0;if(h){m=!0,S=!0;var w=u.getFreeDockingPointByTypeAndNumber("AVO",1);I=null!=w&&!w.IsDisabled}else!y||null!=p||null!=g&&g.isShelfAccessoire||(m=u.getFreeDockingPointsByType("AVL").some((function(t){return!t.IsDisabled})),S=u.getFreeDockingPointsByType("AVR").some((function(t){return!t.IsDisabled})),x=!0);var A=g?b(v,g.isActive,!!g.isShelfAccessoire):"unselectable",D=null!=g&&g.isShelfAccessoire?"shelfAccessoire":h?"boxElement":null!=p?"accessoire":"planned";c.set(null!==(i=null==g?void 0:g.shelfElementId)&&void 0!==i?i:String(v),{setId:null!==(l=null==g?void 0:g.setId)&&void 0!==l?l:r,posNr:null==g?void 0:g.posNr,state:A,type:D,articleCodex:u.ArticleCodex,canDelete:!!(null!=g&&g.isShelfAccessoire||x)||null!==(d=null==g?void 0:g.canDelete)&&void 0!==d&&d,parentElementId:p,canCopyLeft:m,canCopyRight:S,canCopyTop:I,copyAlwaysVisible:x})}}catch(t){a.e(t)}finally{a.f()}}));for(var w=0,D=Object.keys(d);w<D.length;w++){var E=d[D[w]];E.isShelfAccessoire&&E.shelfElementId&&!c.has(E.shelfElementId)&&c.set(E.shelfElementId,{setId:E.setId,posNr:String(E.posNr),state:b(E.elementId,E.isActive,!0),type:"shelfAccessoire",canDelete:!0})}return c}(D),Y=D.settingsState.selectedShelfAccessoire,ee=Y&&null!==(i=null===(u=Object.values(D.settingsState.articleInfos).find((function(t){return t.basketId===Y})))||void 0===u?void 0:u.shelfElementId)&&void 0!==i?i:null,te=ee?null===(P=X.get(ee))||void 0===P?void 0:P.state:void 0,ne=null!=ee&&null!=te&&"unselectable"!==te?ee:null,re="2d"!==K,oe=D.divaWebPlanner.getCatalogData(),ae=null!=oe&&oe.catalogCodex?{catalogCodex:oe.catalogCodex,iln:oe.supplierILN}:void 0;return(0,w.jsx)(g(),{catalogInfo:re?ae:void 0,hqRenderScript:re?D.hqRenderScript:void 0,scene2d:U,viewMode:K,stopRender:!V,config:{archiveBaseUrl:R.diva3darchive.endsWith("/")?R.diva3darchive.slice(0,-1):R.diva3darchive,constructorServiceUrl:R.constructorService,jwt:k,capabilities:{supports3d:!0},profiles:J.profiles,profileMode:J.profileMode,camera:J.camera,uiConfig:PlannerRTVNext_objectSpread({plannerMode:D.productState.isBoxPlanner?"BoxPlanner":"3DCOMB",accessoryPlacement:m.d},z?{hideUiIcons:!0}:{})},plannerMode:Z,freePlacesOnGrids:D.settingsState.freePlacesOnGrids,plannedPlacesOnGrids:D.settingsState.plannedPlacesOnGrids,armedAccessoryCodex:D.settingsState.armedAccessoryToken,draggedAccessoryCodex:D.settingsState.draggedAccessoryCodex,callbacks:j,analyzerComponents:E,focusElementId:$,elementsInfo:X,selectedElementId:N,selectedAccessoryKey:ne,showDimensionLines:Q})}))}}]);
|
|
2
|
+
"use strict";(self.webpackChunkCrystaldesignDivaWebPlannerReact=self.webpackChunkCrystaldesignDivaWebPlannerReact||[]).push([[7118],{79837:(t,r,o)=>{o.d(r,{d:()=>a});var a="autoPlaceDrag"},57118:(t,r,o)=>{o.r(r),o.d(r,{default:()=>T});var a=o(12952),i=o(80248),l=o(9204),c=o(32699),d=o(87363),u=o(9420),v=o(88683),p=o(95729),g=o.n(p),h=o(62052),m=o(79837),y=o(71442),b=o(34988),P=o(84658),S=o(50747),I=o.n(S);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var a=0,i=function F(){};return{s:i,n:function n(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return c=t.done,t},e:function e(t){d=!0,l=t},f:function f(){try{c||null==o.return||o.return()}finally{if(d)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,a=Array(r);o<r;o++)a[o]=t[o];return a}function ownKeys(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,a)}return o}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(o),!0).forEach((function(r){(0,i.Z)(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}var x=(0,v.getLogger)("Planner","CreateImageShot"),w={width:3840,height:2160,formats:["png"],jpegQuality:.92,settleFrames:60,stableMs:800,cameraPadding:1.25};function blobToDataUrl(t){return new Promise((function(r,o){var a=new FileReader;a.onload=function(){return r(a.result)},a.onerror=function(){var t;return o(null!==(t=a.error)&&void 0!==t?t:new Error("Failed to read image blob"))},a.readAsDataURL(t)}))}function reencodeJpeg(t,r){return _reencodeJpeg.apply(this,arguments)}function _reencodeJpeg(){return(_reencodeJpeg=(0,P.Z)(I().mark((function _callee2(t,r){var o,a,i;return I().wrap((function _callee2$(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,createImageBitmap(t);case 2:if(o=l.sent,(a=document.createElement("canvas")).width=o.width,a.height=o.height,i=a.getContext("2d")){l.next=9;break}throw new Error("2D canvas context unavailable for JPEG encoding");case 9:return i.fillStyle="#ffffff",i.fillRect(0,0,a.width,a.height),i.drawImage(o,0,0),o.close(),l.abrupt("return",a.toDataURL("image/jpeg",r));case 14:case"end":return l.stop()}}),_callee2)})))).apply(this,arguments)}var A=o(47514);function PlannerRTVNext_ownKeys(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),o.push.apply(o,a)}return o}function PlannerRTVNext_objectSpread(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?PlannerRTVNext_ownKeys(Object(o),!0).forEach((function(r){(0,i.Z)(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):PlannerRTVNext_ownKeys(Object(o)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r))}))}return t}function PlannerRTVNext_createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function PlannerRTVNext_unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return PlannerRTVNext_arrayLikeToArray(t,r);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?PlannerRTVNext_arrayLikeToArray(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var a=0,i=function F(){};return{s:i,n:function n(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return c=t.done,t},e:function e(t){d=!0,l=t},f:function f(){try{c||null==o.return||o.return()}finally{if(d)throw l}}}}function PlannerRTVNext_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,a=Array(r);o<r;o++)a[o]=t[o];return a}var D=new Set(["PLANNER","ACC_PLANNER","PLANNER_2.0"]),E=new Set(["AVO","AVU","AVC","AVN","AVS"]),O={};function buildScene2D(t){var r,o=null===(r=t.divaWebPlanner.getCatalogData())||void 0===r?void 0:r.plan2DFontUrl,i=t.viewPlannerHandler.plannedElementsDict;if(!i||0===i.size)return{isPoolPlanning:!1};var l=function getDimensionConfigs(t){var r,o;return null!==(o=null===(r=t.divaWebPlanner.getCatalogData())||void 0===r?void 0:r.dimensionConfig2D)&&void 0!==o?o:O}(t),c=!1,d=[],u=1/0,v=1/0,p=-1/0,g=-1/0;if(i.forEach((function(r,o){var a,i=PlannerRTVNext_createForOfIteratorHelper(r);try{var h=function _loop(){var r,i,h,m,y,b=a.value,P=b.getWorldPosCenter(),S=null!==(r=b.getGlobalWidth())&&void 0!==r?r:0,I=null!==(i=b.getGlobalDepth())&&void 0!==i?i:0,x=b.getSVGData(),w=b.getHeightOLT(),A=b.getIsDockedAccessoire(),D=[],O=[],T=PlannerRTVNext_createForOfIteratorHelper(b.getAllDockingPoints());try{for(T.s();!(y=T.n()).done;){var R=y.value;O.push({dpId:R.DpId,type:R.Type,localOffset:[R.LocalWorldPos.x-S/2,R.LocalWorldPos.z-I/2],rotDeg:R.RotDeg,isDocking:R.IsDocking,onElementId:R.OnElementId,number:R.HasNumber?R.Number:void 0}),E.has(R.Type)&&(R.IsDocking&&A||D.push({dpId:R.DpId,localOffset:[R.LocalWorldPos.x-S/2,R.LocalWorldPos.z-I/2],iconRotDeg:R.RotDeg,isDocking:R.IsDocking,onElementId:R.OnElementId}))}}catch(t){T.e(t)}finally{T.f()}var k=b.getRotDeg()*Math.PI/180,C=Math.cos(k),_=Math.sin(k),j=function toLocalOutline(t){return t.map((function(t){var r=t.x-P.x,o=t.y-P.z;return[r*C+o*_,-r*_+o*C]}))},N=b.getOLTPolygonWorldPos(),V=b.getOLFPolygonWorldPos(),L=N.length>0||V.length>0?PlannerRTVNext_objectSpread(PlannerRTVNext_objectSpread({},N.length>0?{olt:j(N)}:{}),V.length>0?{olf:j(V)}:{}):void 0,M=l[b.ArticleCodex];null!=M&&(c=!0);var H=function resolveText(r){return function resolveOptionPlaceholders(t,r,o){var a;return o&&o.includes("{")&&null!==(a=t.divaWebPlanner.convertTemplateToCodex(r,o))&&void 0!==a?a:o}(t,b.getBasketId(),r)},G=null==M?void 0:M.dimensionConfig,B=G&&[G.widthPrefix,G.widthPostfix,G.depthPrefix,G.depthPostfix].some((function(t){return null==t?void 0:t.includes("{")}))?PlannerRTVNext_objectSpread(PlannerRTVNext_objectSpread({},G),{},{widthPrefix:H(G.widthPrefix),widthPostfix:H(G.widthPostfix),depthPrefix:H(G.depthPrefix),depthPostfix:H(G.depthPostfix)}):G,W=null!=M&&null!==(h=M.annotations)&&void 0!==h&&h.some((function(t){return t.text.includes("{")}))?M.annotations.map((function(t){var r;return PlannerRTVNext_objectSpread(PlannerRTVNext_objectSpread({},t),{},{text:null!==(r=H(t.text))&&void 0!==r?r:t.text})})):null==M?void 0:M.annotations;d.push({name:"Element".concat(b.getElementId()),setId:o,elementId:b.getElementId(),position:[P.x,P.z],pivotOffset:[0,0],rotation:b.getRotDeg(),width:S,depth:I,svgDataUrl:x?"data:image/svg+xml;base64,".concat(btoa(unescape(encodeURIComponent(x)))):void 0,height:w>0?w:void 0,dockingButtons:D.length>0?D:void 0,dockingPointsDebug:O.length>0?O:void 0,outlinesDebug:L,zLayer:null!==(m=null==M?void 0:M.zLayer)&&void 0!==m?m:b.getLayer(),opacity:null==M?void 0:M.opacity,dimensionConfig:B,annotations:W});var U=S/2,z=I/2;u=Math.min(u,P.x-U),p=Math.max(p,P.x+U),v=Math.min(v,P.z-z),g=Math.max(g,P.z+z)};for(i.s();!(a=i.n()).done;)h()}catch(t){i.e(t)}finally{i.f()}})),0===d.length)return{isPoolPlanning:c};var h=function buildDockingGroups(t){var r=new Map;function find(t){for(var o=t;r.get(o)!==o;)o=r.get(o);for(var a=t;a!==o;){var i=r.get(a);r.set(a,o),a=i}return o}function union(t,o){var a=find(t),i=find(o);a!==i&&r.set(a,i)}t.forEach((function(t){var o,a=PlannerRTVNext_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var i=o.value,l=i.getElementId();r.has(l)||r.set(l,l);var c,d=PlannerRTVNext_createForOfIteratorHelper(i.getDockingPoints());try{for(d.s();!(c=d.n()).done;){var u=c.value;if(u.IsDocking&&null!=u.OnElementId){var v=u.OnElementId;r.has(v)||r.set(v,v),union(l,v)}}}catch(t){d.e(t)}finally{d.f()}}}catch(t){a.e(t)}finally{a.f()}}));var o,i=new Map,l=PlannerRTVNext_createForOfIteratorHelper(r.keys());try{for(l.s();!(o=l.n()).done;){var c=o.value,d=find(c),u=i.get(d);u||(u=[],i.set(d,u)),u.push(c)}}catch(t){l.e(t)}finally{l.f()}return(0,a.Z)(i.values()).filter((function(t){return t.length>1}))}(i);return{scene2d:PlannerRTVNext_objectSpread(PlannerRTVNext_objectSpread({elements:d,boundingBox:{x:(u+p)/2,z:(v+g)/2,width:p-u,depth:g-v}},o?{fontUrl:o}:{}),h.length>0?{dockingGroups:h}:{}),isPoolPlanning:c}}function resolveAccessoryTargets(t,r){var o,a,i,l,c=null===(o=t.settingsState.plannedPlacesOnGrids)||void 0===o?void 0:o.find((function(t){var o;return(null!==(o=t.elementId)&&void 0!==o?o:"").replace(/^E/,"")===r.parentElementKey}));if(!c)return null;for(var d=0,u=Object.keys(c.grids);d<u.length;d++){var v=u[d],p=c.grids[v];if(p.idx===r.gridId){l=v;var g=p.accessories.find((function(t){return t.index===r.cellIdx}));if(g){a=g.basketId,i=g.articleCodex;break}}}return{parentBasketId:c.basketId,accBasketId:a,accCodex:i,gridName:l}}const T=(0,u.Pi)((function PlannerRTVNext(){var t,r,o,a,i,u,S,E=(0,l.NP)(),O=(0,c.Qv)(),T=(0,v.useDivaCore)(),R=T.state,k=R.apiConfig,C=R.jwt,_=T.actions;(0,d.useEffect)((function(){(0,h.JB)("rtv: PlannerRTVNext mounted")}),[]);var j=(0,d.useRef)(E.hqRenderScript);(0,d.useEffect)((function(){E.hqRenderScript!==j.current&&(j.current=E.hqRenderScript,E.hqRenderScript&&_.toggleLoading("RTV_Assembling",!1,!0))}),[E.hqRenderScript,_]);var N=(0,d.useMemo)((function(){return{onElementSelected:function onElementSelected(t,r){E.viewPlannerHandler.onElementSelected(t,r)},onElementDeselected:function onElementDeselected(){E.viewPlannerHandler.onClearElementSelection()},updatePlannerTrans:function updatePlannerTrans(t,r,o,a,i,l,c,d){E.divaWebPlanner.updatePlannerTrans(t,r,{x:o.x,y:o.y,z:o.z},a,i,l,c,d)},getDockSnapPreview:function getDockSnapPreview(t,r,o,a){return E.divaWebPlanner.getDockSnapPreview(r,o,a)},onElementDeleted:function onElementDeleted(t,r){E.viewPlannerHandler.onElementDeleted(t,r)},onElementCopy:function onElementCopy(t,r,o){return E.viewPlannerHandler.onElementCopy(t,r,o)},onDockingPointInteraction:function onDockingPointInteraction(t,r,o,a,i){return E.viewPlannerHandler.onDockingPointInteraction(t,r,o,a,i)},onAccessoryPlace:function onAccessoryPlace(t,r,o,a){E.paletteViewHandler.addAccessorieOnShelfPlannerView(t,r,o,a)},onAccessoryDragOver:function onAccessoryDragOver(t){E.settingsState.setDraggedAccessoryHasTarget(t)},onAccessorySelect:function onAccessorySelect(t){var r=resolveAccessoryTargets(E,t);r&&E.paletteViewHandler.selectShelfAccessorie(r.accCodex,r.accBasketId)},onAccessoryDeselect:function onAccessoryDeselect(){E.paletteViewHandler.selectShelfAccessorie(void 0)},onAccessoryDelete:function onAccessoryDelete(t){var r=resolveAccessoryTargets(E,t);r&&E.paletteViewHandler.deleteAccessorieOnShelfPlannerView(t.gridId,t.cellIdx,r.parentBasketId)},onAccessoryMoveStart:function onAccessoryMoveStart(t){var r=resolveAccessoryTargets(E,t);if(r&&r.accBasketId&&r.gridName)return E.divaWebPlanner.getFreeToMovePlacesOnGrids(r.gridName,r.accBasketId,!0)},onAccessoryMove:function onAccessoryMove(t,r){var o=resolveAccessoryTargets(E,t);if(o&&o.accBasketId){var a=r.articleCodex&&r.articleCodex!==o.accCodex?r.articleCodex:void 0;E.divaWebPlanner.moveShelfItemToGrid(o.accBasketId,r.parentBasketId,r.gridName,r.cellIdx,a)}},onSceneReady:function onSceneReady(){(0,h.JB)("rtv: onSceneReady"),_.toggleLoading("RTV_Assembling",!1,!1)}}}),[E.viewPlannerHandler,E.divaWebPlanner,E,_]),V=E.productState.rtvSelectedElementId,L=E.isParentViewVisible;(0,d.useEffect)((function(){if(L)return(0,y.RS)()}),[L]);var M=E.productState.doShowRTV,H=E.productState.doShow3DComb,G=E.productState.doShowGrid,B="CREATE_IMAGE"===E.configState.initMode,W=!L||!M&&!H&&!G&&!B,U=W?void 0:buildScene2D(E),z=null==U?void 0:U.scene2d,J=null!==(t=null==U?void 0:U.isPoolPlanning)&&void 0!==t&&t,K=null!==(r=null===(o=E.divaWebPlanner.getCatalogData())||void 0===o?void 0:o.rtvPreset)&&void 0!==r?r:p.WHITE_ROOM_PRESET;if(function useCreateImageShot(t,r,o){var a="CREATE_IMAGE"===t.configState.initMode,i=(0,d.useRef)(!1),l=a&&r?r.elements.map((function(t){return"".concat(t.elementId,":").concat(t.width,"x").concat(t.depth,"@").concat(t.position[0],",").concat(t.position[1])})).join("|"):"";(0,d.useEffect)((function(){if(a&&l&&!i.current){var r=_objectSpread(_objectSpread(_objectSpread({},w),o.createImage),t.configState.createImageConfig),c=window.setTimeout((0,P.Z)(I().mark((function _callee(){var o,a,l,c,d,u,v,g,h,m,y;return I().wrap((function _callee$(P){for(;;)switch(P.prev=P.next){case 0:if(!i.current){P.next=2;break}return P.abrupt("return");case 2:return i.current=!0,P.prev=3,a={id:"plan-2d",viewMode:"2d",showGrid:!1,showDimensionLines:!0,showPosNr:!1,environment:_objectSpread(_objectSpread(_objectSpread(_objectSpread({},(0,p.emitConfig)(p.ENVIRONMENT_CONFIG,p.useRTVStore.getState().resolvedEnvironment)),r.dimensionLineUnit?{dimensionLineUnit:r.dimensionLineUnit}:{}),void 0!==r.dimensionLineHideUnit?{dimensionLineHideUnit:r.dimensionLineHideUnit}:{}),r.dimensionLineColor?{dimensionLineColor:r.dimensionLineColor}:{}),resolution:{width:r.width,height:r.height},camera:{padding:r.cameraPadding},format:"png",settleFrames:r.settleFrames},P.next=7,p.useRTVStore.getState().captureShots({shots:[a]});case 7:if(l=P.sent,c=(0,b.Z)(l,1),d=c[0]){P.next=12;break}throw new Error("captureShots returned no result");case 12:u=[],v=_createForOfIteratorHelper(r.formats),P.prev=14,v.s();case 16:if((g=v.n()).done){P.next=31;break}if("jpeg"!==(h=g.value)){P.next=24;break}return P.next=21,reencodeJpeg(d.blob,r.jpegQuality);case 21:P.t0=P.sent,P.next=27;break;case 24:return P.next=26,blobToDataUrl(d.blob);case 26:P.t0=P.sent;case 27:m=P.t0,u.push({format:h,dataUrl:m,width:d.width,height:d.height});case 29:P.next=16;break;case 31:P.next=36;break;case 33:P.prev=33,P.t1=P.catch(14),v.e(P.t1);case 36:return P.prev=36,v.f(),P.finish(36);case 39:null===(o=t.actions)||void 0===o||o.onEvent({type:"planImageCreated",data:{images:u}}),P.next=47;break;case 42:P.prev=42,P.t2=P.catch(3),x.warn("CREATE_IMAGE capture failed",P.t2),i.current=!1,null===(y=t.actions)||void 0===y||y.onEvent({type:"planImageFailed",data:{message:P.t2 instanceof Error?P.t2.message:String(P.t2)}});case 47:case"end":return P.stop()}}),_callee,null,[[3,42],[14,33,36,39]])}))),r.stableMs);return function(){return window.clearTimeout(c)}}}),[a,l,t,o])}(E,z,K),W)return null;var q=G||B?"2d":"3d",Z=null===(a=E.tabGroupState.curTabGroup)||void 0===a?void 0:a.type,$=null!=Z&&D.has(Z),Q=E.productState.rtvFocusElementId,X=J||E.productState.doShow3DDimensionLines,Y=function buildElementsInfoFromArticles(t){for(var r,o,a,i,l,c=new Map,d=t.settingsState.articleInfos,u=t.viewPlannerHandler.plannedElementsDict,v=t.productState.rtvSelectedElementId,p="SHELFPLANNER"===(null===(r=t.tabGroupState.curTabGroup)||void 0===r?void 0:r.type),g=null!=(l=null===(i=t.tabGroupState.curTabGroup)||void 0===i?void 0:i.type)&&D.has(l),h=null===(o=t.divaWebPlanner.getCatalogData())||void 0===o?void 0:o.elementCopyAVLR,m=null===(a=t.tabGroupState.curOption)||void 0===a?void 0:a.codex,y=null!=h&&(g||Array.isArray(h)&&null!=m&&h.includes(m)),b=function resolveState(t,r,o){return o?p||r?"selectable":"unselectable":p?"active":void 0!==t&&v===t?"selected":r?"active":"selectable"},P=new Map,S=0,I=Object.keys(d);S<I.length;S++){var x=d[I[S]];void 0!==x.elementId&&P.set(x.elementId,{setId:x.setId,posNr:String(x.posNr),isActive:x.isActive,canDelete:x.isActive,isShelfAccessoire:!!x.isShelfAccessoire,shelfElementId:x.shelfElementId})}u&&u.forEach((function(t,r){var o,a=PlannerRTVNext_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var i,l,d,u=o.value,v=u.getElementId(),p=u.getParentElementId(),g=P.get(v),h="BOX"===u.getPlannerType(),m=void 0,S=void 0,I=void 0,x=void 0;if(h){m=!0,S=!0;var w=u.getFreeDockingPointByTypeAndNumber("AVO",1);I=null!=w&&!w.IsDisabled}else!y||null!=p||null!=g&&g.isShelfAccessoire||(m=u.getFreeDockingPointsByType("AVL").some((function(t){return!t.IsDisabled})),S=u.getFreeDockingPointsByType("AVR").some((function(t){return!t.IsDisabled})),x=!0);var A=g?b(v,g.isActive,!!g.isShelfAccessoire):"unselectable",D=null!=g&&g.isShelfAccessoire?"shelfAccessoire":h?"boxElement":null!=p?"accessoire":"planned";c.set(null!==(i=null==g?void 0:g.shelfElementId)&&void 0!==i?i:String(v),{setId:null!==(l=null==g?void 0:g.setId)&&void 0!==l?l:r,posNr:null==g?void 0:g.posNr,state:A,type:D,articleCodex:u.ArticleCodex,canDelete:!!(null!=g&&g.isShelfAccessoire||x)||null!==(d=null==g?void 0:g.canDelete)&&void 0!==d&&d,parentElementId:p,canCopyLeft:m,canCopyRight:S,canCopyTop:I,copyAlwaysVisible:x})}}catch(t){a.e(t)}finally{a.f()}}));for(var w=0,A=Object.keys(d);w<A.length;w++){var E=d[A[w]];E.isShelfAccessoire&&E.shelfElementId&&!c.has(E.shelfElementId)&&c.set(E.shelfElementId,{setId:E.setId,posNr:String(E.posNr),state:b(E.elementId,E.isActive,!0),type:"shelfAccessoire",canDelete:!0})}return c}(E),ee=E.settingsState.selectedShelfAccessoire,te=ee&&null!==(i=null===(u=Object.values(E.settingsState.articleInfos).find((function(t){return t.basketId===ee})))||void 0===u?void 0:u.shelfElementId)&&void 0!==i?i:null,ne=te?null===(S=Y.get(te))||void 0===S?void 0:S.state:void 0,re=null!=te&&null!=ne&&"unselectable"!==ne?te:null,oe="2d"!==q,ae=E.divaWebPlanner.getCatalogData(),ie=null!=ae&&ae.catalogCodex?{catalogCodex:ae.catalogCodex,iln:ae.supplierILN}:void 0;return(0,A.jsx)(g(),{catalogInfo:oe?ie:void 0,hqRenderScript:oe?E.hqRenderScript:void 0,scene2d:z,viewMode:q,stopRender:!L,config:{archiveBaseUrl:k.diva3darchive.endsWith("/")?k.diva3darchive.slice(0,-1):k.diva3darchive,constructorServiceUrl:k.constructorService,jwt:C,capabilities:{supports3d:!0},profiles:K.profiles,profileMode:K.profileMode,camera:K.camera,uiConfig:PlannerRTVNext_objectSpread({plannerMode:E.productState.isBoxPlanner?"BoxPlanner":"3DCOMB",accessoryPlacement:m.d},J?{hideUiIcons:!0}:{})},plannerMode:$,freePlacesOnGrids:E.settingsState.freePlacesOnGrids,plannedPlacesOnGrids:E.settingsState.plannedPlacesOnGrids,armedAccessoryCodex:E.settingsState.armedAccessoryToken,draggedAccessoryCodex:E.settingsState.draggedAccessoryCodex,callbacks:N,analyzerComponents:O,focusElementId:Q,elementsInfo:Y,selectedElementId:V,selectedAccessoryKey:re,showDimensionLines:X})}))}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 7909.diva-web-planner-react.umd.min.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunkCrystaldesignDivaWebPlannerReact=self.webpackChunkCrystaldesignDivaWebPlannerReact||[]).push([[7909],{87909:(t,r,a)=>{a.r(r),a.d(r,{default:()=>y});var o=a(12952),l=a(84658),i=a(13125),c=a(43860),d=a(80248),u=a(50747),g=a.n(u),h=a(57312),P=a(69369),p=a(60415),D=a(41219),m=a(64357),E=a(65411);function parseSetPlanData(t){var r=P.ZP.decodeBase64(t);return JSON.parse(r)}function isSavePlannerV2(t){return 2===t.v}function saveElementArticleCodex(t){return t.articleCodex||t.Codex}var k=a(58178);function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,l=function F(){};return{s:l,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,d=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();return c=t.done,t},e:function e(t){d=!0,i=t},f:function f(){try{c||null==a.return||a.return()}finally{if(d)throw i}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=Array(r);a<r;a++)o[a]=t[a];return o}var v=P.ZP.initLog("Planner","WEB-PLANNER-LOGIC"),I=["AVO","AVU","AVC","AVS","AVN"],y=function(){function DivaStandardPlanner(t,r,a,o,l,c){var u=this;(0,i.Z)(this,DivaStandardPlanner),(0,d.Z)(this,"plannerID",void 0),(0,d.Z)(this,"set",void 0),(0,d.Z)(this,"plannerBoundingBox",void 0),(0,d.Z)(this,"plannerElements",void 0),(0,d.Z)(this,"doDisablePlanner2D",!1),(0,d.Z)(this,"plannerHasStaticBackground",void 0),(0,d.Z)(this,"isIDM3DCat",!1),(0,d.Z)(this,"IDM3DCatCodex",""),(0,d.Z)(this,"IDM3DEnvironment","diva.ro"),(0,d.Z)(this,"nextElementId",1),(0,d.Z)(this,"collisionHandler",void 0),(0,d.Z)(this,"dockToAVUorAVOororAVNorAVSorAVC",(function(t,r){var a=function hasFreeDP(r){return t.getFreeDockingPointsByType(r).length>0};if(a("AVU")){var o=E.Z.tryDockElement(t,"AVU",r);if(o)return u.updateWorldPos(t,o),!0;for(var l=0;l<r.length;l++){var i=r[l].getCurrentAccessorires().map((function(t){return u.plannerElements.get(t.getElementId())}));if(u.dockToAVUorAVOororAVNorAVSorAVC(t,i))return!0}}if(a("AVO")){var c=E.Z.tryDockElement(t,"AVO",r);if(c)return u.updateWorldPos(t,c),!0}if(a("AVN")){var d=E.Z.tryDockElement(t,"AVN",r);if(d)return u.updateWorldPos(t,d),!0}if(a("AVS")){var g=E.Z.tryDockElement(t,"AVS",r);if(g)return u.updateWorldPos(t,g),!0}if(a("AVC")){var h=E.Z.tryDockElement(t,"AVC",r);if(h)return u.updateWorldPos(t,h),!0}return!1})),this.set=t,this.plannerID=a,this.plannerElements=new Map,this.plannerBoundingBox=new k.Z,this.plannerBoundingBox.initPlannerBBox(o),this.doDisablePlanner2D=l,this.collisionHandler={updatePlannerMsgContainer:r,collisionDetected:!1,collisionPairs:[]},this.plannerHasStaticBackground=c}return(0,c.Z)(DivaStandardPlanner,[{key:"updatePlannerPosNr",value:function updatePlannerPosNr(){var t,r=this,a=[],o=new Map,l=this;this.plannerElements.forEach((function(t,r){o.set(r,!0),t.IsDockedAccessoire||t.HasAVL&&t.dockingTypeIsDocking("AVL")||a.push(t)})),this.getCatalogData().dontSetPosNrFromPlanner||(a=a.sort((function(t,r){return t.WorldPosCenter.x-r.WorldPosCenter.x})));for(var i=function updateAccessoiresOfElement(a,c){for(var d=[],u=function setPosNrForElementsOnDock(r,i){if(a["Has"+r]){var d=a.getDockingDockingPointsByType(r);d=d.sort((function(t,r){return l.plannerElements.get(t.OnElementId).WorldPosCorner.x-l.plannerElements.get(r.OnElementId).WorldPosCorner.x}));for(var u=0;u<d.length;u++){var g=d[u].OnElementId;if(o.has(g)){var h=l.plannerElements.get(g);h.PosNr=c,h.AccessoirePosNr=t,o.delete(g),t++,i.push(h)}}}},g=0;g<I.length;g++)u(I[g],d);r.plannerElements.forEach((function(r){r.getIsNotDockedAccessoire()&&r.getParentElementId()===a.getElementId()&&(r.PosNr=c,r.AccessoirePosNr=t,o.delete(r.getElementId()),t++,d.push(r))}));for(var h=0;h<d.length;h++)i(d[h],c)},c=function updatePosInChain(r,a){if(null==r)return a;if(r.PosNr=a,t=1,o.delete(r.ElementId),i(r,a),a++,r.HasAVR&&r.dockingTypeIsDocking("AVR")){var d=r.getDockingDockingPointsByType("AVR")[0].OnElementId;return c(l.plannerElements.get(d),a)}return a},d=1,u=0;u<a.length;u++)d=c(a[u],d)}},{key:"updateWorldPos",value:function updateWorldPos(t,r){var a=!1,o=this.plannerElements.get(r.OnElementId),l=o.getDockingPointById(r.OnDP.DpId);if(null==l)return a;this.applyDockTransform(t,o,r,l),a=this.set.onDockingChanged(t.ElementId,o.ElementId,"DOCK",r.Type);var i=this.set.getPlannerData(t.ElementId);t.updatePlannerData(i);var c=this.set.getPlannerData(o.ElementId);return o.updatePlannerData(c),a}},{key:"applyDockTransform",value:function applyDockTransform(t,r,a,o){var l=(0,p.eY)(r,o,t,a);t.RotDeg=l.rotDeg,t.WorldPosCorner=new m.P(l.worldPosCorner.x,l.worldPosCorner.y,l.worldPosCorner.z),t.WorldPosCornerIgnoreOLF=new m.P(l.worldPosCornerIgnoreOLF.x,l.worldPosCornerIgnoreOLF.y,l.worldPosCornerIgnoreOLF.z)}},{key:"getDockSnapPreview",value:function getDockSnapPreview(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=this.plannerElements.get(t);if(!o)return null;var l,i=this.getAllPlannerElements().filter((function(r){return r.getElementId()!==t&&!a.includes(r.getElementId())})),c=E.Z.searchDockableElementsInArea(o,i,r);if(!c||0===c.size)return null;if(c.forEach((function(t){(null==l||t.distance<l.distance)&&(l=t)})),null==l)return null;var d=this.plannerElements.get(l.targetDP.ElementId);if(!d)return null;var u=o.RotDeg,g=o.WorldPosCenter,h=g.x,P=g.y,p=g.z;this.applyDockTransform(o,d,l.sourceDP,l.targetDP);var D=o.WorldPosCenter,k={dx:D.x-h,dz:D.z-p,dRotDeg:o.RotDeg-u};return o.RotDeg=u,o.WorldPosCenter=new m.P(h,P,p),k}},{key:"updateAllElementsWorldPos",value:function updateAllElementsWorldPos(t,r){if(this.doDisablePlanner2D)return!1;var a=function getDockedDPsInPriorityOrder(t){return t.getDockingDockingPointsByType("AVL").concat(t.getDockingDockingPointsByType("AVR")).concat(t.getDockingDockingPointsByType("AVU")).concat(t.getDockingDockingPointsByType("AVO")).concat(t.getDockingDockingPointsByType("AVN")).concat(t.getDockingDockingPointsByType("AVS")).concat(t.getDockingDockingPointsByType("AVC"))},o=!1,l=[],i=[];this.plannerElements.forEach((function(t,r){t.IsDockedAccessoire?i.push(t):l[t.PosNr-1]=t})),l=l.concat(i);for(var c=[],d=0,u=0;u<l.length;u++)if(l[u]){var g=l[u];if(c.push(g.ElementId),u>d)for(var h=a(g),P=0;P<h.length;P++)if(c.indexOf(h[P].OnElementId)>=0){o=this.updateWorldPos(g,h[P]);break}}else d=u;if(r&&r.length>0)for(var p=new Set(r),D=!0;D;){D=!1;var m,E=_createForOfIteratorHelper(l);try{for(E.s();!(m=E.n()).done;){var k=m.value;if(k&&!p.has(k.ElementId)){var v=a(k).find((function(t){return p.has(t.OnElementId)}));v&&(o=this.updateWorldPos(k,v)||o,p.add(k.ElementId),D=!0)}}}catch(t){E.e(t)}finally{E.f()}}return this.checkCollision(!1,t),o}},{key:"addElementToWorld",value:(C=(0,l.Z)(g().mark((function _callee(t,r,a,o){var l,i,c,d,u,h,P,p,D,k,v,I,y=arguments;return g().wrap((function _callee$(g){for(;;)switch(g.prev=g.next){case 0:if(l=y.length>4&&void 0!==y[4]?y[4]:100,!(i=y.length>5?y[5]:void 0)||!i.forceSetToTrans){g.next=8;break}t.WorldPosCenter=i.transform.worldPosCenter,t.RotDeg=i.transform.rotDeg,this.set.onDockingChanged(t.ElementId,-1,"NOT_DOCKED"),g.next=47;break;case 8:if(c=!1,!r){g.next=46;break}d=0;case 11:if(!(d<r.length)){g.next=46;break}if(u=r[d].targetElemIdToDock,h=r[d].targetDockingPointId,!(u&&u>-1&&this.plannerElements.has(u))){g.next=43;break}if(!h||""==h){g.next=31;break}if(!(P=this.plannerElements.get(u))){g.next=29;break}if(!(p=P.getDockingPointById(h))){g.next=29;break}if(!(D=E.Z.tryDockElementToDP(t,P,p))){g.next=26;break}this.updateWorldPos(t,D),c=!0,g.next=29;break;case 26:return g.next=28,this.tryToDockWithDifferentSVGWithFormula(t,u);case 28:k=g.sent;case 29:g.next=43;break;case 31:if(k=!1,(t.HasAVL||t.HasAVR)&&(k=this.dockToAVLorAVR(t,[this.plannerElements.get(u)])),k||(k=this.dockToAVUorAVOororAVNorAVSorAVC(t,[this.plannerElements.get(u)])),k){g.next=42;break}return g.next=37,this.tryToDockWithDifferentSVGWithFormula(t,u);case 37:if(k=g.sent){g.next=42;break}return g.next=41,this.addElementToWorld(t,void 0,void 0,void 0,50);case 41:return g.abrupt("return");case 42:k&&(c=!0);case 43:d++,g.next=11;break;case 46:c||(v=this.getAllPlannerElements(),I=this.dockToAVLorAVR(t,v),a&&(I=!1),I||(I=this.dockToAVUorAVOororAVNorAVSorAVC(t,v),a&&(I=!1),I||(null==o&&(t.WorldPosCenter=new m.P(this.plannerBoundingBox.WorldPos.x+this.plannerBoundingBox.Size.x+(0==this.plannerBoundingBox.Size.x?0:t.Width/2+l),this.plannerBoundingBox.WorldPos.y,this.plannerBoundingBox.WorldPos.z+t.Depth/2)),this.set.onDockingChanged(t.ElementId,-1,"NOT_DOCKED"))));case 47:this.updatePlannerPosNr(),this.updateAllElementsWorldPos(),this.updatePlannerPosNr(),this.checkCollision(!1,t.getElementId()),this.updatePlannerBoundingBox();case 52:case"end":return g.stop()}}),_callee,this)}))),function addElementToWorld(t,r,a,o){return C.apply(this,arguments)})},{key:"tryToDockWithDifferentSVGWithFormula",value:(A=(0,l.Z)(g().mark((function _callee2(t,r){var a,o,l,i,c,d,u,h,p,D,m,E,k,I,y,x,A,C;return g().wrap((function _callee2$(g){for(;;)switch(g.prev=g.next){case 0:if(a=!1,o=this.set.getArticleByElementId(t.ElementId),l=null==o?void 0:o.VariantValues,i=t.getSVGsWithFormula(),!t.FilterAVL.length&&!t.FilterAVR.length){g.next=47;break}if(null==i||!i.length){g.next=22;break}c=0;case 7:if(!(c<i.length)){g.next=22;break}for(p in d=new Map,u=new Map,h=P.ZP.getVariantValuesFromRule(i[c].JsFormula,{}))u.set(p,h[p]);return d.set(t.ElementId,u),g.next=15,this.set.updateCfgValuesByPlanner(d,!0);case 15:if(!(a=this.dockToAVLorAVR(t,[this.plannerElements.get(r)]))){g.next=19;break}return v.debug("svgWithFormula nr: "+c+" did dock: "+i[c].SVG),g.abrupt("break",22);case 19:c++,g.next=7;break;case 22:if(null==(D=t.getVaraintValuesInfluencingAVLAVRFilter())||!D.length||a){g.next=40;break}m=0;case 25:if(!(m<D.length&&m<20)){g.next=40;break}for(y in E=D[m],k=new Map,I=new Map,E)I.set(y,E[y]);return k.set(t.ElementId,I),g.next=33,this.set.updateCfgValuesByPlanner(k,!0);case 33:if(!(a=this.dockToAVLorAVR(t,[this.plannerElements.get(r)]))){g.next=37;break}return v.debug("following variantValues did dock: ",I),g.abrupt("break",40);case 37:m++,g.next=25;break;case 40:if(a){g.next=47;break}for(C in x=new Map,A=new Map,l)A.set(C,l[C]);return x.set(t.ElementId,A),g.next=47,this.set.updateCfgValuesByPlanner(x,!0);case 47:return g.abrupt("return",a);case 48:case"end":return g.stop()}}),_callee2,this)}))),function tryToDockWithDifferentSVGWithFormula(t,r){return A.apply(this,arguments)})},{key:"dockToAVLorAVR",value:function dockToAVLorAVR(t,r){var a=!1,o=!1;if(t.HasAVL){var l=E.Z.tryDockElement(t,"AVL",r);l&&(this.updateWorldPos(t,l),a=!0)}if(!a&&t.HasAVR){var i=E.Z.tryDockElement(t,"AVR",r);i&&(o=!0,this.updateWorldPos(t,i))}return a||o}},{key:"getAllViewPlannerElements",value:function getAllViewPlannerElements(){return this.getAllPlannerElements()}},{key:"getFreeDockingPointsByElementId",value:function getFreeDockingPointsByElementId(t,r){if(!this.plannerElements.has(t))return{dockingPoints:[],filter:[]};var a=this.plannerElements.get(t),o=a.getFreeDockingPointsByType(r),l=[];switch(r){case"AVR":l=a.getFilterAVR();break;case"AVL":l=a.getFilterAVL()}return{dockingPoints:o,filter:l}}},{key:"getDockedDockingPointsByElementId",value:function getDockedDockingPointsByElementId(t,r){if(!this.plannerElements.has(t))return[];for(var a=this.plannerElements.get(t),o=[],l=0;l<r.length;l++)o=o.concat(a.getDockingDockingPointsByType(r[l]));return o}},{key:"getNeighborElements",value:function getNeighborElements(t,r){if(!this.plannerElements.has(t))return[];var a=this.plannerElements.get(t),o=null==a?void 0:a.getDockingDockingPointsByType(r);if(!o)return[];for(var l=[],i=0;i<(null==o?void 0:o.length);i++)null!=o[i]&&l.push(o[i].OnElementId);return l}},{key:"getDockedGroups",value:function getDockedGroups(){for(var t=[],r=this.getAllPlannerElements(),a=[],o=0;o<this.getAllPlannerElements().length;o++){var l=r[o];if(a.push(l.getElementId()),!l.IsAccessoire){var i=l.getDockingPointsByType("AVL");if(i&&0!=i.length)for(var c=0;c<i.length;c++)i[c].IsDocking||t.push(l);else t.push(l)}}t.sort((function(t,r){return t.WorldPosCorner.x<r.WorldPosCorner.x?1:0}));var d=[];for(o=0;o<t.length;o++){var u=t[o],g=[];a.splice(a.indexOf(u.getElementId()),1);for(var h=!1,P=u;!h;){g.push(P.getElementId()),a.splice(a.indexOf(P.getElementId()),1);var p=this.getAccessoiresRecursive(P.getElementId());for(c=0;c<p.length;c++)g.push(p[c]),a.splice(a.indexOf(p[c]),1);var D=this.getNeighborElements(P.getElementId(),"AVR");D&&0!=D.length?P=this.plannerElements.get(D[0]):h=!0}d.push(g)}for(o=0;o<a.length;o++)d.push([a[o]]);return d}},{key:"getAccessoiresRecursive",value:function getAccessoiresRecursive(t){var r=this,a=function calcAccs(t,o,l){l.push(t);for(var i=r.getNeighborElements(t,"AVC"),c=r.getNeighborElements(t,"AVO"),d=r.getNeighborElements(t,"AVU"),u=r.getNeighborElements(t,"AVN"),g=r.getNeighborElements(t,"AVS"),h=i.concat(c).concat(d).concat(u).concat(g),P=0;P<h.length;P++)l.indexOf(h[P])>=0||(o.push(h[P]),l.push(h[P]),a(h[P],o,l))},o=[];return a(t,o,[]),o}},{key:"getBoundingBox",value:function getBoundingBox(){return this.plannerBoundingBox}},{key:"initIDM3DMeta",value:function initIDM3DMeta(t,r){this.isIDM3DCat=!0,this.IDM3DCatCodex=t||this.set.getCatalogCodex(),r&&(this.IDM3DEnvironment=r)}},{key:"updatePlanner",value:(x=(0,l.Z)(g().mark((function _callee3(){var t,r,a,o,l,i;return g().wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:t=this.getAllPlannerElements(),r=[],a=0;case 3:if(!(a<t.length)){c.next=13;break}if(!(o=t[a]).updatePlannerData(this.set.getPlannerData(o.getElementId()))){c.next=10;break}return r.push(o.ElementId),c.next=10,D.Z.loadSVG(o,this.set);case 10:a++,c.next=3;break;case 13:if(l=[],r.length){for(v.debug("Configuration changed one plannerElement. UpdateDockingRelations","DivaStandardPlanner - updatePlanner"),i=E.Z.updateDockingRelations(this.plannerElements),a=0;a<i.length;a++)i[a].IsDockedAccessoire&&l.push(i[a].ElementId);this.updateAllElementsWorldPos(void 0,r),this.updatePlannerPosNr(),this.updatePlannerBoundingBox()}return c.abrupt("return",{doDeleteBackGrid:!1,elemIdsToDelete:l,elementIdsToUpdateSelection:r,failed:!1});case 16:case"end":return c.stop()}}),_callee3,this)}))),function updatePlanner(){return x.apply(this,arguments)})},{key:"extendPlanner",value:(y=(0,l.Z)(g().mark((function _callee4(t,r){var a,l,i,c,d,u,p,k,I,y,x,A,C,b,B,V,N,S,W,T;return g().wrap((function _callee4$(g){for(;;)switch(g.prev=g.next){case 0:if(!isSavePlannerV2(a=parseSetPlanData(t))){g.next=39;break}l=a.set.elements,i=[],c=[],d=new Map,u=0;case 7:if(!(u<l.length)){g.next=35;break}if(g.prev=8,I=l[u],this.set.CatalogData.getCatalogArticleByArticleCodex(null!==(p=saveElementArticleCodex(I))&&void 0!==p?p:"")||null===(k=I.AccessoireInitParams)||void 0===k||!k.RelatedToBasketID||this.set.getSetState.onlyRunLogic){g.next=14;break}return v.error(new P.GE("Error initializing element nr "+u+" in the Standard Web Planner. PlanData V2",{code:"WC_0012"})),g.abrupt("continue",32);case 14:if(y=new h.Z(this.set.getSetId(),I.basketID,this.nextElementId,DivaStandardPlanner.plannerType),d.set(I.elementID,y),this.nextElementId=y.getElementId()+1,this.plannerElements.set(y.ElementId,y),this.set.setElementId(I.basketID,y.ElementId),x=this.set.getPlannerData(y.ElementId),y.updatePlannerData(x),this.doDisablePlanner2D){g.next=24;break}return g.next=24,D.Z.loadSVG(y,this.set);case 24:y.WorldPosCenter=new m.P(r.WorldPos.x+r.Size.x+I.x+100,r.WorldPos.y+I.y,r.WorldPos.z+I.z),y.RotDeg=I.rot,y.IsDockedAccessoire?(c.push(I),y.PosNr=I.posNr,null!=I.accNr&&(y.AccessoirePosNr=I.accNr)):(i[I.posNr-1]=I,y.PosNr=I.posNr),g.next=32;break;case 29:g.prev=29,g.t0=g.catch(8),v.error(new P.GE("Error initializing element nr "+u+" in the Standard Web Planner. PlanData V2",{cause:g.t0,code:"WC_0012"}));case 32:u++,g.next=7;break;case 35:for(A=[].concat((0,o.Z)(i.filter((function(t){return null!=t}))),c),u=0;u<A.length;u++)if(C=A[u],b=d.get(C.elementID),A.length>1&&u>0)for(B=C.DP,V=0;V<B.length;V++)N=B[V],S=null==b?void 0:b.getDockingPointById(N.id),W=d.get(N.onID),T=null==W?void 0:W.getDockingPointById(N.onDPID),S&&T&&E.Z.tryDockElementDPToDP(b,W,S,T);g.next=40;break;case 39:v.error(new P.GE("The function extend Planner works only with products that are saved in the configurator 2.0",{code:"WC_0012"}));case 40:case"end":return g.stop()}}),_callee4,this,[[8,29]])}))),function extendPlanner(t,r){return y.apply(this,arguments)})},{key:"initPlanner",value:(u=(0,l.Z)(g().mark((function _callee5(t){var r,a,l,i,c,d,u,p,k,I,y,x,A,C,b,B,V,N,S,W,T,w,_,O,R,Z,L,M,z,G,H,U,$,J,K,j,X,Y,q,Q,ee,ne,te,re,ae,oe,le,ie,se,ce,de,ue;return g().wrap((function _callee5$(g){for(;;)switch(g.prev=g.next){case 0:if(!isSavePlannerV2(r=parseSetPlanData(t))){g.next=63;break}if(v.debug("Initialize set Plan Data - V2\n"+r,"DivaStandardPlanner initPlanner"),null!==(a=r.set)&&void 0!==a&&null!==(a=a.elements)&&void 0!==a&&a.length){g.next=5;break}return g.abrupt("return");case 5:l=r.set.elements,i=[],c=[],d=0;case 9:if(!(d<l.length)){g.next=37;break}if(g.prev=10,k=l[d],this.set.CatalogData.getCatalogArticleByArticleCodex(null!==(u=saveElementArticleCodex(k))&&void 0!==u?u:"")||null===(p=k.AccessoireInitParams)||void 0===p||!p.RelatedToBasketID||this.set.getSetState.onlyRunLogic){g.next=16;break}return v.error(new P.GE("Error initializing element nr "+d+" in the Standard Web Planner. PlanData V2",{code:"WC_0012"})),g.abrupt("continue",34);case 16:if(I=k.elementID,y=new h.Z(this.set.getSetId(),k.basketID,I,DivaStandardPlanner.plannerType),this.nextElementId=I+1,this.plannerElements.set(y.ElementId,y),this.set.setElementId(k.basketID,y.ElementId),x=this.set.getPlannerData(y.ElementId),y.updatePlannerData(x),this.doDisablePlanner2D){g.next=26;break}return g.next=26,D.Z.loadSVG(y,this.set);case 26:y.WorldPosCenter=new m.P(this.plannerBoundingBox.WorldPos.x+k.x,this.plannerBoundingBox.WorldPos.y+k.y,this.plannerBoundingBox.WorldPos.z+k.z),y.RotDeg=k.rot,y.IsDockedAccessoire?(c.push(k),y.PosNr=k.posNr,null!=k.accNr&&(y.AccessoirePosNr=k.accNr)):(i[k.posNr-1]=k,y.PosNr=k.posNr),g.next=34;break;case 31:g.prev=31,g.t0=g.catch(10),v.error(new P.GE("Error initializing element nr "+d+" in the Standard Web Planner. PlanData V2",{cause:g.t0,code:"WC_0012"}));case 34:d++,g.next=9;break;case 37:A=1==i.filter(Boolean).length,C=[].concat((0,o.Z)(i.filter((function(t){return null!=t}))),c),d=0;case 40:if(!(d<C.length)){g.next=61;break}if(g.prev=41,b=C[d],0!=d||!A||!this.plannerHasStaticBackground){g.next=48;break}return null!=(null==(B=i[d])?void 0:B.x)||null!=(null==B?void 0:B.y)||null!=(null==B?void 0:B.z)||(V=this.plannerElements.get(b.elementID))&&(V.WorldPosCenter=new m.P(0,V.Height/2,V.Depth/2)),g.abrupt("continue",58);case 48:if(null!=b.DP&&0!=b.DP.length){g.next=50;break}return g.abrupt("continue",58);case 50:for(N=b.DP,S=0;S<N.length;S++)(W=N[S]).id&&null!=W.onID&&W.onDPID&&(T=this.plannerElements.get(b.elementID),w=null==T?void 0:T.getDockingPointById(W.id),_=this.plannerElements.get(W.onID),O=null==_?void 0:_.getDockingPointById(W.onDPID),w&&O?w.IsDocking&&w.OnDP==O||E.Z.tryDockElementDPToDP(T,_,w,O)||this.doDisablePlanner2D||v.error(new P.GE("Saved docking relation rejected on init: "+W.id+" (elem "+(null==T?void 0:T.ElementId)+") -> "+W.onDPID+" (elem "+(null==_?void 0:_.ElementId)+")",{code:"WC_0012"})):this.doDisablePlanner2D||v.error(new P.GE("Error initializing docking point between source element with id: "+(null==T?void 0:T.ElementId)+" and target Element with id: "+(null==_?void 0:_.ElementId)+". SourceDPID: "+W.id+"; targetDPID: "+W.onDPID)));g.next=58;break;case 54:g.prev=54,g.t1=g.catch(41),Z=null===(R=C[d])||void 0===R?void 0:R.elementID,v.error(new P.GE("Error initializing dockingPoints of element with elementID "+Z,{cause:g.t1,code:"WC_0012"}));case 58:d++,g.next=40;break;case 61:g.next=116;break;case 63:if(v.debug("Initialize set Plan Data - old V1\n"+r,"DivaStandardPlanner initPlanner"),null!=(z=null===(L=r.Sets)||void 0===L?void 0:L[0])&&null!==(M=z.Elements)&&void 0!==M&&M.length){g.next=67;break}return g.abrupt("return");case 67:G=z.Elements,H=[],U=[],d=0;case 71:if(!(d<G.length)){g.next=105;break}if(g.prev=72,K=G[d],this.set.CatalogData.getCatalogArticleByArticleCodex(null!==($=saveElementArticleCodex(K))&&void 0!==$?$:"")||null===(J=K.AccessoireInitParams)||void 0===J||!J.RelatedToBasketID||this.set.getSetState.onlyRunLogic){g.next=78;break}return v.error(new P.GE("Error initializing element nr "+d+" in the Standard Web Planner. PlanData V1",{code:"WC_0012"})),g.abrupt("continue",102);case 78:if(j=K.BasketID,-1==this.set.getElementId(j)&&this.set.setElementId(j,Number(K.ID)),X=this.set.getElementId(j),K.elementId=X,-1!=X){g.next=85;break}return v.error(new P.GE("Error when initializing planner. The elementID Was not saved in the article. ",{code:"WC_0012"})),g.abrupt("continue",102);case 85:if(Y=new h.Z(this.set.getSetId(),j,X,DivaStandardPlanner.plannerType),this.nextElementId=X+1,this.plannerElements.set(Y.ElementId,Y),q=this.set.getPlannerData(Y.ElementId),Y.updatePlannerData(q),this.doDisablePlanner2D){g.next=93;break}return g.next=93,D.Z.loadSVG(Y,this.set);case 93:Q=new m.P(K.PosX,K.PosZ,K.PosY),Y.WorldPosCenter=new m.P(this.plannerBoundingBox.WorldPos.x+Q.x,this.plannerBoundingBox.WorldPos.y+Q.y,this.plannerBoundingBox.WorldPos.z+Q.z),Y.RotDeg=K.Rot,Y.IsDockedAccessoire?(U.push(K),K.PosNum.toString().indexOf(".")>0&&(ee=K.PosNum.toString().split(".")[0],ne=K.PosNum.toString().split(".")[1],Y.PosNr=Number(ee),Y.AccessoirePosNr=Number(ne))):(H[K.PosNum-1]=K,Y.PosNr=K.PosNum),g.next=102;break;case 99:g.prev=99,g.t2=g.catch(72),v.error(new P.GE("Error initializing element nr "+d+" in the Standard Web Planner - Plan Data old Planner",{cause:g.t2,code:"WC_0012"}));case 102:d++,g.next=71;break;case 105:te=[].concat((0,o.Z)(H.filter((function(t){return null!=t}))),U),d=0;case 107:if(!(d<te.length)){g.next=116;break}if(null!=(re=te[d]).DP&&0!=re.DP.length){g.next=111;break}return g.abrupt("continue",113);case 111:for(ae=re.DP,S=0;S<ae.length;S++)(oe=ae[S]).DP&&""!=oe.DP&&oe.onID&&""!=oe.onID&&(ie=parseInt(String(oe.onID)),se=oe.DP,ce=null!=re.elementId?this.plannerElements.get(re.elementId):void 0,de=null!==(le=this.plannerElements.get(ie))&&void 0!==le?le:this.getPlannerElementByIndex(ie-1),ce&&de?E.Z.initDockingPointRelationByArea(ce,de,se):v.error(new P.GE("Error initializing dockingPoints of element with elementID "+re.elementId,{code:"WC_0012"})));case 113:d++,g.next=107;break;case 116:this.plannerElements.forEach((function(t){!t.IsDockedAccessoire&&(null==ue||t.PosNr<ue.PosNr)&&(ue=t)})),this.updateAllElementsWorldPos(void 0,ue?[ue.ElementId]:void 0),this.updatePlannerPosNr();case 119:case"end":return g.stop()}}),_callee5,this,[[10,31],[41,54],[72,99]])}))),function initPlanner(t){return u.apply(this,arguments)})},{key:"getPlannerElementByIndex",value:function getPlannerElementByIndex(t){var r=void 0,a=0;return this.plannerElements.forEach((function(o,l){t==a&&(r=o),a++})),r}},{key:"addPlannerElement",value:(a=(0,l.Z)(g().mark((function _callee6(t,r){var a,o,l,i,c,d,u;return g().wrap((function _callee6$(g){for(;;)switch(g.prev=g.next){case 0:if(c=new h.Z(this.set.getSetId(),t,this.nextElementId,DivaStandardPlanner.plannerType),this.nextElementId++,this.plannerElements.set(c.ElementId,c),this.set.setElementId(t,c.ElementId),d=this.set.getPlannerData(c.ElementId),c.updatePlannerData(d),this.doDisablePlanner2D){g.next=9;break}return g.next=9,D.Z.loadSVG(c,this.set);case 9:if(null==(u=null!==(a=r.dockingPointInfos)&&void 0!==a?a:[{targetDockingPointId:r.targetDockingPointId,targetElemIdToDock:r.targetElemIdToDock}])||null===(o=u[0])||void 0===o||!o.targetElemIdToDock||null==u||null===(l=u[0])||void 0===l||!l.targetDockingPointId){g.next=15;break}return g.next=13,this.addElementToWorld(c,u);case 13:g.next=27;break;case 15:if(null==u||null===(i=u[0])||void 0===i||!i.targetElemIdToDock){g.next=20;break}return g.next=18,this.addElementToWorld(c,u);case 18:g.next=27;break;case 20:if(!r.oldPlannerTransform){g.next=25;break}return g.next=23,this.addElementToWorld(c,void 0,void 0,void 0,void 0,{forceSetToTrans:!0,transform:r.oldPlannerTransform});case 23:g.next=27;break;case 25:return g.next=27,this.addElementToWorld(c);case 27:this.updatePlannerBoundingBox();case 28:case"end":return g.stop()}}),_callee6,this)}))),function addPlannerElement(t,r){return a.apply(this,arguments)})},{key:"movePlannerElement",value:function movePlannerElement(){throw Error("move planner not implemented in standard")}},{key:"copyPlannerElement",value:(r=(0,l.Z)(g().mark((function _callee7(t,r){var a,o,l,i,c,d;return g().wrap((function _callee7$(u){for(;;)switch(u.prev=u.next){case 0:a=0;case 1:if(!(a<t.length)){u.next=24;break}if(l=t[a],null!=r){u.next=7;break}return u.next=6,this.addPlannerElement(l.value,{});case 6:return u.abrupt("continue",21);case 7:if(-1==(i=null===(o=r.copyIndex)||void 0===o?void 0:o.x)||1==i){u.next=12;break}return u.next=11,this.addPlannerElement(l.value,{});case 11:return u.abrupt("continue",21);case 12:if(c=this.plannerElements.get(l.key),d=null==c?void 0:c.getFreeDockingPointsByType(-1==i?"AVL":"AVR").find((function(t){return!t.IsDisabled})),!c||!d){u.next=19;break}return u.next=17,this.addPlannerElement(l.value,{targetElemIdToDock:c.ElementId,targetDockingPointId:d.DpId});case 17:u.next=21;break;case 19:return u.next=21,this.addPlannerElement(l.value,{});case 21:a++,u.next=1;break;case 24:case"end":return u.stop()}}),_callee7,this)}))),function copyPlannerElement(t,a){return r.apply(this,arguments)})},{key:"getPlannerElementsInfluencedByDeletion",value:function getPlannerElementsInfluencedByDeletion(t,r){return[]}},{key:"getPlannerElementsInfluencedByCopy",value:function getPlannerElementsInfluencedByCopy(t,r){if(!r||"BoxPlanner_backside"!=r.copyType&&"STD"!=r.copyType)throw new Error("copyType needs to be BoxPlanner_backside or STD here");return this.plannerElements.has(t)?[t]:[]}},{key:"deletePlannerElement",value:(t=(0,l.Z)(g().mark((function _callee8(t,r){var a,o,l,i,c,d,u,h,p,D,m,k,v,I,y;return g().wrap((function _callee8$(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,P.ZP.Sleep(1);case 2:if(this.plannerElements.has(t)){g.next=4;break}return g.abrupt("return",{});case 4:return a=this.plannerElements.get(t),o=this.getParentElement(a),l=-1,i=999,c=-1,d=-1,u=!1,this.plannerElements.forEach((function(t,r){u||(null!=a&&a.IsAccessoire&&a.PosNr==t.PosNr&&(c=t.getElementId(),u=!0),t.getPosNr()<a.getPosNr()&&t.getPosNr()>l?(l=t.getPosNr(),c=t.getElementId()):t.getPosNr()>a.getPosNr()&&t.getPosNr()<i&&(i=t.getPosNr(),d=t.getElementId()))})),h=!1,r&&(p=a.getDockingDockingPointsByType("AVL"),D=a.getDockingDockingPointsByType("AVR"),p.length>0&&D.length>0&&(m=this.plannerElements.get(p[0].OnElementId),k=this.plannerElements.get(D[0].OnElementId),m&&k&&(v=m.getDockingDockingPointsByType("AVR"),I=k.getDockingDockingPointsByType("AVL"),v.length>0&&I.length>0&&(E.Z.removeDockingPointRelations(a),h=!0,E.Z.tryDockElementDPToDP(m,k,v[0],I[0]))))),y={rotDeg:a.getRotDeg(),worldPosCenter:a.WorldPosCenter},h||E.Z.removeDockingPointRelations(a),this.plannerElements.delete(t),this.tryToDockForNotDockedAccessoire(o),this.updatePlannerPosNr(),this.updateAllElementsWorldPos(),this.updatePlannerPosNr(),this.checkCollision(!1,a.getElementId()),this.updatePlannerBoundingBox(),g.abrupt("return",{newElementToSelect:c>=0?c:d>=0?d:void 0,transform:y});case 24:case"end":return g.stop()}}),_callee8,this)}))),function deletePlannerElement(r,a){return t.apply(this,arguments)})},{key:"tryToDockForNotDockedAccessoire",value:function tryToDockForNotDockedAccessoire(t){if(t)for(var r=t.getCurrentAccessorires().filter((function(t){return t.getIsNotDockedAccessoire()})),a=0;a<r.length;a++){var o=r[a].getElementId(),l=this.plannerElements.get(o);if(l)if(this.dockToAVUorAVOororAVNorAVSorAVC(l,[t]))break}}},{key:"checkCollision",value:function checkCollision(t,r){if(!this.doDisablePlanner2D){for(var a,o,l=this.getAllPlannerElements(),i=!1,c=[],d=0;d<l.length;d++){var u=l[d];if(!r||u.getElementId()==r)for(var g=r?0:d+1;g<l.length;g++){var h,P,p=l[g];if(u.getElementId()!=p.getElementId()&&!E.Z.checkElementsAreDocking(u,p)){var m=!1;if((this.set.CatalogData.doCheckConstructionWarnings||null!==(h=this.set.CatalogData.forceConstructionWarningForArticles)&&void 0!==h&&h.includes(u.ArticleCodex)||null!==(P=this.set.CatalogData.forceConstructionWarningForArticles)&&void 0!==P&&P.includes(p.ArticleCodex))&&(m=D.Z.checkCollision(u,p,this.set.CatalogData.checkCollisionForDifferentLayers)),m&&(i=!0,c.push({elementId1:u.getElementId(),elementId2:p.getElementId()}),v.debug("Collision Found between element1: "+u.ElementId+"; and element2: "+p.ElementId),!t))break}}}if(this.collisionHandler.collisionDetected&&!i)null===(a=(o=this.collisionHandler).updatePlannerMsgContainer)||void 0===a||a.call(o,"COLLISION_MSG",!1,"WARNING","COLLISION_MSG",!1);else if(!this.collisionHandler.collisionDetected&&i){var k,I;null===(k=(I=this.collisionHandler).updatePlannerMsgContainer)||void 0===k||k.call(I,"COLLISION_MSG",!0,"WARNING","COLLISION_MSG",!1)}this.collisionHandler.collisionPairs=c,this.collisionHandler.collisionDetected=i}}},{key:"updateSetPosNr",value:function updateSetPosNr(t){for(var r=this.getAllPlannerElements(),a=0;a<r.length;a++){var o=r[a];o.SetPosNr=t+o.PosNr-1,this.set.setPosNr(o.ElementId,o.getPosNr())}for(var l=0;l<r.length;l++)r[l].IsAccessoire||this.set.giveAccNewPosNrByBasketId(r[l].getBasketId());return r.length}},{key:"updatePlannerTrans",value:function updatePlannerTrans(t,r,a,o,l,i,c){var d=this,u=!1;if(this.plannerElements.has(t)){var g=this.plannerElements.get(t);if(null==g||g.updateDeltaTrans(r,a,o,"END"==l,c),"START"==l){if(g){var h=["AVR","AVL"];g.IsDockedAccessoire&&(h=h.concat(["AVO","AVU","AVN","AVS","AVC"]));for(var P=E.Z.removeDockingPointRelationsByType(g,h),p=0;p<P.length;p++)u=this.set.onDockingChanged(g.ElementId,P[p],"UNDOCK")}}else if("END"==l){var D=E.Z.searchDockableElementsInArea(g,this.getAllPlannerElements(),i);null!=D&&D.size>0&&D.forEach((function(t,r){var a=d.plannerElements.get(t.targetDP.ElementId);a&&E.Z.tryDockElementDPToDP(g,a,t.sourceDP,t.targetDP)})),u=this.updateAllElementsWorldPos(t),this.updatePlannerPosNr(),this.updatePlannerBoundingBox()}}return u}},{key:"destroyPlanner",value:function destroyPlanner(){this.plannerElements.forEach((function(t,r){t.destroy()})),this.plannerElements.clear()}},{key:"saveSetPlanner",value:function saveSetPlanner(){var t=this;if(0==this.plannerElements.size)return null;var r=[];return this.plannerElements.forEach((function(a,o){for(var l=a.getDockingDockingPoints(),i=[],c=0;c<l.length;c++){var d,u={id:l[c].DpId,onID:l[c].OnElementId,onDPID:null===(d=l[c].OnDP)||void 0===d?void 0:d.DpId};i.push(u)}var g={elementID:a.getElementId(),basketID:t.set.getBasketId(a.getElementId()),CatalogCodex:t.set.getCatalogCodex(),Codex:t.set.getArticleCodex(a.getElementId()),posNr:a.PosNr,accNr:a.IsDockedAccessoire?a.AccessoirePosNr:void 0,x:a.WorldPosCenter.x,y:a.WorldPosCenter.y,z:a.WorldPosCenter.z,rot:a.RotDeg,width:a.Width?a.Width:-1,height:a.Height?a.Height:-1,depth:a.Depth?a.Depth:-1,DP:i};if(a.IsAccessoire){var h=t.set.getParentBasketIdOfElementId(a.getElementId());null!=h&&(g.AccessoireInitParams={RelatedToBasketID:h})}r.push(g)})),{setId:this.set.getSetId(),x:0,y:0,z:0,width:this.plannerBoundingBox.Size.x,height:this.plannerBoundingBox.Size.y,depth:this.plannerBoundingBox.Size.z,rot:0,elements:r}}},{key:"getPlannerId",value:function getPlannerId(){return this.plannerID}},{key:"getSetData",value:function getSetData(t,r,a,o){var l=this,i={ID:r?this.set.getSetId():"S1",H:"",x:0,y:0,z:0,w:0,ELE:[],Blob:this.set.CatalogData.supplierILN,Cat:this.set.getCatalogCodex()},c=this.set.getAlternateRenderInfo();c&&(i.AlternateImg=c),a&&(i.ShowDim=a),this.isIDM3DCat&&(i.IsIDM3D=!0,i.IDM3DCatCodex=this.IDM3DCatCodex,i.IDM3DEnvironment=this.IDM3DEnvironment),this.plannerElements.forEach((function(r,c){var d=l.set.getPlannerConfigData(c,o),u=d.config,g=[];if(d.accs&&d.accs.length>0)for(var h=0;h<d.accs.length;h++)l.plannerElements.has(d.accs[h])&&g.push("E"+d.accs[h]);if(!t||null!=u.Model){var p,D,m,E,k=l.set.getArticleByElementId(c),v={ID:"E"+c,Model:u.Model,x:-Math.round(100*r.WorldPosCenterIgnoreOLF.x)/100,y:Math.round(100*r.WorldPosCenterIgnoreOLF.y)/100,z:Math.round(100*r.WorldPosCenterIgnoreOLF.z)/100,PosPivot:"Center",w:Math.round(100*r.getRotDeg())/100,RotPivot:"Center",DP:r.getDockingPointJS3D(),MAT:u.MAT,MOVE:null!==(p=u.MOVE)&&void 0!==p?p:void 0,CFG:u.CFG,H:"",ACCs:g.length>0?g:void 0};if(a)v.TechSize={Width:null==r.Width||isNaN(r.Width)?null!==(D=null==k?void 0:k.width)&&void 0!==D?D:0:r.Width,Height:null==r.Height||isNaN(r.Height)?null!==(m=null==k?void 0:k.height)&&void 0!==m?m:0:r.Height,Depth:null==r.Depth||isNaN(r.Depth)?null!==(E=null==k?void 0:k.depth)&&void 0!==E?E:0:r.Depth};var I=(0,P.FB)(JSON.stringify(v));v.H=I,i.ELE.push(v)}var y=l.set.getShelfPlannerData(c);if(y)for(var x=0;x<y.length;x++){var A=y[x],C=l.set.getShelfPlannerConfigData(A.basketId).config,b=[];if(C.accs&&C.accs.length>0)for(var B=0;B<C.accs.length;B++)l.plannerElements.has(C.accs[B])&&b.push("E"+C.accs[B]);var V={ID:"E"+A.parentElementId+"."+A.gridId+"."+A.rh,H:"",Model:A.model,x:0,y:0,z:1,w:0,PosPivot:"Center",RotPivot:"Center",DP:"RH"+A.rh+":E"+A.parentElementId,GN:A.gridName,MAT:C.MAT,CFG:C.CFG,ACCs:b.length>0?b:void 0};I=(0,P.FB)(JSON.stringify(V));V.H=I,i.ELE.push(V)}}));var d=(0,P.FB)(JSON.stringify(i));return i.H=d,{constructionSet:i}}},{key:"getElementPosInfo",value:function getElementPosInfo(){var t={};return this.plannerElements.forEach((function(r,a){r.IsDockedAccessoire?t[a]={pos:r.PosNr,isAcc:!0,accPos:r.AccessoirePosNr}:t[a]={pos:r.PosNr,isAcc:!1}})),t}},{key:"getPlanningIsComplete",value:function getPlanningIsComplete(t){var r=this,a=!t&&(this.set.CatalogData.doHideCompletenessWarning||!this.set.CatalogData.doCheckConstructionWarnings),o=!1;return this.plannerElements.forEach((function(t,l){var i;(!a||null!==(i=r.set.CatalogData.forceConstructionWarningForArticles)&&void 0!==i&&i.includes(t.ArticleCodex))&&!o&&(t.getFreeDockingPointsByType("AVL").length>0||t.getFreeDockingPointsByType("AVR").length>0)&&(o=!0)})),!o}},{key:"getPlannerBoundingBox",value:function getPlannerBoundingBox(){var t=this.set.CatalogData,r=this.plannerBoundingBox.getWidth(t.PlannerMeasureDigits),a=this.plannerBoundingBox.getDepth(t.PlannerMeasureDigits),o=this.plannerBoundingBox.getHeight(t.PlannerMeasureDigits),l=this.plannerBoundingBox.getWidth(t.PlannerMeasureDigits,!0),i=this.plannerBoundingBox.getDepth(t.PlannerMeasureDigits,!0),c=this.plannerBoundingBox.getHeight(t.PlannerMeasureDigits,!0),d=l!==r||i!==a||c!==o;return{width:r,height:o,depth:a,widthIgnoreOLF:d?l:void 0,depthIgnoreOLF:d?i:void 0,heightIgnoreOLF:d?c:void 0}}},{key:"updatePlannerBoundingBox",value:function updatePlannerBoundingBox(){this.plannerBoundingBox.calcPlannerBoundingBox(this.getAllPlannerElements()),this.plannerBoundingBox.calcPlannerBoundingBoxIgnoreOLF(this.getAllPlannerElements())}},{key:"getCatalogData",value:function getCatalogData(){return this.set.CatalogData}},{key:"getAllPlannerElements",value:function getAllPlannerElements(){var t=[];return this.plannerElements.forEach((function(r,a){t.push(r)})),t}},{key:"getParentElement",value:function getParentElement(t){var r=void 0,a=t.getParentElementId();return a&&(r=this.plannerElements.get(a)),r}},{key:"getPositionOfPlannerElements",value:function getPositionOfPlannerElements(){var t=this.set.getSetId();this.plannerElements.forEach((function(r,a){v.log("SetID:",t),v.log("Elementid:",r.ElementId),v.log("X:",r.WorldPosCenter.x),v.log("Y:",r.WorldPosCenter.y),v.log("X:",r.WorldPosCenter.z),v.log("ROT:",r.RotDeg),v.log("___________________________")}))}},{key:"clonePlanner",value:function clonePlanner(t,r){return new DivaStandardPlanner(t,(function(){}),r,new k.Z,!0,!1)}},{key:"getPlannerInteractionInformation",value:function getPlannerInteractionInformation(){return v.error(new P.GE("The function getPlannerInteractionInformation is not implemented yet for standard planner. Dont call it or ask roadmap when its its turn",{code:"WC_0012"})),{boxPlannerInteractionInformationPerElement:new Map}}},{key:"getGeneralPlanningState",value:function getGeneralPlanningState(t){return v.error(new P.GE("The function getGeneralPlanningState is not implemented yet for standard planner. Dont call it or ask roadmap when its its turn",{code:"WC_0012"})),{grids:[]}}}]);var t,r,a,u,y,x,A,C}();(0,d.Z)(y,"plannerType","STD")}}]);
|
|
2
|
+
"use strict";(self.webpackChunkCrystaldesignDivaWebPlannerReact=self.webpackChunkCrystaldesignDivaWebPlannerReact||[]).push([[7909],{87909:(t,r,a)=>{a.r(r),a.d(r,{default:()=>y});var o=a(12952),l=a(84658),i=a(13125),c=a(43860),d=a(80248),u=a(50747),g=a.n(u),h=a(57312),P=a(69369),p=a(60415),m=a(41219),D=a(64357),k=a(65411);function parseSetPlanData(t){var r=P.ZP.decodeBase64(t);return JSON.parse(r)}function isSavePlannerV2(t){return 2===t.v}function saveElementArticleCodex(t){return t.articleCodex||t.Codex}var v=a(58178);function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,l=function F(){};return{s:l,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,d=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();return c=t.done,t},e:function e(t){d=!0,i=t},f:function f(){try{c||null==a.return||a.return()}finally{if(d)throw i}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=Array(r);a<r;a++)o[a]=t[a];return o}var E=P.ZP.initLog("Planner","WEB-PLANNER-LOGIC"),I=["AVO","AVU","AVC","AVS","AVN"],y=function(){function DivaStandardPlanner(t,r,a,o,l,c){var u=this;(0,i.Z)(this,DivaStandardPlanner),(0,d.Z)(this,"plannerID",void 0),(0,d.Z)(this,"set",void 0),(0,d.Z)(this,"plannerBoundingBox",void 0),(0,d.Z)(this,"plannerElements",void 0),(0,d.Z)(this,"doDisablePlanner2D",!1),(0,d.Z)(this,"plannerHasStaticBackground",void 0),(0,d.Z)(this,"isIDM3DCat",!1),(0,d.Z)(this,"IDM3DCatCodex",""),(0,d.Z)(this,"IDM3DEnvironment","diva.ro"),(0,d.Z)(this,"nextElementId",1),(0,d.Z)(this,"collisionHandler",void 0),(0,d.Z)(this,"dockToAVUorAVOororAVNorAVSorAVC",(function(t,r){var a=function hasFreeDP(r){return t.getFreeDockingPointsByType(r).length>0};if(a("AVU")){var o=k.Z.tryDockElement(t,"AVU",r);if(o)return u.updateWorldPos(t,o),!0;for(var l=0;l<r.length;l++){var i=r[l].getCurrentAccessorires().map((function(t){return u.plannerElements.get(t.getElementId())}));if(u.dockToAVUorAVOororAVNorAVSorAVC(t,i))return!0}}if(a("AVO")){var c=k.Z.tryDockElement(t,"AVO",r);if(c)return u.updateWorldPos(t,c),!0}if(a("AVN")){var d=k.Z.tryDockElement(t,"AVN",r);if(d)return u.updateWorldPos(t,d),!0}if(a("AVS")){var g=k.Z.tryDockElement(t,"AVS",r);if(g)return u.updateWorldPos(t,g),!0}if(a("AVC")){var h=k.Z.tryDockElement(t,"AVC",r);if(h)return u.updateWorldPos(t,h),!0}return!1})),this.set=t,this.plannerID=a,this.plannerElements=new Map,this.plannerBoundingBox=new v.Z,this.plannerBoundingBox.initPlannerBBox(o),this.doDisablePlanner2D=l,this.collisionHandler={updatePlannerMsgContainer:r,collisionDetected:!1,collisionPairs:[]},this.plannerHasStaticBackground=c}return(0,c.Z)(DivaStandardPlanner,[{key:"updatePlannerPosNr",value:function updatePlannerPosNr(){var t,r=this,a=[],o=new Map,l=this;this.plannerElements.forEach((function(t,r){o.set(r,!0),t.IsDockedAccessoire||t.HasAVL&&t.dockingTypeIsDocking("AVL")||a.push(t)})),this.getCatalogData().dontSetPosNrFromPlanner||(a=a.sort((function(t,r){return t.WorldPosCenter.x-r.WorldPosCenter.x})));for(var i=function updateAccessoiresOfElement(a,c){for(var d=[],u=function setPosNrForElementsOnDock(r,i){if(a["Has"+r]){var d=a.getDockingDockingPointsByType(r);d=d.sort((function(t,r){return l.plannerElements.get(t.OnElementId).WorldPosCorner.x-l.plannerElements.get(r.OnElementId).WorldPosCorner.x}));for(var u=0;u<d.length;u++){var g=d[u].OnElementId;if(o.has(g)){var h=l.plannerElements.get(g);h.PosNr=c,h.AccessoirePosNr=t,o.delete(g),t++,i.push(h)}}}},g=0;g<I.length;g++)u(I[g],d);r.plannerElements.forEach((function(r){r.getIsNotDockedAccessoire()&&r.getParentElementId()===a.getElementId()&&(r.PosNr=c,r.AccessoirePosNr=t,o.delete(r.getElementId()),t++,d.push(r))}));for(var h=0;h<d.length;h++)i(d[h],c)},c=function updatePosInChain(r,a){if(null==r)return a;if(r.PosNr=a,t=1,o.delete(r.ElementId),i(r,a),a++,r.HasAVR&&r.dockingTypeIsDocking("AVR")){var d=r.getDockingDockingPointsByType("AVR")[0].OnElementId;return c(l.plannerElements.get(d),a)}return a},d=1,u=0;u<a.length;u++)d=c(a[u],d)}},{key:"updateWorldPos",value:function updateWorldPos(t,r){var a=!1,o=this.plannerElements.get(r.OnElementId),l=o.getDockingPointById(r.OnDP.DpId);if(null==l)return a;this.applyDockTransform(t,o,r,l),a=this.set.onDockingChanged(t.ElementId,o.ElementId,"DOCK",r.Type);var i=this.set.getPlannerData(t.ElementId);t.updatePlannerData(i);var c=this.set.getPlannerData(o.ElementId);return o.updatePlannerData(c),a}},{key:"applyDockTransform",value:function applyDockTransform(t,r,a,o){var l=(0,p.eY)(r,o,t,a);t.RotDeg=l.rotDeg,t.WorldPosCorner=new D.P(l.worldPosCorner.x,l.worldPosCorner.y,l.worldPosCorner.z),t.WorldPosCornerIgnoreOLF=new D.P(l.worldPosCornerIgnoreOLF.x,l.worldPosCornerIgnoreOLF.y,l.worldPosCornerIgnoreOLF.z)}},{key:"getDockSnapPreview",value:function getDockSnapPreview(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=this.plannerElements.get(t);if(!o)return null;var l,i=this.getAllPlannerElements().filter((function(r){return r.getElementId()!==t&&!a.includes(r.getElementId())})),c=k.Z.searchDockableElementsInArea(o,i,r);if(!c||0===c.size)return null;if(c.forEach((function(t){(null==l||t.distance<l.distance)&&(l=t)})),null==l)return null;var d=this.plannerElements.get(l.targetDP.ElementId);if(!d)return null;var u=o.RotDeg,g=o.WorldPosCenter,h=g.x,P=g.y,p=g.z;this.applyDockTransform(o,d,l.sourceDP,l.targetDP);var m=o.WorldPosCenter,v={dx:m.x-h,dz:m.z-p,dRotDeg:o.RotDeg-u};return o.RotDeg=u,o.WorldPosCenter=new D.P(h,P,p),v}},{key:"updateAllElementsWorldPos",value:function updateAllElementsWorldPos(t,r){if(this.doDisablePlanner2D)return!1;var a=function getDockedDPsInPriorityOrder(t){return t.getDockingDockingPointsByType("AVL").concat(t.getDockingDockingPointsByType("AVR")).concat(t.getDockingDockingPointsByType("AVU")).concat(t.getDockingDockingPointsByType("AVO")).concat(t.getDockingDockingPointsByType("AVN")).concat(t.getDockingDockingPointsByType("AVS")).concat(t.getDockingDockingPointsByType("AVC"))},o=!1,l=[],i=[];this.plannerElements.forEach((function(t,r){t.IsDockedAccessoire?i.push(t):l[t.PosNr-1]=t})),l=l.concat(i);for(var c=[],d=0,u=0;u<l.length;u++)if(l[u]){var g=l[u];if(c.push(g.ElementId),u>d)for(var h=a(g),P=0;P<h.length;P++)if(c.indexOf(h[P].OnElementId)>=0){o=this.updateWorldPos(g,h[P]);break}}else d=u;if(r&&r.length>0)for(var p=new Set(r),m=!0;m;){m=!1;var D,k=_createForOfIteratorHelper(l);try{for(k.s();!(D=k.n()).done;){var v=D.value;if(v&&!p.has(v.ElementId)){var E=a(v).find((function(t){return p.has(t.OnElementId)}));E&&(o=this.updateWorldPos(v,E)||o,p.add(v.ElementId),m=!0)}}}catch(t){k.e(t)}finally{k.f()}}return this.checkCollision(!1,t),o}},{key:"addElementToWorld",value:(b=(0,l.Z)(g().mark((function _callee(t,r,a,o){var l,i,c,d,u,h,P,p,m,v,E,I,y=arguments;return g().wrap((function _callee$(g){for(;;)switch(g.prev=g.next){case 0:if(l=y.length>4&&void 0!==y[4]?y[4]:100,!(i=y.length>5?y[5]:void 0)||!i.forceSetToTrans){g.next=8;break}t.WorldPosCenter=i.transform.worldPosCenter,t.RotDeg=i.transform.rotDeg,this.set.onDockingChanged(t.ElementId,-1,"NOT_DOCKED"),g.next=48;break;case 8:if(c=!1,!r){g.next=47;break}d=0;case 11:if(!(d<r.length)){g.next=47;break}if(u=r[d].targetElemIdToDock,h=r[d].targetDockingPointId,!(u&&u>-1&&this.plannerElements.has(u))){g.next=44;break}if(!h||""==h){g.next=32;break}if(!(P=this.plannerElements.get(u))){g.next=30;break}if(!(p=P.getDockingPointById(h))){g.next=30;break}if(!(m=k.Z.tryDockElementToDP(t,P,p))){g.next=26;break}this.updateWorldPos(t,m),c=!0,g.next=30;break;case 26:return g.next=28,this.tryToDockWithDifferentSVGWithFormula(t,u);case 28:if(!g.sent){g.next=30;break}c=!0;case 30:g.next=44;break;case 32:if(v=!1,(t.HasAVL||t.HasAVR)&&(v=this.dockToAVLorAVR(t,[this.plannerElements.get(u)])),v||(v=this.dockToAVUorAVOororAVNorAVSorAVC(t,[this.plannerElements.get(u)])),v){g.next=43;break}return g.next=38,this.tryToDockWithDifferentSVGWithFormula(t,u);case 38:if(v=g.sent){g.next=43;break}return g.next=42,this.addElementToWorld(t,void 0,void 0,void 0,50);case 42:return g.abrupt("return");case 43:v&&(c=!0);case 44:d++,g.next=11;break;case 47:c||(E=this.getAllPlannerElements(),I=this.dockToAVLorAVR(t,E),a&&(I=!1),I||(I=this.dockToAVUorAVOororAVNorAVSorAVC(t,E),a&&(I=!1),I||(null==o&&(t.WorldPosCenter=new D.P(this.plannerBoundingBox.WorldPos.x+this.plannerBoundingBox.Size.x+(0==this.plannerBoundingBox.Size.x?0:t.Width/2+l),this.plannerBoundingBox.WorldPos.y,this.plannerBoundingBox.WorldPos.z+t.Depth/2)),this.set.onDockingChanged(t.ElementId,-1,"NOT_DOCKED"))));case 48:this.updatePlannerPosNr(),this.updateAllElementsWorldPos(),this.updatePlannerPosNr(),this.checkCollision(!1,t.getElementId()),this.updatePlannerBoundingBox();case 53:case"end":return g.stop()}}),_callee,this)}))),function addElementToWorld(t,r,a,o){return b.apply(this,arguments)})},{key:"tryToDockWithDifferentSVGWithFormula",value:(C=(0,l.Z)(g().mark((function _callee2(t,r){var a,o,l,i,c,d,u,h,p,m,D,k,v;return g().wrap((function _callee2$(g){for(;;)switch(g.prev=g.next){case 0:if(a=!1,o=this.set.getArticleByElementId(t.ElementId),l=null==o?void 0:o.VariantValues,i=t.getSVGsWithFormula(),!t.FilterAVL.length&&!t.FilterAVR.length){g.next=52;break}if(null==i||!i.length){g.next=18;break}c=0;case 7:if(!(c<i.length)){g.next=18;break}return d=P.ZP.getVariantValuesFromRule(i[c].JsFormula,{}),g.next=11,this.applyVariantValuesAndTryDock(t,r,d);case 11:if(!(a=g.sent)){g.next=15;break}return E.debug("svgWithFormula nr: "+c+" did dock: "+i[c].SVG),g.abrupt("break",18);case 15:c++,g.next=7;break;case 18:if(a||!o){g.next=31;break}u=this.getVariantValuesMatchingTargetFilters(o,this.plannerElements.get(r)),h=0;case 21:if(!(h<u.length&&h<20)){g.next=31;break}return g.next=24,this.applyVariantValuesAndTryDock(t,r,u[h]);case 24:if(!(a=g.sent)){g.next=28;break}return E.debug("following variantValues matching the target avl/avr filter did dock: ",u[h]),g.abrupt("break",31);case 28:h++,g.next=21;break;case 31:if(null==(p=t.getVaraintValuesInfluencingAVLAVRFilter())||!p.length||a){g.next=44;break}m=0;case 34:if(!(m<p.length&&m<20)){g.next=44;break}return g.next=37,this.applyVariantValuesAndTryDock(t,r,p[m]);case 37:if(!(a=g.sent)){g.next=41;break}return E.debug("following variantValues did dock: ",p[m]),g.abrupt("break",44);case 41:m++,g.next=34;break;case 44:if(a){g.next=52;break}for(v in D=new Map,k=new Map,l)k.set(v,l[v]);return D.set(t.ElementId,k),g.next=51,this.set.updateCfgValuesByPlanner(D,!0);case 51:o&&this.commitPendingConnectorFilters(o);case 52:return g.abrupt("return",a);case 53:case"end":return g.stop()}}),_callee2,this)}))),function tryToDockWithDifferentSVGWithFormula(t,r){return C.apply(this,arguments)})},{key:"applyVariantValuesAndTryDock",value:(A=(0,l.Z)(g().mark((function _callee3(t,r,a){var o,l,i,c;return g().wrap((function _callee3$(d){for(;;)switch(d.prev=d.next){case 0:for(i in o=new Map,l=new Map,a)l.set(i,a[i]);return o.set(t.ElementId,l),d.next=6,this.set.updateCfgValuesByPlanner(o,!0);case 6:return(c=this.set.getArticleByElementId(t.ElementId))&&this.commitPendingConnectorFilters(c),d.abrupt("return",this.dockToAVLorAVR(t,[this.plannerElements.get(r)]));case 9:case"end":return d.stop()}}),_callee3,this)}))),function applyVariantValuesAndTryDock(t,r,a){return A.apply(this,arguments)})},{key:"commitPendingConnectorFilters",value:function commitPendingConnectorFilters(t){t.newPossibleAVRFilters&&(t.avr=t.newPossibleAVRFilters,t.newPossibleAVRFilters=void 0),t.newPossibleAVLFilters&&(t.avl=t.newPossibleAVLFilters,t.newPossibleAVLFilters=void 0)}},{key:"getVariantValuesMatchingTargetFilters",value:function getVariantValuesMatchingTargetFilters(t,r){if(!r)return[];var a=t.CatalogData.isIDMFormat?"":"OPT",o=t.CatalogData.isIDMFormat?"":"OPV",l=[],i=new Set,c=function collect(r,c){var d,u=_createForOfIteratorHelper(c);try{for(u.s();!(d=u.n()).done;){var g,h=d.value,P=_createForOfIteratorHelper(t.getVariantValuesInfluencingOptions([a+r],o+h));try{for(P.s();!(g=P.n()).done;){var p=g.value,m=JSON.stringify(p);i.has(m)||(i.add(m),l.push(p))}}catch(t){P.e(t)}finally{P.f()}}}catch(t){u.e(t)}finally{u.f()}};return c("89",r.FilterAVR),c("90",r.FilterAVL),l}},{key:"dockToAVLorAVR",value:function dockToAVLorAVR(t,r){var a=!1,o=!1;if(t.HasAVL){var l=k.Z.tryDockElement(t,"AVL",r);l&&(this.updateWorldPos(t,l),a=!0)}if(!a&&t.HasAVR){var i=k.Z.tryDockElement(t,"AVR",r);i&&(o=!0,this.updateWorldPos(t,i))}return a||o}},{key:"getAllViewPlannerElements",value:function getAllViewPlannerElements(){return this.getAllPlannerElements()}},{key:"getFreeDockingPointsByElementId",value:function getFreeDockingPointsByElementId(t,r){if(!this.plannerElements.has(t))return{dockingPoints:[],filter:[]};var a=this.plannerElements.get(t),o=a.getFreeDockingPointsByType(r),l=[];switch(r){case"AVR":l=a.getFilterAVR();break;case"AVL":l=a.getFilterAVL()}return{dockingPoints:o,filter:l}}},{key:"getDockedDockingPointsByElementId",value:function getDockedDockingPointsByElementId(t,r){if(!this.plannerElements.has(t))return[];for(var a=this.plannerElements.get(t),o=[],l=0;l<r.length;l++)o=o.concat(a.getDockingDockingPointsByType(r[l]));return o}},{key:"getNeighborElements",value:function getNeighborElements(t,r){if(!this.plannerElements.has(t))return[];var a=this.plannerElements.get(t),o=null==a?void 0:a.getDockingDockingPointsByType(r);if(!o)return[];for(var l=[],i=0;i<(null==o?void 0:o.length);i++)null!=o[i]&&l.push(o[i].OnElementId);return l}},{key:"getDockedGroups",value:function getDockedGroups(){for(var t=[],r=this.getAllPlannerElements(),a=[],o=0;o<this.getAllPlannerElements().length;o++){var l=r[o];if(a.push(l.getElementId()),!l.IsAccessoire){var i=l.getDockingPointsByType("AVL");if(i&&0!=i.length)for(var c=0;c<i.length;c++)i[c].IsDocking||t.push(l);else t.push(l)}}t.sort((function(t,r){return t.WorldPosCorner.x<r.WorldPosCorner.x?1:0}));var d=[];for(o=0;o<t.length;o++){var u=t[o],g=[];a.splice(a.indexOf(u.getElementId()),1);for(var h=!1,P=u;!h;){g.push(P.getElementId()),a.splice(a.indexOf(P.getElementId()),1);var p=this.getAccessoiresRecursive(P.getElementId());for(c=0;c<p.length;c++)g.push(p[c]),a.splice(a.indexOf(p[c]),1);var m=this.getNeighborElements(P.getElementId(),"AVR");m&&0!=m.length?P=this.plannerElements.get(m[0]):h=!0}d.push(g)}for(o=0;o<a.length;o++)d.push([a[o]]);return d}},{key:"getAccessoiresRecursive",value:function getAccessoiresRecursive(t){var r=this,a=function calcAccs(t,o,l){l.push(t);for(var i=r.getNeighborElements(t,"AVC"),c=r.getNeighborElements(t,"AVO"),d=r.getNeighborElements(t,"AVU"),u=r.getNeighborElements(t,"AVN"),g=r.getNeighborElements(t,"AVS"),h=i.concat(c).concat(d).concat(u).concat(g),P=0;P<h.length;P++)l.indexOf(h[P])>=0||(o.push(h[P]),l.push(h[P]),a(h[P],o,l))},o=[];return a(t,o,[]),o}},{key:"getBoundingBox",value:function getBoundingBox(){return this.plannerBoundingBox}},{key:"initIDM3DMeta",value:function initIDM3DMeta(t,r){this.isIDM3DCat=!0,this.IDM3DCatCodex=t||this.set.getCatalogCodex(),r&&(this.IDM3DEnvironment=r)}},{key:"updatePlanner",value:(x=(0,l.Z)(g().mark((function _callee4(){var t,r,a,o,l,i;return g().wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:t=this.getAllPlannerElements(),r=[],a=0;case 3:if(!(a<t.length)){c.next=13;break}if(!(o=t[a]).updatePlannerData(this.set.getPlannerData(o.getElementId()))){c.next=10;break}return r.push(o.ElementId),c.next=10,m.Z.loadSVG(o,this.set);case 10:a++,c.next=3;break;case 13:if(l=[],r.length){for(E.debug("Configuration changed one plannerElement. UpdateDockingRelations","DivaStandardPlanner - updatePlanner"),i=k.Z.updateDockingRelations(this.plannerElements),a=0;a<i.length;a++)i[a].IsDockedAccessoire&&l.push(i[a].ElementId);this.updateAllElementsWorldPos(void 0,r),this.updatePlannerPosNr(),this.updatePlannerBoundingBox()}return c.abrupt("return",{doDeleteBackGrid:!1,elemIdsToDelete:l,elementIdsToUpdateSelection:r,failed:!1});case 16:case"end":return c.stop()}}),_callee4,this)}))),function updatePlanner(){return x.apply(this,arguments)})},{key:"extendPlanner",value:(y=(0,l.Z)(g().mark((function _callee5(t,r){var a,l,i,c,d,u,p,v,I,y,x,A,C,b,V,B,N,S,T,W;return g().wrap((function _callee5$(g){for(;;)switch(g.prev=g.next){case 0:if(!isSavePlannerV2(a=parseSetPlanData(t))){g.next=39;break}l=a.set.elements,i=[],c=[],d=new Map,u=0;case 7:if(!(u<l.length)){g.next=35;break}if(g.prev=8,I=l[u],this.set.CatalogData.getCatalogArticleByArticleCodex(null!==(p=saveElementArticleCodex(I))&&void 0!==p?p:"")||null===(v=I.AccessoireInitParams)||void 0===v||!v.RelatedToBasketID||this.set.getSetState.onlyRunLogic){g.next=14;break}return E.error(new P.GE("Error initializing element nr "+u+" in the Standard Web Planner. PlanData V2",{code:"WC_0012"})),g.abrupt("continue",32);case 14:if(y=new h.Z(this.set.getSetId(),I.basketID,this.nextElementId,DivaStandardPlanner.plannerType),d.set(I.elementID,y),this.nextElementId=y.getElementId()+1,this.plannerElements.set(y.ElementId,y),this.set.setElementId(I.basketID,y.ElementId),x=this.set.getPlannerData(y.ElementId),y.updatePlannerData(x),this.doDisablePlanner2D){g.next=24;break}return g.next=24,m.Z.loadSVG(y,this.set);case 24:y.WorldPosCenter=new D.P(r.WorldPos.x+r.Size.x+I.x+100,r.WorldPos.y+I.y,r.WorldPos.z+I.z),y.RotDeg=I.rot,y.IsDockedAccessoire?(c.push(I),y.PosNr=I.posNr,null!=I.accNr&&(y.AccessoirePosNr=I.accNr)):(i[I.posNr-1]=I,y.PosNr=I.posNr),g.next=32;break;case 29:g.prev=29,g.t0=g.catch(8),E.error(new P.GE("Error initializing element nr "+u+" in the Standard Web Planner. PlanData V2",{cause:g.t0,code:"WC_0012"}));case 32:u++,g.next=7;break;case 35:for(A=[].concat((0,o.Z)(i.filter((function(t){return null!=t}))),c),u=0;u<A.length;u++)if(C=A[u],b=d.get(C.elementID),A.length>1&&u>0)for(V=C.DP,B=0;B<V.length;B++)N=V[B],S=null==b?void 0:b.getDockingPointById(N.id),T=d.get(N.onID),W=null==T?void 0:T.getDockingPointById(N.onDPID),S&&W&&k.Z.tryDockElementDPToDP(b,T,S,W);g.next=40;break;case 39:E.error(new P.GE("The function extend Planner works only with products that are saved in the configurator 2.0",{code:"WC_0012"}));case 40:case"end":return g.stop()}}),_callee5,this,[[8,29]])}))),function extendPlanner(t,r){return y.apply(this,arguments)})},{key:"initPlanner",value:(u=(0,l.Z)(g().mark((function _callee6(t){var r,a,l,i,c,d,u,p,v,I,y,x,A,C,b,V,B,N,S,T,W,w,_,O,R,Z,L,M,z,G,H,U,$,J,K,j,X,Y,q,Q,ee,ne,te,re,ae,oe,le,ie,se,ce,de,ue;return g().wrap((function _callee6$(g){for(;;)switch(g.prev=g.next){case 0:if(!isSavePlannerV2(r=parseSetPlanData(t))){g.next=63;break}if(E.debug("Initialize set Plan Data - V2\n"+r,"DivaStandardPlanner initPlanner"),null!==(a=r.set)&&void 0!==a&&null!==(a=a.elements)&&void 0!==a&&a.length){g.next=5;break}return g.abrupt("return");case 5:l=r.set.elements,i=[],c=[],d=0;case 9:if(!(d<l.length)){g.next=37;break}if(g.prev=10,v=l[d],this.set.CatalogData.getCatalogArticleByArticleCodex(null!==(u=saveElementArticleCodex(v))&&void 0!==u?u:"")||null===(p=v.AccessoireInitParams)||void 0===p||!p.RelatedToBasketID||this.set.getSetState.onlyRunLogic){g.next=16;break}return E.error(new P.GE("Error initializing element nr "+d+" in the Standard Web Planner. PlanData V2",{code:"WC_0012"})),g.abrupt("continue",34);case 16:if(I=v.elementID,y=new h.Z(this.set.getSetId(),v.basketID,I,DivaStandardPlanner.plannerType),this.nextElementId=I+1,this.plannerElements.set(y.ElementId,y),this.set.setElementId(v.basketID,y.ElementId),x=this.set.getPlannerData(y.ElementId),y.updatePlannerData(x),this.doDisablePlanner2D){g.next=26;break}return g.next=26,m.Z.loadSVG(y,this.set);case 26:y.WorldPosCenter=new D.P(this.plannerBoundingBox.WorldPos.x+v.x,this.plannerBoundingBox.WorldPos.y+v.y,this.plannerBoundingBox.WorldPos.z+v.z),y.RotDeg=v.rot,y.IsDockedAccessoire?(c.push(v),y.PosNr=v.posNr,null!=v.accNr&&(y.AccessoirePosNr=v.accNr)):(i[v.posNr-1]=v,y.PosNr=v.posNr),g.next=34;break;case 31:g.prev=31,g.t0=g.catch(10),E.error(new P.GE("Error initializing element nr "+d+" in the Standard Web Planner. PlanData V2",{cause:g.t0,code:"WC_0012"}));case 34:d++,g.next=9;break;case 37:A=1==i.filter(Boolean).length,C=[].concat((0,o.Z)(i.filter((function(t){return null!=t}))),c),d=0;case 40:if(!(d<C.length)){g.next=61;break}if(g.prev=41,b=C[d],0!=d||!A||!this.plannerHasStaticBackground){g.next=48;break}return null!=(null==(V=i[d])?void 0:V.x)||null!=(null==V?void 0:V.y)||null!=(null==V?void 0:V.z)||(B=this.plannerElements.get(b.elementID))&&(B.WorldPosCenter=new D.P(0,B.Height/2,B.Depth/2)),g.abrupt("continue",58);case 48:if(null!=b.DP&&0!=b.DP.length){g.next=50;break}return g.abrupt("continue",58);case 50:for(N=b.DP,S=0;S<N.length;S++)(T=N[S]).id&&null!=T.onID&&T.onDPID&&(W=this.plannerElements.get(b.elementID),w=null==W?void 0:W.getDockingPointById(T.id),_=this.plannerElements.get(T.onID),O=null==_?void 0:_.getDockingPointById(T.onDPID),w&&O?w.IsDocking&&w.OnDP==O||k.Z.tryDockElementDPToDP(W,_,w,O)||this.doDisablePlanner2D||E.error(new P.GE("Saved docking relation rejected on init: "+T.id+" (elem "+(null==W?void 0:W.ElementId)+") -> "+T.onDPID+" (elem "+(null==_?void 0:_.ElementId)+")",{code:"WC_0012"})):this.doDisablePlanner2D||E.error(new P.GE("Error initializing docking point between source element with id: "+(null==W?void 0:W.ElementId)+" and target Element with id: "+(null==_?void 0:_.ElementId)+". SourceDPID: "+T.id+"; targetDPID: "+T.onDPID)));g.next=58;break;case 54:g.prev=54,g.t1=g.catch(41),Z=null===(R=C[d])||void 0===R?void 0:R.elementID,E.error(new P.GE("Error initializing dockingPoints of element with elementID "+Z,{cause:g.t1,code:"WC_0012"}));case 58:d++,g.next=40;break;case 61:g.next=116;break;case 63:if(E.debug("Initialize set Plan Data - old V1\n"+r,"DivaStandardPlanner initPlanner"),null!=(z=null===(L=r.Sets)||void 0===L?void 0:L[0])&&null!==(M=z.Elements)&&void 0!==M&&M.length){g.next=67;break}return g.abrupt("return");case 67:G=z.Elements,H=[],U=[],d=0;case 71:if(!(d<G.length)){g.next=105;break}if(g.prev=72,K=G[d],this.set.CatalogData.getCatalogArticleByArticleCodex(null!==($=saveElementArticleCodex(K))&&void 0!==$?$:"")||null===(J=K.AccessoireInitParams)||void 0===J||!J.RelatedToBasketID||this.set.getSetState.onlyRunLogic){g.next=78;break}return E.error(new P.GE("Error initializing element nr "+d+" in the Standard Web Planner. PlanData V1",{code:"WC_0012"})),g.abrupt("continue",102);case 78:if(j=K.BasketID,-1==this.set.getElementId(j)&&this.set.setElementId(j,Number(K.ID)),X=this.set.getElementId(j),K.elementId=X,-1!=X){g.next=85;break}return E.error(new P.GE("Error when initializing planner. The elementID Was not saved in the article. ",{code:"WC_0012"})),g.abrupt("continue",102);case 85:if(Y=new h.Z(this.set.getSetId(),j,X,DivaStandardPlanner.plannerType),this.nextElementId=X+1,this.plannerElements.set(Y.ElementId,Y),q=this.set.getPlannerData(Y.ElementId),Y.updatePlannerData(q),this.doDisablePlanner2D){g.next=93;break}return g.next=93,m.Z.loadSVG(Y,this.set);case 93:Q=new D.P(K.PosX,K.PosZ,K.PosY),Y.WorldPosCenter=new D.P(this.plannerBoundingBox.WorldPos.x+Q.x,this.plannerBoundingBox.WorldPos.y+Q.y,this.plannerBoundingBox.WorldPos.z+Q.z),Y.RotDeg=K.Rot,Y.IsDockedAccessoire?(U.push(K),K.PosNum.toString().indexOf(".")>0&&(ee=K.PosNum.toString().split(".")[0],ne=K.PosNum.toString().split(".")[1],Y.PosNr=Number(ee),Y.AccessoirePosNr=Number(ne))):(H[K.PosNum-1]=K,Y.PosNr=K.PosNum),g.next=102;break;case 99:g.prev=99,g.t2=g.catch(72),E.error(new P.GE("Error initializing element nr "+d+" in the Standard Web Planner - Plan Data old Planner",{cause:g.t2,code:"WC_0012"}));case 102:d++,g.next=71;break;case 105:te=[].concat((0,o.Z)(H.filter((function(t){return null!=t}))),U),d=0;case 107:if(!(d<te.length)){g.next=116;break}if(null!=(re=te[d]).DP&&0!=re.DP.length){g.next=111;break}return g.abrupt("continue",113);case 111:for(ae=re.DP,S=0;S<ae.length;S++)(oe=ae[S]).DP&&""!=oe.DP&&oe.onID&&""!=oe.onID&&(ie=parseInt(String(oe.onID)),se=oe.DP,ce=null!=re.elementId?this.plannerElements.get(re.elementId):void 0,de=null!==(le=this.plannerElements.get(ie))&&void 0!==le?le:this.getPlannerElementByIndex(ie-1),ce&&de?k.Z.initDockingPointRelationByArea(ce,de,se):E.error(new P.GE("Error initializing dockingPoints of element with elementID "+re.elementId,{code:"WC_0012"})));case 113:d++,g.next=107;break;case 116:this.plannerElements.forEach((function(t){!t.IsDockedAccessoire&&(null==ue||t.PosNr<ue.PosNr)&&(ue=t)})),this.updateAllElementsWorldPos(void 0,ue?[ue.ElementId]:void 0),this.updatePlannerPosNr();case 119:case"end":return g.stop()}}),_callee6,this,[[10,31],[41,54],[72,99]])}))),function initPlanner(t){return u.apply(this,arguments)})},{key:"getPlannerElementByIndex",value:function getPlannerElementByIndex(t){var r=void 0,a=0;return this.plannerElements.forEach((function(o,l){t==a&&(r=o),a++})),r}},{key:"addPlannerElement",value:(a=(0,l.Z)(g().mark((function _callee7(t,r){var a,o,l,i,c,d,u;return g().wrap((function _callee7$(g){for(;;)switch(g.prev=g.next){case 0:if(c=new h.Z(this.set.getSetId(),t,this.nextElementId,DivaStandardPlanner.plannerType),this.nextElementId++,this.plannerElements.set(c.ElementId,c),this.set.setElementId(t,c.ElementId),d=this.set.getPlannerData(c.ElementId),c.updatePlannerData(d),this.doDisablePlanner2D){g.next=9;break}return g.next=9,m.Z.loadSVG(c,this.set);case 9:if(null==(u=null!==(a=r.dockingPointInfos)&&void 0!==a?a:[{targetDockingPointId:r.targetDockingPointId,targetElemIdToDock:r.targetElemIdToDock}])||null===(o=u[0])||void 0===o||!o.targetElemIdToDock||null==u||null===(l=u[0])||void 0===l||!l.targetDockingPointId){g.next=15;break}return g.next=13,this.addElementToWorld(c,u);case 13:g.next=27;break;case 15:if(null==u||null===(i=u[0])||void 0===i||!i.targetElemIdToDock){g.next=20;break}return g.next=18,this.addElementToWorld(c,u);case 18:g.next=27;break;case 20:if(!r.oldPlannerTransform){g.next=25;break}return g.next=23,this.addElementToWorld(c,void 0,void 0,void 0,void 0,{forceSetToTrans:!0,transform:r.oldPlannerTransform});case 23:g.next=27;break;case 25:return g.next=27,this.addElementToWorld(c);case 27:this.updatePlannerBoundingBox();case 28:case"end":return g.stop()}}),_callee7,this)}))),function addPlannerElement(t,r){return a.apply(this,arguments)})},{key:"movePlannerElement",value:function movePlannerElement(){throw Error("move planner not implemented in standard")}},{key:"copyPlannerElement",value:(r=(0,l.Z)(g().mark((function _callee8(t,r){var a,o,l,i,c,d;return g().wrap((function _callee8$(u){for(;;)switch(u.prev=u.next){case 0:a=0;case 1:if(!(a<t.length)){u.next=24;break}if(l=t[a],null!=r){u.next=7;break}return u.next=6,this.addPlannerElement(l.value,{});case 6:return u.abrupt("continue",21);case 7:if(-1==(i=null===(o=r.copyIndex)||void 0===o?void 0:o.x)||1==i){u.next=12;break}return u.next=11,this.addPlannerElement(l.value,{});case 11:return u.abrupt("continue",21);case 12:if(c=this.plannerElements.get(l.key),d=null==c?void 0:c.getFreeDockingPointsByType(-1==i?"AVL":"AVR").find((function(t){return!t.IsDisabled})),!c||!d){u.next=19;break}return u.next=17,this.addPlannerElement(l.value,{targetElemIdToDock:c.ElementId,targetDockingPointId:d.DpId});case 17:u.next=21;break;case 19:return u.next=21,this.addPlannerElement(l.value,{});case 21:a++,u.next=1;break;case 24:case"end":return u.stop()}}),_callee8,this)}))),function copyPlannerElement(t,a){return r.apply(this,arguments)})},{key:"getPlannerElementsInfluencedByDeletion",value:function getPlannerElementsInfluencedByDeletion(t,r){return[]}},{key:"getPlannerElementsInfluencedByCopy",value:function getPlannerElementsInfluencedByCopy(t,r){if(!r||"BoxPlanner_backside"!=r.copyType&&"STD"!=r.copyType)throw new Error("copyType needs to be BoxPlanner_backside or STD here");return this.plannerElements.has(t)?[t]:[]}},{key:"deletePlannerElement",value:(t=(0,l.Z)(g().mark((function _callee9(t,r){var a,o,l,i,c,d,u,h,p,m,D,v,E,I,y;return g().wrap((function _callee9$(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,P.ZP.Sleep(1);case 2:if(this.plannerElements.has(t)){g.next=4;break}return g.abrupt("return",{});case 4:return a=this.plannerElements.get(t),o=this.getParentElement(a),l=-1,i=999,c=-1,d=-1,u=!1,this.plannerElements.forEach((function(t,r){u||(null!=a&&a.IsAccessoire&&a.PosNr==t.PosNr&&(c=t.getElementId(),u=!0),t.getPosNr()<a.getPosNr()&&t.getPosNr()>l?(l=t.getPosNr(),c=t.getElementId()):t.getPosNr()>a.getPosNr()&&t.getPosNr()<i&&(i=t.getPosNr(),d=t.getElementId()))})),h=!1,r&&(p=a.getDockingDockingPointsByType("AVL"),m=a.getDockingDockingPointsByType("AVR"),p.length>0&&m.length>0&&(D=this.plannerElements.get(p[0].OnElementId),v=this.plannerElements.get(m[0].OnElementId),D&&v&&(E=D.getDockingDockingPointsByType("AVR"),I=v.getDockingDockingPointsByType("AVL"),E.length>0&&I.length>0&&(k.Z.removeDockingPointRelations(a),h=!0,k.Z.tryDockElementDPToDP(D,v,E[0],I[0]))))),y={rotDeg:a.getRotDeg(),worldPosCenter:a.WorldPosCenter},h||k.Z.removeDockingPointRelations(a),this.plannerElements.delete(t),this.tryToDockForNotDockedAccessoire(o),this.updatePlannerPosNr(),this.updateAllElementsWorldPos(),this.updatePlannerPosNr(),this.checkCollision(!1,a.getElementId()),this.updatePlannerBoundingBox(),g.abrupt("return",{newElementToSelect:c>=0?c:d>=0?d:void 0,transform:y});case 24:case"end":return g.stop()}}),_callee9,this)}))),function deletePlannerElement(r,a){return t.apply(this,arguments)})},{key:"tryToDockForNotDockedAccessoire",value:function tryToDockForNotDockedAccessoire(t){if(t)for(var r=t.getCurrentAccessorires().filter((function(t){return t.getIsNotDockedAccessoire()})),a=0;a<r.length;a++){var o=r[a].getElementId(),l=this.plannerElements.get(o);if(l)if(this.dockToAVUorAVOororAVNorAVSorAVC(l,[t]))break}}},{key:"checkCollision",value:function checkCollision(t,r){if(!this.doDisablePlanner2D){for(var a,o,l=this.getAllPlannerElements(),i=!1,c=[],d=0;d<l.length;d++){var u=l[d];if(!r||u.getElementId()==r)for(var g=r?0:d+1;g<l.length;g++){var h,P,p=l[g];if(u.getElementId()!=p.getElementId()&&!k.Z.checkElementsAreDocking(u,p)){var D=!1;if((this.set.CatalogData.doCheckConstructionWarnings||null!==(h=this.set.CatalogData.forceConstructionWarningForArticles)&&void 0!==h&&h.includes(u.ArticleCodex)||null!==(P=this.set.CatalogData.forceConstructionWarningForArticles)&&void 0!==P&&P.includes(p.ArticleCodex))&&(D=m.Z.checkCollision(u,p,this.set.CatalogData.checkCollisionForDifferentLayers)),D&&(i=!0,c.push({elementId1:u.getElementId(),elementId2:p.getElementId()}),E.debug("Collision Found between element1: "+u.ElementId+"; and element2: "+p.ElementId),!t))break}}}if(this.collisionHandler.collisionDetected&&!i)null===(a=(o=this.collisionHandler).updatePlannerMsgContainer)||void 0===a||a.call(o,"COLLISION_MSG",!1,"WARNING","COLLISION_MSG",!1);else if(!this.collisionHandler.collisionDetected&&i){var v,I;null===(v=(I=this.collisionHandler).updatePlannerMsgContainer)||void 0===v||v.call(I,"COLLISION_MSG",!0,"WARNING","COLLISION_MSG",!1)}this.collisionHandler.collisionPairs=c,this.collisionHandler.collisionDetected=i}}},{key:"updateSetPosNr",value:function updateSetPosNr(t){for(var r=this.getAllPlannerElements(),a=0;a<r.length;a++){var o=r[a];o.SetPosNr=t+o.PosNr-1,this.set.setPosNr(o.ElementId,o.getPosNr())}for(var l=0;l<r.length;l++)r[l].IsAccessoire||this.set.giveAccNewPosNrByBasketId(r[l].getBasketId());return r.length}},{key:"updatePlannerTrans",value:function updatePlannerTrans(t,r,a,o,l,i,c){var d=this,u=!1;if(this.plannerElements.has(t)){var g=this.plannerElements.get(t);if(null==g||g.updateDeltaTrans(r,a,o,"END"==l,c),"START"==l){if(g){var h=["AVR","AVL"];g.IsDockedAccessoire&&(h=h.concat(["AVO","AVU","AVN","AVS","AVC"]));for(var P=k.Z.removeDockingPointRelationsByType(g,h),p=0;p<P.length;p++)u=this.set.onDockingChanged(g.ElementId,P[p],"UNDOCK")}}else if("END"==l){var m=k.Z.searchDockableElementsInArea(g,this.getAllPlannerElements(),i);null!=m&&m.size>0&&m.forEach((function(t,r){var a=d.plannerElements.get(t.targetDP.ElementId);a&&k.Z.tryDockElementDPToDP(g,a,t.sourceDP,t.targetDP)})),u=this.updateAllElementsWorldPos(t),this.updatePlannerPosNr(),this.updatePlannerBoundingBox()}}return u}},{key:"destroyPlanner",value:function destroyPlanner(){this.plannerElements.forEach((function(t,r){t.destroy()})),this.plannerElements.clear()}},{key:"saveSetPlanner",value:function saveSetPlanner(){var t=this;if(0==this.plannerElements.size)return null;var r=[];return this.plannerElements.forEach((function(a,o){for(var l=a.getDockingDockingPoints(),i=[],c=0;c<l.length;c++){var d,u={id:l[c].DpId,onID:l[c].OnElementId,onDPID:null===(d=l[c].OnDP)||void 0===d?void 0:d.DpId};i.push(u)}var g={elementID:a.getElementId(),basketID:t.set.getBasketId(a.getElementId()),CatalogCodex:t.set.getCatalogCodex(),Codex:t.set.getArticleCodex(a.getElementId()),posNr:a.PosNr,accNr:a.IsDockedAccessoire?a.AccessoirePosNr:void 0,x:a.WorldPosCenter.x,y:a.WorldPosCenter.y,z:a.WorldPosCenter.z,rot:a.RotDeg,width:a.Width?a.Width:-1,height:a.Height?a.Height:-1,depth:a.Depth?a.Depth:-1,DP:i};if(a.IsAccessoire){var h=t.set.getParentBasketIdOfElementId(a.getElementId());null!=h&&(g.AccessoireInitParams={RelatedToBasketID:h})}r.push(g)})),{setId:this.set.getSetId(),x:0,y:0,z:0,width:this.plannerBoundingBox.Size.x,height:this.plannerBoundingBox.Size.y,depth:this.plannerBoundingBox.Size.z,rot:0,elements:r}}},{key:"getPlannerId",value:function getPlannerId(){return this.plannerID}},{key:"getSetData",value:function getSetData(t,r,a,o){var l=this,i={ID:r?this.set.getSetId():"S1",H:"",x:0,y:0,z:0,w:0,ELE:[],Blob:this.set.CatalogData.supplierILN,Cat:this.set.getCatalogCodex()},c=this.set.getAlternateRenderInfo();c&&(i.AlternateImg=c),a&&(i.ShowDim=a),this.isIDM3DCat&&(i.IsIDM3D=!0,i.IDM3DCatCodex=this.IDM3DCatCodex,i.IDM3DEnvironment=this.IDM3DEnvironment),this.plannerElements.forEach((function(r,c){var d=l.set.getPlannerConfigData(c,o),u=d.config,g=[];if(d.accs&&d.accs.length>0)for(var h=0;h<d.accs.length;h++)l.plannerElements.has(d.accs[h])&&g.push("E"+d.accs[h]);if(!t||null!=u.Model){var p,m,D,k,v=l.set.getArticleByElementId(c),E={ID:"E"+c,Model:u.Model,x:-Math.round(100*r.WorldPosCenterIgnoreOLF.x)/100,y:Math.round(100*r.WorldPosCenterIgnoreOLF.y)/100,z:Math.round(100*r.WorldPosCenterIgnoreOLF.z)/100,PosPivot:"Center",w:Math.round(100*r.getRotDeg())/100,RotPivot:"Center",DP:r.getDockingPointJS3D(),MAT:u.MAT,MOVE:null!==(p=u.MOVE)&&void 0!==p?p:void 0,CFG:u.CFG,H:"",ACCs:g.length>0?g:void 0};if(a)E.TechSize={Width:null==r.Width||isNaN(r.Width)?null!==(m=null==v?void 0:v.width)&&void 0!==m?m:0:r.Width,Height:null==r.Height||isNaN(r.Height)?null!==(D=null==v?void 0:v.height)&&void 0!==D?D:0:r.Height,Depth:null==r.Depth||isNaN(r.Depth)?null!==(k=null==v?void 0:v.depth)&&void 0!==k?k:0:r.Depth};var I=(0,P.FB)(JSON.stringify(E));E.H=I,i.ELE.push(E)}var y=l.set.getShelfPlannerData(c);if(y)for(var x=0;x<y.length;x++){var A=y[x],C=l.set.getShelfPlannerConfigData(A.basketId).config,b=[];if(C.accs&&C.accs.length>0)for(var V=0;V<C.accs.length;V++)l.plannerElements.has(C.accs[V])&&b.push("E"+C.accs[V]);var B={ID:"E"+A.parentElementId+"."+A.gridId+"."+A.rh,H:"",Model:A.model,x:0,y:0,z:1,w:0,PosPivot:"Center",RotPivot:"Center",DP:"RH"+A.rh+":E"+A.parentElementId,GN:A.gridName,MAT:C.MAT,CFG:C.CFG,ACCs:b.length>0?b:void 0};I=(0,P.FB)(JSON.stringify(B));B.H=I,i.ELE.push(B)}}));var d=(0,P.FB)(JSON.stringify(i));return i.H=d,{constructionSet:i}}},{key:"getElementPosInfo",value:function getElementPosInfo(){var t={};return this.plannerElements.forEach((function(r,a){r.IsDockedAccessoire?t[a]={pos:r.PosNr,isAcc:!0,accPos:r.AccessoirePosNr}:t[a]={pos:r.PosNr,isAcc:!1}})),t}},{key:"getPlanningIsComplete",value:function getPlanningIsComplete(t){var r=this,a=!t&&(this.set.CatalogData.doHideCompletenessWarning||!this.set.CatalogData.doCheckConstructionWarnings),o=!1;return this.plannerElements.forEach((function(t,l){var i;(!a||null!==(i=r.set.CatalogData.forceConstructionWarningForArticles)&&void 0!==i&&i.includes(t.ArticleCodex))&&!o&&(t.getFreeDockingPointsByType("AVL").length>0||t.getFreeDockingPointsByType("AVR").length>0)&&(o=!0)})),!o}},{key:"getPlannerBoundingBox",value:function getPlannerBoundingBox(){var t=this.set.CatalogData,r=this.plannerBoundingBox.getWidth(t.PlannerMeasureDigits),a=this.plannerBoundingBox.getDepth(t.PlannerMeasureDigits),o=this.plannerBoundingBox.getHeight(t.PlannerMeasureDigits),l=this.plannerBoundingBox.getWidth(t.PlannerMeasureDigits,!0),i=this.plannerBoundingBox.getDepth(t.PlannerMeasureDigits,!0),c=this.plannerBoundingBox.getHeight(t.PlannerMeasureDigits,!0),d=l!==r||i!==a||c!==o;return{width:r,height:o,depth:a,widthIgnoreOLF:d?l:void 0,depthIgnoreOLF:d?i:void 0,heightIgnoreOLF:d?c:void 0}}},{key:"updatePlannerBoundingBox",value:function updatePlannerBoundingBox(){this.plannerBoundingBox.calcPlannerBoundingBox(this.getAllPlannerElements()),this.plannerBoundingBox.calcPlannerBoundingBoxIgnoreOLF(this.getAllPlannerElements())}},{key:"getCatalogData",value:function getCatalogData(){return this.set.CatalogData}},{key:"getAllPlannerElements",value:function getAllPlannerElements(){var t=[];return this.plannerElements.forEach((function(r,a){t.push(r)})),t}},{key:"getParentElement",value:function getParentElement(t){var r=void 0,a=t.getParentElementId();return a&&(r=this.plannerElements.get(a)),r}},{key:"getPositionOfPlannerElements",value:function getPositionOfPlannerElements(){var t=this.set.getSetId();this.plannerElements.forEach((function(r,a){E.log("SetID:",t),E.log("Elementid:",r.ElementId),E.log("X:",r.WorldPosCenter.x),E.log("Y:",r.WorldPosCenter.y),E.log("X:",r.WorldPosCenter.z),E.log("ROT:",r.RotDeg),E.log("___________________________")}))}},{key:"clonePlanner",value:function clonePlanner(t,r){return new DivaStandardPlanner(t,(function(){}),r,new v.Z,!0,!1)}},{key:"getPlannerInteractionInformation",value:function getPlannerInteractionInformation(){return E.error(new P.GE("The function getPlannerInteractionInformation is not implemented yet for standard planner. Dont call it or ask roadmap when its its turn",{code:"WC_0012"})),{boxPlannerInteractionInformationPerElement:new Map}}},{key:"getGeneralPlanningState",value:function getGeneralPlanningState(t){return E.error(new P.GE("The function getGeneralPlanningState is not implemented yet for standard planner. Dont call it or ask roadmap when its its turn",{code:"WC_0012"})),{grids:[]}}}]);var t,r,a,u,y,x,A,C,b}();(0,d.Z)(y,"plannerType","STD")}}]);
|