@perceptimagery/dita-configurator-staging 0.2.1311 → 0.3.1

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.
Files changed (2) hide show
  1. package/dist/index.js +1147 -841
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  try {
5
5
  if (typeof document != "undefined") {
6
6
  var elementStyle = document.createElement("style");
7
- elementStyle.appendChild(document.createTextNode("@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@200;300;400;500;600;700;800&display=swap');\n\n#Sprie-config-html,\n#Sprie-config-body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n font-family: 'Work Sans', sans-serif;\n box-sizing: border-box;\n}\n\n#Sprie-config-body * {\n box-sizing: border-box;\n}\n\n.sprie-config-loadingBox {\n position: fixed;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: 24px;\n font-weight: 500;\n z-index: 1000;\n background: #f2f2f2;\n}\n.my-btn {\n border: 1px solid gray;\n border-radius: 5px;\n padding: 5px 10px;\n cursor: pointer;\n transition: all 300ms ease-in;\n}\n\n.my-btn:hover {\n box-shadow: 0 0 2px 3px gray;\n}\n.my-panel {\n border: 1px solid gray;\n padding: 10px 20px;\n border-radius: 10px;\n margin: 10px auto;\n}\n\n.my-panel h3 {\n font-family: sans-serif;\n}\n#Sprie-config-Main-Container {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column-reverse;\n background: #ffffff;\n}\n\n#Sprie-config-Viewer-Container {\n width: 100%;\n position: relative;\n height: 100%;\n}\n\n#holder-canvas > canvas {\n width: 100%;\n height: 100%;\n}\n\n#Sprie-config-Checkout-Container {\n width: 100%;\n height: min(70%, 45rem);\n}\n\n#Sprie-config-Checkout-box {\n width: 100%;\n background: #efefef;\n padding: 1rem;\n min-height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n#Sprie-config-Checkout-header {\n right: 0;\n display: flex;\n flex-direction: column;\n width: 100%;\n justify-content: center;\n align-items: center;\n gap: 1rem;\n padding-bottom: 0.9rem;\n border-bottom: 1px solid #ccc;\n margin-bottom: 2.5rem;\n}\n\n#Sprie-config-Checkout-header #Sprie-config-frameName {\n color: #222;\n font-size: 1.375rem;\n font-weight: 400;\n line-height: 1.5275rem; /* 111.091% */\n letter-spacing: -0.05rem;\n text-transform: uppercase;\n}\n\n#Sprie-config-Checkout-header #Sprie-config-lensPrice {\n color: #222;\n font-size: 1.3125rem;\n font-weight: 400;\n line-height: 2.275rem; /* 173.333% */\n}\n\n#Sprie-config-Checkout-body {\n display: flex;\n flex-direction: column;\n}\n\n#Sprie-config-Dropdown-Container {\n flex-direction: column;\n gap: 1.5rem;\n}\n\n#Sprie-config-Checkout-button {\n display: flex;\n padding: 0rem 1.25rem;\n align-items: center;\n justify-content: center;\n width: 100%;\n background: #222;\n color: #fff;\n text-align: center;\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 3.5rem; /* 400% */\n letter-spacing: 0.125rem;\n text-transform: uppercase;\n cursor: pointer;\n margin-top: 6rem;\n}\n\n.sprie-config-loadingFrame {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n fontsize: 24px;\n font-weight: 500;\n z-index: 1000;\n background: #f2f2f2;\n opacity: 0.8;\n}\n\n.sprie-config-loader {\n border: 8px solid #f3f3f3; /* Light grey */\n border-top: 8px solid #222222; /* Blue */\n border-radius: 50%;\n width: 60px;\n height: 60px;\n animation: spin 1.5s linear infinite;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/* Breakpoints */\n@media (max-width : 576px) {\n\n #Sprie-config-Viewer-Container {\n width: 100%;\n height: min(30%, 20rem);\n }\n\n #Sprie-config-Viewer-Container .sprie-config-webgl {\n height: 99%;\n }\n\n}\n\n@media (min-width: 800px) {\n #Sprie-config-Main-Container {\n flex-direction: row-reverse;\n }\n\n #Sprie-config-Checkout-Container {\n width: auto;\n padding: 2.5rem;\n height: 100%;\n }\n\n #Sprie-config-Checkout-box {\n width: 350px;\n padding: 1.5rem;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n #Sprie-config-Dropdown-Container {\n gap: 2.5rem;\n }\n\n #Sprie-config-Viewer-Container .sprie-config-webgl {\n height: 99%;\n }\n}\n\n@media (min-width: 992px) {\n #Sprie-config-Checkout-box {\n width: 450px;\n padding: 2.5rem;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n}\n/* Dropdown.css */\n\n.sprie-config-label {\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.75rem;\n font-weight: 400;\n letter-spacing: 0.02813rem;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin-left: 0.1rem;\n}\n\n.sprie-config-dropdown-wrapper {\n position: relative;\n width: 100%;\n}\n\n.sprie-config-select-box {\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px;\n /* border: 1px solid #ccc; */\n border-radius: 5px;\n position: relative;\n user-select: none;\n width: 100%;\n box-sizing: border-box;\n transition: border-radius 0.3s ease;\n padding: 1rem 1.25rem;\n background-color: #ffffff;\n max-height: 17rem; /* Set the fixed height for the dropdown */\n overflow-y: auto;\n}\n\n.sprie-config-select-box.sprie-config-open {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.sprie-config-selected-option {\n flex: 1;\n}\n\n.sprie-config-arrow {\n margin-left: 10px;\n transition: transform 0.3s ease;\n}\n\n.sprie-config-arrow.sprie-config-up {\n transform: rotate(180deg);\n}\n\n.sprie-config-dropdown-options {\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n z-index: 1;\n background-color: #fff;\n border-top: 1px solid #ccc;\n border-radius: 0 0 5px 5px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n opacity: 0;\n visibility: hidden;\n overflow: hidden;\n transition: height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;\n max-height: 17rem; /* Set the fixed height for the dropdown */\n overflow-y: auto;\n}\n\n.sprie-config-dropdown-options.sprie-config-open {\n opacity: 1;\n visibility: visible;\n height: auto;\n z-index: 1000;\n}\n\n.sprie-config-dropdown-options li {\n padding: 0.75rem 1rem;\n cursor: pointer;\n transition: background-color 0.3s ease;\n}\n\n.sprie-config-dropdown-options li:hover {\n background-color: #f0f0f0;\n}\n\n.sprie-config-dropdown-options li.sprie-config-selected {\n background-color: #f2f2f2; /* Highlight color for selected option */\n}\n\n.sprie-config-selected-option {\n width: 90%;\n}\n\n.sprie-config-frame-details-wrapper {\n display: flex;\n gap: 1rem;\n height: auto;\n overflow: hidden;\n}\n\n.sprie-config-variantImgBox {\n width: 3.4rem;\n height: 100%;\n display: flex;\n align-items: center; /* Center vertically */\n justify-content: center; /* Center horizontally */\n background: #fff;\n}\n\n.sprie-config-details {\n display: flex;\n flex-direction: column;\n gap: 2px;\n overflow: hidden;\n}\n\n.sprie-config-details .sprie-config-frameName {\n color: #4d4d4d;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem; /* 150% */\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin : 0\n}\n\n.sprie-config-details .sprie-config-skuName {\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 0.96125rem; /* 109.857% */\n letter-spacing: 0.02813rem;\n text-transform: uppercase;\n margin : 0\n}\n/* LensDropdown.css */\n\n.sprie-config-label {\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.75rem;\n font-weight: 400;\n letter-spacing: 0.02813rem;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin-left: 0.1rem;\n}\n\n.sprie-config-dropdown-wrapper {\n position: relative;\n width: 100%;\n}\n\n.sprie-config-select-box {\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-radius: 0.125rem;\n position: relative;\n user-select: none;\n width: 100%;\n box-sizing: border-box;\n transition: border-radius 0.3s ease;\n background-color: #ffffff;\n}\n\n.sprie-config-select-box.sprie-config-open {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.sprie-config-selected-lens {\n flex: 1;\n display: flex;\n gap: 1rem;\n height: auto;\n}\n\n.sprie-config-selected-lens .sprie-config-lens-details {\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: auto;\n padding-bottom: 0.2rem;\n}\n\n.sprie-config-colorBox {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.sprie-config-lensName {\n color: #4d4d4d;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem; /* 150% */\n margin: 0;\n}\n\n.sprie-config-lensColor {\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 0.96125rem; /* 109.857% */\n letter-spacing: 0.02813rem;\n text-transform: uppercase;\n margin: 0;\n}\n\n.sprie-config-arrow {\n margin-left: 10px;\n transition: transform 0.3s ease;\n}\n\n.sprie-config-arrow.sprie-config-up {\n transform: rotate(180deg);\n}\n\n.sprie-config-lens-dropdown-options {\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n z-index: 100; /* Adjust z-index to ensure dropdown options are above other elements */\n background-color: transparent;\n border-radius: 0 0 0.125rem 0.125rem;\n border: 0;\n box-shadow: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n max-height: 4rem; /* Set the fixed height for the dropdown */\n overflow-x: auto;\n overflow-y: hidden;\n display: flex;\n flex-direction: row;\n flex-wrap: no-wrap;\n padding: 0;\n}\n\n.sprie-config-lens-dropdown-options.sprie-config-open {\n opacity: 1;\n visibility: visible;\n}\n\n.sprie-config-lens-dropdown-options li {\n padding: 1rem 1.25rem;\n cursor: pointer;\n transition: background-color 0.3s ease;\n padding: 0.25rem;\n}\n\n.sprie-config-lens-dropdown-options li .sprie-config-li-element {\n width: 100%;\n height: 100%;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.sprie-config-lens-dropdown-options li .sprie-config-tooltip {\n display: none;\n}\n\n@media (min-width: 768px) {\n .sprie-config-lens-dropdown-options {\n max-height: 9.2rem;\n overflow-x: hidden;\n overflow-y: auto;\n display: grid;\n grid-template-columns: repeat(5, auto);\n padding: 0.5rem;\n border-top: 1px solid #ccc;\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n\n .sprie-config-lens-dropdown-options li {\n min-width: auto;\n }\n\n .sprie-config-lens-dropdown-options li .sprie-config-tooltip {\n position: absolute;\n width: auto;\n height: 2rem;\n flex-shrink: 0;\n border-radius: 0.125rem;\n background: #fff;\n box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.25);\n text-align: center;\n line-height: 2rem;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n display: block;\n\n /* Font style properties */\n color: rgba(34, 34, 34, 0.7);\n font-size: 0.875rem;\n font-weight: 400;\n letter-spacing: 0.02813rem;\n text-transform: uppercase;\n white-space: nowrap; /* Ensure text is in one line */\n z-index: 200;\n }\n\n .sprie-config-tooltip.sprie-config-top {\n bottom: 12%;\n }\n\n .sprie-config-tooltip.sprie-config-right {\n right: 2%;\n }\n}"));
7
+ elementStyle.appendChild(document.createTextNode("@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@200;300;400;500;600;700;800&display=swap');\n\n#Sprie-config-html,\n#Sprie-config-body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n font-family: 'Work Sans', sans-serif;\n box-sizing: border-box;\n}\n\n#Sprie-config-body * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n.sprie-config-loadingBox {\n position: fixed;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: 24px;\n font-weight: 500;\n z-index: 10000;\n background: #f2f2f2;\n}\n/*== MAIN_CONTAINER ==*/\n#Sprie-config-Main-Container {\n width: 100%;\n height: 100%;\n}\n\n/*== HEADER ==*/\n#Sprie-config-Header {\n height: 5rem; /* 88px */\n border-bottom: 1.5px solid #aeaeae;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n .sprie-config-Header-groupName {\n color: #373737;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5275rem; /* 111.091% */\n letter-spacing: -0.05rem;\n text-transform: uppercase;\n }\n}\n\n/*== 3D_VIEWER ==*/\n#Sprie-config-Viewer-Container {\n position: relative;\n width: 100%;\n\n img {\n position: absolute;\n top: 2rem;\n left: 2rem;\n }\n}\n\n/*= 3D_VIEWER-LOADER =*/\n.sprie-config-loadingFrame {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n font-size: 24px;\n font-weight: 500;\n z-index: 1000;\n background: #fafafa;\n opacity: 0.7;\n}\n\n.sprie-config-loader {\n border: 8px solid #222222;\n width: 60px;\n padding: 8px;\n aspect-ratio: 1;\n border-radius: 50%;\n background: #222222;\n --_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;\n -webkit-mask: var(--_m);\n mask: var(--_m);\n -webkit-mask-composite: source-out;\n mask-composite: subtract;\n animation: spin 1s infinite linear;\n}\n\n@keyframes spin {\n to {\n transform: rotate(1turn);\n }\n}\n\n/*== CUSTOMISATION_BLOCK ==*/\n#Sprie-config-Customisation-block {\n height: 15rem; /* 240px */\n background-color: #f2f2f2;\n border-top: 1px solid #91847e;\n position: relative;\n flex-grow: 1;\n}\n\n.sprie-config-price-block {\n position: absolute;\n right: 0;\n z-index: 1000;\n display: flex;\n flex-direction: column;\n align-items: end;\n gap: 0.4rem;\n p {\n font-size: 1.25rem;\n font-weight: 500;\n color: #121212;\n }\n}\n\n.frameName {\n color: #4d4d4d;\n font-size: 0.875rem;\n font-weight: 500;\n line-height: 1.5275rem; /* 111.091% */\n letter-spacing: -0.05rem;\n text-transform: uppercase;\n}\n\n.price-tag {\n color: #222;\n font-size: 1.3125rem;\n font-weight: 400;\n line-height: 2.275rem; /* 173.333% */\n}\n\n/*=== Mobile_View ===*/\n@media (max-width: 576px) {\n /* HEADER */\n #Sprie-config-Header {\n height: 5.25rem; /* 84px */\n }\n\n #Sprie-config-Viewer-Container {\n img {\n position: absolute;\n top: 1.2rem;\n left: 1.2rem;\n }\n }\n}\n.sprie-config-palette {\n display: flex;\n gap: 1.5rem;\n justify-content: flex-start;\n overflow-x: auto;\n}\n\n.sprie-config-palette-img-box {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.sprie-config-palette-img-box > button {\n background-color: transparent;\n}\n\n.sprie-config-palette-img-text {\n position: absolute;\n z-index: 100;\n bottom: -12px;\n\n .sprie-config-palette-imgName {\n white-space: nowrap;\n z-index: 100;\n }\n}\n.sprie-config-engraving-block {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.8rem;\n}\n\n.sprie-config-engraving-checkbox[type='checkbox'] {\n width: 1rem;\n height: 1rem;\n accent-color: #000;\n border: 0.25rem solid #000;\n border-radius: 0.5rem;\n background-color: transparent;\n}\n\n.sprie-config-engraving-inputField-block {\n width: 25rem;\n position: relative;\n}\n\n.sprie-config-engraving-inputField {\n width: 100%;\n font-size: 0.8rem;\n font-weight: 500;\n background: transparent;\n border-width: 1px;\n}\n\n.sprie-config-engraving-inputInfo {\n position: absolute;\n white-space: nowrap;\n font-size: 0.6rem;\n bottom: 0.2rem;\n right: 0.4rem;\n color: #686868;\n}\n\n.sprie-config-engraving-link {\n position: absolute;\n white-space: nowrap;\n font-size: 0.7rem;\n bottom: -1.2rem;\n right: 0;\n color: #686868;\n text-decoration: underline;\n}\n\n@media (max-width: 576px) {\n .sprie-config-engraving-inputField-block {\n width: 70%;\n }\n}\n.carousel {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.carousel-container {\n width: 80%;\n display: flex;\n position: relative;\n overflow: hidden;\n}\n\n.carousel-item {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 100%;\n transition-property: transform;\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n transition-duration: 500ms;\n}\n\n.carousel-header {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 2rem;\n\n .step-syntax {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.5rem;\n color: #4d4d4d;\n }\n\n .select-syntax {\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5rem;\n color: #91847e;\n }\n}\n\n/* Arrow-btns */\n.carousel-btn {\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n background-color: transparent;\n}\n.arrow {\n border: solid #91847e;\n border-width: 0 3px 3px 0;\n display: inline-block;\n}\n\n.right-arrow {\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n}\n\n.left-arrow {\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n}\n\n/* Step-tracker */\n\n.step-tracker-block {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid #aeaeae;\n width: 26.25rem;\n}\n\n.step-tracker {\n display: flex;\n gap: 1rem;\n}\n\n.step-circle {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n border: 1px solid #7d7d7d;\n background-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 10px;\n font-size: 14px;\n}\n\n.step-circle.active {\n background-color: #000; /* Change color for active step */\n border-color: #000;\n}\n\n@media (max-width: 576px) {\n .carousel-container {\n width: 100%;\n }\n\n .step-tracker-block {\n width: 80%;\n }\n}\n.sprie-config-add-to-cart-block {\n width: 14.5rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n}\n.sprie-config-add-to-cart-btn {\n width: 100%;\n height: 2.75rem; /* 44px */\n background-color: #000000;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: 0;\n\n font-size: 0.875rem;\n letter-spacing: 0.1rem;\n font-weight: 500;\n color: #ffffff;\n}\n\n#Sprie-Config-return-policy-label {\n display: flex;\n justify-content: center;\n width: 13.5rem;\n\n p {\n font-size: 0.7rem;\n text-align: end;\n margin-top: 0.05rem;\n }\n}\n#Sprie-Config-return-policy-checkbox[type='checkbox'] {\n width: 1rem;\n height: 1rem;\n accent-color: #000;\n border: 0.25rem solid #000;\n border-radius: 0.5rem;\n background-color: transparent;\n}\n\n.sprie-config-add-to-cart-btn:disabled,\n.sprie-config-add-to-cart-btn [disabled] {\n /* border: 1px solid #999999; */\n background-color: rgb(80, 79, 79);\n cursor: default;\n}\n@media (max-width: 576px) {\n .sprie-config-add-to-cart-block {\n width: 100%;\n }\n\n .sprie-config-add-to-cart-btn {\n width: 100%;\n height: 4rem; /* 64px */\n }\n\n #Sprie-Config-return-policy-label {\n width: 100%;\n gap : .5rem;\n }\n}"));
8
8
  document.head.appendChild(elementStyle);
9
9
  }
10
10
  } catch (e) {
@@ -112,11 +112,11 @@ var __publicField = (obj, key, value) => {
112
112
  host: "https://api.sprie.io"
113
113
  };
114
114
  const config$1 = Object.freeze(Config$2);
115
- const version$1 = "0.2.1311";
115
+ const version$1 = "0.3.0001";
116
116
  function modifyLensArr$1(arr, element) {
117
- const index = arr.findIndex((e) => e["sku"] === element["sku"]);
118
- if (index !== -1) {
119
- return [element, ...arr.slice(0, index), ...arr.slice(index + 1)];
117
+ const index2 = arr.findIndex((e) => e["sku"] === element["sku"]);
118
+ if (index2 !== -1) {
119
+ return [element, ...arr.slice(0, index2), ...arr.slice(index2 + 1)];
120
120
  }
121
121
  return arr;
122
122
  }
@@ -178,13 +178,13 @@ var __publicField = (obj, key, value) => {
178
178
  return response;
179
179
  }
180
180
  // Lens-list call
181
- async FetchCustomisationList() {
182
- const url = `/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50`;
181
+ async FetchCustomisationList(type) {
182
+ const url = `/v1/widget/list-customisation?search=type:${type},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`;
183
183
  const response = await this.fetcher.Get(url);
184
- const defaultLensData = response.data.find((e) => e.sku === "lens-default");
184
+ const defaultCustomisationData = response.data.find((e) => e.sku === `${type.toLowerCase()}-default`);
185
185
  const modifiedRes = {
186
186
  ...response,
187
- data: modifyLensArr$1(response.data, defaultLensData)
187
+ data: modifyLensArr$1(response.data, defaultCustomisationData)
188
188
  };
189
189
  return modifiedRes;
190
190
  }
@@ -213,16 +213,6 @@ var __publicField = (obj, key, value) => {
213
213
  }
214
214
  }
215
215
  async HandleShopifyAddToCart(items) {
216
- items.forEach((ele) => {
217
- var _a2;
218
- const text = (_a2 = ele.properties) == null ? void 0 : _a2.customText;
219
- if (text) {
220
- delete ele.properties["customText"];
221
- Object.assign(ele.properties, { "custom-laser-etching": "Add Laser Engraving" });
222
- Object.assign(ele.properties, { "custom-text": text });
223
- Object.assign(ele.properties, { "This customized item cannot be returned or exchanged": "I agree" });
224
- }
225
- });
226
216
  let formData = {
227
217
  "items": items,
228
218
  "sections": "mini-cart"
@@ -681,424 +671,6 @@ var __publicField = (obj, key, value) => {
681
671
  }
682
672
  var jsxRuntimeExports = jsxRuntime.exports;
683
673
  const App$1 = "";
684
- const Button = "";
685
- const Panel = "";
686
- const MainContainer$1 = "";
687
- const FrameDropdown$1 = "";
688
- const dropdownIcon = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDlMMTIuNzgwOSAxNC4zMzA2QzEyLjMzMTYgMTQuNzE1OCAxMS42Njg0IDE0LjcxNTggMTEuMjE5MSAxNC4zMzA2TDUgOSIgc3Ryb2tlPSIjNEQ0RDREIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPgo=";
689
- function FrameDropdown({
690
- label,
691
- options,
692
- selectedFrame,
693
- changeFrame
694
- }) {
695
- const [isOpen, setIsOpen] = reactExports.useState(false);
696
- const dropdownRef = reactExports.useRef(null);
697
- const handleToggleDropdown = () => {
698
- setIsOpen((prevIsOpen) => !prevIsOpen);
699
- };
700
- const handleClickOutside = (event) => {
701
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
702
- setIsOpen(false);
703
- }
704
- };
705
- const handleSelectOption = (option) => {
706
- changeFrame(option);
707
- setIsOpen(false);
708
- };
709
- reactExports.useEffect(() => {
710
- document.addEventListener("click", handleClickOutside);
711
- return () => {
712
- document.removeEventListener("click", handleClickOutside);
713
- };
714
- }, []);
715
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sprie-config-dropdown-wrapper`, ref: dropdownRef, children: [
716
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-label`, children: label }),
717
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
718
- "div",
719
- {
720
- className: `sprie-config-select-box ${isOpen ? "sprie-config-open" : ""}`,
721
- onClick: handleToggleDropdown,
722
- children: [
723
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sprie-config-selected-option sprie-config-frame-details-wrapper`, children: [
724
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sprie-config-variantImgBox`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
725
- "img",
726
- {
727
- src: selectedFrame && selectedFrame.variantImage,
728
- alt: "variant-img",
729
- className: `sprie-config-variantImg`,
730
- width: 50,
731
- height: 42
732
- }
733
- ) }),
734
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sprie-config-details`, children: [
735
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-frameName`, children: selectedFrame && selectedFrame.name }),
736
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-skuName`, children: selectedFrame && selectedFrame.sku })
737
- ] })
738
- ] }),
739
- /* @__PURE__ */ jsxRuntimeExports.jsx(
740
- "img",
741
- {
742
- src: dropdownIcon,
743
- alt: "dropdown-icon",
744
- className: `sprie-config-arrow ${isOpen ? "sprie-config-up" : ""}`
745
- }
746
- )
747
- ]
748
- }
749
- ),
750
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: `sprie-config-dropdown-options ${isOpen ? "sprie-config-open" : ""}`, children: options && options.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
751
- "li",
752
- {
753
- onClick: () => handleSelectOption(option),
754
- className: `sprie-config-frame-details-wrapper ${selectedFrame && selectedFrame.name === option.name ? "sprie-config-selected" : ""}`,
755
- children: [
756
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `sprie-config-variantImgBox`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
757
- "img",
758
- {
759
- src: option.variantImage,
760
- alt: "variant-img",
761
- className: `sprie-config-variantImg`,
762
- width: 50,
763
- height: 42
764
- }
765
- ) }),
766
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `sprie-config-details`, children: [
767
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-frameName`, children: option.name }),
768
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `sprie-config-skuName`, children: option.sku })
769
- ] })
770
- ]
771
- },
772
- option._id
773
- )) })
774
- ] }) });
775
- }
776
- const LensDropdown$1 = "";
777
- function LensDropdown({
778
- label,
779
- lensData,
780
- selectedLens,
781
- changeLensMaterial
782
- }) {
783
- const [isOpen, setIsOpen] = reactExports.useState(false);
784
- const [hoveredOption, setHoveredOption] = reactExports.useState(
785
- null
786
- );
787
- const dropdownRef = reactExports.useRef(null);
788
- const isMobileView = window.innerWidth < 768;
789
- const handleToggleDropdown = () => {
790
- if (!isMobileView) {
791
- setIsOpen((prevIsOpen) => !prevIsOpen);
792
- }
793
- };
794
- const handleSelectOption = (option) => {
795
- changeLensMaterial(option);
796
- setIsOpen(false);
797
- };
798
- const handleHoverOption = (option) => {
799
- setHoveredOption(option);
800
- };
801
- const handleClickOutside = (event) => {
802
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
803
- setIsOpen(false);
804
- }
805
- };
806
- reactExports.useEffect(() => {
807
- document.addEventListener("click", handleClickOutside);
808
- return () => {
809
- document.removeEventListener("click", handleClickOutside);
810
- };
811
- }, []);
812
- const calculateTooltipPosition = (index) => {
813
- if (lensData) {
814
- const totalElements = lensData.length;
815
- const elementsPerRow = 5;
816
- const rowIndex = Math.floor(index / elementsPerRow);
817
- return rowIndex === Math.floor((totalElements - 1) / elementsPerRow) ? "top" : "";
818
- }
819
- };
820
- const calculateTooltipAlignment = (index) => {
821
- const itemsPerRow = 5;
822
- const remainder = (index + 1) % itemsPerRow;
823
- if (remainder === 0) {
824
- return "right";
825
- } else {
826
- return "left";
827
- }
828
- };
829
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-dropdown-wrapper", ref: dropdownRef, children: [
830
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "sprie-config-label", children: label }),
831
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
832
- "div",
833
- {
834
- className: `sprie-config-select-box ${isMobileView ? "sprie-config-open" : `${isOpen ? "sprie-config-open" : ""}`}`,
835
- onClick: handleToggleDropdown,
836
- style: {
837
- background: isMobileView ? "transparent" : "#ffffff",
838
- padding: isMobileView ? "0.2rem 1.25rem .7rem 0.1rem" : "1rem 1.25rem"
839
- },
840
- children: [
841
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-selected-lens", children: [
842
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-colorBox", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
843
- "img",
844
- {
845
- src: selectedLens && selectedLens.thumbnail,
846
- width: 50
847
- }
848
- ) }),
849
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-lens-details", children: [
850
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "sprie-config-lensName", children: selectedLens && selectedLens.name }),
851
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "sprie-config-lensColor", children: selectedLens && selectedLens.metadata[0].value })
852
- ] })
853
- ] }),
854
- !isMobileView && /* @__PURE__ */ jsxRuntimeExports.jsx(
855
- "img",
856
- {
857
- src: dropdownIcon,
858
- alt: "dropdown-icon",
859
- className: `sprie-config-arrow ${isOpen ? "sprie-config-up" : ""}`
860
- }
861
- )
862
- ]
863
- }
864
- ),
865
- /* @__PURE__ */ jsxRuntimeExports.jsx(
866
- "ul",
867
- {
868
- className: `sprie-config-lens-dropdown-options ${isMobileView ? "sprie-config-open" : `${isOpen ? "sprie-config-open" : ""}`}`,
869
- style: { marginLeft: isMobileView ? ".1rem" : "0" },
870
- children: lensData && lensData.map((option, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
871
- "li",
872
- {
873
- className: selectedLens && selectedLens.name === option.name ? "sprie-config-selected" : "",
874
- children: [
875
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-li-element", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
876
- "img",
877
- {
878
- src: option.thumbnail,
879
- width: 50,
880
- onClick: () => handleSelectOption(option),
881
- onMouseEnter: () => handleHoverOption(option),
882
- onMouseLeave: () => setHoveredOption(null)
883
- }
884
- ) }),
885
- hoveredOption === option && /* @__PURE__ */ jsxRuntimeExports.jsx(
886
- "div",
887
- {
888
- className: `sprie-config-tooltip ${calculateTooltipPosition(
889
- index
890
- )} ${calculateTooltipAlignment(index)}`,
891
- children: option.metadata[0].value
892
- }
893
- )
894
- ]
895
- },
896
- index
897
- ))
898
- }
899
- )
900
- ] });
901
- }
902
- function MainContainer({
903
- orgName,
904
- customEvent,
905
- apiService: apiService2,
906
- frameList,
907
- lensList,
908
- viewerOnly,
909
- ThreeDConfigurator: ThreeDConfigurator2
910
- }) {
911
- const [selectedFrame, setSelectedFrame] = reactExports.useState();
912
- const [selectedLens, setSelectedLens] = reactExports.useState();
913
- const [modelLoading, setModelLoading] = reactExports.useState(false);
914
- const domInstance = reactExports.useRef();
915
- const orgId = apiService2.fetcher.LoadConfig().ORGID;
916
- const setUpAndRender = reactExports.useCallback(async () => {
917
- if (apiService2 && frameList && orgId) {
918
- setModelLoading(true);
919
- const frame = frameList[0];
920
- const apiRes = await apiService2.FetchAssetBySKUOrBarcode({
921
- sku: frame.sku,
922
- barcode: null
923
- });
924
- ThreeDConfigurator2.renderAsset(
925
- {
926
- containerId: "holder-canvas",
927
- data: {
928
- assetDetails: apiRes,
929
- customisation: apiRes == null ? void 0 : apiRes.customisation
930
- }
931
- }
932
- ).then((instance) => {
933
- setModelLoading(false);
934
- setSelectedFrame(frame);
935
- domInstance.current = instance;
936
- });
937
- }
938
- }, [orgId, frameList, apiService2, ThreeDConfigurator2]);
939
- reactExports.useEffect(() => {
940
- setUpAndRender();
941
- }, [setUpAndRender]);
942
- const getLensInfo = (frame) => {
943
- const hasSpecialDefaultLens = (frame == null ? void 0 : frame.customisation.length) == 0;
944
- const includedLens = hasSpecialDefaultLens ? null : frame == null ? void 0 : frame.customisation.find((x2) => x2.type == "Lens");
945
- return includedLens;
946
- };
947
- const onChangeLens = async (requestedLens) => {
948
- if (!domInstance.current) {
949
- return;
950
- }
951
- if (requestedLens == selectedLens) {
952
- return;
953
- }
954
- const isDefaultRequested = requestedLens.sku == "lens-default";
955
- const frameDefaultLens = getLensInfo(selectedFrame);
956
- if (!frameDefaultLens && isDefaultRequested) {
957
- setModelLoading(true);
958
- domInstance.current.changeLens(requestedLens, true, selectedFrame).then(() => {
959
- setModelLoading(false);
960
- });
961
- } else if (!frameDefaultLens && !isDefaultRequested) {
962
- if ((selectedLens == null ? void 0 : selectedLens.sku) == "lens-default") {
963
- setModelLoading(true);
964
- domInstance.current.changeLens(requestedLens, true, selectedFrame).then(() => {
965
- setModelLoading(false);
966
- });
967
- } else {
968
- domInstance.current.changeLens(requestedLens, false, selectedFrame);
969
- }
970
- } else if (frameDefaultLens && isDefaultRequested) {
971
- domInstance.current.changeLens(frameDefaultLens, false, selectedFrame);
972
- } else {
973
- domInstance.current.changeLens(requestedLens, false, selectedFrame);
974
- }
975
- setSelectedLens(requestedLens);
976
- };
977
- const onChangeFrame = async (frame, reload) => {
978
- if (frame._id == (selectedFrame == null ? void 0 : selectedFrame._id) && !reload) {
979
- return;
980
- }
981
- if (!domInstance.current)
982
- return;
983
- setModelLoading(true);
984
- domInstance.current.changeFrame(frame, selectedLens).then(() => {
985
- setModelLoading(false);
986
- });
987
- setSelectedFrame(frame);
988
- };
989
- reactExports.useEffect(() => {
990
- frameList && setSelectedFrame(frameList[0]);
991
- lensList && setSelectedLens(lensList[0]);
992
- }, [frameList, lensList]);
993
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Main-Container", children: [
994
- !viewerOnly && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "Sprie-config-Checkout-Container", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Checkout-box", children: [
995
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Checkout-header", children: [
996
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "Sprie-config-frameName", children: orgName }),
997
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "Sprie-config-lensPrice", children: `${(selectedLens == null ? void 0 : selectedLens.price) ? `+ $${selectedLens == null ? void 0 : selectedLens.price}.00 USD` : ""}` })
998
- ] }),
999
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Checkout-body", children: [
1000
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
1001
- "div",
1002
- {
1003
- id: "Sprie-config-Dropdown-Container",
1004
- style: { display: frameList && lensList ? "flex" : "none" },
1005
- children: [
1006
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1007
- FrameDropdown,
1008
- {
1009
- label: "STEP 1 : SELECT FRAME COLOUR",
1010
- options: frameList,
1011
- selectedFrame,
1012
- changeFrame: onChangeFrame
1013
- }
1014
- ),
1015
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1016
- LensDropdown,
1017
- {
1018
- label: "STEP 2 : SELECT LENS COLOUR",
1019
- lensData: lensList,
1020
- selectedLens,
1021
- changeLensMaterial: onChangeLens
1022
- }
1023
- )
1024
- ]
1025
- }
1026
- ),
1027
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1028
- "button",
1029
- {
1030
- id: "Sprie-config-Checkout-button",
1031
- onClick: () => {
1032
- if (selectedFrame && selectedLens) {
1033
- const frameVariantId = selectedFrame.metadata.find(
1034
- (item) => item.key == "variantId"
1035
- );
1036
- const baseCurve = selectedFrame.metadata.find(
1037
- (item) => item.key == "baseCurve"
1038
- );
1039
- let lensVariantKey = "variantId";
1040
- if (baseCurve && baseCurve.value == "2B") {
1041
- lensVariantKey = "2bVariantId";
1042
- } else if (baseCurve && baseCurve.value == "6B") {
1043
- lensVariantKey = "6bVariantId";
1044
- }
1045
- const lensVariantId = selectedLens.metadata.find(
1046
- (item) => item.key == lensVariantKey
1047
- );
1048
- const frameId = frameVariantId ? Number(frameVariantId.value) : null;
1049
- const lensId = lensVariantId ? Number(lensVariantId.value) : null;
1050
- const eventData = {
1051
- frameIdentifier: frameId,
1052
- lensIdentifier: lensId
1053
- };
1054
- customEvent.emitEvent("onAddToCart", eventData);
1055
- var cartItems = [];
1056
- if (lensVariantId) {
1057
- let lensItem = {
1058
- id: lensId,
1059
- quantity: 1,
1060
- properties: null
1061
- };
1062
- cartItems.push(lensItem);
1063
- }
1064
- if (frameVariantId) {
1065
- const engravingProps = {
1066
- customText: "This is an engraving test"
1067
- };
1068
- const isFlight006x = frameVariantId.value == "46792553201897";
1069
- if (isFlight006x) {
1070
- let engravingItem = {
1071
- id: 44745490890985,
1072
- quantity: 1,
1073
- properties: null
1074
- };
1075
- cartItems.push(engravingItem);
1076
- }
1077
- let frameItem = {
1078
- id: frameId,
1079
- quantity: 1,
1080
- properties: isFlight006x ? engravingProps : null
1081
- };
1082
- cartItems.push(frameItem);
1083
- }
1084
- apiService2.HandleShopifyAddToCart(cartItems);
1085
- }
1086
- },
1087
- type: "button",
1088
- children: "Add to cart"
1089
- }
1090
- )
1091
- ] })
1092
- ] }) }),
1093
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "Sprie-config-Viewer-Container", children: [
1094
- modelLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-loadingFrame", children: [
1095
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-loader" }),
1096
- "."
1097
- ] }),
1098
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, id: "holder-canvas" })
1099
- ] })
1100
- ] });
1101
- }
1102
674
  var __defProp2 = Object.defineProperty;
1103
675
  var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1104
676
  var __publicField2 = (obj, key, value) => {
@@ -1150,9 +722,9 @@ var __publicField = (obj, key, value) => {
1150
722
  baseURL: config.host
1151
723
  });
1152
724
  function modifyLensArr(arr, element) {
1153
- const index = arr.findIndex((e) => e["sku"] === element["sku"]);
1154
- if (index !== -1) {
1155
- return [element, ...arr.slice(0, index), ...arr.slice(index + 1)];
725
+ const index2 = arr.findIndex((e) => e["sku"] === element["sku"]);
726
+ if (index2 !== -1) {
727
+ return [element, ...arr.slice(0, index2), ...arr.slice(index2 + 1)];
1156
728
  }
1157
729
  return arr;
1158
730
  }
@@ -1646,9 +1218,9 @@ var __publicField = (obj, key, value) => {
1646
1218
  copy[i] = arr[i];
1647
1219
  return copy;
1648
1220
  }
1649
- function spliceOne$1(list, index) {
1650
- for (; index + 1 < list.length; index++)
1651
- list[index] = list[index + 1];
1221
+ function spliceOne$1(list, index2) {
1222
+ for (; index2 + 1 < list.length; index2++)
1223
+ list[index2] = list[index2 + 1];
1652
1224
  list.pop();
1653
1225
  }
1654
1226
  function unwrapListeners$1(arr) {
@@ -8212,8 +7784,8 @@ var __publicField = (obj, key, value) => {
8212
7784
  }
8213
7785
  }
8214
7786
  let keyIndex = 0;
8215
- for (let index = 0; index < N + 2; index++) {
8216
- ctx.pbox[index] = ORIG_P[index] ^ key[keyIndex];
7787
+ for (let index2 = 0; index2 < N + 2; index2++) {
7788
+ ctx.pbox[index2] = ORIG_P[index2] ^ key[keyIndex];
8217
7789
  keyIndex++;
8218
7790
  if (keyIndex >= keysize) {
8219
7791
  keyIndex = 0;
@@ -12687,9 +12259,9 @@ var __publicField = (obj, key, value) => {
12687
12259
  const listeners2 = this._listeners;
12688
12260
  const listenerArray = listeners2[type];
12689
12261
  if (listenerArray !== void 0) {
12690
- const index = listenerArray.indexOf(listener);
12691
- if (index !== -1) {
12692
- listenerArray.splice(index, 1);
12262
+ const index2 = listenerArray.indexOf(listener);
12263
+ if (index2 !== -1) {
12264
+ listenerArray.splice(index2, 1);
12693
12265
  }
12694
12266
  }
12695
12267
  }
@@ -12929,8 +12501,8 @@ var __publicField = (obj, key, value) => {
12929
12501
  this.y = y;
12930
12502
  return this;
12931
12503
  }
12932
- setComponent(index, value) {
12933
- switch (index) {
12504
+ setComponent(index2, value) {
12505
+ switch (index2) {
12934
12506
  case 0:
12935
12507
  this.x = value;
12936
12508
  break;
@@ -12938,18 +12510,18 @@ var __publicField = (obj, key, value) => {
12938
12510
  this.y = value;
12939
12511
  break;
12940
12512
  default:
12941
- throw new Error("index is out of range: " + index);
12513
+ throw new Error("index is out of range: " + index2);
12942
12514
  }
12943
12515
  return this;
12944
12516
  }
12945
- getComponent(index) {
12946
- switch (index) {
12517
+ getComponent(index2) {
12518
+ switch (index2) {
12947
12519
  case 0:
12948
12520
  return this.x;
12949
12521
  case 1:
12950
12522
  return this.y;
12951
12523
  default:
12952
- throw new Error("index is out of range: " + index);
12524
+ throw new Error("index is out of range: " + index2);
12953
12525
  }
12954
12526
  }
12955
12527
  clone() {
@@ -13134,9 +12706,9 @@ var __publicField = (obj, key, value) => {
13134
12706
  array[offset + 1] = this.y;
13135
12707
  return array;
13136
12708
  }
13137
- fromBufferAttribute(attribute, index) {
13138
- this.x = attribute.getX(index);
13139
- this.y = attribute.getY(index);
12709
+ fromBufferAttribute(attribute, index2) {
12710
+ this.x = attribute.getX(index2);
12711
+ this.y = attribute.getY(index2);
13140
12712
  return this;
13141
12713
  }
13142
12714
  rotateAround(center, angle) {
@@ -13935,8 +13507,8 @@ var __publicField = (obj, key, value) => {
13935
13507
  this.w = w2;
13936
13508
  return this;
13937
13509
  }
13938
- setComponent(index, value) {
13939
- switch (index) {
13510
+ setComponent(index2, value) {
13511
+ switch (index2) {
13940
13512
  case 0:
13941
13513
  this.x = value;
13942
13514
  break;
@@ -13950,12 +13522,12 @@ var __publicField = (obj, key, value) => {
13950
13522
  this.w = value;
13951
13523
  break;
13952
13524
  default:
13953
- throw new Error("index is out of range: " + index);
13525
+ throw new Error("index is out of range: " + index2);
13954
13526
  }
13955
13527
  return this;
13956
13528
  }
13957
- getComponent(index) {
13958
- switch (index) {
13529
+ getComponent(index2) {
13530
+ switch (index2) {
13959
13531
  case 0:
13960
13532
  return this.x;
13961
13533
  case 1:
@@ -13965,7 +13537,7 @@ var __publicField = (obj, key, value) => {
13965
13537
  case 3:
13966
13538
  return this.w;
13967
13539
  default:
13968
- throw new Error("index is out of range: " + index);
13540
+ throw new Error("index is out of range: " + index2);
13969
13541
  }
13970
13542
  }
13971
13543
  clone() {
@@ -14241,11 +13813,11 @@ var __publicField = (obj, key, value) => {
14241
13813
  array[offset + 3] = this.w;
14242
13814
  return array;
14243
13815
  }
14244
- fromBufferAttribute(attribute, index) {
14245
- this.x = attribute.getX(index);
14246
- this.y = attribute.getY(index);
14247
- this.z = attribute.getZ(index);
14248
- this.w = attribute.getW(index);
13816
+ fromBufferAttribute(attribute, index2) {
13817
+ this.x = attribute.getX(index2);
13818
+ this.y = attribute.getY(index2);
13819
+ this.z = attribute.getZ(index2);
13820
+ this.w = attribute.getW(index2);
14249
13821
  return this;
14250
13822
  }
14251
13823
  random() {
@@ -14739,11 +14311,11 @@ var __publicField = (obj, key, value) => {
14739
14311
  array[offset + 3] = this._w;
14740
14312
  return array;
14741
14313
  }
14742
- fromBufferAttribute(attribute, index) {
14743
- this._x = attribute.getX(index);
14744
- this._y = attribute.getY(index);
14745
- this._z = attribute.getZ(index);
14746
- this._w = attribute.getW(index);
14314
+ fromBufferAttribute(attribute, index2) {
14315
+ this._x = attribute.getX(index2);
14316
+ this._y = attribute.getY(index2);
14317
+ this._z = attribute.getZ(index2);
14318
+ this._w = attribute.getW(index2);
14747
14319
  return this;
14748
14320
  }
14749
14321
  toJSON() {
@@ -14795,8 +14367,8 @@ var __publicField = (obj, key, value) => {
14795
14367
  this.z = z;
14796
14368
  return this;
14797
14369
  }
14798
- setComponent(index, value) {
14799
- switch (index) {
14370
+ setComponent(index2, value) {
14371
+ switch (index2) {
14800
14372
  case 0:
14801
14373
  this.x = value;
14802
14374
  break;
@@ -14807,12 +14379,12 @@ var __publicField = (obj, key, value) => {
14807
14379
  this.z = value;
14808
14380
  break;
14809
14381
  default:
14810
- throw new Error("index is out of range: " + index);
14382
+ throw new Error("index is out of range: " + index2);
14811
14383
  }
14812
14384
  return this;
14813
14385
  }
14814
- getComponent(index) {
14815
- switch (index) {
14386
+ getComponent(index2) {
14387
+ switch (index2) {
14816
14388
  case 0:
14817
14389
  return this.x;
14818
14390
  case 1:
@@ -14820,7 +14392,7 @@ var __publicField = (obj, key, value) => {
14820
14392
  case 2:
14821
14393
  return this.z;
14822
14394
  default:
14823
- throw new Error("index is out of range: " + index);
14395
+ throw new Error("index is out of range: " + index2);
14824
14396
  }
14825
14397
  }
14826
14398
  clone() {
@@ -15118,11 +14690,11 @@ var __publicField = (obj, key, value) => {
15118
14690
  this.z = sz;
15119
14691
  return this;
15120
14692
  }
15121
- setFromMatrixColumn(m2, index) {
15122
- return this.fromArray(m2.elements, index * 4);
14693
+ setFromMatrixColumn(m2, index2) {
14694
+ return this.fromArray(m2.elements, index2 * 4);
15123
14695
  }
15124
- setFromMatrix3Column(m2, index) {
15125
- return this.fromArray(m2.elements, index * 3);
14696
+ setFromMatrix3Column(m2, index2) {
14697
+ return this.fromArray(m2.elements, index2 * 3);
15126
14698
  }
15127
14699
  setFromEuler(e) {
15128
14700
  this.x = e._x;
@@ -15151,10 +14723,10 @@ var __publicField = (obj, key, value) => {
15151
14723
  array[offset + 2] = this.z;
15152
14724
  return array;
15153
14725
  }
15154
- fromBufferAttribute(attribute, index) {
15155
- this.x = attribute.getX(index);
15156
- this.y = attribute.getY(index);
15157
- this.z = attribute.getZ(index);
14726
+ fromBufferAttribute(attribute, index2) {
14727
+ this.x = attribute.getX(index2);
14728
+ this.y = attribute.getY(index2);
14729
+ this.z = attribute.getZ(index2);
15158
14730
  return this;
15159
14731
  }
15160
14732
  random() {
@@ -17028,10 +16600,10 @@ var __publicField = (obj, key, value) => {
17028
16600
  }
17029
16601
  return this;
17030
16602
  }
17031
- const index = this.children.indexOf(object);
17032
- if (index !== -1) {
16603
+ const index2 = this.children.indexOf(object);
16604
+ if (index2 !== -1) {
17033
16605
  object.parent = null;
17034
- this.children.splice(index, 1);
16606
+ this.children.splice(index2, 1);
17035
16607
  object.dispatchEvent(_removedEvent);
17036
16608
  }
17037
16609
  return this;
@@ -18022,10 +17594,10 @@ var __publicField = (obj, key, value) => {
18022
17594
  array[offset + 2] = this.b;
18023
17595
  return array;
18024
17596
  }
18025
- fromBufferAttribute(attribute, index) {
18026
- this.r = attribute.getX(index);
18027
- this.g = attribute.getY(index);
18028
- this.b = attribute.getZ(index);
17597
+ fromBufferAttribute(attribute, index2) {
17598
+ this.r = attribute.getX(index2);
17599
+ this.g = attribute.getY(index2);
17600
+ this.b = attribute.getZ(index2);
18029
17601
  return this;
18030
17602
  }
18031
17603
  toJSON() {
@@ -18697,100 +18269,100 @@ var __publicField = (obj, key, value) => {
18697
18269
  this.array.set(value, offset);
18698
18270
  return this;
18699
18271
  }
18700
- getComponent(index, component) {
18701
- let value = this.array[index * this.itemSize + component];
18272
+ getComponent(index2, component) {
18273
+ let value = this.array[index2 * this.itemSize + component];
18702
18274
  if (this.normalized)
18703
18275
  value = denormalize(value, this.array);
18704
18276
  return value;
18705
18277
  }
18706
- setComponent(index, component, value) {
18278
+ setComponent(index2, component, value) {
18707
18279
  if (this.normalized)
18708
18280
  value = normalize(value, this.array);
18709
- this.array[index * this.itemSize + component] = value;
18281
+ this.array[index2 * this.itemSize + component] = value;
18710
18282
  return this;
18711
18283
  }
18712
- getX(index) {
18713
- let x2 = this.array[index * this.itemSize];
18284
+ getX(index2) {
18285
+ let x2 = this.array[index2 * this.itemSize];
18714
18286
  if (this.normalized)
18715
18287
  x2 = denormalize(x2, this.array);
18716
18288
  return x2;
18717
18289
  }
18718
- setX(index, x2) {
18290
+ setX(index2, x2) {
18719
18291
  if (this.normalized)
18720
18292
  x2 = normalize(x2, this.array);
18721
- this.array[index * this.itemSize] = x2;
18293
+ this.array[index2 * this.itemSize] = x2;
18722
18294
  return this;
18723
18295
  }
18724
- getY(index) {
18725
- let y = this.array[index * this.itemSize + 1];
18296
+ getY(index2) {
18297
+ let y = this.array[index2 * this.itemSize + 1];
18726
18298
  if (this.normalized)
18727
18299
  y = denormalize(y, this.array);
18728
18300
  return y;
18729
18301
  }
18730
- setY(index, y) {
18302
+ setY(index2, y) {
18731
18303
  if (this.normalized)
18732
18304
  y = normalize(y, this.array);
18733
- this.array[index * this.itemSize + 1] = y;
18305
+ this.array[index2 * this.itemSize + 1] = y;
18734
18306
  return this;
18735
18307
  }
18736
- getZ(index) {
18737
- let z = this.array[index * this.itemSize + 2];
18308
+ getZ(index2) {
18309
+ let z = this.array[index2 * this.itemSize + 2];
18738
18310
  if (this.normalized)
18739
18311
  z = denormalize(z, this.array);
18740
18312
  return z;
18741
18313
  }
18742
- setZ(index, z) {
18314
+ setZ(index2, z) {
18743
18315
  if (this.normalized)
18744
18316
  z = normalize(z, this.array);
18745
- this.array[index * this.itemSize + 2] = z;
18317
+ this.array[index2 * this.itemSize + 2] = z;
18746
18318
  return this;
18747
18319
  }
18748
- getW(index) {
18749
- let w2 = this.array[index * this.itemSize + 3];
18320
+ getW(index2) {
18321
+ let w2 = this.array[index2 * this.itemSize + 3];
18750
18322
  if (this.normalized)
18751
18323
  w2 = denormalize(w2, this.array);
18752
18324
  return w2;
18753
18325
  }
18754
- setW(index, w2) {
18326
+ setW(index2, w2) {
18755
18327
  if (this.normalized)
18756
18328
  w2 = normalize(w2, this.array);
18757
- this.array[index * this.itemSize + 3] = w2;
18329
+ this.array[index2 * this.itemSize + 3] = w2;
18758
18330
  return this;
18759
18331
  }
18760
- setXY(index, x2, y) {
18761
- index *= this.itemSize;
18332
+ setXY(index2, x2, y) {
18333
+ index2 *= this.itemSize;
18762
18334
  if (this.normalized) {
18763
18335
  x2 = normalize(x2, this.array);
18764
18336
  y = normalize(y, this.array);
18765
18337
  }
18766
- this.array[index + 0] = x2;
18767
- this.array[index + 1] = y;
18338
+ this.array[index2 + 0] = x2;
18339
+ this.array[index2 + 1] = y;
18768
18340
  return this;
18769
18341
  }
18770
- setXYZ(index, x2, y, z) {
18771
- index *= this.itemSize;
18342
+ setXYZ(index2, x2, y, z) {
18343
+ index2 *= this.itemSize;
18772
18344
  if (this.normalized) {
18773
18345
  x2 = normalize(x2, this.array);
18774
18346
  y = normalize(y, this.array);
18775
18347
  z = normalize(z, this.array);
18776
18348
  }
18777
- this.array[index + 0] = x2;
18778
- this.array[index + 1] = y;
18779
- this.array[index + 2] = z;
18349
+ this.array[index2 + 0] = x2;
18350
+ this.array[index2 + 1] = y;
18351
+ this.array[index2 + 2] = z;
18780
18352
  return this;
18781
18353
  }
18782
- setXYZW(index, x2, y, z, w2) {
18783
- index *= this.itemSize;
18354
+ setXYZW(index2, x2, y, z, w2) {
18355
+ index2 *= this.itemSize;
18784
18356
  if (this.normalized) {
18785
18357
  x2 = normalize(x2, this.array);
18786
18358
  y = normalize(y, this.array);
18787
18359
  z = normalize(z, this.array);
18788
18360
  w2 = normalize(w2, this.array);
18789
18361
  }
18790
- this.array[index + 0] = x2;
18791
- this.array[index + 1] = y;
18792
- this.array[index + 2] = z;
18793
- this.array[index + 3] = w2;
18362
+ this.array[index2 + 0] = x2;
18363
+ this.array[index2 + 1] = y;
18364
+ this.array[index2 + 2] = z;
18365
+ this.array[index2 + 3] = w2;
18794
18366
  return this;
18795
18367
  }
18796
18368
  onUpload(callback) {
@@ -18859,11 +18431,11 @@ var __publicField = (obj, key, value) => {
18859
18431
  getIndex() {
18860
18432
  return this.index;
18861
18433
  }
18862
- setIndex(index) {
18863
- if (Array.isArray(index)) {
18864
- this.index = new (arrayNeedsUint32(index) ? Uint32BufferAttribute : Uint16BufferAttribute)(index, 1);
18434
+ setIndex(index2) {
18435
+ if (Array.isArray(index2)) {
18436
+ this.index = new (arrayNeedsUint32(index2) ? Uint32BufferAttribute : Uint16BufferAttribute)(index2, 1);
18865
18437
  } else {
18866
- this.index = index;
18438
+ this.index = index2;
18867
18439
  }
18868
18440
  return this;
18869
18441
  }
@@ -19065,13 +18637,13 @@ var __publicField = (obj, key, value) => {
19065
18637
  }
19066
18638
  }
19067
18639
  computeTangents() {
19068
- const index = this.index;
18640
+ const index2 = this.index;
19069
18641
  const attributes = this.attributes;
19070
- if (index === null || attributes.position === void 0 || attributes.normal === void 0 || attributes.uv === void 0) {
18642
+ if (index2 === null || attributes.position === void 0 || attributes.normal === void 0 || attributes.uv === void 0) {
19071
18643
  console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
19072
18644
  return;
19073
18645
  }
19074
- const indices = index.array;
18646
+ const indices = index2.array;
19075
18647
  const positions2 = attributes.position.array;
19076
18648
  const normals = attributes.normal.array;
19077
18649
  const uvs = attributes.uv.array;
@@ -19156,7 +18728,7 @@ var __publicField = (obj, key, value) => {
19156
18728
  }
19157
18729
  }
19158
18730
  computeVertexNormals() {
19159
- const index = this.index;
18731
+ const index2 = this.index;
19160
18732
  const positionAttribute = this.getAttribute("position");
19161
18733
  if (positionAttribute !== void 0) {
19162
18734
  let normalAttribute = this.getAttribute("normal");
@@ -19171,11 +18743,11 @@ var __publicField = (obj, key, value) => {
19171
18743
  const pA = new Vector3(), pB = new Vector3(), pC = new Vector3();
19172
18744
  const nA = new Vector3(), nB = new Vector3(), nC = new Vector3();
19173
18745
  const cb = new Vector3(), ab = new Vector3();
19174
- if (index) {
19175
- for (let i = 0, il = index.count; i < il; i += 3) {
19176
- const vA = index.getX(i + 0);
19177
- const vB = index.getX(i + 1);
19178
- const vC = index.getX(i + 2);
18746
+ if (index2) {
18747
+ for (let i = 0, il = index2.count; i < il; i += 3) {
18748
+ const vA = index2.getX(i + 0);
18749
+ const vB = index2.getX(i + 1);
18750
+ const vC = index2.getX(i + 2);
19179
18751
  pA.fromBufferAttribute(positionAttribute, vA);
19180
18752
  pB.fromBufferAttribute(positionAttribute, vB);
19181
18753
  pC.fromBufferAttribute(positionAttribute, vC);
@@ -19223,15 +18795,15 @@ var __publicField = (obj, key, value) => {
19223
18795
  const itemSize = attribute.itemSize;
19224
18796
  const normalized = attribute.normalized;
19225
18797
  const array2 = new array.constructor(indices2.length * itemSize);
19226
- let index = 0, index2 = 0;
18798
+ let index2 = 0, index22 = 0;
19227
18799
  for (let i = 0, l = indices2.length; i < l; i++) {
19228
18800
  if (attribute.isInterleavedBufferAttribute) {
19229
- index = indices2[i] * attribute.data.stride + attribute.offset;
18801
+ index2 = indices2[i] * attribute.data.stride + attribute.offset;
19230
18802
  } else {
19231
- index = indices2[i] * itemSize;
18803
+ index2 = indices2[i] * itemSize;
19232
18804
  }
19233
18805
  for (let j = 0; j < itemSize; j++) {
19234
- array2[index2++] = array[index++];
18806
+ array2[index22++] = array[index2++];
19235
18807
  }
19236
18808
  }
19237
18809
  return new BufferAttribute(array2, itemSize, normalized);
@@ -19290,11 +18862,11 @@ var __publicField = (obj, key, value) => {
19290
18862
  return data;
19291
18863
  }
19292
18864
  data.data = { attributes: {} };
19293
- const index = this.index;
19294
- if (index !== null) {
18865
+ const index2 = this.index;
18866
+ if (index2 !== null) {
19295
18867
  data.data.index = {
19296
- type: index.array.constructor.name,
19297
- array: Array.prototype.slice.call(index.array)
18868
+ type: index2.array.constructor.name,
18869
+ array: Array.prototype.slice.call(index2.array)
19298
18870
  };
19299
18871
  }
19300
18872
  const attributes = this.attributes;
@@ -19345,9 +18917,9 @@ var __publicField = (obj, key, value) => {
19345
18917
  this.boundingSphere = null;
19346
18918
  const data = {};
19347
18919
  this.name = source.name;
19348
- const index = source.index;
19349
- if (index !== null) {
19350
- this.setIndex(index.clone(data));
18920
+ const index2 = source.index;
18921
+ if (index2 !== null) {
18922
+ this.setIndex(index2.clone(data));
19351
18923
  }
19352
18924
  const attributes = source.attributes;
19353
18925
  for (const name in attributes) {
@@ -19441,12 +19013,12 @@ var __publicField = (obj, key, value) => {
19441
19013
  }
19442
19014
  }
19443
19015
  }
19444
- getVertexPosition(index, target) {
19016
+ getVertexPosition(index2, target) {
19445
19017
  const geometry = this.geometry;
19446
19018
  const position = geometry.attributes.position;
19447
19019
  const morphPosition = geometry.morphAttributes.position;
19448
19020
  const morphTargetsRelative = geometry.morphTargetsRelative;
19449
- target.fromBufferAttribute(position, index);
19021
+ target.fromBufferAttribute(position, index2);
19450
19022
  const morphInfluences = this.morphTargetInfluences;
19451
19023
  if (morphPosition && morphInfluences) {
19452
19024
  _morphA.set(0, 0, 0);
@@ -19455,7 +19027,7 @@ var __publicField = (obj, key, value) => {
19455
19027
  const morphAttribute = morphPosition[i];
19456
19028
  if (influence === 0)
19457
19029
  continue;
19458
- _tempA.fromBufferAttribute(morphAttribute, index);
19030
+ _tempA.fromBufferAttribute(morphAttribute, index2);
19459
19031
  if (morphTargetsRelative) {
19460
19032
  _morphA.addScaledVector(_tempA, influence);
19461
19033
  } else {
@@ -19495,24 +19067,24 @@ var __publicField = (obj, key, value) => {
19495
19067
  let intersection;
19496
19068
  const geometry = this.geometry;
19497
19069
  const material = this.material;
19498
- const index = geometry.index;
19070
+ const index2 = geometry.index;
19499
19071
  const position = geometry.attributes.position;
19500
19072
  const uv = geometry.attributes.uv;
19501
19073
  const uv1 = geometry.attributes.uv1;
19502
19074
  const normal = geometry.attributes.normal;
19503
19075
  const groups = geometry.groups;
19504
19076
  const drawRange = geometry.drawRange;
19505
- if (index !== null) {
19077
+ if (index2 !== null) {
19506
19078
  if (Array.isArray(material)) {
19507
19079
  for (let i = 0, il = groups.length; i < il; i++) {
19508
19080
  const group = groups[i];
19509
19081
  const groupMaterial = material[group.materialIndex];
19510
19082
  const start = Math.max(group.start, drawRange.start);
19511
- const end = Math.min(index.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
19083
+ const end = Math.min(index2.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
19512
19084
  for (let j = start, jl = end; j < jl; j += 3) {
19513
- const a = index.getX(j);
19514
- const b = index.getX(j + 1);
19515
- const c2 = index.getX(j + 2);
19085
+ const a = index2.getX(j);
19086
+ const b = index2.getX(j + 1);
19087
+ const c2 = index2.getX(j + 2);
19516
19088
  intersection = checkGeometryIntersection(this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c2);
19517
19089
  if (intersection) {
19518
19090
  intersection.faceIndex = Math.floor(j / 3);
@@ -19523,11 +19095,11 @@ var __publicField = (obj, key, value) => {
19523
19095
  }
19524
19096
  } else {
19525
19097
  const start = Math.max(0, drawRange.start);
19526
- const end = Math.min(index.count, drawRange.start + drawRange.count);
19098
+ const end = Math.min(index2.count, drawRange.start + drawRange.count);
19527
19099
  for (let i = start, il = end; i < il; i += 3) {
19528
- const a = index.getX(i);
19529
- const b = index.getX(i + 1);
19530
- const c2 = index.getX(i + 2);
19100
+ const a = index2.getX(i);
19101
+ const b = index2.getX(i + 1);
19102
+ const c2 = index2.getX(i + 2);
19531
19103
  intersection = checkGeometryIntersection(this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c2);
19532
19104
  if (intersection) {
19533
19105
  intersection.faceIndex = Math.floor(i / 3);
@@ -21548,7 +21120,7 @@ var __publicField = (obj, key, value) => {
21548
21120
  const defaultState = createBindingState(null);
21549
21121
  let currentState = defaultState;
21550
21122
  let forceUpdate = false;
21551
- function setup(object, material, program, geometry, index) {
21123
+ function setup(object, material, program, geometry, index2) {
21552
21124
  let updateBuffers = false;
21553
21125
  if (vaoAvailable) {
21554
21126
  const state = getBindingState(geometry, program, material);
@@ -21556,9 +21128,9 @@ var __publicField = (obj, key, value) => {
21556
21128
  currentState = state;
21557
21129
  bindVertexArrayObject(currentState.object);
21558
21130
  }
21559
- updateBuffers = needsUpdate(object, geometry, program, index);
21131
+ updateBuffers = needsUpdate(object, geometry, program, index2);
21560
21132
  if (updateBuffers)
21561
- saveCache(object, geometry, program, index);
21133
+ saveCache(object, geometry, program, index2);
21562
21134
  } else {
21563
21135
  const wireframe = material.wireframe === true;
21564
21136
  if (currentState.geometry !== geometry.id || currentState.program !== program.id || currentState.wireframe !== wireframe) {
@@ -21568,14 +21140,14 @@ var __publicField = (obj, key, value) => {
21568
21140
  updateBuffers = true;
21569
21141
  }
21570
21142
  }
21571
- if (index !== null) {
21572
- attributes.update(index, gl.ELEMENT_ARRAY_BUFFER);
21143
+ if (index2 !== null) {
21144
+ attributes.update(index2, gl.ELEMENT_ARRAY_BUFFER);
21573
21145
  }
21574
21146
  if (updateBuffers || forceUpdate) {
21575
21147
  forceUpdate = false;
21576
21148
  setupVertexAttributes(object, material, program, geometry);
21577
- if (index !== null) {
21578
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(index).buffer);
21149
+ if (index2 !== null) {
21150
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(index2).buffer);
21579
21151
  }
21580
21152
  }
21581
21153
  }
@@ -21635,7 +21207,7 @@ var __publicField = (obj, key, value) => {
21635
21207
  index: null
21636
21208
  };
21637
21209
  }
21638
- function needsUpdate(object, geometry, program, index) {
21210
+ function needsUpdate(object, geometry, program, index2) {
21639
21211
  const cachedAttributes = currentState.attributes;
21640
21212
  const geometryAttributes = geometry.attributes;
21641
21213
  let attributesNum = 0;
@@ -21662,11 +21234,11 @@ var __publicField = (obj, key, value) => {
21662
21234
  }
21663
21235
  if (currentState.attributesNum !== attributesNum)
21664
21236
  return true;
21665
- if (currentState.index !== index)
21237
+ if (currentState.index !== index2)
21666
21238
  return true;
21667
21239
  return false;
21668
21240
  }
21669
- function saveCache(object, geometry, program, index) {
21241
+ function saveCache(object, geometry, program, index2) {
21670
21242
  const cache = {};
21671
21243
  const attributes2 = geometry.attributes;
21672
21244
  let attributesNum = 0;
@@ -21692,7 +21264,7 @@ var __publicField = (obj, key, value) => {
21692
21264
  }
21693
21265
  currentState.attributes = cache;
21694
21266
  currentState.attributesNum = attributesNum;
21695
- currentState.index = index;
21267
+ currentState.index = index2;
21696
21268
  }
21697
21269
  function initAttributes() {
21698
21270
  const newAttributes = currentState.newAttributes;
@@ -21728,11 +21300,11 @@ var __publicField = (obj, key, value) => {
21728
21300
  }
21729
21301
  }
21730
21302
  }
21731
- function vertexAttribPointer(index, size, type, normalized, stride, offset, integer) {
21303
+ function vertexAttribPointer(index2, size, type, normalized, stride, offset, integer) {
21732
21304
  if (integer === true) {
21733
- gl.vertexAttribIPointer(index, size, type, stride, offset);
21305
+ gl.vertexAttribIPointer(index2, size, type, stride, offset);
21734
21306
  } else {
21735
- gl.vertexAttribPointer(index, size, type, normalized, stride, offset);
21307
+ gl.vertexAttribPointer(index2, size, type, normalized, stride, offset);
21736
21308
  }
21737
21309
  }
21738
21310
  function setupVertexAttributes(object, material, program, geometry) {
@@ -23308,14 +22880,14 @@ var __publicField = (obj, key, value) => {
23308
22880
  let morphInfluencesSum = 0;
23309
22881
  for (let i = 0; i < 8; i++) {
23310
22882
  const influence = workInfluences[i];
23311
- const index = influence[0];
22883
+ const index2 = influence[0];
23312
22884
  const value = influence[1];
23313
- if (index !== Number.MAX_SAFE_INTEGER && value) {
23314
- if (morphTargets && geometry.getAttribute("morphTarget" + i) !== morphTargets[index]) {
23315
- geometry.setAttribute("morphTarget" + i, morphTargets[index]);
22885
+ if (index2 !== Number.MAX_SAFE_INTEGER && value) {
22886
+ if (morphTargets && geometry.getAttribute("morphTarget" + i) !== morphTargets[index2]) {
22887
+ geometry.setAttribute("morphTarget" + i, morphTargets[index2]);
23316
22888
  }
23317
- if (morphNormals && geometry.getAttribute("morphNormal" + i) !== morphNormals[index]) {
23318
- geometry.setAttribute("morphNormal" + i, morphNormals[index]);
22889
+ if (morphNormals && geometry.getAttribute("morphNormal" + i) !== morphNormals[index2]) {
22890
+ geometry.setAttribute("morphNormal" + i, morphNormals[index2]);
23319
22891
  }
23320
22892
  morphInfluences[i] = value;
23321
22893
  morphInfluencesSum += value;
@@ -28360,27 +27932,27 @@ var __publicField = (obj, key, value) => {
28360
27932
  this.cameraAutoUpdate = true;
28361
27933
  this.enabled = false;
28362
27934
  this.isPresenting = false;
28363
- this.getController = function(index) {
28364
- let controller = controllers[index];
27935
+ this.getController = function(index2) {
27936
+ let controller = controllers[index2];
28365
27937
  if (controller === void 0) {
28366
27938
  controller = new WebXRController();
28367
- controllers[index] = controller;
27939
+ controllers[index2] = controller;
28368
27940
  }
28369
27941
  return controller.getTargetRaySpace();
28370
27942
  };
28371
- this.getControllerGrip = function(index) {
28372
- let controller = controllers[index];
27943
+ this.getControllerGrip = function(index2) {
27944
+ let controller = controllers[index2];
28373
27945
  if (controller === void 0) {
28374
27946
  controller = new WebXRController();
28375
- controllers[index] = controller;
27947
+ controllers[index2] = controller;
28376
27948
  }
28377
27949
  return controller.getGripSpace();
28378
27950
  };
28379
- this.getHand = function(index) {
28380
- let controller = controllers[index];
27951
+ this.getHand = function(index2) {
27952
+ let controller = controllers[index2];
28381
27953
  if (controller === void 0) {
28382
27954
  controller = new WebXRController();
28383
- controllers[index] = controller;
27955
+ controllers[index2] = controller;
28384
27956
  }
28385
27957
  return controller.getHandSpace();
28386
27958
  };
@@ -28538,10 +28110,10 @@ var __publicField = (obj, key, value) => {
28538
28110
  function onInputSourcesChange(event) {
28539
28111
  for (let i = 0; i < event.removed.length; i++) {
28540
28112
  const inputSource = event.removed[i];
28541
- const index = controllerInputSources.indexOf(inputSource);
28542
- if (index >= 0) {
28543
- controllerInputSources[index] = null;
28544
- controllers[index].disconnect(inputSource);
28113
+ const index2 = controllerInputSources.indexOf(inputSource);
28114
+ if (index2 >= 0) {
28115
+ controllerInputSources[index2] = null;
28116
+ controllers[index2].disconnect(inputSource);
28545
28117
  }
28546
28118
  }
28547
28119
  for (let i = 0; i < event.added.length; i++) {
@@ -29129,28 +28701,28 @@ var __publicField = (obj, key, value) => {
29129
28701
  }
29130
28702
  gl.bindBuffer(gl.UNIFORM_BUFFER, null);
29131
28703
  }
29132
- function hasUniformChanged(uniform, index, cache) {
28704
+ function hasUniformChanged(uniform, index2, cache) {
29133
28705
  const value = uniform.value;
29134
- if (cache[index] === void 0) {
28706
+ if (cache[index2] === void 0) {
29135
28707
  if (typeof value === "number") {
29136
- cache[index] = value;
28708
+ cache[index2] = value;
29137
28709
  } else {
29138
28710
  const values = Array.isArray(value) ? value : [value];
29139
28711
  const tempValues = [];
29140
28712
  for (let i = 0; i < values.length; i++) {
29141
28713
  tempValues.push(values[i].clone());
29142
28714
  }
29143
- cache[index] = tempValues;
28715
+ cache[index2] = tempValues;
29144
28716
  }
29145
28717
  return true;
29146
28718
  } else {
29147
28719
  if (typeof value === "number") {
29148
- if (cache[index] !== value) {
29149
- cache[index] = value;
28720
+ if (cache[index2] !== value) {
28721
+ cache[index2] = value;
29150
28722
  return true;
29151
28723
  }
29152
28724
  } else {
29153
- const cachedObjects = Array.isArray(cache[index]) ? cache[index] : [cache[index]];
28725
+ const cachedObjects = Array.isArray(cache[index2]) ? cache[index2] : [cache[index2]];
29154
28726
  const values = Array.isArray(value) ? value : [value];
29155
28727
  for (let i = 0; i < cachedObjects.length; i++) {
29156
28728
  const cachedObject = cachedObjects[i];
@@ -29237,8 +28809,8 @@ var __publicField = (obj, key, value) => {
29237
28809
  function onUniformsGroupsDispose(event) {
29238
28810
  const uniformsGroup = event.target;
29239
28811
  uniformsGroup.removeEventListener("dispose", onUniformsGroupsDispose);
29240
- const index = allocatedBindingPoints.indexOf(uniformsGroup.__bindingPointIndex);
29241
- allocatedBindingPoints.splice(index, 1);
28812
+ const index2 = allocatedBindingPoints.indexOf(uniformsGroup.__bindingPointIndex);
28813
+ allocatedBindingPoints.splice(index2, 1);
29242
28814
  gl.deleteBuffer(buffers[uniformsGroup.id]);
29243
28815
  delete buffers[uniformsGroup.id];
29244
28816
  delete updateList[uniformsGroup.id];
@@ -29658,11 +29230,11 @@ var __publicField = (obj, key, value) => {
29658
29230
  const frontFaceCW = object.isMesh && object.matrixWorld.determinant() < 0;
29659
29231
  const program = setProgram(camera, scene, geometry, material, object);
29660
29232
  state.setMaterial(material, frontFaceCW);
29661
- let index = geometry.index;
29233
+ let index2 = geometry.index;
29662
29234
  let rangeFactor = 1;
29663
29235
  if (material.wireframe === true) {
29664
- index = geometries.getWireframeAttribute(geometry);
29665
- if (index === void 0)
29236
+ index2 = geometries.getWireframeAttribute(geometry);
29237
+ if (index2 === void 0)
29666
29238
  return;
29667
29239
  rangeFactor = 2;
29668
29240
  }
@@ -29674,9 +29246,9 @@ var __publicField = (obj, key, value) => {
29674
29246
  drawStart = Math.max(drawStart, group.start * rangeFactor);
29675
29247
  drawEnd = Math.min(drawEnd, (group.start + group.count) * rangeFactor);
29676
29248
  }
29677
- if (index !== null) {
29249
+ if (index2 !== null) {
29678
29250
  drawStart = Math.max(drawStart, 0);
29679
- drawEnd = Math.min(drawEnd, index.count);
29251
+ drawEnd = Math.min(drawEnd, index2.count);
29680
29252
  } else if (position !== void 0 && position !== null) {
29681
29253
  drawStart = Math.max(drawStart, 0);
29682
29254
  drawEnd = Math.min(drawEnd, position.count);
@@ -29684,11 +29256,11 @@ var __publicField = (obj, key, value) => {
29684
29256
  const drawCount = drawEnd - drawStart;
29685
29257
  if (drawCount < 0 || drawCount === Infinity)
29686
29258
  return;
29687
- bindingStates.setup(object, material, program, geometry, index);
29259
+ bindingStates.setup(object, material, program, geometry, index2);
29688
29260
  let attribute;
29689
29261
  let renderer = bufferRenderer;
29690
- if (index !== null) {
29691
- attribute = attributes.get(index);
29262
+ if (index2 !== null) {
29263
+ attribute = attributes.get(index2);
29692
29264
  renderer = indexedBufferRenderer;
29693
29265
  renderer.setIndex(attribute);
29694
29266
  }
@@ -30789,88 +30361,88 @@ var __publicField = (obj, key, value) => {
30789
30361
  }
30790
30362
  return this;
30791
30363
  }
30792
- setX(index, x2) {
30364
+ setX(index2, x2) {
30793
30365
  if (this.normalized)
30794
30366
  x2 = normalize(x2, this.array);
30795
- this.data.array[index * this.data.stride + this.offset] = x2;
30367
+ this.data.array[index2 * this.data.stride + this.offset] = x2;
30796
30368
  return this;
30797
30369
  }
30798
- setY(index, y) {
30370
+ setY(index2, y) {
30799
30371
  if (this.normalized)
30800
30372
  y = normalize(y, this.array);
30801
- this.data.array[index * this.data.stride + this.offset + 1] = y;
30373
+ this.data.array[index2 * this.data.stride + this.offset + 1] = y;
30802
30374
  return this;
30803
30375
  }
30804
- setZ(index, z) {
30376
+ setZ(index2, z) {
30805
30377
  if (this.normalized)
30806
30378
  z = normalize(z, this.array);
30807
- this.data.array[index * this.data.stride + this.offset + 2] = z;
30379
+ this.data.array[index2 * this.data.stride + this.offset + 2] = z;
30808
30380
  return this;
30809
30381
  }
30810
- setW(index, w2) {
30382
+ setW(index2, w2) {
30811
30383
  if (this.normalized)
30812
30384
  w2 = normalize(w2, this.array);
30813
- this.data.array[index * this.data.stride + this.offset + 3] = w2;
30385
+ this.data.array[index2 * this.data.stride + this.offset + 3] = w2;
30814
30386
  return this;
30815
30387
  }
30816
- getX(index) {
30817
- let x2 = this.data.array[index * this.data.stride + this.offset];
30388
+ getX(index2) {
30389
+ let x2 = this.data.array[index2 * this.data.stride + this.offset];
30818
30390
  if (this.normalized)
30819
30391
  x2 = denormalize(x2, this.array);
30820
30392
  return x2;
30821
30393
  }
30822
- getY(index) {
30823
- let y = this.data.array[index * this.data.stride + this.offset + 1];
30394
+ getY(index2) {
30395
+ let y = this.data.array[index2 * this.data.stride + this.offset + 1];
30824
30396
  if (this.normalized)
30825
30397
  y = denormalize(y, this.array);
30826
30398
  return y;
30827
30399
  }
30828
- getZ(index) {
30829
- let z = this.data.array[index * this.data.stride + this.offset + 2];
30400
+ getZ(index2) {
30401
+ let z = this.data.array[index2 * this.data.stride + this.offset + 2];
30830
30402
  if (this.normalized)
30831
30403
  z = denormalize(z, this.array);
30832
30404
  return z;
30833
30405
  }
30834
- getW(index) {
30835
- let w2 = this.data.array[index * this.data.stride + this.offset + 3];
30406
+ getW(index2) {
30407
+ let w2 = this.data.array[index2 * this.data.stride + this.offset + 3];
30836
30408
  if (this.normalized)
30837
30409
  w2 = denormalize(w2, this.array);
30838
30410
  return w2;
30839
30411
  }
30840
- setXY(index, x2, y) {
30841
- index = index * this.data.stride + this.offset;
30412
+ setXY(index2, x2, y) {
30413
+ index2 = index2 * this.data.stride + this.offset;
30842
30414
  if (this.normalized) {
30843
30415
  x2 = normalize(x2, this.array);
30844
30416
  y = normalize(y, this.array);
30845
30417
  }
30846
- this.data.array[index + 0] = x2;
30847
- this.data.array[index + 1] = y;
30418
+ this.data.array[index2 + 0] = x2;
30419
+ this.data.array[index2 + 1] = y;
30848
30420
  return this;
30849
30421
  }
30850
- setXYZ(index, x2, y, z) {
30851
- index = index * this.data.stride + this.offset;
30422
+ setXYZ(index2, x2, y, z) {
30423
+ index2 = index2 * this.data.stride + this.offset;
30852
30424
  if (this.normalized) {
30853
30425
  x2 = normalize(x2, this.array);
30854
30426
  y = normalize(y, this.array);
30855
30427
  z = normalize(z, this.array);
30856
30428
  }
30857
- this.data.array[index + 0] = x2;
30858
- this.data.array[index + 1] = y;
30859
- this.data.array[index + 2] = z;
30429
+ this.data.array[index2 + 0] = x2;
30430
+ this.data.array[index2 + 1] = y;
30431
+ this.data.array[index2 + 2] = z;
30860
30432
  return this;
30861
30433
  }
30862
- setXYZW(index, x2, y, z, w2) {
30863
- index = index * this.data.stride + this.offset;
30434
+ setXYZW(index2, x2, y, z, w2) {
30435
+ index2 = index2 * this.data.stride + this.offset;
30864
30436
  if (this.normalized) {
30865
30437
  x2 = normalize(x2, this.array);
30866
30438
  y = normalize(y, this.array);
30867
30439
  z = normalize(z, this.array);
30868
30440
  w2 = normalize(w2, this.array);
30869
30441
  }
30870
- this.data.array[index + 0] = x2;
30871
- this.data.array[index + 1] = y;
30872
- this.data.array[index + 2] = z;
30873
- this.data.array[index + 3] = w2;
30442
+ this.data.array[index2 + 0] = x2;
30443
+ this.data.array[index2 + 1] = y;
30444
+ this.data.array[index2 + 2] = z;
30445
+ this.data.array[index2 + 3] = w2;
30874
30446
  return this;
30875
30447
  }
30876
30448
  clone(data) {
@@ -30878,9 +30450,9 @@ var __publicField = (obj, key, value) => {
30878
30450
  console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");
30879
30451
  const array = [];
30880
30452
  for (let i = 0; i < this.count; i++) {
30881
- const index = i * this.data.stride + this.offset;
30453
+ const index2 = i * this.data.stride + this.offset;
30882
30454
  for (let j = 0; j < this.itemSize; j++) {
30883
- array.push(this.data.array[index + j]);
30455
+ array.push(this.data.array[index2 + j]);
30884
30456
  }
30885
30457
  }
30886
30458
  return new BufferAttribute(new this.array.constructor(array), this.itemSize, this.normalized);
@@ -30899,9 +30471,9 @@ var __publicField = (obj, key, value) => {
30899
30471
  console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");
30900
30472
  const array = [];
30901
30473
  for (let i = 0; i < this.count; i++) {
30902
- const index = i * this.data.stride + this.offset;
30474
+ const index2 = i * this.data.stride + this.offset;
30903
30475
  for (let j = 0; j < this.itemSize; j++) {
30904
- array.push(this.data.array[index + j]);
30476
+ array.push(this.data.array[index2 + j]);
30905
30477
  }
30906
30478
  }
30907
30479
  return {
@@ -31002,9 +30574,9 @@ var __publicField = (obj, key, value) => {
31002
30574
  }
31003
30575
  this._computeIntersections(raycaster, intersects, _ray$2);
31004
30576
  }
31005
- getVertexPosition(index, target) {
31006
- super.getVertexPosition(index, target);
31007
- this.applyBoneTransform(index, target);
30577
+ getVertexPosition(index2, target) {
30578
+ super.getVertexPosition(index2, target);
30579
+ this.applyBoneTransform(index2, target);
31008
30580
  return target;
31009
30581
  }
31010
30582
  bind(skeleton, bindMatrix) {
@@ -31044,11 +30616,11 @@ var __publicField = (obj, key, value) => {
31044
30616
  console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode);
31045
30617
  }
31046
30618
  }
31047
- applyBoneTransform(index, vector) {
30619
+ applyBoneTransform(index2, vector) {
31048
30620
  const skeleton = this.skeleton;
31049
30621
  const geometry = this.geometry;
31050
- _skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index);
31051
- _skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index);
30622
+ _skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index2);
30623
+ _skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index2);
31052
30624
  _basePosition.copy(vector).applyMatrix4(this.bindMatrix);
31053
30625
  vector.set(0, 0, 0);
31054
30626
  for (let i = 0; i < 4; i++) {
@@ -31061,9 +30633,9 @@ var __publicField = (obj, key, value) => {
31061
30633
  }
31062
30634
  return vector.applyMatrix4(this.bindMatrixInverse);
31063
30635
  }
31064
- boneTransform(index, vector) {
30636
+ boneTransform(index2, vector) {
31065
30637
  console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151.");
31066
- return this.applyBoneTransform(index, vector);
30638
+ return this.applyBoneTransform(index2, vector);
31067
30639
  }
31068
30640
  }
31069
30641
  class Bone extends Object3D {
@@ -31305,11 +30877,11 @@ var __publicField = (obj, key, value) => {
31305
30877
  this.boundingSphere = source.boundingSphere.clone();
31306
30878
  return this;
31307
30879
  }
31308
- getColorAt(index, color) {
31309
- color.fromArray(this.instanceColor.array, index * 3);
30880
+ getColorAt(index2, color) {
30881
+ color.fromArray(this.instanceColor.array, index2 * 3);
31310
30882
  }
31311
- getMatrixAt(index, matrix) {
31312
- matrix.fromArray(this.instanceMatrix.array, index * 16);
30883
+ getMatrixAt(index2, matrix) {
30884
+ matrix.fromArray(this.instanceMatrix.array, index2 * 16);
31313
30885
  }
31314
30886
  raycast(raycaster, intersects) {
31315
30887
  const matrixWorld = this.matrixWorld;
@@ -31338,14 +30910,14 @@ var __publicField = (obj, key, value) => {
31338
30910
  _instanceIntersects.length = 0;
31339
30911
  }
31340
30912
  }
31341
- setColorAt(index, color) {
30913
+ setColorAt(index2, color) {
31342
30914
  if (this.instanceColor === null) {
31343
30915
  this.instanceColor = new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count * 3), 3);
31344
30916
  }
31345
- color.toArray(this.instanceColor.array, index * 3);
30917
+ color.toArray(this.instanceColor.array, index2 * 3);
31346
30918
  }
31347
- setMatrixAt(index, matrix) {
31348
- matrix.toArray(this.instanceMatrix.array, index * 16);
30919
+ setMatrixAt(index2, matrix) {
30920
+ matrix.toArray(this.instanceMatrix.array, index2 * 16);
31349
30921
  }
31350
30922
  updateMorphTargets() {
31351
30923
  }
@@ -31435,15 +31007,15 @@ var __publicField = (obj, key, value) => {
31435
31007
  const interSegment = new Vector3();
31436
31008
  const interRay = new Vector3();
31437
31009
  const step = this.isLineSegments ? 2 : 1;
31438
- const index = geometry.index;
31010
+ const index2 = geometry.index;
31439
31011
  const attributes = geometry.attributes;
31440
31012
  const positionAttribute = attributes.position;
31441
- if (index !== null) {
31013
+ if (index2 !== null) {
31442
31014
  const start = Math.max(0, drawRange.start);
31443
- const end = Math.min(index.count, drawRange.start + drawRange.count);
31015
+ const end = Math.min(index2.count, drawRange.start + drawRange.count);
31444
31016
  for (let i = start, l = end - 1; i < l; i += step) {
31445
- const a = index.getX(i);
31446
- const b = index.getX(i + 1);
31017
+ const a = index2.getX(i);
31018
+ const b = index2.getX(i + 1);
31447
31019
  vStart.fromBufferAttribute(positionAttribute, a);
31448
31020
  vEnd.fromBufferAttribute(positionAttribute, b);
31449
31021
  const distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment);
@@ -31600,14 +31172,14 @@ var __publicField = (obj, key, value) => {
31600
31172
  _ray$4.copy(raycaster.ray).applyMatrix4(_inverseMatrix);
31601
31173
  const localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3);
31602
31174
  const localThresholdSq = localThreshold * localThreshold;
31603
- const index = geometry.index;
31175
+ const index2 = geometry.index;
31604
31176
  const attributes = geometry.attributes;
31605
31177
  const positionAttribute = attributes.position;
31606
- if (index !== null) {
31178
+ if (index2 !== null) {
31607
31179
  const start = Math.max(0, drawRange.start);
31608
- const end = Math.min(index.count, drawRange.start + drawRange.count);
31180
+ const end = Math.min(index2.count, drawRange.start + drawRange.count);
31609
31181
  for (let i = start, il = end; i < il; i++) {
31610
- const a = index.getX(i);
31182
+ const a = index2.getX(i);
31611
31183
  _position$2.fromBufferAttribute(positionAttribute, a);
31612
31184
  testPoint(_position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this);
31613
31185
  }
@@ -31638,7 +31210,7 @@ var __publicField = (obj, key, value) => {
31638
31210
  }
31639
31211
  }
31640
31212
  }
31641
- function testPoint(point, index, localThresholdSq, matrixWorld, raycaster, intersects, object) {
31213
+ function testPoint(point, index2, localThresholdSq, matrixWorld, raycaster, intersects, object) {
31642
31214
  const rayPointDistanceSq = _ray$4.distanceSqToPoint(point);
31643
31215
  if (rayPointDistanceSq < localThresholdSq) {
31644
31216
  const intersectPoint = new Vector3();
@@ -31651,7 +31223,7 @@ var __publicField = (obj, key, value) => {
31651
31223
  distance,
31652
31224
  distanceToRay: Math.sqrt(rayPointDistanceSq),
31653
31225
  point: intersectPoint,
31654
- index,
31226
+ index: index2,
31655
31227
  face: null,
31656
31228
  object
31657
31229
  });
@@ -32061,8 +31633,8 @@ var __publicField = (obj, key, value) => {
32061
31633
  getSettings_() {
32062
31634
  return this.settings || this.DefaultSettings_;
32063
31635
  }
32064
- copySampleValue_(index) {
32065
- const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, offset = index * stride;
31636
+ copySampleValue_(index2) {
31637
+ const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, offset = index2 * stride;
32066
31638
  for (let i = 0; i !== stride; ++i) {
32067
31639
  result[i] = values[offset + i];
32068
31640
  }
@@ -32761,9 +32333,9 @@ var __publicField = (obj, key, value) => {
32761
32333
  return this;
32762
32334
  };
32763
32335
  this.removeHandler = function(regex) {
32764
- const index = handlers.indexOf(regex);
32765
- if (index !== -1) {
32766
- handlers.splice(index, 2);
32336
+ const index2 = handlers.indexOf(regex);
32337
+ if (index2 !== -1) {
32338
+ handlers.splice(index2, 2);
32767
32339
  }
32768
32340
  return this;
32769
32341
  };
@@ -33439,10 +33011,10 @@ var __publicField = (obj, key, value) => {
33439
33011
  }
33440
33012
  }
33441
33013
  static extractUrlBase(url) {
33442
- const index = url.lastIndexOf("/");
33443
- if (index === -1)
33014
+ const index2 = url.lastIndexOf("/");
33015
+ if (index2 === -1)
33444
33016
  return "./";
33445
- return url.slice(0, index + 1);
33017
+ return url.slice(0, index2 + 1);
33446
33018
  }
33447
33019
  static resolveURL(url, path) {
33448
33020
  if (typeof url !== "string" || url === "")
@@ -34792,8 +34364,8 @@ var __publicField = (obj, key, value) => {
34792
34364
  return geometry;
34793
34365
  }
34794
34366
  if (drawMode === TriangleFanDrawMode || drawMode === TriangleStripDrawMode) {
34795
- let index = geometry.getIndex();
34796
- if (index === null) {
34367
+ let index2 = geometry.getIndex();
34368
+ if (index2 === null) {
34797
34369
  const indices = [];
34798
34370
  const position = geometry.getAttribute("position");
34799
34371
  if (position !== void 0) {
@@ -34801,30 +34373,30 @@ var __publicField = (obj, key, value) => {
34801
34373
  indices.push(i);
34802
34374
  }
34803
34375
  geometry.setIndex(indices);
34804
- index = geometry.getIndex();
34376
+ index2 = geometry.getIndex();
34805
34377
  } else {
34806
34378
  console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.");
34807
34379
  return geometry;
34808
34380
  }
34809
34381
  }
34810
- const numberOfTriangles = index.count - 2;
34382
+ const numberOfTriangles = index2.count - 2;
34811
34383
  const newIndices = [];
34812
34384
  if (drawMode === TriangleFanDrawMode) {
34813
34385
  for (let i = 1; i <= numberOfTriangles; i++) {
34814
- newIndices.push(index.getX(0));
34815
- newIndices.push(index.getX(i));
34816
- newIndices.push(index.getX(i + 1));
34386
+ newIndices.push(index2.getX(0));
34387
+ newIndices.push(index2.getX(i));
34388
+ newIndices.push(index2.getX(i + 1));
34817
34389
  }
34818
34390
  } else {
34819
34391
  for (let i = 0; i < numberOfTriangles; i++) {
34820
34392
  if (i % 2 === 0) {
34821
- newIndices.push(index.getX(i));
34822
- newIndices.push(index.getX(i + 1));
34823
- newIndices.push(index.getX(i + 2));
34393
+ newIndices.push(index2.getX(i));
34394
+ newIndices.push(index2.getX(i + 1));
34395
+ newIndices.push(index2.getX(i + 2));
34824
34396
  } else {
34825
- newIndices.push(index.getX(i + 2));
34826
- newIndices.push(index.getX(i + 1));
34827
- newIndices.push(index.getX(i));
34397
+ newIndices.push(index2.getX(i + 2));
34398
+ newIndices.push(index2.getX(i + 1));
34399
+ newIndices.push(index2.getX(i));
34828
34400
  }
34829
34401
  }
34830
34402
  }
@@ -35142,10 +34714,10 @@ var __publicField = (obj, key, value) => {
35142
34714
  parser.cache.add(cacheKey, dependency);
35143
34715
  return dependency;
35144
34716
  }
35145
- getDependency(type, index) {
34717
+ getDependency(type, index2) {
35146
34718
  if (type !== "light")
35147
34719
  return;
35148
- return this._loadLight(index);
34720
+ return this._loadLight(index2);
35149
34721
  }
35150
34722
  createNodeAttachment(nodeIndex) {
35151
34723
  const self2 = this;
@@ -35592,9 +35164,9 @@ var __publicField = (obj, key, value) => {
35592
35164
  this.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION;
35593
35165
  this.parser = parser;
35594
35166
  }
35595
- loadBufferView(index) {
35167
+ loadBufferView(index2) {
35596
35168
  const json = this.parser.json;
35597
- const bufferView = json.bufferViews[index];
35169
+ const bufferView = json.bufferViews[index2];
35598
35170
  if (bufferView.extensions && bufferView.extensions[this.name]) {
35599
35171
  const extensionDef = bufferView.extensions[this.name];
35600
35172
  const buffer = this.parser.getDependency("buffer", extensionDef.buffer);
@@ -35826,8 +35398,8 @@ var __publicField = (obj, key, value) => {
35826
35398
  constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {
35827
35399
  super(parameterPositions, sampleValues, sampleSize, resultBuffer);
35828
35400
  }
35829
- copySampleValue_(index) {
35830
- const result = this.resultBuffer, values = this.sampleValues, valueSize = this.valueSize, offset = index * valueSize * 3 + valueSize;
35401
+ copySampleValue_(index2) {
35402
+ const result = this.resultBuffer, values = this.sampleValues, valueSize = this.valueSize, offset = index2 * valueSize * 3 + valueSize;
35831
35403
  for (let i = 0; i !== valueSize; i++) {
35832
35404
  result[i] = values[offset + i];
35833
35405
  }
@@ -36210,17 +35782,17 @@ var __publicField = (obj, key, value) => {
36210
35782
  *
36211
35783
  * Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
36212
35784
  */
36213
- _addNodeRef(cache, index) {
36214
- if (index === void 0)
35785
+ _addNodeRef(cache, index2) {
35786
+ if (index2 === void 0)
36215
35787
  return;
36216
- if (cache.refs[index] === void 0) {
36217
- cache.refs[index] = cache.uses[index] = 0;
35788
+ if (cache.refs[index2] === void 0) {
35789
+ cache.refs[index2] = cache.uses[index2] = 0;
36218
35790
  }
36219
- cache.refs[index]++;
35791
+ cache.refs[index2]++;
36220
35792
  }
36221
35793
  /** Returns a reference to a shared resource, cloning it if necessary. */
36222
- _getNodeRef(cache, index, object) {
36223
- if (cache.refs[index] <= 1)
35794
+ _getNodeRef(cache, index2, object) {
35795
+ if (cache.refs[index2] <= 1)
36224
35796
  return object;
36225
35797
  const ref = object.clone();
36226
35798
  const updateMappings = (original, clone) => {
@@ -36233,7 +35805,7 @@ var __publicField = (obj, key, value) => {
36233
35805
  }
36234
35806
  };
36235
35807
  updateMappings(object, ref);
36236
- ref.name += "_instance_" + cache.uses[index]++;
35808
+ ref.name += "_instance_" + cache.uses[index2]++;
36237
35809
  return ref;
36238
35810
  }
36239
35811
  _invokeOne(func) {
@@ -36263,59 +35835,59 @@ var __publicField = (obj, key, value) => {
36263
35835
  * @param {number} index
36264
35836
  * @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
36265
35837
  */
36266
- getDependency(type, index) {
36267
- const cacheKey = type + ":" + index;
35838
+ getDependency(type, index2) {
35839
+ const cacheKey = type + ":" + index2;
36268
35840
  let dependency = this.cache.get(cacheKey);
36269
35841
  if (!dependency) {
36270
35842
  switch (type) {
36271
35843
  case "scene":
36272
- dependency = this.loadScene(index);
35844
+ dependency = this.loadScene(index2);
36273
35845
  break;
36274
35846
  case "node":
36275
35847
  dependency = this._invokeOne(function(ext) {
36276
- return ext.loadNode && ext.loadNode(index);
35848
+ return ext.loadNode && ext.loadNode(index2);
36277
35849
  });
36278
35850
  break;
36279
35851
  case "mesh":
36280
35852
  dependency = this._invokeOne(function(ext) {
36281
- return ext.loadMesh && ext.loadMesh(index);
35853
+ return ext.loadMesh && ext.loadMesh(index2);
36282
35854
  });
36283
35855
  break;
36284
35856
  case "accessor":
36285
- dependency = this.loadAccessor(index);
35857
+ dependency = this.loadAccessor(index2);
36286
35858
  break;
36287
35859
  case "bufferView":
36288
35860
  dependency = this._invokeOne(function(ext) {
36289
- return ext.loadBufferView && ext.loadBufferView(index);
35861
+ return ext.loadBufferView && ext.loadBufferView(index2);
36290
35862
  });
36291
35863
  break;
36292
35864
  case "buffer":
36293
- dependency = this.loadBuffer(index);
35865
+ dependency = this.loadBuffer(index2);
36294
35866
  break;
36295
35867
  case "material":
36296
35868
  dependency = this._invokeOne(function(ext) {
36297
- return ext.loadMaterial && ext.loadMaterial(index);
35869
+ return ext.loadMaterial && ext.loadMaterial(index2);
36298
35870
  });
36299
35871
  break;
36300
35872
  case "texture":
36301
35873
  dependency = this._invokeOne(function(ext) {
36302
- return ext.loadTexture && ext.loadTexture(index);
35874
+ return ext.loadTexture && ext.loadTexture(index2);
36303
35875
  });
36304
35876
  break;
36305
35877
  case "skin":
36306
- dependency = this.loadSkin(index);
35878
+ dependency = this.loadSkin(index2);
36307
35879
  break;
36308
35880
  case "animation":
36309
35881
  dependency = this._invokeOne(function(ext) {
36310
- return ext.loadAnimation && ext.loadAnimation(index);
35882
+ return ext.loadAnimation && ext.loadAnimation(index2);
36311
35883
  });
36312
35884
  break;
36313
35885
  case "camera":
36314
- dependency = this.loadCamera(index);
35886
+ dependency = this.loadCamera(index2);
36315
35887
  break;
36316
35888
  default:
36317
35889
  dependency = this._invokeOne(function(ext) {
36318
- return ext != this && ext.getDependency && ext.getDependency(type, index);
35890
+ return ext != this && ext.getDependency && ext.getDependency(type, index2);
36319
35891
  });
36320
35892
  if (!dependency) {
36321
35893
  throw new Error("Unknown type: " + type);
@@ -36336,8 +35908,8 @@ var __publicField = (obj, key, value) => {
36336
35908
  if (!dependencies) {
36337
35909
  const parser = this;
36338
35910
  const defs = this.json[type + (type === "mesh" ? "es" : "s")] || [];
36339
- dependencies = Promise.all(defs.map(function(def, index) {
36340
- return parser.getDependency(type, index);
35911
+ dependencies = Promise.all(defs.map(function(def, index2) {
35912
+ return parser.getDependency(type, index2);
36341
35913
  }));
36342
35914
  this.cache.add(type, dependencies);
36343
35915
  }
@@ -36442,14 +36014,14 @@ var __publicField = (obj, key, value) => {
36442
36014
  bufferAttribute = new BufferAttribute(bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized);
36443
36015
  }
36444
36016
  for (let i = 0, il = sparseIndices.length; i < il; i++) {
36445
- const index = sparseIndices[i];
36446
- bufferAttribute.setX(index, sparseValues[i * itemSize]);
36017
+ const index2 = sparseIndices[i];
36018
+ bufferAttribute.setX(index2, sparseValues[i * itemSize]);
36447
36019
  if (itemSize >= 2)
36448
- bufferAttribute.setY(index, sparseValues[i * itemSize + 1]);
36020
+ bufferAttribute.setY(index2, sparseValues[i * itemSize + 1]);
36449
36021
  if (itemSize >= 3)
36450
- bufferAttribute.setZ(index, sparseValues[i * itemSize + 2]);
36022
+ bufferAttribute.setZ(index2, sparseValues[i * itemSize + 2]);
36451
36023
  if (itemSize >= 4)
36452
- bufferAttribute.setW(index, sparseValues[i * itemSize + 3]);
36024
+ bufferAttribute.setW(index2, sparseValues[i * itemSize + 3]);
36453
36025
  if (itemSize >= 5)
36454
36026
  throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
36455
36027
  }
@@ -38438,14 +38010,14 @@ var __publicField = (obj, key, value) => {
38438
38010
  this.passes.push(pass);
38439
38011
  pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
38440
38012
  }
38441
- insertPass(pass, index) {
38442
- this.passes.splice(index, 0, pass);
38013
+ insertPass(pass, index2) {
38014
+ this.passes.splice(index2, 0, pass);
38443
38015
  pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
38444
38016
  }
38445
38017
  removePass(pass) {
38446
- const index = this.passes.indexOf(pass);
38447
- if (index !== -1) {
38448
- this.passes.splice(index, 1);
38018
+ const index2 = this.passes.indexOf(pass);
38019
+ if (index2 !== -1) {
38020
+ this.passes.splice(index2, 1);
38449
38021
  }
38450
38022
  }
38451
38023
  isLastEnabledPass(passIndex) {
@@ -38818,10 +38390,10 @@ var __publicField = (obj, key, value) => {
38818
38390
  if (!geo.index) {
38819
38391
  const vertexCount = geo.attributes.position.count;
38820
38392
  const BufferConstructor = options.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer;
38821
- const index = getIndexArray(vertexCount, BufferConstructor);
38822
- geo.setIndex(new BufferAttribute(index, 1));
38393
+ const index2 = getIndexArray(vertexCount, BufferConstructor);
38394
+ geo.setIndex(new BufferAttribute(index2, 1));
38823
38395
  for (let i = 0; i < vertexCount; i++) {
38824
- index[i] = i;
38396
+ index2[i] = i;
38825
38397
  }
38826
38398
  }
38827
38399
  }
@@ -39036,7 +38608,7 @@ var __publicField = (obj, key, value) => {
39036
38608
  function computeTriangleBounds(geo, fullBounds) {
39037
38609
  makeEmptyBounds(fullBounds);
39038
38610
  const posAttr = geo.attributes.position;
39039
- const index = geo.index ? geo.index.array : null;
38611
+ const index2 = geo.index ? geo.index.array : null;
39040
38612
  const triCount = getTriCount(geo);
39041
38613
  const triangleBounds = new Float32Array(triCount * 6);
39042
38614
  const normalized = posAttr.normalized;
@@ -39053,10 +38625,10 @@ var __publicField = (obj, key, value) => {
39053
38625
  let ai = tri3 + 0;
39054
38626
  let bi = tri3 + 1;
39055
38627
  let ci = tri3 + 2;
39056
- if (index) {
39057
- ai = index[ai];
39058
- bi = index[bi];
39059
- ci = index[ci];
38628
+ if (index2) {
38629
+ ai = index2[ai];
38630
+ bi = index2[bi];
38631
+ ci = index2[ci];
39060
38632
  }
39061
38633
  if (!normalized) {
39062
38634
  ai = ai * stride + bufferOffset;
@@ -39273,7 +38845,7 @@ var __publicField = (obj, key, value) => {
39273
38845
  constructor() {
39274
38846
  }
39275
38847
  }
39276
- function partition(indirectBuffer, index, triangleBounds, offset, count, split) {
38848
+ function partition(indirectBuffer, index2, triangleBounds, offset, count, split) {
39277
38849
  let left = offset;
39278
38850
  let right = offset + count - 1;
39279
38851
  const pos = split.pos;
@@ -39287,9 +38859,9 @@ var __publicField = (obj, key, value) => {
39287
38859
  }
39288
38860
  if (left < right) {
39289
38861
  for (let i = 0; i < 3; i++) {
39290
- let t0 = index[left * 3 + i];
39291
- index[left * 3 + i] = index[right * 3 + i];
39292
- index[right * 3 + i] = t0;
38862
+ let t0 = index2[left * 3 + i];
38863
+ index2[left * 3 + i] = index2[right * 3 + i];
38864
+ index2[right * 3 + i] = t0;
39293
38865
  }
39294
38866
  for (let i = 0; i < 6; i++) {
39295
38867
  let tb = triangleBounds[left * 6 + i];
@@ -39303,7 +38875,7 @@ var __publicField = (obj, key, value) => {
39303
38875
  }
39304
38876
  }
39305
38877
  }
39306
- function partition_indirect(indirectBuffer, index, triangleBounds, offset, count, split) {
38878
+ function partition_indirect(indirectBuffer, index2, triangleBounds, offset, count, split) {
39307
38879
  let left = offset;
39308
38880
  let right = offset + count - 1;
39309
38881
  const pos = split.pos;
@@ -40056,8 +39628,8 @@ var __publicField = (obj, key, value) => {
40056
39628
  for (let i = 0; i < 3; i++) {
40057
39629
  const axis = satAxes[i];
40058
39630
  const sb = satBounds[i];
40059
- const index = 1 << i;
40060
- const pi = points[index];
39631
+ const index2 = 1 << i;
39632
+ const pi = points[index2];
40061
39633
  axis.subVectors(minVec, pi);
40062
39634
  sb.setFromPoints(axis, points);
40063
39635
  }
@@ -40218,10 +39790,10 @@ var __publicField = (obj, key, value) => {
40218
39790
  for (let i2 = 0; i2 <= 1; i2++) {
40219
39791
  const nextIndex = (i + 1) % 3;
40220
39792
  const nextIndex2 = (i + 2) % 3;
40221
- const index = i1 << nextIndex | i2 << nextIndex2;
40222
- const index2 = 1 << i | i1 << nextIndex | i2 << nextIndex2;
40223
- const p1 = points[index];
40224
- const p2 = points[index2];
39793
+ const index2 = i1 << nextIndex | i2 << nextIndex2;
39794
+ const index22 = 1 << i | i1 << nextIndex | i2 << nextIndex2;
39795
+ const p1 = points[index2];
39796
+ const p2 = points[index22];
40225
39797
  const line1 = segments1[count];
40226
39798
  line1.set(p1, p2);
40227
39799
  const f1 = xyzFields[i];
@@ -40585,11 +40157,11 @@ var __publicField = (obj, key, value) => {
40585
40157
  let a = triOffset + 0;
40586
40158
  let b = triOffset + 1;
40587
40159
  let c2 = triOffset + 2;
40588
- const index = geo.index;
40160
+ const index2 = geo.index;
40589
40161
  if (geo.index) {
40590
- a = index.getX(a);
40591
- b = index.getX(b);
40592
- c2 = index.getX(c2);
40162
+ a = index2.getX(a);
40163
+ b = index2.getX(b);
40164
+ c2 = index2.getX(c2);
40593
40165
  }
40594
40166
  const { position, normal, uv, uv1 } = geo.attributes;
40595
40167
  const intersection = checkBufferGeometryIntersection(ray, position, normal, uv, uv1, a, b, c2, side);
@@ -40601,17 +40173,17 @@ var __publicField = (obj, key, value) => {
40601
40173
  }
40602
40174
  return null;
40603
40175
  }
40604
- function setTriangle(tri, i, index, pos) {
40176
+ function setTriangle(tri, i, index2, pos) {
40605
40177
  const ta = tri.a;
40606
40178
  const tb = tri.b;
40607
40179
  const tc = tri.c;
40608
40180
  let i0 = i;
40609
40181
  let i1 = i + 1;
40610
40182
  let i2 = i + 2;
40611
- if (index) {
40612
- i0 = index.getX(i0);
40613
- i1 = index.getX(i1);
40614
- i2 = index.getX(i2);
40183
+ if (index2) {
40184
+ i0 = index2.getX(i0);
40185
+ i1 = index2.getX(i1);
40186
+ i2 = index2.getX(i2);
40615
40187
  }
40616
40188
  ta.x = pos.getX(i0);
40617
40189
  ta.y = pos.getY(i0);
@@ -40645,12 +40217,12 @@ var __publicField = (obj, key, value) => {
40645
40217
  }
40646
40218
  function iterateOverTriangles(offset, count, bvh, intersectsTriangleFunc, contained, depth, triangle3) {
40647
40219
  const { geometry } = bvh;
40648
- const { index } = geometry;
40220
+ const { index: index2 } = geometry;
40649
40221
  const pos = geometry.attributes.position;
40650
40222
  for (let i = offset, l = count + offset; i < l; i++) {
40651
40223
  let tri;
40652
40224
  tri = i;
40653
- setTriangle(triangle3, tri * 3, index, pos);
40225
+ setTriangle(triangle3, tri * 3, index2, pos);
40654
40226
  triangle3.needsUpdate = true;
40655
40227
  if (intersectsTriangleFunc(triangle3, tri, contained, depth)) {
40656
40228
  return true;
@@ -40689,10 +40261,10 @@ var __publicField = (obj, key, value) => {
40689
40261
  let maxy = -Infinity;
40690
40262
  let maxz = -Infinity;
40691
40263
  for (let i = 3 * offset, l = 3 * (offset + count); i < l; i++) {
40692
- let index = indexArr[i];
40693
- const x2 = posAttr.getX(index);
40694
- const y = posAttr.getY(index);
40695
- const z = posAttr.getZ(index);
40264
+ let index2 = indexArr[i];
40265
+ const x2 = posAttr.getX(index2);
40266
+ const y = posAttr.getY(index2);
40267
+ const z = posAttr.getZ(index2);
40696
40268
  if (x2 < minx)
40697
40269
  minx = x2;
40698
40270
  if (x2 > maxx)
@@ -40790,12 +40362,12 @@ var __publicField = (obj, key, value) => {
40790
40362
  }
40791
40363
  function iterateOverTriangles_indirect(offset, count, bvh, intersectsTriangleFunc, contained, depth, triangle3) {
40792
40364
  const { geometry } = bvh;
40793
- const { index } = geometry;
40365
+ const { index: index2 } = geometry;
40794
40366
  const pos = geometry.attributes.position;
40795
40367
  for (let i = offset, l = count + offset; i < l; i++) {
40796
40368
  let tri;
40797
40369
  tri = bvh.resolveTriangleIndex(i);
40798
- setTriangle(triangle3, tri * 3, index, pos);
40370
+ setTriangle(triangle3, tri * 3, index2, pos);
40799
40371
  triangle3.needsUpdate = true;
40800
40372
  if (intersectsTriangleFunc(triangle3, tri, contained, depth)) {
40801
40373
  return true;
@@ -40905,7 +40477,7 @@ var __publicField = (obj, key, value) => {
40905
40477
  const thisGeometry = bvh.geometry;
40906
40478
  const thisIndex = thisGeometry.index;
40907
40479
  const thisPos = thisGeometry.attributes.position;
40908
- const index = otherGeometry.index;
40480
+ const index2 = otherGeometry.index;
40909
40481
  const pos = otherGeometry.attributes.position;
40910
40482
  const offset = OFFSET(nodeIndex32, uint32Array);
40911
40483
  const count = COUNT(nodeIndex16, uint16Array);
@@ -40939,8 +40511,8 @@ var __publicField = (obj, key, value) => {
40939
40511
  triangle$1.b.applyMatrix4(invertedMat$1);
40940
40512
  triangle$1.c.applyMatrix4(invertedMat$1);
40941
40513
  triangle$1.needsUpdate = true;
40942
- for (let i2 = 0, l2 = index.count; i2 < l2; i2 += 3) {
40943
- setTriangle(triangle2$1, i2, index, pos);
40514
+ for (let i2 = 0, l2 = index2.count; i2 < l2; i2 += 3) {
40515
+ setTriangle(triangle2$1, i2, index2, pos);
40944
40516
  triangle2$1.needsUpdate = true;
40945
40517
  if (triangle$1.intersectsTriangle(triangle2$1)) {
40946
40518
  return true;
@@ -40977,7 +40549,7 @@ var __publicField = (obj, key, value) => {
40977
40549
  obb$3.needsUpdate = true;
40978
40550
  const geometry = bvh.geometry;
40979
40551
  const pos = geometry.attributes.position;
40980
- const index = geometry.index;
40552
+ const index2 = geometry.index;
40981
40553
  const otherPos = otherGeometry.attributes.position;
40982
40554
  const otherIndex = otherGeometry.index;
40983
40555
  const triangle3 = ExtendedTrianglePool.getPrimitive();
@@ -41029,7 +40601,7 @@ var __publicField = (obj, key, value) => {
41029
40601
  triangle22.c.applyMatrix4(geometryToBvh);
41030
40602
  triangle22.needsUpdate = true;
41031
40603
  for (let i = offset, l = offset + count; i < l; i++) {
41032
- setTriangle(triangle3, 3 * i, index, pos);
40604
+ setTriangle(triangle3, 3 * i, index2, pos);
41033
40605
  triangle3.needsUpdate = true;
41034
40606
  const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
41035
40607
  if (dist < closestDistance) {
@@ -41057,7 +40629,7 @@ var __publicField = (obj, key, value) => {
41057
40629
  triangle22.c.applyMatrix4(geometryToBvh);
41058
40630
  triangle22.needsUpdate = true;
41059
40631
  for (let i = offset, l = offset + count; i < l; i++) {
41060
- setTriangle(triangle3, 3 * i, index, pos);
40632
+ setTriangle(triangle3, 3 * i, index2, pos);
41061
40633
  triangle3.needsUpdate = true;
41062
40634
  const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
41063
40635
  if (dist < closestDistance) {
@@ -41134,11 +40706,11 @@ var __publicField = (obj, key, value) => {
41134
40706
  for (let i = offset, l = offset + count; i < l; i++) {
41135
40707
  const t2 = 3 * bvh.resolveTriangleIndex(i);
41136
40708
  for (let j = 0; j < 3; j++) {
41137
- let index = t2 + j;
41138
- index = indexArr ? indexArr[index] : index;
41139
- const x2 = posAttr.getX(index);
41140
- const y = posAttr.getY(index);
41141
- const z = posAttr.getZ(index);
40709
+ let index2 = t2 + j;
40710
+ index2 = indexArr ? indexArr[index2] : index2;
40711
+ const x2 = posAttr.getX(index2);
40712
+ const y = posAttr.getY(index2);
40713
+ const z = posAttr.getZ(index2);
41142
40714
  if (x2 < minx)
41143
40715
  minx = x2;
41144
40716
  if (x2 > maxx)
@@ -41311,7 +40883,7 @@ var __publicField = (obj, key, value) => {
41311
40883
  const thisGeometry = bvh.geometry;
41312
40884
  const thisIndex = thisGeometry.index;
41313
40885
  const thisPos = thisGeometry.attributes.position;
41314
- const index = otherGeometry.index;
40886
+ const index2 = otherGeometry.index;
41315
40887
  const pos = otherGeometry.attributes.position;
41316
40888
  const offset = OFFSET(nodeIndex32, uint32Array);
41317
40889
  const count = COUNT(nodeIndex16, uint16Array);
@@ -41346,8 +40918,8 @@ var __publicField = (obj, key, value) => {
41346
40918
  triangle.b.applyMatrix4(invertedMat);
41347
40919
  triangle.c.applyMatrix4(invertedMat);
41348
40920
  triangle.needsUpdate = true;
41349
- for (let i2 = 0, l2 = index.count; i2 < l2; i2 += 3) {
41350
- setTriangle(triangle2, i2, index, pos);
40921
+ for (let i2 = 0, l2 = index2.count; i2 < l2; i2 += 3) {
40922
+ setTriangle(triangle2, i2, index2, pos);
41351
40923
  triangle2.needsUpdate = true;
41352
40924
  if (triangle.intersectsTriangle(triangle2)) {
41353
40925
  return true;
@@ -41384,7 +40956,7 @@ var __publicField = (obj, key, value) => {
41384
40956
  obb$1.needsUpdate = true;
41385
40957
  const geometry = bvh.geometry;
41386
40958
  const pos = geometry.attributes.position;
41387
- const index = geometry.index;
40959
+ const index2 = geometry.index;
41388
40960
  const otherPos = otherGeometry.attributes.position;
41389
40961
  const otherIndex = otherGeometry.index;
41390
40962
  const triangle3 = ExtendedTrianglePool.getPrimitive();
@@ -41438,7 +41010,7 @@ var __publicField = (obj, key, value) => {
41438
41010
  triangle22.needsUpdate = true;
41439
41011
  for (let i = offset, l = offset + count; i < l; i++) {
41440
41012
  const ti = bvh.resolveTriangleIndex(i);
41441
- setTriangle(triangle3, 3 * ti, index, pos);
41013
+ setTriangle(triangle3, 3 * ti, index2, pos);
41442
41014
  triangle3.needsUpdate = true;
41443
41015
  const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
41444
41016
  if (dist < closestDistance) {
@@ -41467,7 +41039,7 @@ var __publicField = (obj, key, value) => {
41467
41039
  triangle22.needsUpdate = true;
41468
41040
  for (let i = offset, l = offset + count; i < l; i++) {
41469
41041
  const ti = bvh.resolveTriangleIndex(i);
41470
- setTriangle(triangle3, 3 * ti, index, pos);
41042
+ setTriangle(triangle3, 3 * ti, index2, pos);
41471
41043
  triangle3.needsUpdate = true;
41472
41044
  const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
41473
41045
  if (dist < closestDistance) {
@@ -41817,7 +41389,7 @@ var __publicField = (obj, key, value) => {
41817
41389
  indirect: Boolean(data.indirectBuffer),
41818
41390
  ...options
41819
41391
  };
41820
- const { index, roots, indirectBuffer } = data;
41392
+ const { index: index2, roots, indirectBuffer } = data;
41821
41393
  const bvh = new MeshBVH(geometry, { ...options, [SKIP_GENERATION]: true });
41822
41394
  bvh._roots = roots;
41823
41395
  bvh._indirectBuffer = indirectBuffer || null;
@@ -41826,8 +41398,8 @@ var __publicField = (obj, key, value) => {
41826
41398
  if (indexAttribute === null) {
41827
41399
  const newIndex = new BufferAttribute(data.index, 1, false);
41828
41400
  geometry.setIndex(newIndex);
41829
- } else if (indexAttribute.array !== index) {
41830
- indexAttribute.array.set(index);
41401
+ } else if (indexAttribute.array !== index2) {
41402
+ indexAttribute.array.set(index2);
41831
41403
  indexAttribute.needsUpdate = true;
41832
41404
  }
41833
41405
  }
@@ -42313,9 +41885,9 @@ var __publicField = (obj, key, value) => {
42313
41885
  }
42314
41886
  }
42315
41887
  dispose() {
42316
- const { index, position, bvhBounds, bvhContents } = this;
42317
- if (index)
42318
- index.dispose();
41888
+ const { index: index2, position, bvhBounds, bvhContents } = this;
41889
+ if (index2)
41890
+ index2.dispose();
42319
41891
  if (position)
42320
41892
  position.dispose();
42321
41893
  if (bvhBounds)
@@ -42869,6 +42441,24 @@ bool bvhIntersectFirstHit(
42869
42441
  }`
42870
42442
  );
42871
42443
  let lensMaterial;
42444
+ let orbitalMaterial;
42445
+ const defaultOrbitalMaterial = new MeshPhysicalMaterial({
42446
+ metalness: 0,
42447
+ roughness: 0.05,
42448
+ ior: 1,
42449
+ opacity: 0.6,
42450
+ clearcoat: 0,
42451
+ color: new Color(16777215),
42452
+ transparent: true,
42453
+ shadowSide: BackSide,
42454
+ depthWrite: true,
42455
+ map: null,
42456
+ alphaMap: null,
42457
+ aoMap: null,
42458
+ roughnessMap: null,
42459
+ metalnessMap: null,
42460
+ normalMap: null
42461
+ });
42872
42462
  let envMap;
42873
42463
  const positions = [0, 0.4, 0.7, 1];
42874
42464
  const opacities = [0.85, 0.62, 0.3, 0];
@@ -42909,9 +42499,11 @@ bool bvhIntersectFirstHit(
42909
42499
  __publicField2(this, "canvasSize");
42910
42500
  __publicField2(this, "isInitialised");
42911
42501
  __publicField2(this, "orgId");
42502
+ __publicField2(this, "textureLoader");
42912
42503
  this.scene = new Scene();
42913
42504
  this.canvasSize = new Vector2();
42914
42505
  this.isInitialised = false;
42506
+ this.textureLoader = new TextureLoader();
42915
42507
  this.orgId = "";
42916
42508
  }
42917
42509
  async intialize() {
@@ -43006,51 +42598,87 @@ bool bvhIntersectFirstHit(
43006
42598
  });
43007
42599
  }
43008
42600
  async loadFirstFrame(orgId, frame) {
43009
- var _a2, _b2;
43010
42601
  if (frame && orgId) {
43011
42602
  const apiRes = await this.downloadModel(orgId, frame._id);
43012
- const specialLens = ((_a2 = frame.customisation) == null ? void 0 : _a2.length) == 0;
43013
- const includedLens = specialLens ? null : (_b2 = frame.customisation) == null ? void 0 : _b2.find((x2) => x2.type == "Lens");
43014
- await this.renderModel(apiRes.asset.cloudfrontUrl, specialLens, apiRes.decryptionKey).then(() => {
43015
- if (includedLens) {
43016
- this.setupLensMaterial(
43017
- includedLens
43018
- );
43019
- }
42603
+ const customLensMaterial = frame.customisation.find((x2) => x2.type == "Lens");
42604
+ const customOrbitalMaterial = frame.customisation.find((x2) => x2.type == "Orbital");
42605
+ await this.renderModel(apiRes.asset.cloudfrontUrl, false, apiRes.decryptionKey).then(async () => {
42606
+ return new Promise(async (res, rej) => {
42607
+ if (customLensMaterial) {
42608
+ this.setupLensMaterial(customLensMaterial);
42609
+ res();
42610
+ } else {
42611
+ res();
42612
+ }
42613
+ if (customOrbitalMaterial) {
42614
+ await this.setupOrbitalMaterial(customOrbitalMaterial).then(() => {
42615
+ res();
42616
+ });
42617
+ } else {
42618
+ res();
42619
+ }
42620
+ });
43020
42621
  });
43021
42622
  } else {
43022
42623
  return;
43023
42624
  }
43024
42625
  }
43025
- async changeFrame(orgId, frame, selectedLens) {
42626
+ async changeFrame(orgId, frame, selectedCustomisations) {
43026
42627
  if (frame && orgId) {
43027
42628
  const apiRes = await this.downloadModel(orgId, frame._id);
43028
- const specialLens = frame.customisation.length == 0;
43029
- const customLensMaterial = specialLens ? null : frame.customisation.find((x2) => x2.type == "Lens");
43030
- const renderAsIs = specialLens && selectedLens.sku == "lens-default";
42629
+ const selectedLens = selectedCustomisations.find((x2) => x2.type == "Lens");
42630
+ const selectedOrbital = selectedCustomisations.find((x2) => x2.type == "Orbital");
42631
+ const customLensMaterial = frame.customisation.find((x2) => x2.type == "Lens");
42632
+ const customOrbitalMaterial = frame.customisation.find((x2) => x2.type == "Orbital");
42633
+ const renderAsIs = customLensMaterial == null && selectedLens.sku == "lens-default";
43031
42634
  await this.renderModel(apiRes.asset.cloudfrontUrl, renderAsIs, apiRes.decryptionKey).then(async () => {
43032
- if (selectedLens.sku == "lens-default") {
43033
- if (customLensMaterial) {
43034
- this.setupLensMaterial(customLensMaterial);
42635
+ return new Promise(async (res, rej) => {
42636
+ if (selectedLens.sku == "lens-default") {
42637
+ if (customLensMaterial) {
42638
+ this.setupLensMaterial(customLensMaterial);
42639
+ res();
42640
+ } else {
42641
+ res();
42642
+ }
42643
+ } else {
42644
+ this.setupLensMaterial(selectedLens);
42645
+ res();
43035
42646
  }
43036
- } else {
43037
- this.setupLensMaterial(selectedLens);
43038
- }
42647
+ if ((selectedOrbital == null ? void 0 : selectedOrbital.sku) == "orbital-default") {
42648
+ if (customOrbitalMaterial) {
42649
+ await this.setupOrbitalMaterial(customOrbitalMaterial).then(() => {
42650
+ res();
42651
+ });
42652
+ }
42653
+ } else {
42654
+ await this.setupOrbitalMaterial(selectedOrbital).then(() => {
42655
+ res();
42656
+ });
42657
+ }
42658
+ });
43039
42659
  });
43040
42660
  }
43041
42661
  }
43042
- async changeLens(lens, orgId, reloadNeeded, frame) {
42662
+ async changeLens(customisations, orgId, reloadNeeded, frame) {
43043
42663
  return new Promise((res, rej) => {
43044
42664
  if (reloadNeeded) {
43045
- this.changeFrame(orgId, frame, lens).then(() => {
42665
+ this.changeFrame(orgId, frame, customisations).then(() => {
43046
42666
  res();
43047
42667
  });
43048
42668
  } else {
42669
+ const lens = customisations.find((x2) => x2.type == "Lens");
43049
42670
  this.setupLensMaterial(lens);
43050
42671
  res();
43051
42672
  }
43052
42673
  });
43053
42674
  }
42675
+ async changeOrbital(orbital) {
42676
+ return new Promise(async (res, rej) => {
42677
+ await this.setupOrbitalMaterial(orbital).then(() => {
42678
+ res();
42679
+ });
42680
+ });
42681
+ }
43054
42682
  async renderModel(modelContent, renderAsIs, decryptionKey) {
43055
42683
  const loader = new GLTFLoader();
43056
42684
  if (modelContent) {
@@ -43197,6 +42825,14 @@ bool bvhIntersectFirstHit(
43197
42825
  lensMaterial.needsUpdate = true;
43198
42826
  }
43199
42827
  }
42828
+ if (node.material && node.material.name.toLowerCase() == "frame-stems") {
42829
+ orbitalMaterial = defaultOrbitalMaterial;
42830
+ orbitalMaterial.envMap = this.scene.environment;
42831
+ node.material = orbitalMaterial;
42832
+ node.matrixAutoUpdate = true;
42833
+ orbitalMaterial.matrixAutoUpdate = true;
42834
+ orbitalMaterial.needsUpdate = true;
42835
+ }
43200
42836
  if (node.material && node.name === "Diamonds") {
43201
42837
  this.initGemstoneDependencies();
43202
42838
  gemstoneMaterial.uniforms.bvh.value = new MeshBVHUniformStruct();
@@ -43248,12 +42884,12 @@ bool bvhIntersectFirstHit(
43248
42884
  } else if (selectedLens.direction == "tb") {
43249
42885
  const gradientColors = selectedLens.gradientColors;
43250
42886
  gu.uAlpha.value = true;
43251
- let index = 0;
42887
+ let index2 = 0;
43252
42888
  gradientColors.forEach(() => {
43253
- gu.colors.value[index] = new Color(gradientColors[index].color);
43254
- gu.positions.value[index] = gradientColors[index].position;
43255
- gu.opacities.value[index] = gradientColors[index].alpha;
43256
- index++;
42889
+ gu.colors.value[index2] = new Color(gradientColors[index2].color);
42890
+ gu.positions.value[index2] = gradientColors[index2].position;
42891
+ gu.opacities.value[index2] = gradientColors[index2].alpha;
42892
+ index2++;
43257
42893
  });
43258
42894
  }
43259
42895
  if (selectedLens.finish == "MIRBLKHMC") {
@@ -43270,6 +42906,83 @@ bool bvhIntersectFirstHit(
43270
42906
  lensMaterial.metalness = selectedLens.metalness;
43271
42907
  }
43272
42908
  }
42909
+ async downloadTexture(url) {
42910
+ let tex;
42911
+ return await this.textureLoader.loadAsync(url).then((texture) => {
42912
+ texture.colorSpace = SRGBColorSpace;
42913
+ texture.flipY = false;
42914
+ texture.magFilter = NearestFilter;
42915
+ texture.wrapS = ClampToEdgeWrapping;
42916
+ texture.wrapT = ClampToEdgeWrapping;
42917
+ tex = texture;
42918
+ }).then(() => tex);
42919
+ }
42920
+ resetOrbitalMaterial(mat) {
42921
+ mat.metalness = 0;
42922
+ mat.roughness = 0.05;
42923
+ mat.ior = 1;
42924
+ mat.opacity = 1;
42925
+ mat.clearcoat = 0;
42926
+ mat.color = new Color(16777215);
42927
+ mat.transparent = false;
42928
+ mat.shadowSide = BackSide;
42929
+ mat.depthWrite = true;
42930
+ mat.map = null;
42931
+ mat.alphaMap = null;
42932
+ mat.aoMap = null;
42933
+ mat.roughnessMap = null;
42934
+ mat.metalnessMap = null;
42935
+ mat.normalMap = null;
42936
+ mat.transmission = 0;
42937
+ }
42938
+ async setupOrbitalMaterial(selectedOrbital) {
42939
+ if (orbitalMaterial) {
42940
+ this.resetOrbitalMaterial(orbitalMaterial);
42941
+ if (selectedOrbital.texture) {
42942
+ if (selectedOrbital.texture.baseColor) {
42943
+ await this.downloadTexture(selectedOrbital.texture.baseColor).then((texture) => {
42944
+ orbitalMaterial.map = texture;
42945
+ });
42946
+ }
42947
+ if (selectedOrbital.texture.opacity) {
42948
+ await this.downloadTexture(selectedOrbital.texture.opacity).then((texture) => {
42949
+ orbitalMaterial.alphaMap = texture;
42950
+ });
42951
+ }
42952
+ if (selectedOrbital.texture.thickness) {
42953
+ await this.downloadTexture(selectedOrbital.texture.thickness).then((texture) => {
42954
+ orbitalMaterial.thicknessMap = texture;
42955
+ });
42956
+ }
42957
+ if (selectedOrbital.texture.orm) {
42958
+ await this.downloadTexture(selectedOrbital.texture.orm).then((texture) => {
42959
+ orbitalMaterial.aoMap = texture;
42960
+ orbitalMaterial.roughnessMap = texture;
42961
+ orbitalMaterial.metalnessMap = texture;
42962
+ });
42963
+ } else {
42964
+ orbitalMaterial.roughness = selectedOrbital.roughness;
42965
+ orbitalMaterial.metalness = selectedOrbital.metalness;
42966
+ }
42967
+ } else {
42968
+ orbitalMaterial.color = new Color(selectedOrbital.color);
42969
+ orbitalMaterial.roughness = selectedOrbital.roughness;
42970
+ orbitalMaterial.metalness = selectedOrbital.metalness;
42971
+ }
42972
+ if (selectedOrbital.ior > 1) {
42973
+ orbitalMaterial.ior = selectedOrbital.ior;
42974
+ orbitalMaterial.transmission = 1;
42975
+ orbitalMaterial.transparent = true;
42976
+ orbitalMaterial.thickness = 0.05;
42977
+ } else {
42978
+ orbitalMaterial.ior = 1;
42979
+ orbitalMaterial.transmission = 0;
42980
+ orbitalMaterial.transparent = false;
42981
+ orbitalMaterial.opacity = selectedOrbital.opacity;
42982
+ }
42983
+ orbitalMaterial.clearcoat = 0;
42984
+ }
42985
+ }
43273
42986
  setupAndRenderScene() {
43274
42987
  if (!this.camera || !this.renderer)
43275
42988
  return;
@@ -43465,7 +43178,7 @@ bool bvhIntersectFirstHit(
43465
43178
  this.customRenderer.setupAndRenderScene();
43466
43179
  }
43467
43180
  }
43468
- loadFirstFrame(orgId, assetDetails) {
43181
+ loadFirstFrame(orgId, assetDetails, customisationArr) {
43469
43182
  return new Promise((res, rej) => {
43470
43183
  this.customRenderer.loadFirstFrame(orgId, assetDetails).then(() => {
43471
43184
  res(1);
@@ -43474,11 +43187,14 @@ bool bvhIntersectFirstHit(
43474
43187
  });
43475
43188
  });
43476
43189
  }
43477
- changeFrame(orgId, frame, lens) {
43478
- return this.customRenderer.changeFrame(orgId, frame, lens);
43190
+ changeFrame(orgId, frame, customisations) {
43191
+ return this.customRenderer.changeFrame(orgId, frame, customisations);
43479
43192
  }
43480
- changeLens(lens, orgId, reloadNeeded, frame) {
43481
- return this.customRenderer.changeLens(lens, orgId, reloadNeeded, frame);
43193
+ changeLens(customisations, orgId, reloadNeeded, frame) {
43194
+ return this.customRenderer.changeLens(customisations, orgId, reloadNeeded, frame);
43195
+ }
43196
+ changeOrbital(orbital) {
43197
+ return this.customRenderer.changeOrbital(orbital);
43482
43198
  }
43483
43199
  }
43484
43200
  class DOMService {
@@ -43519,14 +43235,17 @@ bool bvhIntersectFirstHit(
43519
43235
  this.customisationArr = param.data.customisation;
43520
43236
  this.prepareDOM();
43521
43237
  await this.rendererService.Init();
43522
- await this.rendererService.loadFirstFrame(this.orgId, this.assetDetails);
43238
+ await this.rendererService.loadFirstFrame(this.orgId, this.assetDetails, this.customisationArr);
43523
43239
  return this;
43524
43240
  }
43525
- changeFrame(frame, lens) {
43526
- return this.rendererService.changeFrame(this.orgId, frame, lens);
43241
+ changeFrame(frame, customisations) {
43242
+ return this.rendererService.changeFrame(this.orgId, frame, customisations);
43243
+ }
43244
+ changeLens(customisations, reloadNeeded, frame) {
43245
+ return this.rendererService.changeLens(customisations, this.orgId, reloadNeeded, frame);
43527
43246
  }
43528
- changeLens(lens, reloadNeeded, frame) {
43529
- return this.rendererService.changeLens(lens, this.orgId, reloadNeeded, frame);
43247
+ changeOrbital(orbital) {
43248
+ return this.rendererService.changeOrbital(orbital);
43530
43249
  }
43531
43250
  unmount() {
43532
43251
  if (this.containerElement) {
@@ -43577,12 +43296,583 @@ bool bvhIntersectFirstHit(
43577
43296
  }
43578
43297
  }
43579
43298
  window.ThreeDConfigurator = ThreeDConfigurator;
43299
+ const MainContainer$1 = "";
43300
+ const index$3 = "";
43301
+ function FramePalette({
43302
+ frameList,
43303
+ selectedFrame,
43304
+ modelLoading,
43305
+ onChangeFrame
43306
+ }) {
43307
+ const isMobileView = window.innerWidth <= 576;
43308
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
43309
+ "div",
43310
+ {
43311
+ className: "sprie-config-palette",
43312
+ style: {
43313
+ padding: "0 4rem 1.6rem 4rem",
43314
+ marginTop: isMobileView ? "1rem" : "0"
43315
+ },
43316
+ children: frameList == null ? void 0 : frameList.map((e) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-palette-img-box", children: [
43317
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43318
+ "button",
43319
+ {
43320
+ style: {
43321
+ border: "0",
43322
+ cursor: modelLoading ? "default" : "pointer",
43323
+ opacity: (selectedFrame == null ? void 0 : selectedFrame._id) === e._id ? "1" : ".6"
43324
+ },
43325
+ onClick: () => onChangeFrame(e),
43326
+ disabled: modelLoading,
43327
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43328
+ "img",
43329
+ {
43330
+ src: e.variantImage,
43331
+ alt: e.name + "image",
43332
+ width: 60,
43333
+ height: 60,
43334
+ style: {
43335
+ transform: (selectedFrame == null ? void 0 : selectedFrame._id) === e._id ? "scale(1.2,1.2)" : "scale(1,1)"
43336
+ }
43337
+ }
43338
+ )
43339
+ }
43340
+ ),
43341
+ (selectedFrame == null ? void 0 : selectedFrame._id) === e._id && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "sprie-config-palette-img-text", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sprie-config-palette-imgName", children: e.name }) })
43342
+ ] }, e._id))
43343
+ }
43344
+ );
43345
+ }
43346
+ function LensPalette({
43347
+ lensList,
43348
+ selectedLens,
43349
+ modelLoading,
43350
+ onChangeLens
43351
+ }) {
43352
+ const isMobileView = window.innerWidth <= 576;
43353
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
43354
+ "div",
43355
+ {
43356
+ className: "sprie-config-palette",
43357
+ style: {
43358
+ padding: "0 1.2rem 1.6rem 1.2rem",
43359
+ marginTop: isMobileView ? "1rem" : "0",
43360
+ gap: isMobileView ? ".3rem" : "1rem"
43361
+ },
43362
+ children: lensList == null ? void 0 : lensList.map((e) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-palette-img-box", children: [
43363
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43364
+ "button",
43365
+ {
43366
+ style: {
43367
+ border: "0",
43368
+ cursor: modelLoading ? "default" : "pointer",
43369
+ opacity: (selectedLens == null ? void 0 : selectedLens._id) === e._id ? "1" : ".6"
43370
+ },
43371
+ onClick: () => onChangeLens(e),
43372
+ disabled: modelLoading,
43373
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43374
+ "img",
43375
+ {
43376
+ src: e.thumbnail,
43377
+ alt: e.name + "image",
43378
+ width: isMobileView ? 45 : 60,
43379
+ height: isMobileView ? 45 : 60,
43380
+ style: {
43381
+ border: (selectedLens == null ? void 0 : selectedLens._id) === e._id ? "1px solid #9d9b9c" : "0",
43382
+ borderRadius: "50%",
43383
+ padding: "1px"
43384
+ }
43385
+ }
43386
+ )
43387
+ }
43388
+ ),
43389
+ (selectedLens == null ? void 0 : selectedLens._id) === e._id && /* @__PURE__ */ jsxRuntimeExports.jsx(
43390
+ "p",
43391
+ {
43392
+ className: "sprie-config-palette-img-text",
43393
+ style: { bottom: "-1.2rem" },
43394
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sprie-config-palette-imgName", children: e.name })
43395
+ }
43396
+ )
43397
+ ] }, e._id))
43398
+ }
43399
+ );
43400
+ }
43401
+ const index$2 = "";
43402
+ function LaserEngraving({ heading, onChecked, onTextAdded }) {
43403
+ const [input, setInput] = reactExports.useState("");
43404
+ const [isChecked, setIsChecked] = reactExports.useState(false);
43405
+ reactExports.useEffect(() => {
43406
+ onChecked(isChecked);
43407
+ });
43408
+ reactExports.useEffect(() => {
43409
+ onTextAdded(input);
43410
+ }, [input]);
43411
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-engraving-block", style: { marginTop: ".5rem" }, children: [
43412
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: ".8rem" }, children: [
43413
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43414
+ "input",
43415
+ {
43416
+ type: "checkbox",
43417
+ className: "sprie-config-engraving-checkbox",
43418
+ onChange: (e) => {
43419
+ setIsChecked(e.target.checked);
43420
+ },
43421
+ checked: isChecked
43422
+ }
43423
+ ),
43424
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { style: { fontSize: ".9rem", color: "#4d4d4d", fontWeight: "500" }, children: [
43425
+ "Add ",
43426
+ "Laser Engraving",
43427
+ " ",
43428
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontWeight: "400" }, children: "(OPTIONAL)" })
43429
+ ] })
43430
+ ] }),
43431
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-engraving-inputField-block", children: [
43432
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43433
+ "input",
43434
+ {
43435
+ type: "text",
43436
+ className: "sprie-config-engraving-inputField",
43437
+ placeholder: "ADD CUSTOM TEXT",
43438
+ value: input,
43439
+ onChange: (e) => setInput(e.target.value),
43440
+ maxLength: 15,
43441
+ style: { padding: "0.7rem" },
43442
+ disabled: !isChecked
43443
+ }
43444
+ ),
43445
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sprie-config-engraving-inputInfo", children: `${input.length}/15 characters` }),
43446
+ /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "#", className: "sprie-config-engraving-link", children: "About Custom Laser Engraving" })
43447
+ ] })
43448
+ ] });
43449
+ }
43450
+ const index$1 = "";
43451
+ function StepTracker({
43452
+ totalSteps,
43453
+ currentStep
43454
+ }) {
43455
+ const isMobileView = window.innerWidth <= 576;
43456
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
43457
+ "div",
43458
+ {
43459
+ className: "step-tracker-block",
43460
+ style: {
43461
+ margin: isMobileView ? "1rem 0" : ".7rem 0 1rem 0",
43462
+ paddingBottom: "1.5rem"
43463
+ },
43464
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "step-tracker", children: Array.from({ length: totalSteps }).map((_, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43465
+ "div",
43466
+ {
43467
+ className: `step-circle ${index2 + 1 === currentStep ? "active" : ""}`
43468
+ },
43469
+ index2
43470
+ )) })
43471
+ }
43472
+ );
43473
+ }
43474
+ function CarouselHeader({
43475
+ nextSlide,
43476
+ previousSlide,
43477
+ currentIndex,
43478
+ stepsName,
43479
+ isLastStep
43480
+ }) {
43481
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "carousel-header", children: [
43482
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43483
+ "button",
43484
+ {
43485
+ className: "carousel-btn prev",
43486
+ onClick: previousSlide,
43487
+ style: { visibility: currentIndex !== 0 ? "visible" : "hidden" },
43488
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43489
+ "i",
43490
+ {
43491
+ className: "arrow left-arrow",
43492
+ style: {
43493
+ padding: ".25rem"
43494
+ /* 4px */
43495
+ }
43496
+ }
43497
+ )
43498
+ }
43499
+ ),
43500
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
43501
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "step-syntax", children: `STEP ${currentIndex + 1}: ` }),
43502
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "select-syntax", children: stepsName[currentIndex] })
43503
+ ] }),
43504
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43505
+ "button",
43506
+ {
43507
+ className: "carousel-btn next",
43508
+ onClick: nextSlide,
43509
+ style: {
43510
+ visibility: isLastStep ? "hidden" : "visible"
43511
+ },
43512
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43513
+ "i",
43514
+ {
43515
+ className: "arrow right-arrow",
43516
+ style: {
43517
+ padding: ".25rem"
43518
+ /* 4px */
43519
+ }
43520
+ }
43521
+ )
43522
+ }
43523
+ )
43524
+ ] });
43525
+ }
43526
+ function Carousel({
43527
+ setShowAddToCart,
43528
+ children
43529
+ }) {
43530
+ var _a2;
43531
+ const [currentIndex, setCurrentIndex] = reactExports.useState(0);
43532
+ const carouselElements = React.Children.toArray(children);
43533
+ const isLastStep = !(currentIndex !== carouselElements.length - 1);
43534
+ const stepsName = (_a2 = carouselElements.map((child) => child)) == null ? void 0 : _a2.map((e) => e.props.heading);
43535
+ const goToPreviousSlide = () => {
43536
+ setCurrentIndex(
43537
+ (prevIndex) => prevIndex === 0 ? React.Children.count(children) - 1 : prevIndex - 1
43538
+ );
43539
+ };
43540
+ const goToNextSlide = () => {
43541
+ setCurrentIndex(
43542
+ (prevIndex) => prevIndex === React.Children.count(children) - 1 ? 0 : prevIndex + 1
43543
+ );
43544
+ };
43545
+ reactExports.useEffect(() => {
43546
+ if (isLastStep) {
43547
+ setShowAddToCart(true);
43548
+ } else {
43549
+ setShowAddToCart(false);
43550
+ }
43551
+ }, [isLastStep, setShowAddToCart]);
43552
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "carousel", children: [
43553
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43554
+ CarouselHeader,
43555
+ {
43556
+ nextSlide: goToNextSlide,
43557
+ previousSlide: goToPreviousSlide,
43558
+ currentIndex,
43559
+ stepsName,
43560
+ isLastStep
43561
+ }
43562
+ ),
43563
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43564
+ StepTracker,
43565
+ {
43566
+ totalSteps: stepsName == null ? void 0 : stepsName.length,
43567
+ currentStep: currentIndex + 1
43568
+ }
43569
+ ),
43570
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "carousel-container", children: carouselElements.map((child, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43571
+ "div",
43572
+ {
43573
+ className: "carousel-item",
43574
+ style: {
43575
+ transform: `translateX(-${currentIndex * 100}%)`
43576
+ },
43577
+ children: child
43578
+ },
43579
+ index2
43580
+ )) })
43581
+ ] });
43582
+ }
43583
+ const index = "";
43584
+ function AddToCartBtn() {
43585
+ const [isChecked, setIsChecked] = reactExports.useState(false);
43586
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-add-to-cart-block", children: [
43587
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
43588
+ "label",
43589
+ {
43590
+ htmlFor: "Sprie-Config-return-policy-checkbox",
43591
+ id: "Sprie-Config-return-policy-label",
43592
+ children: [
43593
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43594
+ "input",
43595
+ {
43596
+ type: "checkbox",
43597
+ id: "Sprie-Config-return-policy-checkbox",
43598
+ name: "sprie-config-return-policy-checkbox",
43599
+ onChange: (e) => setIsChecked(e.target.checked),
43600
+ checked: isChecked
43601
+ }
43602
+ ),
43603
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
43604
+ "I agree this customized Item cannot be returned or exchanged.",
43605
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "red" }, children: "*" })
43606
+ ] })
43607
+ ]
43608
+ }
43609
+ ),
43610
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "sprie-config-add-to-cart-btn", disabled: !isChecked, children: "ADD TO CART" })
43611
+ ] });
43612
+ }
43613
+ function OrbitalPalette({
43614
+ orbitalList,
43615
+ selectedOrbital,
43616
+ modelLoading,
43617
+ onChangeOrbital
43618
+ }) {
43619
+ const isMobileView = window.innerWidth <= 576;
43620
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
43621
+ "div",
43622
+ {
43623
+ className: "sprie-config-palette",
43624
+ style: {
43625
+ padding: "0 1.2rem 1.6rem 1.2rem",
43626
+ marginTop: isMobileView ? "1rem" : "0",
43627
+ gap: isMobileView ? ".3rem" : "1rem"
43628
+ },
43629
+ children: orbitalList == null ? void 0 : orbitalList.map((e) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sprie-config-palette-img-box", children: [
43630
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43631
+ "button",
43632
+ {
43633
+ style: {
43634
+ border: "0",
43635
+ cursor: modelLoading ? "default" : "pointer",
43636
+ opacity: (selectedOrbital == null ? void 0 : selectedOrbital._id) === e._id ? "1" : ".6"
43637
+ },
43638
+ onClick: () => onChangeOrbital(e),
43639
+ disabled: modelLoading,
43640
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43641
+ "img",
43642
+ {
43643
+ src: e.thumbnail,
43644
+ alt: e.name + "image",
43645
+ width: isMobileView ? 45 : 60,
43646
+ height: isMobileView ? 45 : 60,
43647
+ style: {
43648
+ border: (selectedOrbital == null ? void 0 : selectedOrbital._id) === e._id ? "1px solid #9d9b9c" : "0",
43649
+ borderRadius: "50%",
43650
+ padding: "1px"
43651
+ }
43652
+ }
43653
+ )
43654
+ }
43655
+ ),
43656
+ (selectedOrbital == null ? void 0 : selectedOrbital._id) === e._id && /* @__PURE__ */ jsxRuntimeExports.jsx(
43657
+ "p",
43658
+ {
43659
+ className: "sprie-config-palette-img-text",
43660
+ style: { bottom: "-1.2rem" },
43661
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "sprie-config-palette-imgName", children: e.name })
43662
+ }
43663
+ )
43664
+ ] }, e._id))
43665
+ }
43666
+ );
43667
+ }
43668
+ const ditaLogo = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K";
43669
+ const deg360_Icon = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K";
43670
+ function MainContainer({
43671
+ orgName,
43672
+ customEvent,
43673
+ apiService: apiService2,
43674
+ frameList,
43675
+ lensList,
43676
+ orbitalList,
43677
+ showOrbitalList,
43678
+ viewerOnly,
43679
+ domService,
43680
+ ThreeDConfigurator: ThreeDConfigurator2
43681
+ }) {
43682
+ const [selectedFrame, setSelectedFrame] = reactExports.useState();
43683
+ const [selectedLens, setSelectedLens] = reactExports.useState();
43684
+ const [selectedOrbital, setSelectedOrbital] = reactExports.useState();
43685
+ const [modelLoading, setModelLoading] = reactExports.useState(false);
43686
+ const [showAddToCart, setShowAddToCart] = reactExports.useState(false);
43687
+ const domInstance = reactExports.useRef();
43688
+ domInstance.current = domService;
43689
+ const isMobileView = window.innerWidth <= 576;
43690
+ const windowHeight = window.innerHeight / 16;
43691
+ const occupiedHeight = isMobileView ? showAddToCart ? (336 + 84) / 16 : (280 + 84) / 16 : (240 + 88) / 16;
43692
+ const onChangeFrame = async (frame, reload) => {
43693
+ if (frame._id === (selectedFrame == null ? void 0 : selectedFrame._id) && !reload) {
43694
+ return;
43695
+ }
43696
+ if (!domInstance.current)
43697
+ return;
43698
+ setModelLoading(true);
43699
+ domInstance.current.changeFrame(frame, [selectedLens, selectedOrbital]).then(() => {
43700
+ setModelLoading(false);
43701
+ });
43702
+ setSelectedFrame(frame);
43703
+ };
43704
+ const getLensInfo = (frame) => {
43705
+ const hasSpecialDefaultLens = (frame == null ? void 0 : frame.customisation.length) == 0;
43706
+ const includedLens = hasSpecialDefaultLens ? null : frame == null ? void 0 : frame.customisation.find((x2) => x2.type == "Lens");
43707
+ return includedLens;
43708
+ };
43709
+ const getOrbitalInfo = (frame) => {
43710
+ const includedOrbital = frame == null ? void 0 : frame.customisation.find((x2) => x2.type == "Orbital");
43711
+ return includedOrbital;
43712
+ };
43713
+ const onChangeLens = async (requestedLens) => {
43714
+ if (!domInstance.current) {
43715
+ return;
43716
+ }
43717
+ if (requestedLens == selectedLens) {
43718
+ return;
43719
+ }
43720
+ const isDefaultRequested = requestedLens.sku == "lens-default";
43721
+ const frameDefaultLens = getLensInfo(selectedFrame);
43722
+ if (!frameDefaultLens && isDefaultRequested) {
43723
+ setModelLoading(true);
43724
+ domInstance.current.changeLens([requestedLens, selectedOrbital], true, selectedFrame).then(() => {
43725
+ setModelLoading(false);
43726
+ });
43727
+ } else if (!frameDefaultLens && !isDefaultRequested) {
43728
+ if ((selectedLens == null ? void 0 : selectedLens.sku) == "lens-default") {
43729
+ setModelLoading(true);
43730
+ domInstance.current.changeLens([requestedLens, selectedOrbital], true, selectedFrame).then(() => {
43731
+ setModelLoading(false);
43732
+ });
43733
+ } else {
43734
+ domInstance.current.changeLens([requestedLens, selectedOrbital], false, selectedFrame);
43735
+ }
43736
+ } else if (frameDefaultLens && isDefaultRequested) {
43737
+ domInstance.current.changeLens([frameDefaultLens, selectedOrbital], false, selectedFrame);
43738
+ } else {
43739
+ domInstance.current.changeLens([requestedLens, selectedOrbital], false, selectedFrame);
43740
+ }
43741
+ setSelectedLens(requestedLens);
43742
+ };
43743
+ const onChangeOrbital = async (requestedOrbital) => {
43744
+ if (!domInstance.current) {
43745
+ return;
43746
+ }
43747
+ if (requestedOrbital == selectedOrbital) {
43748
+ return;
43749
+ }
43750
+ const isDefaultRequested = requestedOrbital.sku == "orbital-default";
43751
+ const frameDefaultOrbital = getOrbitalInfo(selectedFrame);
43752
+ setModelLoading(true);
43753
+ if (isDefaultRequested) {
43754
+ await domInstance.current.changeOrbital(frameDefaultOrbital).then(() => {
43755
+ setModelLoading(false);
43756
+ });
43757
+ } else {
43758
+ await domInstance.current.changeOrbital(requestedOrbital).then(() => {
43759
+ setModelLoading(false);
43760
+ });
43761
+ }
43762
+ setSelectedOrbital(requestedOrbital);
43763
+ };
43764
+ const onEngravingChecked = (checked) => {
43765
+ console.log(checked);
43766
+ };
43767
+ const onEngravingTextAdded = (text) => {
43768
+ console.log(text);
43769
+ };
43770
+ reactExports.useEffect(() => {
43771
+ frameList && setSelectedFrame(frameList[0]);
43772
+ lensList && setSelectedLens(lensList[0]);
43773
+ orbitalList && setSelectedOrbital(orbitalList[0]);
43774
+ }, [frameList, lensList, orbitalList]);
43775
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { id: "Sprie-config-Main-Container", children: [
43776
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("header", { id: "Sprie-config-Header", children: [
43777
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43778
+ "img",
43779
+ {
43780
+ src: ditaLogo,
43781
+ alt: "dita-logo",
43782
+ height: 20
43783
+ }
43784
+ ),
43785
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "sprie-config-Header-groupName", children: [
43786
+ orgName,
43787
+ " CUSTOMIZER"
43788
+ ] })
43789
+ ] }),
43790
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
43791
+ "div",
43792
+ {
43793
+ id: "Sprie-config-Viewer-Container",
43794
+ style: { height: `calc(${windowHeight}rem - ${occupiedHeight}rem)` },
43795
+ children: [
43796
+ /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: deg360_Icon, alt: "360deg-logo", height: 34 }),
43797
+ modelLoading && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-loadingFrame", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sprie-config-loader" }) }),
43798
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, id: "holder-canvas" })
43799
+ ]
43800
+ }
43801
+ ),
43802
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
43803
+ "div",
43804
+ {
43805
+ id: "Sprie-config-Customisation-block",
43806
+ style: {
43807
+ paddingTop: "1.5rem",
43808
+ height: isMobileView ? showAddToCart ? "21rem" : "17.5rem" : "15rem"
43809
+ },
43810
+ children: [
43811
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
43812
+ "div",
43813
+ {
43814
+ className: "sprie-config-price-block",
43815
+ style: { top: isMobileView || !showAddToCart ? "-3rem" : "-8.5rem" },
43816
+ children: [
43817
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { marginRight: ".8rem" }, children: "$925.00 USD" }),
43818
+ !isMobileView && showAddToCart && /* @__PURE__ */ jsxRuntimeExports.jsx(AddToCartBtn, {}),
43819
+ showAddToCart && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { marginRight: ".8rem", fontSize: ".6rem" }, children: "Please Allow 7-10 Days for Customization Process." })
43820
+ ]
43821
+ }
43822
+ ),
43823
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Carousel, { setShowAddToCart, children: [
43824
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43825
+ FramePalette,
43826
+ {
43827
+ modelLoading,
43828
+ frameList,
43829
+ selectedFrame,
43830
+ onChangeFrame,
43831
+ heading: "SELECT FRAME"
43832
+ }
43833
+ ),
43834
+ showOrbitalList && /* @__PURE__ */ jsxRuntimeExports.jsx(
43835
+ OrbitalPalette,
43836
+ {
43837
+ orbitalList,
43838
+ selectedOrbital,
43839
+ modelLoading,
43840
+ onChangeOrbital,
43841
+ heading: "SELECT ORBITAL"
43842
+ }
43843
+ ),
43844
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43845
+ LensPalette,
43846
+ {
43847
+ modelLoading,
43848
+ lensList,
43849
+ selectedLens,
43850
+ onChangeLens,
43851
+ heading: "SELECT LENS COLOR"
43852
+ }
43853
+ ),
43854
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43855
+ LaserEngraving,
43856
+ {
43857
+ heading: "LASER ENGRAVING",
43858
+ onChecked: onEngravingChecked,
43859
+ onTextAdded: onEngravingTextAdded
43860
+ }
43861
+ )
43862
+ ] }),
43863
+ isMobileView && showAddToCart && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { position: "absolute", bottom: "0", width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AddToCartBtn, {}) })
43864
+ ]
43865
+ }
43866
+ )
43867
+ ] });
43868
+ }
43580
43869
  function App({ apiService: apiService2, sku, events: events2, viewerOnly = false }) {
43581
43870
  const configurator = reactExports.useRef();
43582
43871
  const [settings, setSettings] = reactExports.useState(null);
43872
+ const orgName = (settings == null ? void 0 : settings.orgName) || "";
43583
43873
  const frameList = (settings == null ? void 0 : settings.frameList) || null;
43584
43874
  const lensList = (settings == null ? void 0 : settings.lensList) || null;
43585
- const orgName = (settings == null ? void 0 : settings.orgName) || "";
43875
+ const orbitalList = (settings == null ? void 0 : settings.orbitalList) || null;
43586
43876
  reactExports.useEffect(() => {
43587
43877
  (async () => {
43588
43878
  var _a2;
@@ -43592,11 +43882,24 @@ bool bvhIntersectFirstHit(
43592
43882
  sku,
43593
43883
  barcode: null
43594
43884
  });
43595
- const lensApiRes = await apiService2.FetchCustomisationList();
43885
+ const lensApiRes = await apiService2.FetchCustomisationList("Lens");
43886
+ const orbitalApiRes = await apiService2.FetchCustomisationList("Orbital");
43887
+ const domInstance = await configurator.current.renderAsset({
43888
+ containerId: "holder-canvas",
43889
+ data: {
43890
+ assetDetails: apiRes,
43891
+ customisation: apiRes == null ? void 0 : apiRes.customisation
43892
+ }
43893
+ });
43596
43894
  setSettings({
43597
43895
  frameList: apiRes == null ? void 0 : apiRes.variants,
43598
43896
  lensList: lensApiRes == null ? void 0 : lensApiRes.data,
43599
- orgName: apiRes == null ? void 0 : apiRes.group.name
43897
+ orbitalList: orbitalApiRes == null ? void 0 : orbitalApiRes.data,
43898
+ orgName: apiRes == null ? void 0 : apiRes.group.name,
43899
+ showOrbitals: (apiRes == null ? void 0 : apiRes.customisation).filter(
43900
+ (e) => e.type === "Orbital"
43901
+ ).length > 0,
43902
+ domService: domInstance
43600
43903
  });
43601
43904
  })();
43602
43905
  return () => {
@@ -43613,8 +43916,11 @@ bool bvhIntersectFirstHit(
43613
43916
  apiService: apiService2,
43614
43917
  frameList,
43615
43918
  lensList,
43919
+ orbitalList,
43920
+ showOrbitalList: (settings == null ? void 0 : settings.showOrbitals) || false,
43616
43921
  viewerOnly,
43617
- ThreeDConfigurator: configurator.current
43922
+ ThreeDConfigurator: configurator.current,
43923
+ domService: settings == null ? void 0 : settings.domService
43618
43924
  }
43619
43925
  )
43620
43926
  ] });
@@ -51215,9 +51521,9 @@ bool bvhIntersectFirstHit(
51215
51521
  copy[i] = arr[i];
51216
51522
  return copy;
51217
51523
  }
51218
- function spliceOne(list, index) {
51219
- for (; index + 1 < list.length; index++)
51220
- list[index] = list[index + 1];
51524
+ function spliceOne(list, index2) {
51525
+ for (; index2 + 1 < list.length; index2++)
51526
+ list[index2] = list[index2 + 1];
51221
51527
  list.pop();
51222
51528
  }
51223
51529
  function unwrapListeners(arr) {