index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/3660.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[3660],{448:function(e,r,t){t.d(r,{a:function(){return l},b:function(){return s},g:function(){return f}});var n=t(4942),o=t(885);function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?i(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function u(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw i}}}}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function s(e){for(var r,t="",n=Object.entries(e);r=n.shift();){var i=r,a=(0,o.Z)(i,2),c=a[0],s=a[1];if(Array.isArray(s)||s&&s.constructor===Object){var f,l=u(Object.entries(s).reverse());try{for(l.s();!(f=l.n()).done;){var d=(0,o.Z)(f.value,2),p=d[0],h=d[1];n.unshift(["".concat(c,"[").concat(p,"]"),h])}}catch(e){l.e(e)}finally{l.f()}}else void 0!==s&&(null===s&&(s=""),t+="&"+[c,s].map(encodeURIComponent).join("="))}return t.substr(1)}function f(e){return(function(e){var r;try{r=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(r)return r}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,r){var t=r.split("=").filter(Boolean).map(decodeURIComponent),n=(0,o.Z)(t,2),i=n[0],u=n[1],c=void 0===u?"":u;return i&&function(e,r,t){for(var n=r.length,o=n-1,i=0;i<n;i++){var u=r[i];!u&&Array.isArray(e)&&(u=e.length.toString());var c=!isNaN(Number(r[i+1]));e[u]=i===o?t:e[u]||(c?[]:{}),Array.isArray(e[u])&&!c&&(e[u]=a({},e[u])),e=e[u]}}(e,i.replace(/\]/g,"").split("["),c),e}),{})}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0;if(!r||!Object.keys(r).length)return e;var t=e,n=e.indexOf("?");return-1!==n&&(r=Object.assign(f(e),r),t=t.substr(0,n)),t+"?"+s(r)}},930:function(e,r,t){t.d(r,{a:function(){return W},h:function(){return q}});var n=t(5861),o=t(5987),i=t(885),a=t(4942),u=t(1284),c=t.n(u),s=t(448),f=["rest_route"],l=["path","url"],d=["url","path","data","parse"];function p(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return h(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw i}}}}function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function v(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function w(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?v(Object(t),!0).forEach((function(r){(0,a.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var m=function(e,r){var t,n,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(t=e.namespace.replace(/^\/|\/$/g,""),o=(n=e.endpoint.replace(/^\//,""))?t+"/"+n:t),delete e.namespace,delete e.endpoint,r(w(w({},e),{},{path:o}))};function b(e){for(var r,t="",n=Object.entries(e);r=n.shift();){var o=r,a=(0,i.Z)(o,2),u=a[0],c=a[1];if(Array.isArray(c)||c&&c.constructor===Object){var s,f=p(Object.entries(c).reverse());try{for(f.s();!(s=f.n()).done;){var l=(0,i.Z)(s.value,2),d=l[0],h=l[1];n.unshift(["".concat(u,"[").concat(d,"]"),h])}}catch(e){f.e(e)}finally{f.f()}}else void 0!==c&&(null===c&&(c=""),t+="&"+[u,c].map(encodeURIComponent).join("="))}return t.substr(1)}function y(e){return(function(e){var r;try{r=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(r)return r}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,r){var t=r.split("=").filter(Boolean).map(decodeURIComponent),n=(0,i.Z)(t,2),o=n[0],a=n[1],u=void 0===a?"":a;return o&&function(e,r,t){for(var n=r.length,o=n-1,i=0;i<n;i++){var a=r[i];!a&&Array.isArray(e)&&(a=e.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;var u=!isNaN(Number(r[i+1]));e[a]=i===o?t:e[a]||(u?[]:{}),Array.isArray(e[a])&&!u&&(e[a]=w({},e[a])),e=e[a]}}(e,o.replace(/\]/g,"").split("["),u),e}),Object.create(null))}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0;if(!r||!Object.keys(r).length)return e;var t=e,n=e.indexOf("?");return-1!==n&&(r=Object.assign(y(e),r),t=t.substr(0,n)),t+"?"+b(r)}function O(e,r){return void 0!==function(e,r){return y(e)[r]}(e,r)}function j(e){var r=e.split("?"),t=r[1],n=r[0];return t?n+"?"+t.split("&").map((function(e){return e.split("=")})).map((function(e){return e.map(decodeURIComponent)})).sort((function(e,r){return e[0].localeCompare(r[0])})).map((function(e){return e.map(encodeURIComponent)})).map((function(e){return e.join("=")})).join("&"):n}function _(e,r){return Promise.resolve(r?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}var x=function(e){return e.json?e.json():Promise.reject(e)},P=function(e){return function(e){if(!e)return{};var r=e.match(/<([^>]+)>; rel="next"/);return r?{next:r[1]}:{}}(e.headers.get("link")).next},k=function(e){var r=!!e.path&&-1!==e.path.indexOf("per_page=-1"),t=!!e.url&&-1!==e.url.indexOf("per_page=-1");return r||t},A=function(){var e=(0,n.Z)(c().mark((function e(r,t){var n,i,a,u,s,f;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==r.parse){e.next=2;break}return e.abrupt("return",t(r));case 2:if(k(r)){e.next=4;break}return e.abrupt("return",t(r));case 4:return e.next=6,W(w(w({},(d={per_page:100},void 0,void 0,p=(c=r).path,h=c.url,w(w({},(0,o.Z)(c,l)),{},{url:h&&g(h,d),path:p&&g(p,d)}))),{},{parse:!1}));case 6:return n=e.sent,e.next=9,x(n);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(a=P(n)){e.next=15;break}return e.abrupt("return",i);case 15:u=[].concat(i);case 16:if(!a){e.next=27;break}return e.next=19,W(w(w({},r),{},{path:void 0,url:a,parse:!1}));case 19:return s=e.sent,e.next=22,x(s);case 22:f=e.sent,u=u.concat(f),a=P(s),e.next=16;break;case 27:return e.abrupt("return",u);case 28:case"end":return e.stop()}var c,d,p,h}),e)})));return function(_x,r){return e.apply(this,arguments)}}(),S=new Set(["PATCH","PUT","DELETE"]),E=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r?204===e.status?null:e.json?e.json():Promise.reject(e):e},Z=function(e){var r={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.")};if(!e||!e.json)throw r;return e.json().catch((function(){throw r}))},I=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(E(e,r)).catch((function(e){return T(e,r)}))};function T(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!r)throw e;return Z(e).then((function(e){var r={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw e||r}))}var C,D,M,U,R,N,L,J={Accept:"application/json, */*;q=0.1"},G={credentials:"include"},H=[function(e,r){return"string"!=typeof e.url||O(e.url,"_locale")||(e.url=g(e.url,{_locale:"user"})),"string"!=typeof e.path||O(e.path,"_locale")||(e.path=g(e.path,{_locale:"user"})),r(e)},m,function(e,r){var t=e.method,n=void 0===t?"GET":t;return S.has(n.toUpperCase())&&(e=w(w({},e),{},{headers:w(w({},e.headers),{},{"X-HTTP-Method-Override":n,"Content-Type":"application/json"}),method:"POST"})),r(e)},A],$=function(e){if(e.status>=200&&e.status<300)return e;throw e},B=function(e){var r=e.url,t=e.path,n=e.data,i=e.parse,a=void 0===i||i,u=(0,o.Z)(e,d),c=e.body,s=e.headers;return s=w(w({},J),s),n&&(c=JSON.stringify(n),s["Content-Type"]="application/json"),window.fetch(r||t||window.location.href,w(w(w({},G),u),{},{body:c,headers:s})).then((function(e){return Promise.resolve(e).then($).catch((function(e){return T(e,a)})).then((function(e){return I(e,a)}))}),(function(e){if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function W(e){return H.reduceRight((function(e,r){return function(t){return r(t,e)}}),B)(e).catch((function(r){return"rest_cookie_invalid_nonce"!==r.code?Promise.reject(r):window.fetch(W.nonceEndpoint).then($).then((function(e){return e.text()})).then((function(r){return W.nonceMiddleware.nonce=r,W(e)}))}))}W.use=function(e){H.unshift(e)},W.setFetchHandler=function(e){B=e},W.createNonceMiddleware=function(e){var r=function e(r,t){var n=r.headers,o=void 0===n?{}:n;for(var i in o)if("x-wp-nonce"===i.toLowerCase()&&o[i]===e.nonce)return t(r);return t(w(w({},r),{},{headers:w(w({},o),{},{"X-WP-Nonce":e.nonce})}))};return r.nonce=e,r},W.createPreloadingMiddleware=function(e){var r=Object.fromEntries(Object.entries(e).map((function(e){var r=(0,i.Z)(e,2),t=r[0],n=r[1];return[j(t),n]})));return function(e,t){var n=e.parse,i=void 0===n||n,a=e.path;if(!a&&e.url){var u=y(e.url),c=u.rest_route,s=(0,o.Z)(u,f);"string"==typeof c&&(a=g(c,s))}if("string"!=typeof a)return t(e);var l=e.method||"GET",d=j(a);if("GET"===l&&r[d]){var p=r[d];return delete r[d],_(p,!!i)}if("OPTIONS"===l&&r[l]&&r[l][d]){var h=r[l][d];return delete r[l][d],_(h,!!i)}return t(e)}},W.createRootURLMiddleware=function(e){return function(r,t){return m(r,(function(r){var n,o=r.url,i=r.path;return"string"==typeof i&&(n=e,-1!==e.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(i=i.replace("?","&")),o=n+i),t(w(w({},r),{},{url:o}))}))}},W.fetchAllMiddleware=A,W.mediaUploadMiddleware=function(e,r){if(!function(e){var r=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&r}(e))return r(e);var t=0,n=function e(n){return t++,r({path:"/wp/v2/media/".concat(n,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return t<5?e(n):(r({path:"/wp/v2/media/".concat(n,"?force=true"),method:"DELETE"}),Promise.reject())}))};return r(w(w({},e),{},{parse:!1})).catch((function(r){var t=r.headers.get("x-wp-upload-attachment-id");return r.status>=500&&r.status<600&&t?n(t).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:wp.i18n.__("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(r)})):T(r,e.parse)})).then((function(r){return I(r,e.parse)}))},W.fetchAllMiddleware=null,W.use(W.createRootURLMiddleware((null===(D=null===(C=null===window||void 0===window?void 0:window.parent)||void 0===C?void 0:C.scData)||void 0===D?void 0:D.root_url)||(null===(M=null===window||void 0===window?void 0:window.scData)||void 0===M?void 0:M.root_url))),(null===(U=null===window||void 0===window?void 0:window.scData)||void 0===U?void 0:U.nonce)&&(W.nonceMiddleware=W.createNonceMiddleware(null===(R=null===window||void 0===window?void 0:window.scData)||void 0===R?void 0:R.nonce),W.use(W.nonceMiddleware)),(null===(N=null===window||void 0===window?void 0:window.scData)||void 0===N?void 0:N.nonce_endpoint)&&(W.nonceEndpoint=null===(L=null===window||void 0===window?void 0:window.scData)||void 0===L?void 0:L.nonce_endpoint),W.use((function(e,r){return e.path=(0,s.a)(e.path,{t:Date.now()}),r(e)}));var X=function(e){var r={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.","surecart")};if((null==e?void 0:e.code)&&(null==e?void 0:e.message))throw e;if(!e||!e.json)throw r;return e.json().catch((function(){throw r}))},q=function(){var e=(0,n.Z)(c().mark((function e(r){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X(r);case 2:if("rest_cookie_invalid_nonce"===(t=e.sent).code){e.next=5;break}throw t;case 5:return e.abrupt("return",window.fetch(W.nonceEndpoint).then((function(e){if(e.status>=200&&e.status<300)return e;throw e})).then((function(e){return e.text()})).then((function(e){W.nonceMiddleware.nonce=e})));case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}()},6455:function(e,r,t){t.d(r,{o:function(){return n}});var n=function(e,r){new window.IntersectionObserver((function(e,t){e[0].intersectionRatio>0&&(r(),t.unobserve(e[0].target))})).observe(e)}},3660:function(e,r,t){t.r(r),t.d(r,{sc_dashboard_customer_details:function(){return d}});var n=t(5861),o=t(5671),i=t(3144),a=t(1284),u=t.n(a),c=t(8860),s=t(930),f=t(6455),l=t(448),d=function(){function e(r){(0,o.Z)(this,e),(0,c.r)(this,r),this.customerId=void 0,this.heading=void 0,this.customer=void 0,this.loading=void 0,this.error=void 0}var r;return(0,i.Z)(e,[{key:"componentWillLoad",value:function(){var e=this;(0,f.o)(this.el,(function(){e.fetch()}))}},{key:"fetch",value:(r=(0,n.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==this.customerId){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,this.loading=!0,e.next=6,(0,s.a)({path:(0,l.a)("surecart/v1/customers/".concat(this.customerId),{expand:["shipping_address","billing_address","tax_identifier"]})});case 6:return e.next=8,e.sent;case 8:this.customer=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(2),(null===e.t0||void 0===e.t0?void 0:e.t0.message)?this.error=e.t0.message:this.error=wp.i18n.__("Something went wrong","surecart"),console.error(this.error);case 15:return e.prev=15,this.loading=!1,e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,11,15,18]])}))),function(){return r.apply(this,arguments)})},{key:"render",value:function(){return(0,c.h)("sc-customer-details",{customer:this.customer,loading:this.loading,error:this.error,heading:this.heading,"edit-link":(0,l.a)(window.location.href,{action:"edit",model:"customer",id:this.customerId})})}},{key:"el",get:function(){return(0,c.a)(this)}}]),e}();d.style=":host{display:block;position:relative}.customer-details{display:grid;gap:0.75em}"},4942:function(e,r,t){function n(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}t.d(r,{Z:function(){return n}})},5987:function(e,r,t){t.d(r,{Z:function(){return o}});var n=t(3366);function o(e,r){if(null==e)return{};var t,o,i=(0,n.Z)(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}},3366:function(e,r,t){function n(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}t.d(r,{Z:function(){return n}})}}]);