1import { 2 __esm, 3 init_define_process 4} from "./chunk-RFSPGZ3L.js"; 5
6// projects/lib/packages/yggdrasil/src/objectUtils.ts 7function isNullOrUndefined(value) { 8 return value === null || typeof value === "undefined"; 9} 10var init_objectUtils = __esm({ 11 "projects/lib/packages/yggdrasil/src/objectUtils.ts"() { 12 init_define_process(); 13 } 14}); 15
16// projects/lib/packages/yggdrasil/src/cfLodash.ts 17function isObject(value) { 18 const type = typeof value; 19 return value !== null && (type === "object" || type === "function"); 20} 21function throttle(func, wait, options) { 22 let leading = true; 23 let trailing = true; 24 if (typeof func !== "function") { 25 throw new TypeError("Expected a function"); 26 } 27 if (isObject(options)) { 28 leading = "leading" in options ? !!options.leading : leading; 29 trailing = "trailing" in options ? !!options.trailing : trailing; 30 } 31 return debounce(func, wait, { 32 leading, 33 trailing, 34 maxWait: wait 35 }); 36} 37function debounce(func, wait, options) { 38 let lastArgs; 39 let lastThis; 40 let maxWait; 41 let result; 42 let timerId; 43 let lastCallTime; 44 let lastInvokeTime = 0; 45 let leading = false; 46 let maxing = false; 47 let trailing = true; 48 if (typeof func !== "function") { 49 throw new TypeError("Expected a function"); 50 } 51 wait = +wait || 0; 52 if (isObject(options)) { 53 leading = !!options.leading; 54 maxing = "maxWait" in options; 55 maxWait = maxing ? Math.max(+options.maxWait || 0, wait) : maxWait; 56 trailing = "trailing" in options ? !!options.trailing : trailing; 57 } 58 function invokeFunc(time) { 59 const args = lastArgs; 60 const thisArg = lastThis; 61 lastArgs = lastThis = void 0; 62 lastInvokeTime = time; 63 result = func.apply(thisArg, args); 64 return result; 65 } 66 function startTimer(pendingFunc, milliseconds) { 67 return setTimeout(pendingFunc, milliseconds); 68 } 69 function cancelTimer(id) { 70 clearTimeout(id); 71 } 72 function leadingEdge(time) { 73 lastInvokeTime = time; 74 timerId = startTimer(timerExpired, wait); 75 return leading ? invokeFunc(time) : result; 76 } 77 function remainingWait(time) { 78 const timeSinceLastCall = time - lastCallTime; 79 const timeSinceLastInvoke = time - lastInvokeTime; 80 const timeWaiting = wait - timeSinceLastCall; 81 return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; 82 } 83 function shouldInvoke(time) { 84 const timeSinceLastCall = time - lastCallTime; 85 const timeSinceLastInvoke = time - lastInvokeTime; 86 return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; 87 } 88 function timerExpired() { 89 const time = Date.now(); 90 if (shouldInvoke(time)) { 91 return trailingEdge(time); 92 } 93 timerId = startTimer(timerExpired, remainingWait(time)); 94 return void 0; 95 } 96 function trailingEdge(time) { 97 timerId = void 0; 98 if (trailing && lastArgs) { 99 return invokeFunc(time); 100 } 101 lastArgs = lastThis = void 0; 102 return result; 103 } 104 function cancel() { 105 if (timerId !== void 0) { 106 cancelTimer(timerId); 107 } 108 lastInvokeTime = 0; 109 lastArgs = lastCallTime = lastThis = timerId = void 0; 110 } 111 function flush() { 112 return timerId === void 0 ? result : trailingEdge(Date.now()); 113 } 114 function pending() { 115 return timerId !== void 0; 116 } 117 function debounced(...args) { 118 const time = Date.now(); 119 const isInvoking = shouldInvoke(time); 120 lastArgs = args; 121 lastThis = this; 122 lastCallTime = time; 123 if (isInvoking) { 124 if (timerId === void 0) { 125 return leadingEdge(lastCallTime); 126 } 127 if (maxing) { 128 timerId = startTimer(timerExpired, wait); 129 return invokeFunc(lastCallTime); 130 } 131 } 132 if (timerId === void 0) { 133 timerId = startTimer(timerExpired, wait); 134 } 135 return result; 136 } 137 debounced.cancel = cancel; 138 debounced.flush = flush; 139 debounced.pending = pending; 140 return debounced; 141} 142function isArrayEqual(array, compare) { 143 if (array.length !== compare.length) return false; 144 for (let i = 0; i < array.length; i++) { 145 if (isObject(array[i])) { 146 if (!isObjectEqual(array[i], compare[i])) { 147 return false; 148 } 149 } else { 150 if (array[i] !== compare[i]) { 151 return false; 152 } 153 } 154 } 155 return true; 156} 157function isObjectEqual(obj1, obj2) { 158 if (Array.isArray(obj1) && Array.isArray(obj2)) return isArrayEqual(obj1, obj2); 159 if (!isObject(obj1) || !isObject(obj2)) { 160 return false;
161 } 162 if (obj1 === obj2) { 163 return true; 164 } 165 const item1Keys = Object.keys(obj1).sort(); 166 const item2Keys = Object.keys(obj2).sort(); 167 if (!isArrayEqual(item1Keys, item2Keys)) { 168 return false; 169 } 170 return item2Keys.every((key) => { 171 const value = obj1[key]; 172 const nextValue = obj2[key]; 173 if (isObject(obj1[key])) { 174 return isObjectEqual(obj1[key], obj2[key]); 175 } else { 176 if (value === nextValue) { 177 return true; 178 } 179 } 180 return Array.isArray(value) && Array.isArray(nextValue) && isArrayEqual(value, nextValue); 181 }); 182} 183function cleanupEmptyValues(obj) { 184 const result = {}; 185 for (const key in obj) { 186 const value = obj[key]; 187 if (isNullOrUndefined(value) || value === "") continue; 188 if (Array.isArray(value) && value.length === 0) continue; 189 result[key] = value; 190 } 191 return result; 192} 193var reEscapedHtml, reHasEscapedHtml, reRegExpChar, reHasRegExpChar, isEqual; 194var init_cfLodash = __esm({ 195 "projects/lib/packages/yggdrasil/src/cfLodash.ts"() { 196 init_define_process(); 197 init_objectUtils(); 198 reEscapedHtml = /&(?:amp|lt|gt|quot|#(0+)?(39|34));/g; 199 reHasEscapedHtml = RegExp(reEscapedHtml.source); 200 reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 201 reHasRegExpChar = RegExp(reRegExpChar.source); 202 isEqual = (value1, value2) => { 203 if (isObject(value1) && isObject(value2)) { 204 return isObjectEqual(value1, value2); 205 } 206 return value1 === value2; 207 }; 208 } 209}); 210
211// projects/user_pages/app/javascript/lander/cf_utils.ts 212function uuidv4() { 213 if (typeof crypto !== "undefined" && crypto.randomUUID) { 214 return crypto.randomUUID(); 215 } 216 return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) { 217 const r = Math.random() * 16 | 0, v = c == "x" ? r : r & 3 | 8; 218 return v.toString(16); 219 }); 220} 221function IntlTel_initPhoneInput(inputElement, options = {}) { 222 options = cleanupEmptyValues(options); 223 const iti = window.intlTelInput(inputElement, { 224 autoPlaceholder: "aggressive", 225 countryOrder: ["us", "ca", "gb", "ie", "ai", "nz"], 226 // TODO: I think the intialCountry logic should be placed in here 227 // - First try to get the country from garlic 228 // - Second from cfVisitorData 229 // - Third from the browser 230 // - Fourth falls back to US 231 initialCountry: "us", 232 countrySearch: false, 233 fixDropdownWidth: false, 234 // NOTE: This follows the docs recommendation to load utils script separately 235 // @ts-expect-error - dynamic import from CDN URL 236 loadUtils: () => import("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/25.5.2/build/js/utils.min.js"), 237 ...options 238 }); 239 inputElement.iti = iti; 240 return iti.promise; 241} 242function isEventInside(event, element) { 243 return event.target === element || element.contains(event.target); 244} 245function closeOnClickOutside(element, cb) { 246 document.addEventListener( 247 "click", 248 (evt) => { 249 if (evt.target !== element && !element.contains(evt.target)) { 250 cb(); 251 } 252 }, 253 { capture: true } 254 ); 255} 256function range(min, max, step = 1) { 257 let arraySize = Math.floor((max - min) / step); 258 if (arraySize < 0) arraySize = 0; 259 return new Array(arraySize).fill(0).map((_, index) => index * step + min); 260} 261function removePageScroll() { 262 document.body.classList.add("remove-page-scroll"); 263} 264function addPageScroll() { 265 document.body.classList.remove("remove-page-scroll"); 266} 267function isWithinCustomerCenterView() { 268 const params = new URLSearchParams(window.location.search); 269 const previewDynamicSection = !!params.get("preview-dynamic-section"); 270 return previewDynamicSection && window.self !== window.parent; 271} 272var init_cf_utils = __esm({ 273 "projects/user_pages/app/javascript/lander/cf_utils.ts"() { 274 init_define_process(); 275 init_cfLodash(); 276 } 277}); 278 279export { 280 throttle, 281 isEqual, 282 init_cfLodash, 283 uuidv4, 284 IntlTel_initPhoneInput, 285 isEventInside, 286 closeOnClickOutside, 287 range, 288 removePageScroll, 289 addPageScroll, 290 isWithinCustomerCenterView, 291 init_cf_utils 292}; 293//# sourceMappingURL=chunk-KIZY5IRN.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.