%PDF- %PDF-
Direktori : /var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/packages/kkart-admin/dist/chunks/ |
Current File : //var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/packages/kkart-admin/dist/chunks/0.js |
(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[0],{439:function(e,t,r){"use strict";var n=r(8),a=r(12),c=r(4),o=r.n(c),i=r(0);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.as,r=void 0===t?"div":t,c=e.className,s=Object(a.a)(e,["as","className"]);return function(e){var t=e.as,r=void 0===t?"div":t,n=Object(a.a)(e,["as"]);return"function"==typeof n.children?n.children(n):Object(i.createElement)(r,n)}(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({as:r,className:o()("components-visually-hidden",c)},s))}},447:function(e,t,r){"use strict";r.d(t,"a",(function(){return h}));var n={};r.r(n),r.d(n,"find",(function(){return i}));var a={};r.r(a),r.d(a,"isTabbableIndex",(function(){return u})),r.d(a,"find",(function(){return f})),r.d(a,"findPrevious",(function(){return y})),r.d(a,"findNext",(function(){return O}));var c=["[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",");function o(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function i(e){var t=e.querySelectorAll(c);return Array.from(t).filter((function(e){return!!o(e)&&("AREA"!==e.nodeName||function(e){var t=e.closest("map[name]");if(!t)return!1;var r=document.querySelector('img[usemap="#'+t.name+'"]');return!!r&&o(r)}(e))}))}var l=r(2);function s(e){var t=e.getAttribute("tabindex");return null===t?0:parseInt(t,10)}function u(e){return-1!==s(e)}function d(e,t){return{element:e,index:t}}function b(e){return e.element}function m(e,t){var r=s(e.element),n=s(t.element);return r===n?e.index-t.index:r-n}function p(e){return e.filter(u).map(d).sort(m).map(b).reduce((t={},function(e,r){var n=r.nodeName,a=r.type,c=r.checked,o=r.name;if("INPUT"!==n||"radio"!==a||!o)return e.concat(r);var i=t.hasOwnProperty(o);if(!c&&i)return e;if(i){var s=t[o];e=Object(l.without)(e,s)}return t[o]=r,e.concat(r)}),[]);var t}function f(e){return p(i(e))}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,t=i(document.body),r=t.indexOf(e);return t.length=r,Object(l.last)(p(t))}function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,t=i(document.body),r=t.indexOf(e),n=t.slice(r+1).filter((function(t){return!e.contains(t)}));return Object(l.first)(p(n))}var h={focusable:n,tabbable:a}},762:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return u}));var n=r(0),a=r(55),c=r(214),o=r.n(c),i=r(36),l=o()(i.b),s=function(e){var t=l.getCurrencyConfig(),r=Object(a.applyFilters)("kkart_admin_report_currency",t,e);return o()(r)},u=Object(n.createContext)(l)},763:function(e,t,r){"use strict";var n=r(17),a=r.n(n),c=r(15),o=r.n(c),i=r(18),l=r.n(i),s=r(19),u=r.n(s),d=r(9),b=r.n(d),m=r(0),p=r(3),f=r(1),y=r.n(f),O=r(77),h=r(36);function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b()(e);if(t){var a=b()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return u()(this,r)}}var j=function(e){l()(r,e);var t=g(r);function r(){return a()(this,r),t.apply(this,arguments)}return o()(r,[{key:"render",value:function(){var e,t,r,n,a=this.props,c=a.className,o=a.isError,i=a.isEmpty;return o?(e=Object(p.__)("There was an error getting your stats. Please try again.",'kkart'),t=Object(p.__)("Reload",'kkart'),n=function(){window.location.reload()}):i&&(e=Object(p.__)("No results could be found for this date range.",'kkart'),t=Object(p.__)("View Orders",'kkart'),r=Object(h.f)("edit.php?post_type=shop_order")),Object(m.createElement)(O.EmptyContent,{className:c,title:e,actionLabel:t,actionURL:r,actionCallback:n})}}]),r}(m.Component);j.propTypes={className:y.a.string,isError:y.a.bool,isEmpty:y.a.bool},j.defaultProps={className:""},t.a=j},767:function(e,t,r){"use strict";var n=r(0),a=r(4),c=r.n(a),o=r(439);function i(e){var t=e.id,r=e.label,a=e.hideLabelFromVision,l=e.help,s=e.className,u=e.children;return Object(n.createElement)("div",{className:c()("components-base-control",s)},Object(n.createElement)("div",{className:"components-base-control__field"},r&&t&&(a?Object(n.createElement)(o.a,{as:"label",htmlFor:t},r):Object(n.createElement)("label",{className:"components-base-control__label",htmlFor:t},r)),r&&!t&&(a?Object(n.createElement)(o.a,{as:"label"},r):Object(n.createElement)(i.VisualLabel,null,r)),u),!!l&&Object(n.createElement)("p",{id:t+"__help",className:"components-base-control__help"},l))}i.VisualLabel=function(e){var t=e.className,r=e.children;return t=c()("components-base-control__label",t),Object(n.createElement)("span",{className:t},r)},t.a=i},770:function(e,t,r){"use strict";var n=r(5),a=r.n(n),c=r(17),o=r.n(c),i=r(15),l=r.n(i),s=r(11),u=r.n(s),d=r(18),b=r.n(d),m=r(19),p=r.n(m),f=r(9),y=r.n(f),O=r(0),h=r(1),g=r.n(h),j=r(2),v=r(20),_=r(77),w=r(36),E=r(35),k=r(40),S=r(64),P=r(762);function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=y()(e);if(t){var a=y()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return p()(this,r)}}var N=function(e){b()(r,e);var t=C(r);function r(){var e;return o()(this,r),(e=t.call(this)).trackDateSelect=e.trackDateSelect.bind(u()(e)),e.trackFilterSelect=e.trackFilterSelect.bind(u()(e)),e.trackAdvancedFilterAction=e.trackAdvancedFilterAction.bind(u()(e)),e}return l()(r,[{key:"trackDateSelect",value:function(e){var t=this.props.report;Object(S.recordEvent)("datepicker_update",R({report:t},Object(j.omitBy)(e,j.isUndefined)))}},{key:"trackFilterSelect",value:function(e){var t=this.props.report;Object(S.recordEvent)("analytics_filter",{report:t,filter:e.filter||"all"})}},{key:"trackAdvancedFilterAction",value:function(e,t){var r=this.props.report;switch(e){case"add":Object(S.recordEvent)("analytics_filters_add",{report:r,filter:t.key});break;case"remove":Object(S.recordEvent)("analytics_filters_remove",{report:r,filter:t.key});break;case"filter":var n=Object.keys(t).reduce((function(e,r){return e[Object(j.snakeCase)(r)]=t[r],e}),{});Object(S.recordEvent)("analytics_filters_filter",R({report:r},n));break;case"clear_all":Object(S.recordEvent)("analytics_filters_clear_all",{report:r});break;case"match":Object(S.recordEvent)("analytics_filters_all_any",{report:r,value:t.match})}}},{key:"render",value:function(){var e=this.props,t=e.advancedFilters,r=e.filters,n=e.path,a=e.query,c=e.showDatePicker,o=e.defaultDateRange,i=Object(k.getDateParamsFromQuery)(a,o),l=i.period,s=i.compare,u=i.before,d=i.after,b=Object(k.getCurrentDates)(a,o),m={period:l,compare:s,before:u,after:d,primaryDate:b.primary,secondaryDate:b.secondary},p=this.context;return Object(O.createElement)(_.ReportFilters,{query:a,siteLocale:w.c.siteLocale,currency:p.getCurrencyConfig(),path:n,filters:r,advancedFilters:t,showDatePicker:c,onDateSelect:this.trackDateSelect,onFilterSelect:this.trackFilterSelect,onAdvancedFilterAction:this.trackAdvancedFilterAction,dateQuery:m,isoDateFormat:k.isoDateFormat})}}]),r}(O.Component);N.contextType=P.a,t.a=Object(v.withSelect)((function(e){return{defaultDateRange:e(E.SETTINGS_STORE_NAME).getSetting("kkart_admin","wcAdminSettings").kkart_default_date_range}}))(N),N.propTypes={advancedFilters:g.a.object,filters:g.a.array,path:g.a.string.isRequired,query:g.a.object,showDatePicker:g.a.bool,report:g.a.string.isRequired}},771:function(e,t,r){"use strict";var n=r(38),a=r.n(n),c=r(30),o=r.n(c),i=r(5),l=r.n(i),s=r(34),u=r.n(s),d=r(62),b=r.n(d),m=r(0),p=r(779),f=r(72),y=r(55),O=r(277),h=r(447),g=r(20),j=r(2),v=r(3),_=r(4),w=r.n(_),E=r(1),k=r.n(E),S=r(77),P=r(32),D=r(740),R=r(35),C=r(64),N=function(){return Object(m.createElement)("svg",{role:"img","aria-hidden":"true",focusable:"false",version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24"},Object(m.createElement)("path",{d:"M18,9c-0.009,0-0.017,0.002-0.025,0.003C17.72,5.646,14.922,3,11.5,3C7.91,3,5,5.91,5,9.5c0,0.524,0.069,1.031,0.186,1.519 C5.123,11.016,5.064,11,5,11c-2.209,0-4,1.791-4,4c0,1.202,0.541,2.267,1.38,3h18.593C22.196,17.089,23,15.643,23,14 C23,11.239,20.761,9,18,9z M12,16l-4-5h3V8h2v3h3L12,16z"}))},x=r(763);function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(827);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=function(e){var t=e.getHeadersContent,r=e.getRowsContent,n=e.getSummary,c=e.isRequesting,i=e.primaryData,s=e.tableData,d=e.endpoint,O=(e.itemIdField,e.tableQuery,e.compareBy),g=e.compareParam,_=e.searchBy,E=e.labels,k=void 0===E?{}:E,F=b()(e,["getHeadersContent","getRowsContent","getSummary","isRequesting","primaryData","tableData","endpoint","itemIdField","tableQuery","compareBy","compareParam","searchBy","labels"]),q=e.query,T=e.columnPrefsKey,Q=s.items,I=s.query,B=q[g]?Object(P.getIdsFromQuery)(q[O]):[],L=Object(m.useState)(B),V=u()(L,2),U=V[0],M=V[1],H=Object(m.useRef)(null),z=Object(R.useUserPreferences)(),G=z.updateUserPreferences,J=b()(z,["updateUserPreferences"]);if(s.isError||i.isError)return Object(m.createElement)(x.a,{isError:!0});var K=[];T&&(K=J&&J[T]?J[T]:K);var W,Y,X,Z,$=function(t){var r=e.ids;M(t?r:[])},ee=function(t,r){var n=e.ids;if(r)M(Object(j.uniq)([n[t]].concat(o()(U))));else{var a=U.indexOf(n[t]);M([].concat(o()(U.slice(0,a)),o()(U.slice(a+1))))}},te=function(t){var r=e.ids,n=void 0===r?[]:r,a=-1!==U.indexOf(n[t]);return{display:Object(m.createElement)(p.a,{onChange:Object(j.partial)(ee,t),checked:a}),value:!1}},re=c||s.isRequesting||i.isRequesting,ne=Object(j.get)(i,["data","totals"],{}),ae=Q.totalResults,ce=ae>0,oe=Object(P.getSearchWords)(q).map((function(e){return{key:e,label:e}})),ie=Object(y.applyFilters)("kkart_admin_report_table",{endpoint:d,headers:t(),rows:r(Q.data),totals:ne,summary:n?n(ne,ae):null,items:Q}),le=ie.headers,se=ie.rows,ue=ie.summary;O&&(se=se.map((function(e,t){return[te(t)].concat(o()(e))})),le=[(W=e.ids,Y=void 0===W?[]:W,X=Y.length>0,Z=X&&Y.length===U.length,{cellClassName:"is-checkbox-column",key:"compare",label:Object(m.createElement)(p.a,{onChange:$,"aria-label":Object(v.__)("Select All"),checked:Z,disabled:!X}),required:!0})].concat(o()(le)));var de=function(e,t){return t?e.map((function(e){return A(A({},e),{},{visible:e.required||!t.includes(e.key)})})):e.map((function(e){return A(A({},e),{},{visible:e.required||!e.hiddenByDefault})}))}(le,K),be=w()("kkart-report-table",{"has-compare":!!O,"has-search":!!_});return Object(m.createElement)(m.Fragment,null,Object(m.createElement)("div",{className:"kkart-report-table__scroll-point",ref:H,"aria-hidden":!0}),Object(m.createElement)(S.TableCard,a()({className:be,actions:[O&&Object(m.createElement)(S.CompareButton,{key:"compare",className:"kkart-table__compare",count:U.length,helpText:k.helpText||Object(v.__)("Check at least two items below to compare",'kkart'),onClick:function(){O&&Object(P.onQueryChange)("compare")(O,g,U.join(","))},disabled:!ce},k.compareButton||Object(v.__)("Compare",'kkart')),_&&Object(m.createElement)(S.Search,{allowFreeTextSearch:!0,inlineTags:!0,key:"search",onChange:function(t){var r,n=e.baseSearchQuery,a=t.map((function(e){return e.label.replace(",","%2C")}));a.length?Object(P.updateQueryString)(A(A((r={filter:void 0},l()(r,g,void 0),l()(r,_,void 0),r),n),{},{search:Object(j.uniq)(a).join(",")})):Object(P.updateQueryString)({search:void 0});Object(C.recordEvent)("analytics_table_filter",{report:d})},placeholder:k.placeholder||Object(v.__)("Search by item name",'kkart'),selected:oe,showClearButton:!0,type:_,disabled:!ce}),ce&&Object(m.createElement)(f.a,{key:"download",className:"kkart-table__download-button",disabled:re,onClick:function(){var n=e.createNotice,a=e.startExport,c=e.title,o=Object.assign({},q),i=Q.data,l=Q.totalResults,s="browser";delete o.extended_info,o.search&&delete o[_],i&&i.length===l?Object(D.downloadCSVFile)(Object(D.generateCSVFileName)(c,o),Object(D.generateCSVDataFromTable)(t(),r(i))):(s="email",a(d,I).then((function(){return n("success",Object(v.sprintf)(Object(v.__)("Your %s Report will be emailed to you.",'kkart'),c))})).catch((function(e){return n("error",e.message||Object(v.sprintf)(Object(v.__)("There was a problem exporting your %s Report. Please try again.",'kkart'),c))}))),Object(C.recordEvent)("analytics_table_download",{report:d,rows:l,downloadType:s})}},Object(m.createElement)(N,null),Object(m.createElement)("span",{className:"kkart-table__download-button__label"},k.downloadButton||Object(v.__)("Download",'kkart')))],headers:de,isLoading:re,onQueryChange:P.onQueryChange,onColumnsChange:function(e,t){var r=le.map((function(e){return e.key})).filter((function(t){return!e.includes(t)}));if(T){var n=l()({},T,r);G(n)}if(t){var a={report:d,column:t,status:e.includes(t)?"on":"off"};Object(C.recordEvent)("analytics_table_header_toggle",a)}},onSort:function(e,t){Object(P.onQueryChange)("sort")(e,t);var r={report:d,column:e,direction:t};Object(C.recordEvent)("analytics_table_sort",r)},onPageChange:function(e,t){H.current.scrollIntoView();var r=H.current.nextSibling.querySelector(".kkart-table__table"),n=h.a.focusable.find(r);n.length&&n[0].focus(),t&&("goto"===t?Object(C.recordEvent)("analytics_table_go_to_page",{report:d,page:e}):Object(C.recordEvent)("analytics_table_page_click",{report:d,direction:t}))},rows:se,rowsPerPage:parseInt(I.per_page,10)||R.QUERY_DEFAULTS.pageSize,summary:ue,totalRows:ae},F)))};Q.propTypes={baseSearchQuery:k.a.object,compareBy:k.a.string,compareParam:k.a.string,columnPrefsKey:k.a.string,endpoint:k.a.string,extendItemsMethodNames:k.a.shape({getError:k.a.string,isRequesting:k.a.string,load:k.a.string}),extendedItemsStoreName:k.a.string,getHeadersContent:k.a.func.isRequired,getRowsContent:k.a.func.isRequired,getSummary:k.a.func,itemIdField:k.a.string,labels:k.a.shape({compareButton:k.a.string,downloadButton:k.a.string,helpText:k.a.string,placeholder:k.a.string}),primaryData:k.a.object,searchBy:k.a.string,summaryFields:k.a.arrayOf(k.a.string),tableData:k.a.object.isRequired,tableQuery:k.a.object,title:k.a.string.isRequired},Q.defaultProps={primaryData:{},tableData:{items:{data:[],totalResults:0},query:{}},tableQuery:{},compareParam:"filter",downloadable:!1,onSearch:j.noop,baseSearchQuery:{}};t.a=Object(O.a)(Object(g.withSelect)((function(e,t){var r=t.endpoint,n=t.getSummary,a=t.isRequesting,c=t.itemIdField,o=t.query,i=t.tableData,l=t.tableQuery,s=t.filters,u=t.advancedFilters,d=t.summaryFields;if(a||o.search&&(!o[r]||!o[r].length))return{};var b=e(R.SETTINGS_STORE_NAME).getSetting("kkart_admin","wcAdminSettings").kkart_default_date_range,m="categories"===r?"products":r,p=n?Object(R.getReportChartData)({endpoint:m,dataType:"primary",query:o,select:e,filters:s,advancedFilters:u,tableQuery:l,defaultDateRange:b,fields:d}):{},f=function(e,t,r){var n=t.extendItemsMethodNames,a=t.extendedItemsStoreName,c=t.itemIdField,o=r.items.data;if(!(Array.isArray(o)&&o.length&&n&&c))return r;var i=e(a),l=i[n.getError],s=i[n.isRequesting],u=i[n.load],d={include:o.map((function(e){return e[c]})).join(","),per_page:o.length},b=u(d),m=!!s&&s(d),p=!!l&&l(d),f=o.map((function(e){var t=Object(j.first)(b.filter((function(t){return e.id===t.id})));return q(q({},e),t)})),y=r.isRequesting||m,O=r.isError||p;return q(q({},r),{},{isRequesting:y,isError:O,items:q(q({},r.items),{},{data:f})})}(e,t,i||Object(R.getReportTableData)({endpoint:r,query:o,select:e,tableQuery:l,filters:s,advancedFilters:u,defaultDateRange:b}));return{primaryData:p,ids:c&&f.items.data?f.items.data.map((function(e){return e[c]})):[],tableData:f,query:A(A({},l),o)}})),Object(g.withDispatch)((function(e){var t=e(R.EXPORT_STORE_NAME).startExport;return{createNotice:e("core/notices").createNotice,startExport:t}})))(Q)},779:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(7),a=r(12),c=r(0),o=r(300),i=r(575),l=r(759),s=r(767);function u(e){var t=e.label,r=e.className,d=e.heading,b=e.checked,m=e.help,p=e.onChange,f=Object(a.a)(e,["label","className","heading","checked","help","onChange"]),y=Object(o.a)(u),O="inspector-checkbox-control-".concat(y);return Object(c.createElement)(s.a,{label:d,id:O,help:m,className:r},Object(c.createElement)("span",{className:"components-checkbox-control__input-container"},Object(c.createElement)("input",Object(n.a)({id:O,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:function(e){return p(e.target.checked)},checked:b,"aria-describedby":m?O+"__help":void 0},f)),b?Object(c.createElement)(i.a,{icon:l.a,className:"components-checkbox-control__checked",role:"presentation"}):null),Object(c.createElement)("label",{className:"components-checkbox-control__label",htmlFor:O},t))}},827:function(e,t,r){}}]);