PageSourceSearch

https://tandyleather.com/cdn/shop/t/474/assets/tandy-club-sdk.js?v=143101318635130782371790089161

js tandyleather.com collected 2026-09-25 19:21:59 UTC 4,357 bytes, 2 lines download raw bytes

1(function(){"use strict";if(window.TandyClub)return;var POLL_MS=300,MAX_TRIES=60,_t0=Date.now(),_dbg={api:"waiting for swellAPI\u2026",cust:"-",watch:"-"};function dbgSummary(d){if(!d||typeof d!="object")return"empty payload";var tier=d.vipTier&&d.vipTier.name?d.vipTier.name:"-";return"email="+(d.email||"-")+" \xB7 optIn="+d.isOptIn+" \xB7 tier="+tier+" \xB7 points="+d.pointsBalance}(function dbgLoop(){if(window.tcDebug){var el=document.getElementById("tc-sdk-debug");!el&&document.body&&(el=document.createElement("pre"),el.id="tc-sdk-debug",el.className="tc-status__debug tc-debug-line",el.style.cssText="position:sticky;top:0;z-index:9999;background:#fffafa;",document.body.insertBefore(el,document.body.firstChild)),el&&(el.textContent="[Tandy Club SDK] t="+Math.round((Date.now()-_t0)/1e3)+"s \xB7 "+_dbg.api+" \xB7 customer: "+_dbg.cust+" \xB7 watcher: "+_dbg.watch),setTimeout(dbgLoop,1e3)}})();function whenReady(){return new Promise(function(resolve,reject){var n=0,done=!1;function settle(){if(done)return!0;var api=window.swellAPI;return api&&typeof api.getCustomerDetails=="function"?(done=!0,_dbg.api="swellAPI ready @"+Math.round((Date.now()-_t0)/1e3)+"s",resolve(api),!0):!1}settle()||(document.addEventListener("swell:setup",settle),(function tick(){if(!done&&!settle()){if(++n>=MAX_TRIES){_dbg.api="swellAPI NOT LOADED after ~18s",reject(new Error("swellAPI unavailable"));return}setTimeout(tick,POLL_MS)}})())})}function hasMemberData(d){return typeof d.pointsBalance=="number"&&d.pointsBalance>0||d.vipTier||d.isOptIn===!0||d.actionHistoryItems&&d.actionHistoryItems.length||d.pointRedemptions&&d.pointRedemptions.length}function isLoaded(d,likelyMember){return!d||typeof d!="object"?!1:hasMemberData(d)?!0:likelyMember?!1:!!(d.email||d.isOptIn!==void 0)}function attemptFetch(api){return Promise.resolve().then(function(){return api.getCustomerDetails({with_history:!0})}).catch(function(){return api.getCustomerDetails()})}function fetchCustomer(api){var likelyMember=!!window.tcLikelyMember;return new Promise(function(resolve){var n=0;function finish(d){_dbg.cust="resolved ("+dbgSummary(d)+")",window.tcLoggedIn&&!(d&&hasMemberData(d))&&lateWatch(api),resolve(d||null)}(function tick(){_dbg.cust="identifying\u2026 try "+(n+1)+"/"+MAX_TRIES,attemptFetch(api).then(function(d){if(_dbg.cust="try "+(n+1)+": "+dbgSummary(d),isLoaded(d,likelyMember)||++n>=MAX_TRIES)return finish(d);setTimeout(tick,POLL_MS)}).catch(function(e){if(_dbg.cust="try "+(n+1)+" threw: "+(e&&e.message||e),++n>=MAX_TRIES)return finish(null);setTimeout(tick,POLL_MS)})})()})}function lateWatch(api){var n=0,iv=setInterval(function(){attemptFetch(api).then(function(d){if(d&&hasMemberData(d)){clearInterval(iv),_dbg.watch="lateWatch: recovered ("+dbgSummary(d)+")",_c=Promise.resolve(d);try{document.dispatchEvent(new CustomEvent("tandyclub:customer-updated",{detail:d}))}catch(e){}}else++n>=96?(clearInterval(iv),_dbg.watch="lateWatch: gave up after 4 min ("+dbgSummary(d)+")"):_dbg.watch="lateWatch "+n+"/96 ("+dbgSummary(d)+")"}).catch(function(){++n>=96&&clearInterval(iv)})},2500)}function lateBoot(){var n=0,iv=setInterval(function(){var api=window.swellAPI;api&&typeof api.getCustomerDetails=="function"?(clearInterval(iv),_dbg.api="swellAPI arrived LATE @"+Math.round((Date.now()-_t0)/1e3)+"s",_t=_r=_cam=void 0,fetchCustomer(api).then(function(d){if(d){_c=Promise.resolve(d);try{document.dispatchEvent(new CustomEvent("tandyclub:customer-updated",{detail:d}))}catch(e){}}})):++n>=96?(clearInterval(iv),_dbg.watch="lateBoot: swellAPI never appeared (4 min)"):_dbg.watch="lateBoot: waiting for swellAPI "+n+"/96"},2500)}function listGetter(name){return whenReady().then(function(api){return typeof api[name]!="function"?[]:Promise.resolve().then(function(){return api[name]()}).then(function(r){return Array.isArray(r)?r:[]})}).catch(function(){return[]})}var _c,_t,_r,_cam;window.TandyClub={isLoaded:isLoaded,customer:function(){return _c||(_c=whenReady().then(fetchCustomer).catch(function(){return lateBoot(),null}))},vipTiers:function(){return _t||(_t=listGetter("getVipTiers"))},redemptionOptions:function(){return _r||(_r=listGetter("getActiveRedemptionOptions"))},campaigns:function(){return _cam||(_cam=listGetter("getActiveCampaigns"))}}})();
2//# sourceMappingURL=/cdn/shop/t/474/assets/tandy-club-sdk.js.map?v=143101318635130782371790089161

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.