HEX
Server: LiteSpeed
System: Linux premium212.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: vitanhod (1367)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //home/vitanhod/www/wp-content/plugins/woocommerce/assets/client/admin/chunks/store-alerts.js
"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[1438],{20178:(e,s,o)=>{o.d(s,{A:()=>a});var t=o(5573),r=o(39793);const a=(0,r.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(t.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})})},28629:(e,s,o)=>{o.d(s,{A:()=>a});var t=o(5573),r=o(39793);const a=(0,r.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(t.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})})},42905:(e,s,o)=>{o.d(s,{A:()=>a});var t=o(5573),r=o(39793);const a=(0,r.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(t.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})})},72691:(e,s,o)=>{o.d(s,{B:()=>t});const t=(e,s,o)=>{const t=!o||window.wcAdminFeatures.analytics;return"two_columns"===(e||s)&&t}},59743:(e,s,o)=>{o.r(s),o.d(s,{StoreAlerts:()=>B,default:()=>L});var t=o(27723),r=o(86087),a=o(56427),n=o(4921),l=o(85703),c=o(47143),i=o(76154),d=o.n(i),m=o(77871),u=o(20178),h=o(28629),_=o(42905),w=o(40314),p=o(83306),g=o(96476),x=o(35888),j=o(39793);class v extends r.Component{render(){const{hasMultipleAlerts:e,className:s}=this.props;return(0,j.jsxs)(a.Card,{className:(0,n.A)("woocommerce-store-alerts is-loading",s),"aria-hidden":!0,size:"none",children:[(0,j.jsxs)(a.CardHeader,{isBorderless:!0,children:[(0,j.jsx)("span",{className:"is-placeholder"}),e&&(0,j.jsx)("span",{className:"is-placeholder"})]}),(0,j.jsx)(a.CardBody,{children:(0,j.jsxs)("div",{className:"woocommerce-store-alerts__message",children:[(0,j.jsx)("span",{className:"is-placeholder"}),(0,j.jsx)("span",{className:"is-placeholder"})]})}),(0,j.jsx)(a.CardFooter,{isBorderless:!0,children:(0,j.jsx)("span",{className:"is-placeholder"})})]})}}const A=v;v.defaultProps={hasMultipleAlerts:!1};var N=o(98467),b=o(99830),f=o(72691),S=o(45881);const C={page:1,per_page:w.QUERY_DEFAULTS.pageSize,type:"error,update",status:"unactioned"};function y(e){return(e||[]).filter(e=>"unactioned"===e.status&&!0!==e.is_deleted)}const B=()=>{const[e,s]=(0,r.useState)(0),{alerts:o=[],isLoading:i,defaultHomescreenLayout:v}=(0,c.useSelect)(e=>{const{getNotes:s,hasFinishedResolution:o}=e(w.notesStore),{getOption:t}=e(w.optionsStore);return{alerts:y(s(C)),isLoading:!o("getNotes",[C]),defaultHomescreenLayout:t("woocommerce_default_homepage_layout")||"single_column"}}),{triggerNoteAction:B,updateNote:L,removeNote:k}=(0,c.useDispatch)(w.notesStore),{createNotice:M}=(0,c.useDispatch)("core/notices"),z=(0,w.useUserPreferences)();function P(o){o?.stopPropagation(),e>0&&s(e-1)}const T=(0,N.Qk)("alertCount",0,e=>parseInt(e,10)),F=(0,g.isWCAdmin)(),H=F&&"homescreen"===(0,g.getScreenFromPath)(),E=(0,f.B)(z.homepage_layout,v,(0,S.EM)("setup"));if(T>0&&i)return(0,j.jsx)(A,{className:(0,n.A)({"is-wc-admin-page":F,"is-homescreen":H,"two-columns":E&&H}),hasMultipleAlerts:T>1});if(0===o.length)return null;const D=o.length,U=o[e],G=U.type,R=(0,n.A)("woocommerce-store-alerts",{"is-alert-error":"error"===G,"is-alert-update":"update"===G,"is-wc-admin-page":F,"is-homescreen":H,"two-columns":E&&H});return(0,j.jsxs)(a.Card,{className:R,size:"none",children:[(0,j.jsxs)(a.CardHeader,{className:"woocommerce-store-alerts__header",isBorderless:!0,children:[(0,j.jsx)("span",{className:"woocommerce-store-alerts__title",children:U.title}),D>1&&(0,j.jsxs)("div",{className:"woocommerce-store-alerts__pagination",children:[(0,j.jsx)("span",{className:"woocommerce-store-alerts__pagination-label",role:"status","aria-live":"polite",children:(0,l.A)({mixedString:(0,t.__)("{{current /}} of {{total /}}","woocommerce"),components:{current:(0,j.jsx)(r.Fragment,{children:e+1}),total:(0,j.jsx)(r.Fragment,{children:D})}})}),(0,j.jsx)(a.Button,{onClick:P,disabled:0===e,label:(0,t.__)("Previous Alert","woocommerce"),children:(0,j.jsx)(m.A,{icon:u.A,className:"arrow-left-icon"})}),(0,j.jsx)(a.Button,{onClick:function(t){t.stopPropagation(),e<o.length-1&&s(e+1)},disabled:D-1===e,label:(0,t.__)("Next Alert","woocommerce"),children:(0,j.jsx)(m.A,{icon:h.A,className:"arrow-right-icon"})})]}),(0,j.jsx)(a.Button,{className:"woocommerce-store-alerts__close",onClick:()=>(async e=>{const s=(0,b.s9)();(0,p.recordEvent)("inbox_action_dismiss",{note_name:e.name,note_title:e.title,note_name_dismiss_all:!1,note_name_dismiss_confirmation:!0,screen:s});const o=e.id;try{await k(o),M("success",(0,t.__)("Message dismissed","woocommerce"))}catch(e){M("error",(0,t._n)("Message could not be dismissed","Messages could not be dismissed",1,"woocommerce"))}})(U),children:(0,j.jsx)(m.A,{width:"18",height:"18",icon:_.A})})]}),(0,j.jsx)(a.CardBody,{children:(0,j.jsx)("div",{className:"woocommerce-store-alerts__message",dangerouslySetInnerHTML:(0,x.A)(U.content)})}),(0,j.jsx)(a.CardFooter,{isBorderless:!0,children:function(e){const s=e.actions.map((s,o)=>{const r=0===o?"secondary":"tertiary";return(0,j.jsx)(a.Button,{variant:r,href:s.url||void 0,onClick:async o=>{const r=o.currentTarget.getAttribute("href");o.preventDefault(),P();try{await B(e.id,s.id),r&&"#"!==r&&(0,g.parseAdminUrl)(r).href!==window.location.href&&(0,g.navigateTo)({url:r})}catch(e){throw M("error",(0,t.__)("Something went wrong while triggering this note's action.","woocommerce")),e}},children:s.label},`${e.id}-${s.label}-${s.name}`)}),o=[{value:d()().add(4,"hours").unix().toString(),label:(0,t.__)("Later Today","woocommerce")},{value:d()().add(1,"day").hour(9).minute(0).second(0).millisecond(0).unix().toString(),label:(0,t.__)("Tomorrow","woocommerce")},{value:d()().add(1,"week").hour(9).minute(0).second(0).millisecond(0).unix().toString(),label:(0,t.__)("Next Week","woocommerce")},{value:d()().add(1,"month").hour(9).minute(0).second(0).millisecond(0).unix().toString(),label:(0,t.__)("Next Month","woocommerce")}],r=e.is_snoozable&&(0,j.jsx)(a.SelectControl,{className:"woocommerce-store-alerts__snooze",options:[{label:(0,t.__)("Remind Me Later","woocommerce"),value:"0"},...o],onChange:s=>{if("0"===s)return;const t=o.find(e=>e.value===s);(s=>{L(e.id,{status:"snoozed",date_reminder:s.value});const o={alert_name:e.name,alert_title:e.title,snooze_duration:s.value,snooze_label:s.label};(0,p.recordEvent)("store_alert_snooze",o)})({value:s,label:t&&t.label})}});if(s||r)return(0,j.jsxs)("div",{className:"woocommerce-store-alerts__actions",children:[s,r]})}(U)})]})},L=B},35888:(e,s,o)=>{o.d(s,{A:()=>r});var t=o(42435);const r=e=>({__html:(0,t.sanitizeHTML)(e)})}}]);