Your IP : 216.73.216.65


Current Path : /home/ataenra/www/administrator/components/com_sppagebuilder/assets/editor/dist/js/
Upload File :
Current File : /home/ataenra/www/administrator/components/com_sppagebuilder/assets/editor/dist/js/382.min.js

/*! For license information please see 382.min.js.LICENSE.txt */
"use strict";(self.webpackChunkreact_typescript_webpack_backend_editor=self.webpackChunkreact_typescript_webpack_backend_editor||[]).push([[382],{2477:(t,e,r)=>{r.r(e),r.d(e,{default:()=>be});var n=r(3871),o=r(7870),i=r(7264),a=r(1731),l=r(4353),c=r(8122),u=r(5350),s=r(7579),d=r(3039),f=r(7894),p=r(8111),h=r(9148),y=r(1709),b=r(9085),v=r(9313),g=r(824),E=r(4185),_=r(917),m=r(1234),O=r(230),S=r(4101),w=r(3579),P=r(1954),I=r(1921),L=r(7294),D=r(5944);function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}const A=function(t){var e,r,n=t.value,o=t.options,a=t.onChange,l=void 0===a?O.ZT:a,c=t.label,u=t.disabled,s=(e=(0,L.useState)(!1),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(e,r)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r=Object.prototype.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)?T(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=s[0],f=s[1],p=(0,P.l)({isOpen:d,isDropdown:!0}),h=p.triggerRef,y=p.triggerWidth,b=p.position,v=p.popoverRef,g=o.find((function(t){return t.value===n})),E={0:"unpublished",1:"published","-2":"trashed"};if(!(0,O.$K)(n)||(0,O.$K)(n)&&!(n in E))return null;var _=G[E[n]];return(0,D.BX)("div",{css:x.mainWrapper,children:[!!c&&(0,D.tZ)("div",{children:c}),(0,D.BX)("button",{type:"button",css:x.dropDownLabel({statusVariant:_,isOpen:d,isDisabled:u||!o.length}),onClick:function(){return f(!0)},ref:h,disabled:u,children:[(0,D.BX)("div",{children:[_.leftIcon,(0,D.tZ)("span",{children:(null==g?void 0:g.label)||""})]}),(0,D.tZ)(i.Z,{name:"chevronDown",width:12,height:8})]}),(0,D.tZ)(P.h,{isOpen:d,onClickOutside:function(){return f(!1)},children:(0,D.tZ)("div",{css:[x.optionsWrapper,{left:b.left,top:b.top,maxWidth:y},";label:StatusSelect;"],ref:v,children:(0,D.tZ)("ul",{css:x.options,children:o.map((function(t){return(0,D.tZ)("li",{css:x.optionItem({isSelected:n===t.value}),children:(0,D.tZ)(w.Z,{label:t.label,checked:n===t.value,onChange:function(){f(!1),l(t)},labelCss:x.radioLabel,disabled:t.disabled})},t.value)}))})})})]})};var C={name:"1f3qfry-dropDownLabel",styles:"pointer-events:none;label:dropDownLabel;"},R={name:"i3yy6i-dropDownLabel",styles:"transform:rotate(180deg);label:dropDownLabel;"},x={mainWrapper:{name:"e9i770-mainWrapper",styles:"width:100%;label:mainWrapper;"},dropDownLabel:function(t){var e=t.statusVariant,r=t.isOpen,n=void 0!==r&&r,o=t.isDisabled,i=void 0!==o&&o;return(0,_.iv)(I.iZ.resetButton," width:124px;display:flex;justify-content:space-between;align-items:center;border-radius:42px;height:24px;padding:0 ",g.W0[8]," 0 ",g.W0[6],";border:1px solid ",e.borderColor,";background-color:",e.backgroundColor,";position:relative;div{display:flex;gap:",g.W0[4],";align-items:center;span{color:",e.color,";}svg{height:16px;width:16px;color:",e.leftIconColor,";transform:none;}}& svg{width:12px;height:8px;color:",e.rightIconColor,";transition:transform 0.3s ease-in-out;",n&&R," ",i&&C,";}",i&&(0,_.iv)("background-color:",g.qo.background.disabled,";border:1px solid ",g.qo.stroke.disabled,";div{span{color:",g.qo.text.disabled,";}svg{color:",g.qo.icon.disabled,";}};label:dropDownLabel;"),";;label:dropDownLabel;")},optionsWrapper:{name:"1cmtbh-optionsWrapper",styles:"position:absolute;min-width:170px;width:100%;label:optionsWrapper;"},options:(0,_.iv)("z-index:",g.W5.dropdown,";background-color:",g.qo.base.white,";list-style-type:none;box-shadow:",g.AF.popover,";padding:",g.W0[4]," 0;margin:0;max-height:500px;overflow-y:auto;border-radius:",g.E0[6],";::-webkit-scrollbar{background-color:",g.qo.base.white,";width:10px;}::-webkit-scrollbar-thumb{background-color:",g.qo.base.secondary,";border-radius:",g.E0[6],";};label:options;"),optionItem:function(t){var e=t.isSelected;return(0,_.iv)(E.c.body(),";min-height:40px;transition:background-color 0.3s ease-in-out;:hover{background-color:",g.qo.background.hover,";}",e&&(0,_.iv)("background-color:",g.qo.background.active,";;label:optionItem;"),";;label:optionItem;")},radioLabel:(0,_.iv)("line-height:40px;padding-left:",g.W0[12],";;label:radioLabel;")},G={published:{backgroundColor:g.qo.background.success,borderColor:g.qo.stroke.success,color:g.qo.base.success,leftIconColor:g.qo.base.success,rightIconColor:g.qo.icon.success,leftIcon:(0,D.tZ)(i.Z,{name:"markCircle",width:16,height:16})},unpublished:{backgroundColor:g.qo.background.neutral,borderColor:g.qo.stroke.neutral,color:g.qo.text.neutral,leftIconColor:g.qo.icon.hints,rightIconColor:g.qo.icon.default,leftIcon:(0,D.tZ)(i.Z,{name:"circleCross",width:16,height:16})},trashed:{backgroundColor:g.qo.background.danger,borderColor:g.qo.stroke.danger,color:g.qo.text.error,leftIconColor:g.qo.icon.error,rightIconColor:g.qo.icon.error,leftIcon:(0,D.tZ)(i.Z,{name:"crossCircle",width:16,height:16})}},B=r(935),j=r(802),M=r(6537),Z=r(6492),U=r(4469),k=r(5501),N=function(t){return k.u.put(M.H.ADD_TO_MENU,t.data)},W=r(7536),q=r(9781);function F(t){return F="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},F(t)}function H(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?H(Object(r),!0).forEach((function(e){X(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function X(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==F(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==F(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===F(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K(){K=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),l=new P(o||[]);return n(a,"_invoke",{value:m(t,r,l)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d={};function f(){}function p(){}function h(){}var y={};c(y,i,(function(){return this}));var b=Object.getPrototypeOf,v=b&&b(b(I([])));v&&v!==e&&r.call(v,i)&&(y=v);var g=h.prototype=f.prototype=Object.create(y);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(n,i,a,l){var c=s(t[n],t,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==F(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,l)}),(function(t){o("throw",t,a,l)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,l)}))}l(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function m(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var l=O(a,r);if(l){if(l===d)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(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 w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return p.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:p,configurable:!0}),p.displayName=c(h,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,l,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},E(_.prototype),c(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(g),c(g,l,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.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}},t.values=I,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,d):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),d},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),w(r),d}},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;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function $(t,e,r,n,o,i,a){try{var l=t[i](a),c=l.value}catch(t){return void r(t)}l.done?e(c):Promise.resolve(c).then(n,o)}const V=function(t){var e,r=t.closeModal,o=t.title,i=t.id,l=(0,m.$)(),s=(0,j.O)({defaultValues:{page_id:i,menu_id:0,parent_id:1,menu_type:"mainmenu",title:"",alias:"",ordering:0}}),d=s.setValue,f=s.reset,p=s.getValues,h=s.watch,y=function(t){var e=(0,a.p)().showToast;return(0,Z.a)({queryKey:["MenuByPageId",t],queryFn:function(){return function(t){return k.u.get(M.H.MENU_BY_PAGE_ID,{params:{id:t}})}(t).then((function(t){return t.data}))},onError:function(t){e({type:"danger",message:t.message})}})}(i),b=(e=(0,a.p)().showToast,(0,Z.a)({queryKey:["MenuList"],queryFn:function(){return k.u.get(M.H.MENU_LIST).then((function(t){return t.data}))},onError:function(t){e({type:"danger",message:t.message})}})),v=function(t){var e=t.menutype,r=t.id,n=(0,a.p)().showToast;return(0,Z.a)({queryKey:["MenuParentItems",e,r],queryFn:function(){return function(t){var e=t.menutype,r=t.id;return k.u.get(M.H.MENU_PARENT_ITEMS,{params:{menutype:e,id:r}})}({menutype:e,id:r}).then((function(t){return t.data}))},onError:function(t){n({type:"danger",message:t.message})}})}({menutype:h("menu_type"),id:p("menu_id")}),g=function(){var t=(0,a.p)().showToast,e=(0,m.$)();return(0,U.D)({mutationFn:N,onSuccess:function(){t({type:"success",message:e("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_SUCCESS_MESSAGE")})},onError:function(e){t({type:"danger",message:e.message})}})}();return(0,L.useEffect)((function(){y.data&&f({menu_id:y.data.id,parent_id:y.data.parent_id,menu_type:y.data.menutype,title:y.data.title,alias:y.data.alias,ordering:y.data.id})}),[y.data,f]),y.isLoading||b.isLoading?(0,D.tZ)(B.fz,{}):(0,D.tZ)(q.Z,{onClose:function(){return r({action:"CLOSE"})},title:o,wrapperCss:Q.wrapper,children:(0,D.BX)("form",{onSubmit:s.handleSubmit(function(){var t,e=(t=K().mark((function t(e){return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.mutateAsync({id:i,data:e});case 2:t.sent.data&&r({action:"CONFIRM"});case 4:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){$(i,n,o,a,l,"next",t)}function l(t){$(i,n,o,a,l,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}()),children:[(0,D.BX)("div",{css:Q.fieldWrapper,children:[(0,D.tZ)(W.Qr,{name:"title",control:s.control,render:function(t){return(0,D.tZ)(u.Z,Y(Y({},t),{},{label:l("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_MENU_TITLE")}))}}),(0,D.tZ)(W.Qr,{name:"alias",control:s.control,render:function(t){return(0,D.tZ)(u.Z,Y(Y({},t),{},{label:l("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_MENU_ALIAS")}))}}),(0,D.tZ)(W.Qr,{name:"menu_type",control:s.control,render:function(t){var e;return(0,D.tZ)(c.Z,Y(Y({},t),{},{label:l("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_MENU"),options:null!==(e=b.data)&&void 0!==e?e:[],isClearable:!1,onChange:function(){d("parent_id",1)}}))}}),(0,D.tZ)(W.Qr,{name:"parent_id",control:s.control,render:function(t){var e;return(0,D.tZ)(c.Z,Y(Y({},t),{},{label:l("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_MENU_PARENT"),options:null!==(e=v.data)&&void 0!==e?e:[],isClearable:!1}))}})]}),(0,D.BX)("div",{css:Q.buttonWrapper,children:[(0,D.tZ)(n.Z,{variant:"secondary",onClick:function(){return r({action:"CLOSE"})},children:l("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_CANCEL")}),(0,D.tZ)(n.Z,{type:"submit",loading:g.isLoading,children:l("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_SAVE_CHANGES")})]})]})})};var Q={wrapper:{name:"1vd4vqj-wrapper",styles:"max-width:500px;label:wrapper;"},fieldWrapper:(0,_.iv)("background-color:",g.qo.base.white,";padding:",g.W0[20],";display:flex;flex-direction:column;gap:",g.W0[12],";;label:fieldWrapper;"),buttonWrapper:(0,_.iv)("background-color:",g.qo.background.white,";box-shadow:",g.AF.dividerTop,";padding:",g.W0[12]," ",g.W0[16],";display:flex;justify-content:end;gap:",g.W0[8],";;label:buttonWrapper;")},z=r(1974),J=r(3106),tt=r(8138),et=r(5587),rt=r(4285);function nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ot=r(2811),it=r(908),at=r(9101),lt=r(1073),ct=r(6238),ut=r(2328),st=r(7184),dt=r(7679),ft=r(6680),pt=r(9655);function ht(t){return ht="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},ht(t)}function yt(){yt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),l=new P(o||[]);return n(a,"_invoke",{value:m(t,r,l)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d={};function f(){}function p(){}function h(){}var y={};c(y,i,(function(){return this}));var b=Object.getPrototypeOf,v=b&&b(b(I([])));v&&v!==e&&r.call(v,i)&&(y=v);var g=h.prototype=f.prototype=Object.create(y);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(n,i,a,l){var c=s(t[n],t,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==ht(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,l)}),(function(t){o("throw",t,a,l)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,l)}))}l(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function m(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var l=O(a,r);if(l){if(l===d)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(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 w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return p.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:p,configurable:!0}),p.displayName=c(h,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,l,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},E(_.prototype),c(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(g),c(g,l,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.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}},t.values=I,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,d):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),d},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),w(r),d}},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;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function bt(t,e,r,n,o,i,a){try{var l=t[i](a),c=l.value}catch(t){return void r(t)}l.done?e(c):Promise.resolve(c).then(n,o)}function vt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){bt(i,n,o,a,l,"next",t)}function l(t){bt(i,n,o,a,l,"throw",t)}a(void 0)}))}}function gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Et(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gt(Object(r),!0).forEach((function(e){_t(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _t(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==ht(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===ht(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}const Ot=function(t){var e,r,n,o=t.selectedItems,l=t.index,c=t.page,s=t.data,d=t.lastSelectedIndex,f=t.setLastSelectedIndex,h=t.setSelectedItems,v=t.columns,_=(0,m.$)(),S=function(){var t,e,r=(t=(0,L.useState)(!1),e=2,function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return nt(t,e);var r=Object.prototype.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)?nt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=r[0],o=r[1],i=function(t){"shift"===t.key.toLowerCase()&&o(!0)},a=function(t){"shift"===t.key.toLowerCase()&&o(!1)};return(0,L.useEffect)((function(){return window.addEventListener("keydown",i),window.addEventListener("keyup",a),function(){window.removeEventListener("keydown",i),window.removeEventListener("keyup",a)}}),[]),n}(),w=(0,y.d)().showModal,P=(0,a.p)().showToast,T=(0,p.g)(),C=(r=(0,L.useState)(!1),n=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(r,n)||function(t,e){if(t){if("string"==typeof t)return mt(t,e);var r=Object.prototype.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)?mt(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),R=C[0],x=C[1],G=(0,ut.v)((function(t){return t.appConfig})),B=(0,dt.R4)(),M=(0,dt.es)(),Z=(0,st.X)(),U=(0,ot.T)().closeSettingPanel,k=(0,lt.j)((function(t){return t.setActiveAction})),N=(0,it.Q)(),q=(0,ct.j)(c.id),F=(0,j.O)({defaultValues:{title:c.title}}),H=(0,et.nB)({id:c.id}),Y=H.attributes,X=H.listeners,K=H.setNodeRef,$=H.transform,Q=H.transition,ht=H.isDragging,bt={transform:rt.ux.Transform.toString($),transition:Q,zIndex:ht?g.W5.positive:g.W5.level,backgroundColor:ht?g.qo.background.hover:""};if((0,L.useEffect)((function(){var t=function(t){"Escape"===t.key&&(x(!1),F.reset({title:c.title}))};return window.addEventListener("keydown",t),function(){window.removeEventListener("keydown",t)}}),[]),q.isLoading||!q.data)return null;var gt=q.data.page.edit,_t=N.edit_own&&c.created_by===G.user_id,Ot=N.create&&gt,St=q.data.page.edit_state,Pt=q.data.page.delete,It=[{id:"view",icon:"eye",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_VIEW"},{id:"rename",icon:"pencil",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_RENAME",isDisabled:!gt&&!_t},{id:"duplicate",icon:"cloneLine",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_DUPLICATE",isDisabled:!Ot},{id:"copyLink",icon:"link",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_COPY_LINK"},{id:"addToMenu",icon:"plus",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_ADD_TO_MENU",isDisabled:!gt&&!_t},{id:"export",icon:"upload",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_EXPORT"},{id:"remove",icon:"trash",title:-2===c.published?"COM_SPPAGEBUILDER_EDITOR_PAGE_DELETE":"COM_SPPAGEBUILDER_EDITOR_PAGE_TRASH",variant:"critical",isDisabled:!Pt}],Lt=[{label:_("COM_SPPAGEBUILDER_EDITOR_FILTER_PUBLISHED"),value:1,disabled:!St},{label:_("COM_SPPAGEBUILDER_EDITOR_FILTER_UNPUBLISHED"),value:0,disabled:!St},{label:_("COM_SPPAGEBUILDER_EDITOR_FILTER_TRASHED"),value:-2,disabled:!St||!Pt}];return(0,D.BX)("tr",{css:wt.bodyTr({isSelected:o.ids.includes(c.id),isShownFrontendButton:G.enable_frontend_editing&&gt}),ref:K,style:bt,children:[(0,D.BX)("td",{css:wt.checkboxWrapper,children:[(0,D.tZ)("div",Et(Et(Et({css:wt.dragPoint,"data-drag-point":!0},Y),X),{},{children:(0,D.tZ)(i.Z,{name:"dragger",height:32,width:32})})),(0,D.tZ)(b.Z,{onChange:function(t){var e=(0,O.R5)({itemId:c.id,isShiftHolding:S,lastSelectedIndex:d,currentIndex:l,isChecked:t,selectedItemIds:o.ids,selectedItemsIndex:o.indexes,totalItemsList:s}),r=e.updatedItemIds,n=e.updatedItemIndexes;h({ids:r,indexes:n}),f(l)},checked:o.ids.includes(c.id)})]}),(0,D.tZ)("td",{children:(0,D.tZ)("div",{css:wt.pageName,children:R?(0,D.tZ)("form",{onSubmit:F.handleSubmit((0,ft.GI)(F,function(){var t=vt(yt().mark((function t(e){var r;return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.title,t.next=3,B.mutateAsync({ids:c.id.toString(),type:"rename",value:r});case 3:x(!1);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())),children:(0,D.tZ)(W.Qr,{control:F.control,name:"title",render:function(t){return(0,D.tZ)(u.Z,Et(Et({},t),{},{hasAutoFocus:!0}))}})}):(0,D.BX)(D.HY,{children:[gt?(0,D.tZ)(pt.rU,{css:wt.titleButton({canEdit:gt}),to:tt.F.PageEditor.buildLink({id:c.id.toString(),type:""}),state:{prevPageName:J.lr},onClick:function(){k(void 0),U()},children:c.title}):(0,D.tZ)("span",{css:wt.titleButton({canEdit:gt}),children:c.title}),0!==c.checked_out&&(0,D.tZ)("button",{type:"button",css:wt.lockButton,onClick:function(){B.mutate({type:"check-out",ids:c.id.toString()})},children:(0,D.tZ)(i.Z,{name:"lock",width:24,height:24})}),G.enable_frontend_editing&&gt&&(0,D.BX)("a",{"data-frontend-editor-button":!0,css:wt.frontendEditorButton,href:c.url,target:"_blank",rel:"noopener noreferrer",children:[(0,D.tZ)(i.Z,{name:"parmaLink",width:16,height:16}),(0,D.tZ)("span",{children:_("COM_SPPAGEBUILDER_EDITOR_FRONTEND_EDITOR")})]})]})})}),v.includes("author")&&(0,D.tZ)("td",{css:wt.widthStyles({width:200}),children:(0,D.tZ)("p",{children:c.author})}),v.includes("categories")&&(0,D.tZ)("td",{children:(0,D.tZ)("p",{children:c.category})}),v.includes("access")&&(0,D.tZ)("td",{css:wt.access,children:(0,D.tZ)("p",{children:c.access_title})}),v.includes("id")&&(0,D.tZ)("td",{css:[E.c.body("medium"),I.iZ.textCenter,";label:PageListItem;"],children:(0,D.tZ)("p",{children:c.id})}),v.includes("hits")&&(0,D.tZ)("td",{css:[E.c.body("medium"),I.iZ.textCenter,";label:PageListItem;"],children:c.hits}),v.includes("language")&&(0,D.tZ)("td",{css:I.iZ.textCenter,children:(0,D.tZ)("p",{children:null!==(e=c.language_title)&&void 0!==e?e:_("COM_SPPAGEBUILDER_EDITOR_LANGUAGE_ALL")})}),(0,D.tZ)("td",{css:wt.status,children:(0,D.tZ)(A,{value:c.published,options:Lt,onChange:function(t){B.mutate({type:{1:"published",0:"unpublished","-2":"trash"}[t.value],ids:c.id.toString()})},disabled:!St})}),(0,D.tZ)("td",{css:wt.actionColumn,children:(0,D.tZ)(at.Z,{actions:It,triggerButtonContent:(0,D.tZ)(i.Z,{name:"ellipsisX",width:24,height:24,style:wt.triggerIcon}),onSelect:function(){var t=vt(yt().mark((function t(e){return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="remove"===t.t0?3:"addToMenu"===t.t0?12:"view"===t.t0?14:"copyLink"===t.t0?16:"duplicate"===t.t0?18:"export"===t.t0?20:"rename"===t.t0?22:25;break;case 3:if(-2===c.published){t.next=6;break}return B.mutate({type:"trash",ids:c.id.toString()}),t.abrupt("break",25);case 6:return t.next=8,T({title:_("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_TITLE"),confirmationMessage:_("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_MESSAGE_SINGLE_PAGE"),confirmButtonText:_("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_DELETE_BUTTON_TEXT_SINGLE_ITEM"),mutationFn:dt.hh,payload:{ids:c.id.toString(),type:"delete"},invalidateKeys:[["PageList"]]});case 8:return"CONFIRM"===t.sent.action&&P({type:"success",message:_("COM_SPPAGEBUILDER_EDITOR_BULK_ACTION_PERFORMED_SUCCESSFULLY")}),t.abrupt("break",25);case 12:return w({component:V,props:{title:_("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_TITLE"),id:c.id}}),t.abrupt("break",25);case 14:return window.open(c.preview,"_blank","noopener=true,noreferrer=true"),t.abrupt("break",25);case 16:return r="".concat(z.Z.APPLICATION_ROOT,"index.php?option=com_sppagebuilder&view=page&id=").concat(c.id),n=void 0,(n=document.createElement("textarea")).value=r,n.setAttribute("readonly",""),n.style.position="absolute",n.style.left="-9999px",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),P({type:"success",message:_("COM_SPPAGEBUILDER_EDITOR_PAGE_COPY_LINK_MESSAGE")}),t.abrupt("break",25);case 18:return M.mutate({id:c.id}),t.abrupt("break",25);case 20:return Z.mutateAsync({template:c.text,css:c.css}),t.abrupt("break",25);case 22:return F.setValue("title",c.title),x(!0),t.abrupt("break",25);case 25:case"end":return t.stop()}var r,n}),t)})));return function(e){return t.apply(this,arguments)}}()})})]},c.id)};var St={name:"1qe2gq2-bodyTr",styles:"[data-frontend-editor-button]{display:flex;};label:bodyTr;"},wt={bodyTr:function(t){var e=t.isSelected,r=t.isShownFrontendButton;return(0,_.iv)("height:80px;border-bottom:1px solid ",g.qo.stroke.neutral,";position:relative;&:hover{background-color:",g.qo.background.hover,";",r&&St," [data-drag-point]{opacity:1;}}",e&&(0,_.iv)("background-color:",g.qo.background.disabled,";;label:bodyTr;"),";;label:bodyTr;")},lockButton:(0,_.iv)(I.iZ.resetButton,";svg{color:",g.qo.icon.default,";};label:lockButton;"),titleButton:function(t){var e=t.canEdit;return(0,_.iv)(E.c.heading6(),";padding-inline:0;",e&&(0,_.iv)(":hover{color:",g.qo.text.primary,";};label:titleButton;")," ",!e&&(0,_.iv)("cursor:not-allowed;color:",g.qo.text.disabled,";;label:titleButton;"),";;label:titleButton;")},widthStyles:function(t){var e=t.width;return(0,_.iv)("width:",e,"px;;label:widthStyles;")},pageName:(0,_.iv)("position:relative;display:flex;gap:",g.W0[12],";align-items:center;max-width:400px;width:100%;;label:pageName;"),frontendEditorButton:(0,_.iv)(E.c.body(),";background-color:",g.qo.base.white,";border-radius:",g.E0[24],";padding:",g.W0[4]," ",g.W0[12]," ",g.W0[4]," ",g.W0[4],";width:fit-content;align-items:center;gap:",g.W0[8],";color:",g.qo.text.neutral,";display:none;position:absolute;left:100%;white-space:nowrap;svg{fill:none;}&:hover{color:",g.qo.text.hover,";}&::before,&::after{content:''!important;all:unset!important;};label:frontendEditorButton;"),checkboxWrapper:{name:"l0wqz3-checkboxWrapper",styles:"position:relative;label:checkboxWrapper;"},dragPoint:(0,_.iv)("position:absolute;top:0;left:0;height:100%;width:32px;display:flex;align-items:center;opacity:0;cursor:grab;svg{color:",g.qo.icon.default,";};label:dragPoint;"),access:{name:"sx074l-access",styles:"text-align:center;label:access;"},status:{name:"1n9i8ph-status",styles:"display:grid;place-content:center;height:inherit;label:status;"},triggerIcon:(0,_.iv)("color:",g.qo.icon.hints,";;label:triggerIcon;"),actionColumn:{name:"1m7ix2e-actionColumn",styles:"text-align:right;label:actionColumn;"}};const Pt=function(t){var e=t.data,r=t.selectedItems,n=t.setSelectedItems,o=t.lastSelectedIndex,i=t.setLastSelectedIndex,a=t.isLoading,l=void 0!==a&&a,c=t.columns,u=(0,m.$)(),s=e.length,d=r.ids.length,f=c.length+3;return(0,D.tZ)("div",{css:Lt.tableContainer,children:(0,D.BX)("table",{css:Lt.table({selectedColumns:c.length}),children:[(0,D.tZ)("thead",{children:(0,D.BX)("tr",{css:Lt.headRow,children:[(0,D.tZ)("th",{css:Lt.widthStyles({width:70}),children:(0,D.tZ)(b.Z,{checked:d>0&&d===s,isIndeterminate:d>0&&d<s,onChange:function(){var t=d===s?[]:(0,O.x9)(e),r=d===s?[]:(0,O.w6)(s);n({ids:t,indexes:r}),i(-1)}})}),(0,D.tZ)("th",{css:Lt.widthStyles({width:250}),children:u("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_PAGE_NAME")}),c.includes("author")&&(0,D.tZ)("th",{css:Lt.widthStyles({width:180}),children:u("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_AUTHOR")}),c.includes("categories")&&(0,D.tZ)("th",{children:u("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_CATEGORIES")}),c.includes("access")&&(0,D.tZ)("th",{css:Lt.textCenter,children:u("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_ACCESS")}),c.includes("id")&&(0,D.tZ)("th",{css:Lt.textCenter,children:u("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_ID")}),c.includes("hits")&&(0,D.tZ)("th",{css:Lt.textCenter,children:u("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_HITS")}),c.includes("language")&&(0,D.tZ)("th",{css:Lt.textCenter,children:u("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_LANGUAGE")}),(0,D.tZ)("th",{css:[Lt.widthStyles({width:160}),Lt.textCenter,";label:PageListTable;"],children:u("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_STATUS")}),(0,D.tZ)("th",{css:Lt.widthStyles({width:100})})]})}),(0,D.tZ)("tbody",{children:l?Array(10).fill(0).map((function(t,e){return(0,D.tZ)("tr",{css:Lt.skeletonWrapper,children:Array(f).fill(0).map((function(t,e){return(0,D.tZ)("td",{css:Lt.widthStyles({width:0===e?70:(0,O.sZ)(100,250)}),children:(0,D.tZ)(v.Z,{animation:!0,height:20,width:"".concat(0===e?100:(0,O.sZ)(90,100),"%")})},e)}))},e)})):e.map((function(t,a){return(0,D.tZ)(Ot,{index:a,data:e,page:t,lastSelectedIndex:o,setLastSelectedIndex:function(t){return i(t)},selectedItems:r,setSelectedItems:function(t){n(t)},columns:c},t.id)}))})]})})};var It={name:"vq4tj-table",styles:"tr:hover{td{:nth-of-type(3)>*{display:none;}}};label:table;"},Lt={tableContainer:{name:"1c7p8s-tableContainer",styles:"display:block;width:100%;overflow-x:auto;label:tableContainer;"},table:function(t){var e=t.selectedColumns;return(0,_.iv)("width:100%;th{background-color:",(0,S.m4)(g.qo.base.primary,.15),";color:",g.qo.text.default,";height:49px;}th,td{",E.c.body(),";padding:",g.W0[16],";:first-of-type{padding-left:",g.W0[32],";}:last-of-type{padding-right:",g.W0[24],";}}",e>0&&It,";;label:table;")},headRow:(0,_.iv)("th{",E.c.body(),";};label:headRow;"),paginatorWrapper:(0,_.iv)("margin-top:",g.W0[32],";;label:paginatorWrapper;"),widthStyles:function(t){var e=t.width;return(0,_.iv)("width:",e,"px;;label:widthStyles;")},textCenter:{name:"lfnssf-textCenter",styles:"text-align:center;label:textCenter;"},skeletonWrapper:(0,_.iv)("border-bottom:1px solid ",g.qo.stroke.neutral,";height:80px;;label:skeletonWrapper;")},Dt=r(9752),Tt=r(36),At=r(4420);function Ct(t){return Ct="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},Ct(t)}function Rt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Rt(Object(r),!0).forEach((function(e){Gt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Gt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Ct(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Ct(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return jt(t,e);var r=Object.prototype.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)?jt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Mt=(0,At.createEnumParam)(["asc","desc"]),Zt=r(2200),Ut=r(8698),kt=r(3425),Nt=r(6511);function Wt(t){return Wt="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},Wt(t)}function qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ft(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qt(Object(r),!0).forEach((function(e){Ht(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ht(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Wt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Wt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Yt=function(t){var e=t.values,r=t.onChange,i=t.wrapperCss,a=t.clearButtonStatus,l=t.onClearFilter,c=(0,m.$)(),u=(0,ut.v)((function(t){return t.appConfig})),s=e.status,d=e.access,f=e.category,p=e.language,h=[{label:c("COM_SPPAGEBUILDER_EDITOR_FILTER_PUBLISHED"),value:1},{label:c("COM_SPPAGEBUILDER_EDITOR_FILTER_UNPUBLISHED"),value:0},{label:c("COM_SPPAGEBUILDER_EDITOR_FILTER_TRASHED"),value:-2}];return(0,D.BX)("div",{css:[Xt.wrapper,i,";label:FilterSelectGroup;"],children:[(0,D.tZ)(o.Z,{placeholder:c("COM_SPPAGEBUILDER_EDITOR_FILTER_PLACEHOLDER_STATUS"),wrapperStyle:Xt.itemCss,value:h.find((function(t){return t.value===s})),options:h,clearOption:function(){r(Ft(Ft({},e),{},{status:null}))},onChange:function(t){r(Ft(Ft({},e),{},{status:t.value}))}}),(0,D.tZ)(o.Z,{placeholder:c("COM_SPPAGEBUILDER_EDITOR_FILTER_PLACEHOLDER_ACCESS"),wrapperStyle:Xt.itemCss,value:u.access_levels.find((function(t){return t.value===d})),options:u.access_levels,clearOption:function(){r(Ft(Ft({},e),{},{access:null}))},onChange:function(t){r(Ft(Ft({},e),{},{access:t.value}))}}),(0,D.tZ)(o.Z,{placeholder:c("COM_SPPAGEBUILDER_EDITOR_FILTER_PLACEHOLDER_CATEGORY"),wrapperStyle:Xt.itemCss,value:f?u.categories.find((function(t){return t.value===Number(f)})):void 0,options:u.categories,clearOption:function(){r(Ft(Ft({},e),{},{category:null}))},onChange:function(t){r(Ft(Ft({},e),{},{category:t.value}))}}),(0,D.tZ)(o.Z,{placeholder:c("COM_SPPAGEBUILDER_EDITOR_FILTER_PLACEHOLDER_LANGUAGE"),wrapperStyle:Xt.itemCss,value:u.languages.find((function(t){return t.value===p})),options:u.languages,clearOption:function(){r(Ft(Ft({},e),{},{language:null}))},onChange:function(t){r(Ft(Ft({},e),{},{language:t.value}))}}),(0,D.tZ)(n.Z,{variant:"secondary",disabled:!a,buttonCss:Xt.itemCss,onClick:function(){r({status:null,access:null,category:null,language:null}),l()},children:c("COM_SPPAGEBUILDER_EDITOR_CLEAR")})]})};var Xt={wrapper:(0,_.iv)("display:flex;border:1px solid ",g.qo.stroke.neutral,";border-radius:",g.E0[5],";overflow:hidden;box-shadow:",g.AF.input,";input,button{border:none;border-radius:0;box-shadow:none;}input{border-right:1px solid ",g.qo.stroke.neutral,";:focus{box-shadow:none;}}button:last-of-type{display:flex;justify-content:center;align-items:center;};label:wrapper;"),itemCss:{name:"1qky7zh-itemCss",styles:"min-width:108px;label:itemCss;"}};function Kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}const $t=function(t){var e,r,n=t.currentPage,o=t.onPageChange,a=t.totalItems,l=t.itemsPerPage,c=(0,m.$)(),u=(e=(0,L.useState)(""),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(e,r)||function(t,e){if(t){if("string"==typeof t)return Kt(t,e);var r=Object.prototype.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)?Kt(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],d=u[1],f=Math.max(Math.ceil(a/l),1);(0,L.useEffect)((function(){d(n.toString())}),[n]);var p=function(t){t<1||t>f||o(t)};return(0,D.BX)("div",{css:Vt.wrapper,children:[(0,D.BX)("div",{css:Vt.pageStatus,children:[c("COM_SPPAGEBUILDER_EDITOR_PAGINATION_PAGE"),(0,D.tZ)("span",{children:(0,D.tZ)("input",{type:"text",css:Vt.paginationInput,value:s,onChange:function(t){var e=t.currentTarget.value.replace(/[^0-9]/g,""),r=Number(e);r>0&&r<=f?(d(e),o(r)):e||d(e)},autoComplete:"off"})}),c("COM_SPPAGEBUILDER_EDITOR_PAGINATION_PAGE_OF")," ",(0,D.tZ)("span",{children:f})]}),(0,D.BX)("div",{css:Vt.pageController,children:[(0,D.tZ)("button",{type:"button",css:Vt.paginationButton,onClick:function(){return p(n-1)},disabled:1===n,children:(0,D.tZ)(i.Z,{name:"chevronLeft",width:24,height:24})}),(0,D.tZ)("button",{type:"button",css:Vt.paginationButton,onClick:function(){return p(n+1)},disabled:n===f,children:(0,D.tZ)(i.Z,{name:"chevronRight",width:24,height:24})})]})]})};var Vt={wrapper:(0,_.iv)("display:flex;justify-content:end;align-items:center;flex-wrap:wrap;gap:",g.W0[8],";height:36px;;label:wrapper;"),pageStatus:(0,_.iv)(E.c.body()," color:",g.qo.text.neutral,";min-width:100px;;label:pageStatus;"),paginationInput:(0,_.iv)("outline:0;border:1px solid ",g.qo.stroke.neutral,";border-radius:",g.E0[5],";margin:0 ",g.W0[8],";color:",g.qo.text.neutral,";padding:",g.W0[8]," ",g.W0[12],";width:72px;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:",g.W0[0],";};label:paginationInput;"),pageController:(0,_.iv)("gap:",g.W0[8],";display:flex;justify-content:center;align-items:center;height:100%;;label:pageController;"),paginationButton:(0,_.iv)(I.iZ.resetButton,";background-color:",g.qo.background.white,";color:",g.qo.icon.default,";border-radius:",g.E0[6],";height:32px;width:32px;display:grid;place-items:center;transition:background-color 0.2s ease-in-out,color 0.3s ease-in-out;&:hover{background-color:",g.qo.base.primary,";&>svg{color:",g.qo.base.white,";}}&:disabled{background-color:",g.qo.background.disabled,";&>svg{color:",g.qo.icon.disabled,";}};label:paginationButton;")};const Qt=r.p+"images/ed8841a7709fb2582a09.svg";var zt=r(4693);function Jt(t){return Jt="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},Jt(t)}function te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ee(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Jt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Jt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var re=function(t){var e=t.draggingNodeRect,r=t.transform,n=t.scrollableAncestorRects[0];return e&&n?ne(r,e,n):r},ne=function(t,e,r){var n=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?te(Object(r),!0).forEach((function(e){ee(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);return e.top+t.y<=r.top?n.y=r.top-e.top:e.bottom+t.y>=r.top+r.height&&(n.y=r.top+r.height-e.bottom),e.left+t.x<=r.left?n.x=r.left-e.left:e.right+t.x>=r.left+r.width&&(n.x=r.left+r.width-e.right),n},oe=r(7273),ie=r(6216);function ae(t){return ae="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},ae(t)}function le(){le=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),l=new P(o||[]);return n(a,"_invoke",{value:m(t,r,l)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d={};function f(){}function p(){}function h(){}var y={};c(y,i,(function(){return this}));var b=Object.getPrototypeOf,v=b&&b(b(I([])));v&&v!==e&&r.call(v,i)&&(y=v);var g=h.prototype=f.prototype=Object.create(y);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(n,i,a,l){var c=s(t[n],t,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==ae(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,l)}),(function(t){o("throw",t,a,l)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,l)}))}l(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function m(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var l=O(a,r);if(l){if(l===d)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(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 w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return p.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:p,configurable:!0}),p.displayName=c(h,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,l,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},E(_.prototype),c(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(g),c(g,l,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.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}},t.values=I,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,d):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),d},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),w(r),d}},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;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function ce(t,e,r,n,o,i,a){try{var l=t[i](a),c=l.value}catch(t){return void r(t)}l.done?e(c):Promise.resolve(c).then(n,o)}function ue(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ce(i,n,o,a,l,"next",t)}function l(t){ce(i,n,o,a,l,"throw",t)}a(void 0)}))}}function se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function de(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?se(Object(r),!0).forEach((function(e){fe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function fe(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==ae(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===ae(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return he(t,e);var r=Object.prototype.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)?he(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ye=(0,ie.fp)(J.dR.TABLE_COLUMNS_LOCAL_STORAGE_KEY);const be=function(){var t,e=pe((0,L.useState)([]),2),r=e[0],b=e[1],v=pe((0,L.useState)(),2),g=v[0],E=v[1],_=(0,it.Q)(),S=(0,m.$)(),w=(0,y.d)().showModal,P=(0,p.g)(),I=(0,a.p)().showToast,T=pe((0,L.useState)(-1),2),A=T[0],C=T[1],R=pe((0,L.useState)({ids:[],indexes:[]}),2),x=R[0],G=R[1],B=_.edit_state,M=_.delete,Z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.limit,r=void 0===e?J.Hy:e,n=t.updateQueryParams,o=void 0!==n&&n,i=Bt((0,At.useQueryParams)({page:(0,At.withDefault)(At.NumberParam,1),sortProperty:(0,At.withDefault)(At.StringParam,""),sortDirection:(0,At.withDefault)(Mt,void 0),filter:(0,At.withDefault)(At.JsonParam,{})}),2),a=i[0],l=i[1],c=Bt((0,L.useState)({page:1,sortProperty:"",sortDirection:void 0,filter:{}}),2),u=c[0],s=c[1],d=o?u:a,f=(r=a.filter.limit?Number(a.filter.limit):r)*Math.max(0,d.page-1),p=(0,L.useCallback)((function(t){o?s((function(e){return xt(xt({},e),t)})):l(xt({},t))}),[l,s,o]),h=(0,L.useCallback)((function(t){return p({filter:t})}),[p]);return{pageInfo:d,onPageChange:function(t){return p({page:t})},onColumnSort:function(t){var e;e=t!==d.sortProperty?{sortDirection:"asc",sortProperty:t}:{sortDirection:"asc"===d.sortDirection?"desc":"asc",sortProperty:t},p(e)},offset:f,itemsPerPage:r,onFilterItems:h}}(),U=Z.pageInfo,k=Z.onPageChange,N=Z.onFilterItems,q=Z.offset,F=(0,dt.R4)(),H=(0,dt.r7)(),Y=Number(U.filter.limit)||J.Hy,X=(0,dt.u6)({offset:q,limit:Y,filter:U.filter}),K=(0,j.O)({defaultValues:{search:U.filter.search||"",sortBy:U.filter.sortBy||"title",limit:Number(U.filter.limit)||J.Hy,status:Number(U.filter.status)||null,access:Number(U.filter.access)||null,category:Number(U.filter.category)||null,language:U.filter.language||""}}),$=(0,j.O)({defaultValues:{columns:["author","categories","access","id","hits","language"]}}),V=(0,Tt.N)(K.watch("search","")),Q=K.watch("limit"),z=K.watch("sortBy"),tt=K.watch("status"),rt=K.watch("access"),nt=K.watch("category"),ot=K.watch("language"),at=!!(V||(0,oe.BB)(tt)||rt||nt||ot),lt=(0,Zt.D)(V);(0,L.useEffect)((function(){if((0,O.$K)(ye))try{var t=JSON.parse(ye);$.setValue("columns",t)}catch(t){console.error(t)}}),[]),(0,L.useEffect)((function(){N(de(de(de(de(de(de(de({},V.length>0&&{search:V}),(0,O.$K)(tt)&&{status:tt.toString()}),rt&&{status:rt.toString()}),(0,O.$K)(nt)&&{category:nt.toString()}),ot&&{language:ot}),Q&&{limit:String(Q)}),z&&{sortBy:z})),V!==lt&&k(1)}),[N,V,Q,z,tt,rt,nt,ot,lt,k]);var ct=!!V||(0,O.$K)(tt)||(0,O.$K)(rt)||(0,O.$K)(nt)||!!ot,ut=(0,Dt.Dy)((0,Dt.VT)(Dt.we),(0,Dt.VT)(Dt.Lg,{coordinateGetter:et.is})),st=[{label:S("COM_SPPAGEBUILDER_EDITOR_FILTER_PUBLISH"),value:"published",disabled:!B},{label:S("COM_SPPAGEBUILDER_EDITOR_FILTER_UNPUBLISH"),value:"unpublished",disabled:!B},{label:S("COM_SPPAGEBUILDER_EDITOR_ACTION_CHECKOUT"),value:"check-out",disabled:!B},{label:S(-2===tt?"COM_SPPAGEBUILDER_EDITOR_FILTER_DELETE":"COM_SPPAGEBUILDER_EDITOR_FILTER_TRASH"),value:-2===tt?"delete":"trash",disabled:!M||!B}],ft=[{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_TITLE_ASC"),value:"title"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_TITLE_DESC"),value:"-title"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_ORDERING_ASC"),value:"ordering"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_ORDERING_DESC"),value:"-ordering"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_DATE_ASC"),value:"created_on"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_DATE_DESC"),value:"-created_on"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_STATUS_ASC"),value:"published"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_STATUS_DESC"),value:"-published"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_HITS_ASC"),value:"hits"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_HITS_DESC"),value:"-hits"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_ID_ASC"),value:"id"},{label:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_SORT_BY_ID_DESC"),value:"-id"}],pt=[{label:S("COM_SPPAGEBUILDER_EDITOR_COLUMN_LIST_AUTHOR"),value:"author"},{label:S("COM_SPPAGEBUILDER_EDITOR_COLUMN_LIST_CATEGORIES"),value:"categories"},{label:S("COM_SPPAGEBUILDER_EDITOR_COLUMN_LIST_ACCESS"),value:"access"},{label:S("COM_SPPAGEBUILDER_EDITOR_COLUMN_LIST_ID"),value:"id"},{label:S("COM_SPPAGEBUILDER_EDITOR_COLUMN_LIST_HITS"),value:"hits"},{label:S("COM_SPPAGEBUILDER_EDITOR_COLUMN_LIST_LANGUAGE"),value:"language"}],ht=[{label:"5",value:5},{label:"10",value:10},{label:"15",value:15},{label:"20",value:20},{label:"25",value:25},{label:"30",value:30},{label:"50",value:50},{label:"100",value:100},{label:"200",value:200},{label:"500",value:500}];(0,L.useEffect)((function(){X.data&&b(X.data.results)}),[X.data]);var yt=$.watch("columns",[]);return(0,L.useEffect)((function(){(0,ie.pj)(J.dR.TABLE_COLUMNS_LOCAL_STORAGE_KEY,JSON.stringify(yt))}),[yt]),(0,D.BX)(d.Z,{children:[(0,D.tZ)(f.Z,{title:S("COM_SPPAGEBUILDER_EDITOR_PAGE_TITLE_PAGES"),subtitle:S("COM_SPPAGEBUILDER_EDITOR_PAGE_SUBTITLE_PAGES"),action:_.create&&(0,D.tZ)(n.Z,{icon:(0,D.tZ)(i.Z,{name:"plus"}),onClick:function(){w({component:h.Z,props:{title:S("COM_SPPAGEBUILDER_EDITOR_CREATE_PAGE_MODAL_TITLE")}})},children:S("COM_SPPAGEBUILDER_EDITOR_ADD_NEW_PAGE_BUTTON")})}),(0,D.tZ)(s.Z,{children:(0,D.BX)(Nt.Z,{query:X,disableLoader:!0,children:[(0,D.BX)("div",{css:ve.topPanel,children:[(0,D.BX)("div",{css:ve.topPanelLeft,children:[(0,D.tZ)(o.Z,{options:st,placeholder:S("COM_SPPAGEBUILDER_EDITOR_BULK_ACTION_DROPDOWN_PLACEHOLDER"),wrapperStyle:ve.topPanelLeftSelect,isClearable:!1,disabled:0===x.ids.length||!B,value:st.find((function(t){return t.value===g})),onChange:function(t){E(t.value)}}),(0,D.tZ)(n.Z,{onClick:ue(le().mark((function t(){var e;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(x.ids.length&&g){t.next=2;break}return t.abrupt("return");case 2:if("delete"===g){t.next=6;break}F.mutate({ids:x.ids.join(","),type:g}),t.next=12;break;case 6:return e=x.ids.length,t.next=9,P({title:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_TITLE"),confirmationMessage:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_MESSAGE_MULTIPLE_PAGES",{totalPages:e.toString().padStart(2,"0")}),confirmButtonText:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_DELETE_BUTTON_TEXT",{totalPages:e.toString().padStart(2,"0")}),mutationFn:dt.hh,payload:{ids:x.ids.join(","),type:g},invalidateKeys:[["PageList"]]});case 9:"CONFIRM"===t.sent.action&&I({type:"success",message:S("COM_SPPAGEBUILDER_EDITOR_BULK_ACTION_PERFORMED_SUCCESSFULLY")});case 12:E(null),G({ids:[],indexes:[]}),C(-1);case 15:case"end":return t.stop()}}),t)}))),disabled:!g,children:S("COM_SPPAGEBUILDER_EDITOR_APPLY")})]}),(0,D.tZ)("div",{css:ve.topPanelRight,children:(0,D.tZ)(Yt,{clearButtonStatus:ct,onClearFilter:function(){return K.reset({search:"",status:null,access:null,category:null,language:""})},values:{status:tt,access:rt,category:nt,language:ot},onChange:function(t){K.reset(de(de({},K.getValues()),{},{status:t.status,access:t.access,category:Number(t.category),language:t.language||""}))}})})]}),(0,D.BX)(Ut.Z,{cardCss:ve.cardStyle,children:[(0,D.BX)("div",{css:ve.tableHeaderWrapper,children:[(0,D.tZ)("div",{css:ve.searchFieldWrapper,children:(0,D.tZ)(W.Qr,{control:K.control,name:"search",render:function(t){return(0,D.tZ)(u.Z,de(de({},t),{},{variant:"search",placeholder:S("COM_SPPAGEBUILDER_EDITOR_SEARCH_INPUT_PLACEHOLDER"),isClearable:!0}))}})}),(0,D.BX)("div",{css:ve.sortByFieldWrapper,children:[(0,D.tZ)(W.Qr,{control:K.control,name:"limit",render:function(t){return(0,D.tZ)(c.Z,de(de({},t),{},{options:ht,isClearable:!1,removeOptionsMinWidth:!0}))}}),(0,D.tZ)(W.Qr,{control:$.control,name:"columns",render:function(t){return(0,D.tZ)(l.Z,de(de({},t),{},{options:pt,placeholder:S("COM_SPPAGEBUILDER_EDITOR_PAGE_TABLE_COLUMNS"),disabled:X.isSuccess&&!X.data.results.length,showChips:!1,hideSelectNumbers:!0}))}}),(0,D.tZ)(W.Qr,{control:K.control,name:"sortBy",render:function(t){return(0,D.tZ)(c.Z,de(de({},t),{},{options:ft,placeholder:S("COM_SPPAGEBUILDER_EDITOR_PAGE_SORT_TABLE_BY_PLACEHOLDER"),showArrowUpDown:!0,disabled:X.isSuccess&&!X.data.results.length}))}})]})]}),X.isSuccess&&!X.data.results.length?at?(0,D.tZ)(kt.Z,{orientation:"vertical",emptyStateImage:zt,imageAltText:S("COM_SPPAGEBUILDER_EDITOR_ADDONS_NO_MATCH_FOUND"),title:S("COM_SPPAGEBUILDER_EDITOR_ADDONS_NO_MATCH_FOUND"),removeBorderRadius:!0,wrapperCss:ve.wrapperCss}):(0,D.tZ)(kt.Z,{orientation:"vertical",emptyStateImage:Qt,imageAltText:S("COM_SPPAGEBUILDER_EDITOR_EMPTY_PAGE_LIST_IMAGE_ALT"),title:S("COM_SPPAGEBUILDER_EDITOR_EMPTY_PAGE_LIST_TITLE"),content:S("COM_SPPAGEBUILDER_EDITOR_EMPTY_PAGE_LIST_CONTENT"),removeBorderRadius:!0,action:(0,D.tZ)(n.Z,{icon:(0,D.tZ)(i.Z,{name:"plus"}),onClick:function(){w({component:h.Z,props:{title:S("COM_SPPAGEBUILDER_EDITOR_CREATE_PAGE_MODAL_TITLE")}})},children:S("COM_SPPAGEBUILDER_EDITOR_EMPTY_PAGE_LIST_ADD_NEW_BUTTON")})}):(0,D.tZ)(Dt.LB,{sensors:ut,collisionDetection:Dt.pE,onDragEnd:function(t){var e=t.active,n=t.over;null!=n&&n.id&&e.id!==n.id&&b((function(t){var o=t.findIndex((function(t){return t.id===e.id})),i=t.findIndex((function(t){return t.id===n.id})),a=(0,et.Rp)(r,o,i),l=(0,O.x9)(a),c=Array.from({length:l.length},(function(t,e){return e+1}));return H.mutate({ids:l,orders:c}),K.reset(de(de({},K.getValues()),{},{sortBy:"ordering"})),a}))},modifiers:[re],children:(0,D.tZ)(et.Fo,{items:r,strategy:et.qw,children:(0,D.tZ)(Pt,{data:r,isLoading:X.isLoading,selectedItems:x,setSelectedItems:G,lastSelectedIndex:A,setLastSelectedIndex:C,columns:yt})})})]}),(0,D.tZ)("div",{css:ve.paginatorWrapper,children:(0,D.tZ)($t,{currentPage:U.page,onPageChange:k,totalItems:(null===(t=X.data)||void 0===t?void 0:t.totalItems)||0,itemsPerPage:Number(U.filter.limit)||J.Hy})})]})})]})};var ve={topPanel:(0,_.iv)("display:flex;justify-content:space-between;align-items:center;gap:",g.W0[8],";margin:",g.W0[16]," 0 ",g.W0[32]," 0;;label:topPanel;"),topPanelLeft:(0,_.iv)("display:flex;justify-content:center;align-items:center;gap:",g.W0[16],";;label:topPanelLeft;"),topPanelLeftSelect:{name:"1ex2zjt-topPanelLeftSelect",styles:"max-width:128px;label:topPanelLeftSelect;"},topPanelRight:{name:"qflu8b-topPanelRight",styles:"width:680px;height:32px;label:topPanelRight;"},pageName:(0,_.iv)(E.c.heading6(),";color:",g.qo.text.default,";;label:pageName;"),cardStyle:(0,_.iv)("border-radius:",g.E0[5],";box-shadow:",g.AF.base,";overflow:hidden;;label:cardStyle;"),tableHeaderWrapper:(0,_.iv)("width:100%;display:flex;justify-content:space-between;align-items:center;gap:",g.W0[8],";padding:",g.W0[24],";;label:tableHeaderWrapper;"),searchFieldWrapper:{name:"tjtfnx-searchFieldWrapper",styles:"width:min(280px, 100%);label:searchFieldWrapper;"},sortByFieldWrapper:(0,_.iv)("width:min(500px, 100%);display:flex;gap:",g.W0[16],";>div:first-of-type{max-width:80px;};label:sortByFieldWrapper;"),tableRowStyle:{name:"1l9y7ek-tableRowStyle",styles:":last-of-type{border-bottom:none;};label:tableRowStyle;"},paginatorWrapper:(0,_.iv)("margin-top:",g.W0[32],";;label:paginatorWrapper;"),wrapperCss:{name:"1kd73z9-wrapperCss",styles:">img{max-width:180px;max-height:180px;};label:wrapperCss;"}}}}]);