PageSourceSearch

https://www.insiderstore.com.br/cdn/shop/t/1705/assets/widget-zend…?v=119673461659353691241790779798

js insiderstore.com.br collected 2026-10-02 03:19:58 UTC 17,914 bytes, 2 lines download raw bytes

vendor: 4,673 bytes, line 1
1"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _createForOfIteratorHelper(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new j(n||[]);return o(a,"_invoke",{value:E(t,r,c)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",v={};function m(){}function g(){}function w(){}var _={};s(_,a,(function(){return this}));var b=Object.getPrototypeOf,C=b&&b(b(S([])));C&&C!==r&&n.call(C,a)&&(_=C);var O=w.prototype=m.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==_typeof(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function E(e,r,n){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=L(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var s=l(e,r,n);if("normal"===s.type){if(o=n.done?y:d,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=l(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function S(e){if(e||""===e){var r=e[a];if(r)return r.call(e);
vendor: 7,133 bytes, line 1
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return g.prototype=w,o(O,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=s(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},k(x.prototype),s(x.prototype,c,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(O),s(O,u,"Generator"),s(O,a,(function(){return this})),s(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_toPropertyKey(n.key),n)}}function _createClass(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function _callSuper(t,e,r){return e=_getPrototypeOf(e),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(e,r||[],_getPrototypeOf(t).constructor):e.apply(t,r))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _wrapNativeSuper(t){var e="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(r,t)},_wrapNativeSuper(t)}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&_setPrototypeOf(o,r.prototype),o}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}var __awaiter=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,c)}u((n=n.apply(t,e||[])).next())}))};customElements.get("widget-zendesk-personal-shopper")||customElements.define("widget-zendesk-personal-shopper",function(t){function e(){var t;return _classCallCheck(this,e),(t=_callSuper(this,e)).toLogger=!0,t.log=Object.assign((function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];
1t.toLogger&&(e=console).log.apply(e,["%c[DEBUG]","color:red;","[WidgetZendesk]"].concat(n))}),{error:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(e=console).error.apply(e,["%c[WidgetZendesk] ".concat(t),"color:red;"].concat(n))},warn:function(e){for(var r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];t.toLogger&&(r=console).warn.apply(r,["%c[WidgetZendesk] ".concat(e),"color:orange;"].concat(o))},info:function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];t.toLogger&&(e=console).info.apply(e,["%c[INFO]","color:blue;","[WidgetZendesk]"].concat(n))}}),t.zeCommandsQueue=[],t.toLogger=!(!t.toLogger&&"true"!==sessionStorage.getItem("insider:debug:widget-zendesk-personal-shopper")),t.init(),t.cartIdCustomFieldId=t.dataset.cartIdCustomFieldId?parseInt(t.dataset.cartIdCustomFieldId):43112175326996,t.discountCodeCustomFieldId=t.dataset.discountCodeCustomFieldId?parseInt(t.dataset.discountCodeCustomFieldId):43112255164180,t.productNameCustomFieldId=t.dataset.productNameCustomFieldId?parseInt(t.dataset.productNameCustomFieldId):43303511358612,t}return _inherits(e,_wrapNativeSuper(HTMLElement)),_createClass(e,[{key:"connectedCallback",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function t(){return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{this.repositionWidget(),this.toggleWidgetByMinicartState()}catch(t){this.log.error("Error to connectedCallback",t)}case 1:case"end":return t.stop()}}),t,this)})))}},{key:"pushZeCommands",value:function(t,e){this.zeCommandsQueue.push({type:t,command:e}),this.flushZeCommands()}},{key:"flushZeCommands",value:function(){"function"==typeof window.zE&&(this.zeCommandsQueue.forEach((function(t){window.zE(t.type,t.command)})),this.zeCommandsQueue=[])}},{key:"init",value:function(){var t,e=this;this.injectGlobalZendeskData(),null===(t=document.getElementById("ze-snippet"))||void 0===t||t.addEventListener("load",(function(){return e.flushZeCommands()}))}},{key:"injectGlobalZendeskData",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function t(){var e=this;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:setTimeout((function(){return __awaiter(e,void 0,void 0,_regeneratorRuntime().mark((function t(){var e,r,n,o,i,a,c,u=this;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.cartIdCustomFieldId,r=this.discountCodeCustomFieldId,n=this.productNameCustomFieldId,t.next=5,this.getActiveCartId();case 5:o=t.sent,i=this.getActiveDiscountCode(),a=this.getProductNameFromUrl(),c=[],o&&c.push({id:e,value:o}),i&&c.push({id:r,value:i}),a&&c.push({id:n,value:a}),"function"==typeof window.zE&&c.length>0?(window.zE("messenger:on","unreadMessages",(function(t){return __awaiter(u,void 0,void 0,_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=1==t,!e.t0){e.next=5;break}return e.next=4,this.refreshCartData();case 4:e.t0=e.sent;case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}}),e,this)})))})),window.zE("messenger:set","conversationFields",c)):this.log.warn("Zendesk Web Widget not loaded yet or no custom fields to set."),this.log.info("Zendesk injected custom fields",c);case 14:case"end":return t.stop()}}),t,this)})))}),2e3);case 1:case"end":return t.stop()}}),t)})))}},{key:"refreshCartData",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function t(){var e;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{this.log.info("Cart refresh initiated"),(e=document.querySelector("cart-drawer"))&&"function"==typeof e.updateCart?(e.updateCart(!1),this.log.info("Cart updated silently using updateCart(false)")):this.log.warn("Cart drawer element not found")}catch(t){this.log.error("Cart refresh failed",t)}case 1:case"end":return t.stop()}}),t,this)})))}},{key:"getActiveCartId",value:function(){return __awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function t(){var e,r,n;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/cart.js",{headers:{"Cache-Control":"max-age=5"}});case 3:return e=t.sent,t.next=6,e.json();case 6:if(r=t.sent,!(n=r.token)||!n.includes("?key=")){t.next=10;break}return t.abrupt("return",n);case 10:this.log.warn("Cart ID has unexpected format"),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(0),this.log.warn("Erro ao buscar dados do carrinho:",t.t0);case 16:case"end":return t.stop()}}),t,this,[[0,13]])})))}},{key:"getActiveDiscountCode",value:function(){try{var t=sessionStorage.getItem("insider:cart:promotionCoupon");if(t){var e=JSON.parse(t);if(e.code)return e.code;var r=e.discount_default;if(r&&r.discount&&r.discount.code)return r.discount.code}}catch(t){this.log.warn("Erro ao buscar cupom padrão no sessionStorage:",t)}}},{key:"getProductNameFromUrl",value:function(){try{var t=window.location.pathname.match(/^\/products\/([^\/\?#]+)/);if(t&&t[1]){var e=t[1];return decodeURIComponent(e.replace(/-/g," "))}}catch(t){this.log.warn("Erro ao extrair nome do produto da URL:",t)}}},{key:"repositionWidget",value:function(){var t=new MutationObserver((function(){var e=document.getElementById("launcher");e&&(e.style.marginBottom="50px",t.disconnect())}
1));t.observe(document.body,{childList:!0,subtree:!0})}},{key:"toggleWidgetByMinicartState",value:function(){var t=this,e=document.querySelector("cart-drawer");e&&!this.cartDrawerObserver&&(this.cartDrawerObserver=new MutationObserver((function(r){var n,o=_createForOfIteratorHelper(r);try{for(o.s();!(n=o.n()).done;){var i=n.value;"attributes"===i.type&&"class"===i.attributeName&&e.classList.contains("active")&&t.pushZeCommands("messenger","hide")}}catch(t){o.e(t)}finally{o.f()}})),this.cartDrawerObserver.observe(e,{attributes:!0,attributeFilter:["class"]}))}}])}());
2//# sourceMappingURL=widget-zendesk-personal-shopper.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.