geno/wp-content/plugins/woocommerce/assets/client/admin/wp-admin-scripts/print-shipping-label-banner.js

1 line
15 KiB
JavaScript
Raw Normal View History

2024-02-01 17:24:18 +05:30
(()=>{var e={31772:(e,t,n)=>{"use strict";var s=n(25148);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,r){if(r!==s){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},7862:(e,t,n)=>{e.exports=n(31772)()},25148:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s);const e=window.wp.element,t=window.wc.data;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const o=window.wp.i18n,r=window.wp.components,a=window.wp.compose,c=window.React;function l(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function p(e,t){let n,s,i=[];for(let o=0;o<e.length;o++){const r=e[o];if("string"!==r.type){if(void 0===t[r.value])throw new Error(`Invalid interpolation, missing component node: \`${r.value}\``);if("object"!=typeof t[r.value])throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${r.value}\``);if("componentClose"===r.type)throw new Error(`Missing opening component token: \`${r.value}\``);if("componentOpen"===r.type){n=t[r.value],s=o;break}i.push(t[r.value])}else i.push(r.value)}if(n){const o=function(e,t){const n=t[e];let s=0;for(let i=e+1;i<t.length;i++){const e=t[i];if(e.value===n.value){if("componentOpen"===e.type){s++;continue}if("componentClose"===e.type){if(0===s)return i;s--}}}throw new Error("Missing closing component token `"+n.value+"`")}(s,e),r=p(e.slice(s+1,o),t),a=(0,c.cloneElement)(n,{},r);if(i.push(a),o<e.length-1){const n=p(e.slice(o+1),t);i=i.concat(n)}}return i=i.filter(Boolean),0===i.length?null:1===i.length?i[0]:(0,c.createElement)(c.Fragment,null,...i)}function d(e){const{mixedString:t,components:n,throwErrors:s}=e;if(!n)return t;if("object"!=typeof n){if(s)throw new Error(`Interpolation Error: unable to process \`${t}\` because components is not an object`);return t}const i=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(l)}(t);try{return p(i,n)}catch(e){if(s)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}var m=n(7862),u=n.n(m);const h=window.lodash,w=window.wp.data,g=window.wc.tracks,_=window.wc.wcSettings;class b extends e.Component{constructor(){super(...arguments),i(this,"setDismissed",(e=>{this.props.updateOptions({woocommerce_shipping_dismissed_timestamp:e})})),i(this,"hideBanner",(()=>{document.getElementById("woocommerce-admin-print-label").style.display="none"})),i(this,"remindMeLaterClicked",(()=>{const{onCloseAll:e,trackElementClicked:t}=this.props;this.setDismissed(Date.now()),e(),this.hideBanner(),t("shipping_banner_dismiss_modal_remind_me_later")})),i(this,"closeForeverClicked",(()=>{const{onCloseAll:e,trackElementClicked:t}=this.props;this.setDismissed(-1),e(),this.hideBanner(),t("shipping_banner_dismiss_modal_close_forever")}))}render(){const{onClose:t,visible: