1(()=>{"use strict";var e=function(){function e(){}return e.isProduction=function(){var e=window.location.hostname;return!("www.shipstation.com"!==e&&"shipstation.com"!==e&&(!e.endsWith(".shipstation.com")||e.includes(".dev.")||e.includes(".staging."))&&("localhost"===e||"127.0.0.1"===e||e.includes("dev")||e.includes("staging")||e.includes("test")||e.includes("local")||e.includes("-blocks")))},e.logDebug=function(e,t,n){e&&(console.log("%c[DEBUG]","background: #f0f0f0; color: blue; font-weight: bold;",t),void 0!==n&&console.log(n))},e.preventAction=function(e,t,n,o){return!(!e||this.isProduction()||(t.preventDefault(),t.stopPropagation(),console.log("%c[PREVENTED ACTION]","background: #ffe0e0; color: red; font-weight: bold;"),console.log("%c"+n,"color: red;"),o&&console.log(o),console.log("==========================================="),0))},e.sendAnalyticsEvent=function(e,t,n){var o=!0===n;o&&(console.log("ð£ Sending event to analytics: ".concat(e)),console.log("Payload:",t)),window.analytics?(window.analytics.track(e,t),o&&console.log("â
Event sent to Segment")):o&&console.error("â Analytics not loaded, tracking skipped")},e.isPagePathMatch=function(e){var t=window.location.pathname;return e.some((function(e){if(e===t)return!0;if(e.endsWith("*")){var n=e.slice(0,-1);return t.startsWith(n)}if(e.startsWith("/")&&e.includes("/"))try{return new RegExp(e.slice(1,-1)).test(t)}catch(t){return console.error("Invalid regex pattern: ".concat(e)),!1}return!1}))},e.getFieldErrorMessage=function(e){for(var t,n,o=null,i=e.getAttribute("name")||e.getAttribute("id"),r=0,a=[e.id,i];r<a.length;r++){var s=a[r];if(s&&(l=document.getElementById("".concat(s,"-error")))&&l.classList.contains("error")&&(o=(null===(t=l.textContent)||void 0===t?void 0:t.trim())||null))break}if(!o){var l,c=e.closest(".row, .form-group, .field-container, .error-container, .error, password-error");if(c&&(l=c.querySelector("label.error, p.error"))&&l!==e){var d=l.getAttribute("for");d&&d!==i&&d!==e.id||(o=(null===(n=l.textContent)||void 0===n?void 0:n.trim())||null)}}return o},e}(),t=function(){function t(){this.debugMode=!1,window.analytics||console.error("Segment analytics.js not loaded")}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.setDebugMode=function(t){if(e.isProduction())return t&&console.log("Debug mode cannot be enabled in production environment"),void(this.debugMode=!1);this.debugMode=t,t&&console.log("â ï¸ WARNING: Navigation will be prevented while debug mode is enabled")},t.prototype.initTracking=function(){var t=this;e.logDebug(this.debugMode,"Setting up global click handler..."),document.addEventListener("click",(function(e){var n=e.target,o=n.closest(".btn, button");if(o&&o instanceof HTMLElement&&t.isSignupButton(o))t.trackSignupClick(e,o);else{var i=n.closest("a");i&&i instanceof HTMLElement&&t.isNavigationElement(i)&&t.trackNavClick(e,i)}}),!0),e.logDebug(this.debugMode,"Global click handler installed. Debug mode is enabled.")},t.prototype.trackSignupClick=function(t,n){var o="";"a"===n.tagName.toLowerCase()&&(o=n.getAttribute("href")||""),this.debugMode&&o&&!e.isProduction()&&e.preventAction(!0,t,"SIGNUP BUTTON CLICK PREVENTED, WOULD NAVIGATE TO: ".concat(o),"To navigate to this URL, paste this in the console:\nwindow.location.href = '".concat(o,"';"));var i=this.sanitizeText(n.textContent||this.findClosestText(n)),r={class:n.classList.contains("btn")?"btn":"button",text:i};e.sendAnalyticsEvent("Signup Button Click",r,this.debugMode)},t.prototype.trackNavClick=function(t,n){var o=n.getAttribute("href")||"";if(o.startsWith("#")||o.startsWith("javascript:"))e.logDebug(this.debugMode,"Skipping non-navigation link:",o);else{this.debugMode&&!e.isProduction()&&e.preventAction(!0,t,"NAVIGATION CLICK PREVENTED, WOULD NAVIGATE TO: ".concat(o),"To navigate to this URL, paste this in the console:\nwindow.location.href = '".concat(o,"';"));var i={nav_name:this.sanitizeText(n.textContent||this.findClosestText(n)),nav_cat:this.determineNavCategory(n),nav_location:this.determineNavLocation(n),nav_destination:o,nav_event:t.type,nav_type:"link"};e.sendAnalyticsEvent("Nav Click",i,this.debugMode)}},t.prototype.sanitizeText=function(e){return e?e.trim().replace(/\s+/g," "):""},t.prototype.isSignupButton=function(e){if("a"===e.tagName.toLowerCase()){var t=e.getAttribute("href")||"";return t.includes("/signup")||t.includes("/start-a-free-trial")||t.includes("/free-trial")}var n=this.sanitizeText(e.textContent||"").toLowerCase();return n.includes("sign up")||n.includes("start a free trial")||n.includes("free trial")||n.includes("try for free")},t.prototype.isNavigationElement=function(e){return!!e.closest("nav.top-nav, .main-menu, .mega-menu, #mobile-menu, footer .
1nav")},t.prototype.findClosestText=function(e){var t,n=e.querySelector("img");if(n&&n.alt&&""!==n.alt.trim())return n.alt.trim();var o=e.querySelector("p");if(o&&o.textContent)return this.sanitizeText(o.textContent);for(var i=e.parentElement;i;){var r=null===(t=i.textContent)||void 0===t?void 0:t.trim();if(r&&""!==r)return this.sanitizeText(r);i=i.parentElement}return"Unknown"},t.prototype.determineNavCategory=function(e){if(e.classList.contains("main-menu-item"))return"main";var t=e.closest(".left-section");if(t&&t instanceof HTMLElement&&(n=t.querySelector(".eyebrow"))&&n.textContent)return this.sanitizeText(n.textContent.toLowerCase());var n,o=e.closest(".right-section");return o&&o instanceof HTMLElement&&(n=o.querySelector(".eyebrow"))&&n.textContent?this.sanitizeText(n.textContent.toLowerCase()):e.closest(".mega-menu")?"mega_menu":e.closest("#mobile-menu")?"mobile":"other"},t.prototype.determineNavLocation=function(e){return e.closest("nav.top-nav")?"header":e.closest("footer")?"footer":e.closest("#mobile-menu")?"mobile_menu":e.closest(".mega-menu")?"mega_menu":"other"},t}(),n=function(){return n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},o=function(){function t(){this.initializedForms=new Set,this.debugMode=!1,window.analytics||console.error("Segment analytics.js not loaded")}return t.prototype.getStepInfo=function(e){var t=parseInt(e.dataset.activeStep||"1",10),n=parseInt(e.dataset.totalFormSteps||"1",10);return{step_count:Number.isFinite(t)?t:1,total_form_steps:Number.isFinite(n)?n:1}},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.initTracking=function(e){void 0===e&&(e={}),this.debugMode&&console.log("ð Initializing form tracking");var t=n({trackForms:!0,formSelector:"form",formOptions:{}},e);t.trackForms&&this.initFormTracking(t.formSelector,t.formOptions)},t.prototype.initFormTracking=function(t,o){var i=this;void 0===t&&(t="form"),void 0===o&&(o={}),this.debugMode&&console.log("ð Setting up form tracking for: ".concat(t));var r=n({trackFieldInteractions:!0,ignoreFields:["password","token","token_payload","ioBlackBox"],formName:"",maskSensitiveData:!0,eventName:"Form Submitted",formIds:null,pagePaths:null,skipEmptyFields:!0,brand:"ShipStation"},o);if(!r.pagePaths||e.isPagePathMatch(r.pagePaths)){var a;if(this.debugMode&&console.log("ð Setting up form tracking for: ".concat(t)),r.formIds&&r.formIds.length>0){var s=r.formIds.map((function(e){return"#".concat(e)})).join(", ");a=document.querySelectorAll(s),this.debugMode&&(console.log("ð Targeting specific forms with IDs: ".concat(r.formIds.join(", "))),console.log("ð Found ".concat(a.length," matching forms")))}else a=document.querySelectorAll(t),this.debugMode&&console.log("ð Found ".concat(a.length," forms matching selector"));a.forEach((function(e){if(e instanceof HTMLFormElement){var t=e.id||e.getAttribute("name");if(i.initializedForms.has(t))i.debugMode&&console.log("â ï¸ Form ".concat(t," already initialized"));else{i.initializedForms.add(t);var n=r.formName||e.getAttribute("data-form-name")||e.getAttribute("name")||e.id||"Unnamed Form";i.debugMode&&console.log("ð Setting up tracking for form: ".concat(n," (").concat(t,")")),r.trackFieldInteractions&&i.setupFieldTracking(e,n,r)}}}))}else this.debugMode&&(console.log("â© Skipping form tracking - current page doesn't match specified paths"),console.log("Current path: ".concat(window.location.pathname)),console.log("Allowed paths:",r.pagePaths))},t.prototype.trackSubmitButtonClick=function(t,n,o,i,r){var a=this;this.debugMode&&console.log("ð Submit button clicked");var s=$(o);"function"==typeof s.valid&&s.valid(),setTimeout((function(){var t=o.querySelectorAll('input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select, textarea'),n=0,s=[];t.forEach((function(e){if(e instanceof HTMLElement){var t=e.getAttribute("name")||e.getAttribute("id")||"unnamed_field";r.ignoreFields.includes(t)||a.shouldTrackFieldOnSubmit(e)&&(n++,s.push(t),a.trackFormFieldOnSubmit(e,o,i,r))}}));var l=a.getVisibleFormData(o,r),c=n>0,d={brand:r.brand||"ShipStation",form_id:o.id||"unnamed_form",form_name:i,submission_successful:!c,submission_failure_reason:c?"Required fields not filled out":null,fields_with_errors:s,error_count:n,form_data:l,total_form_steps:a.getStepInfo(o).total_form_steps};a.debugMode&&console.log("ð Submit validation complete. Errors: ".concat(n)),e.sendAnalyticsEvent(r.eventName,d,a.debugMode)}),50)},t.prototype.trackFormFieldOnSubmit=function(t,o,i,r){var a=t.getAttribute("name")||t.getAttribute("id")||"unnamed_field",s="",l="",c=!0,d=!1;t instanceof HTMLInputElement?(l=t.type,d=t.required,s=t.value,c=t.validity.valid):t instanceof HTMLSelectElement?(l="select",d=t.required,s=t.value,c=t.validity.valid):t instanceof HTMLTextAreaElement&&(l="textarea",d=t.required,s=t.value,c=t.validity.valid);var u=e.getFieldErrorMessage(t);if(!u){var g=t.classList.contains("error"),m="true"===t.getAttribute("aria-invalid");g||m?u="Field has validation error":d&&(""===s||null==s)&&(u="This field is required")}u&&(c=!1);var f=n({brand:r.brand||"ShipStation",form_id:o.id||"unnamed_form",form_name:i,field_name:a,field_type:l,field_valid:c,field_required:d,field_error:u}
1,this.getStepInfo(o));this.debugMode&&console.log("ð Submit Field Validation Payload:",f),e.sendAnalyticsEvent("Account Created Form Field Validation",f,this.debugMode)},t.prototype.shouldTrackFieldOnSubmit=function(t){var n="",o=!1;(t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement)&&(n=t.value,o=t.required);var i=""===n||null==n,r=null!==e.getFieldErrorMessage(t),a=t.classList.contains("error"),s="true"===t.getAttribute("aria-invalid");return r||a||s||o&&i},t.prototype.setDebugMode=function(e){this.debugMode=e,e&&console.log("â
SegmentFormTracker debug mode enabled")},t.prototype.trackFormField=function(t,o,i,r,a){if("blur"===t.type||"focusout"===t.type){var s=o.getAttribute("name")||o.getAttribute("id")||"unnamed_field",l="",c="",d=!0,u=!1;o instanceof HTMLInputElement?(c=o.type,u=o.required,l=o.value,d=o.validity.valid):o instanceof HTMLSelectElement?(c="select",u=o.required,l=o.value,d=o.validity.valid):o instanceof HTMLTextAreaElement&&(c="textarea",u=o.required,l=o.value,d=o.validity.valid);var g=""===l||null==l,m=null,f=o.classList.contains("error"),p="true"===o.getAttribute("aria-invalid");if((f||p||!d)&&(m=e.getFieldErrorMessage(o))&&(d=!1),!g||m){this.debugMode&&(g&&m?console.log("ð Tracking EMPTY field with ERROR: ".concat(s," - Error: ").concat(m)):g||console.log("ð Tracking field with VALUE: ".concat(s," - Value: ").concat(l)));var v=n({brand:a.brand||"ShipStation",form_id:i.id||"unnamed_form",form_name:r,field_name:s,field_type:c,field_valid:d,field_required:u,field_error:m},this.getStepInfo(i));this.debugMode&&console.log("ð Form Field Interaction Payload:",v),e.sendAnalyticsEvent("Account Created Form Field Validation",v,this.debugMode)}else this.debugMode&&console.log("â© Skipping empty field with no error: ".concat(s))}else this.debugMode&&console.log("â© Skipping non-blur event: ".concat(t.type))},t.prototype.getVisibleFormData=function(e,t){var n={};return e.querySelectorAll("input, select, textarea").forEach((function(e){if(e instanceof HTMLElement){var o=e.getAttribute("name")||e.getAttribute("id");if(o&&!(t.ignoreFields.includes(o)||e instanceof HTMLInputElement&&"hidden"===e.type)){var i="",r=!1;if(e instanceof HTMLInputElement)if("checkbox"===e.type||"radio"===e.type){if(!e.checked)return;i=e.value||"on"}else"password"===e.type&&t.maskSensitiveData||"password"===o?(i="[REDACTED]",r=""===e.value):r=""===(i=e.value);else if(e instanceof HTMLSelectElement)r=""===(i=e.value)||e.options.length>0&&0===e.selectedIndex&&""===e.options[0].value;else{if(!(e instanceof HTMLTextAreaElement))return;r=""===(i=e.value)}var a=e.hasAttribute("required");r&&!a||(n[o]=i)}}})),n},t.prototype.setupFieldTracking=function(e,t,n){var o=this;this.debugMode&&console.log("ð Setting up delegated blur tracking for form: ".concat(t)),e.addEventListener("focusout",(function(i){var r=i.target;if(r instanceof HTMLElement&&r.matches('input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select, textarea')){var a=r.getAttribute("name")||r.getAttribute("id")||"unnamed_field";n.ignoreFields.includes(a)?o.debugMode&&console.log("â© Skipping ignored field: ".concat(a)):(o.debugMode&&console.log("ð FOCUSOUT EVENT for field: ".concat(a)),setTimeout((function(){o.trackFormField(i,r,e,t,n)}),0))}}),{passive:!0}),this.debugMode&&console.log("â
Delegated blur tracking set up for form: ".concat(t)),e.addEventListener("click",(function(i){var r=i.target;if(r instanceof HTMLElement){var a=r.closest('button[type="submit"], input[type="submit"]');if(a){var s=a.getAttribute("name")||a.getAttribute("id")||"submit_button";o.debugMode&&console.log("ð Submit button clicked: ".concat(s)),o.trackSubmitButtonClick(i,a,e,t,n)}}})),this.debugMode&&console.log("â
Delegated submit button tracking set up for form: ".concat(t))},t}();function i(){var e=o.getInstance();e.initFormTracking("#registration-form",{formIds:["registration-form"],eventName:"Account Created Form Submission Click",brand:"ShipStation",ignoreFields:["password","token_payload","ioBlackBox","hubspot_cookie"],skipEmptyFields:!0}),e.initFormTracking("#gform_24",{formIds:["gform_24"],eventName:"Account Created Form Submission Click",formName:"ShipStation API Signup Form",brand:"ShipEngine",ignoreFields:["password","token_payload","ioBlackBox","hubspot_cookie"],skipEmptyFields:!0})}document.addEventListener("DOMContentLoaded",(function(){t.getInstance().initTracking(),i()})),document.addEventListener("ss:registration-form-ready",(function(){i()}))})();
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.