{"use strict";var n=r(46518),i=r(43724),o=r(42551),s=r(79306),a=r(48981),u=r(24913);i&&n({target:"Object",proto:!0,forced:o},{__defineSetter__:function(e,t){u.f(a(this),e,{set:s(t),enumerable:!0,configurable:!0})}})},87633:(e,t,r)=>{"use strict";var n=r(97751),i=r(62106),o=r(78227),s=r(43724),a=o("species");e.exports=function(e){var t=n(e);s&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},87745:(e,t,r)=>{"use strict";var n=r(43724),i=r(58429).MISSED_STICKY,o=r(22195),s=r(62106),a=r(91181).get,u=RegExp.prototype,c=TypeError;n&&i&&s(u,"sticky",{configurable:!0,get:function(){if(this!==u){if("RegExp"===o(this))return!!a(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},88177:(e,t,r)=>{"use strict";var n=r(46518),i=r(34598),o=r(6469),s=r(2952);n({target:"Array",proto:!0,name:"groupToMap",forced:r(96395)||!i("groupByToMap")},{groupByToMap:s}),o("groupByToMap")},88205:(e,t,r)=>{"use strict";var n=r(79504),i=WeakSet.prototype;e.exports={WeakSet,add:n(i.add),has:n(i.has),remove:n(i.delete)}},88267:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),o=r(655),s=String.fromCharCode,a=i("".charAt),u=i(/./.exec),c=i("".slice),l=/^[\da-f]{2}$/i,f=/^[\da-f]{4}$/i;n({global:!0},{unescape:function(e){for(var t,r,n=o(e),i="",d=n.length,p=0;p{"use strict";var n=r(46518),i=r(59213).every;n({target:"Array",proto:!0,forced:!r(34598)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},88490:e=>{"use strict";var t=Array,r=Math.abs,n=Math.pow,i=Math.floor,o=Math.log,s=Math.LN2;e.exports={pack:function(e,a,u){var c,l,f,d=t(u),p=8*u-a-1,h=(1<>1,v=23===a?n(2,-24)-n(2,-77):0,m=e<0||0===e&&1/e<0?1:0,b=0;for((e=r(e))!=e||e===1/0?(l=e!=e?1:0,c=h):(c=i(o(e)/s),e*(f=n(2,-c))<1&&(c--,f*=2),(e+=c+g>=1?v/f:v*n(2,1-g))*f>=2&&(c++,f/=2),c+g>=h?(l=0,c=h):c+g>=1?(l=(e*f-1)*n(2,a),c+=g):(l=e*n(2,g-1)*n(2,a),c=0));a>=8;)d[b++]=255&l,l/=256,a-=8;for(c=c<0;)d[b++]=255&c,c/=256,p-=8;return d[b-1]|=128*m,d},unpack:function(e,t){var r,i=e.length,o=8*i-t-1,s=(1<>1,u=o-7,c=i-1,l=e[c--],f=127&l;for(l>>=7;u>0;)f=256*f+e[c--],u-=8;for(r=f&(1<<-u)-1,f>>=-u,u+=t;u>0;)r=256*r+e[c--],u-=8;if(0===f)f=1-a;else{if(f===s)return r?NaN:l?-1/0:1/0;r+=n(2,t),f-=a}return(l?-1:1)*r*n(2,f-t)}}},88588:(e,t,r)=>{"use strict";var n=r(69565),i=r(79504),o=r(19462),s=r(91385),a=TypeError,u=i([].slice),c=i([].push),l="Iterator is exhausted",f="throw",d=o(function(){var e=this.iterCount;if(e){for(var t,r,i=this.openIters,o=this.iters,u=this.padding,d=this.mode,p=this.finishResults,h=[],g=0;g{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},88747:(e,t,r)=>{"use strict";var n=r(94644),i=n.aTypedArray,o=n.exportTypedArrayMethod,s=Math.floor;o("reverse",function(){for(var e,t=this,r=i(t).length,n=s(r/2),o=0;o{"use strict";var n=r(46518),i=r(44576),o=r(1625),s=r(42787),a=r(52967),u=r(77740),c=r(2360),l=r(66699),f=r(6980),d=r(80747),p=r(32603),h=r(78227),g=r(79039),v=r(96395),m=i.SuppressedError,b=h("toStringTag"),y=Error,w=!!m&&3!==m.length,x=!!m&&g(function(){return 4===new m(1,2,3,{cause:4}).cause}),S=w||x,E=function(e,t,r){var n,i=o(C,this);return a?n=!S||i&&s(this)!==C?a(new y,i?s(this):C):new m:(n=i?this:c(C),l(n,b,"Error")),void 0!==r&&l(n,"message",p(r)),d(n,E,n.stack,1),l(n,"error",e),l(n,"suppressed",t),n};a?a(E,y):u(E,y,{name:!0});var C=E.prototype=S?m.prototype:c(y.prototype,{constructor:f(1,E),message:f(1,""),name:f(1,"SuppressedError")});S&&!v&&(C.constructor=E),n({global:!0,constructor:!0,arity:3,forced:S},{SuppressedError:E})},89195:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("small")},{small:function(){return i(this,"small","","")}})},89228:(e,t,r)=>{"use strict";r(27495);var n=r(69565),i=r(36840),o=r(57323),s=r(79039),a=r(78227),u=r(66699),c=a("species"),l=RegExp.prototype;e.exports=function(e,t,r,f){var d=a(e),p=!s(function(){var t={};return t[d]=function(){return 7},7!==""[e](t)}),h=p&&!s(function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[d]=/./[d]),r.exec=function(){return t=!0,null},r[d](""),!t});if(!p||!h||r){var g=/./[d],v=t(d,""[e],function(e,t,r,i,s){var a=t.exec;return a===o||a===l.exec?p&&!s?{done:!0,value:n(g,t,r,i)}:{done:!0,value:n(e,r,t,i)}:{done:!1}});i(String.prototype,e,v[0]),i(l,d,v[1])}f&&u(l[d],"sham",!0)}},89286:(e,t,r)=>{"use strict";var n=r(94402),i=r(38469),o=n.Set,s=n.add;e.exports=function(e){var t=new o;return i(e,function(e){s(t,e)}),t}},89429:(e,t,r)=>{"use strict";var n=r(44576),i=r(38574);e.exports=function(e){if(i){try{return n.process.getBuiltinModule(e)}catch(e){}try{return Function('return require("'+e+'")')()}catch(e){}}}},89463:(e,t,r)=>{"use strict";var n=r(46518),i=r(43724),o=r(44576),s=r(79504),a=r(39297),u=r(94901),c=r(1625),l=r(655),f=r(62106),d=r(77740),p=o.Symbol,h=p&&p.prototype;if(i&&u(p)&&(!("description"in h)||void 0!==p().description)){var g={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=c(h,this)?new p(e):void 0===e?p():p(e);return""===e&&(g[t]=!0),t};d(v,p),v.prototype=h,h.constructor=v;var m="Symbol(description detection)"===String(p("description detection")),b=s(h.valueOf),y=s(h.toString),w=/^Symbol\((.*)\)[^)]+$/,x=s("".replace),S=s("".slice);f(h,"description",{configurable:!0,get:function(){var e=b(this);if(a(g,e))return"";var t=y(e),r=m?S(t,7,-1):x(t,w,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:v})}},89544:(e,t,r)=>{"use strict";var n=r(82839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},89572:(e,t,r)=>{"use strict";var n=r(39297),i=r(36840),o=r(53640),s=r(78227)("toPrimitive"),a=Date.prototype;n(a,s)||i(a,s,o)},89907:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("anchor")},{anchor:function(e){return i(this,"a","name",e)}})},89955:(e,t,r)=>{"use strict";var n=r(94644),i=r(59213).findIndex,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)})},90235:(e,t,r)=>{"use strict";var n=r(59213).forEach,i=r(34598)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},90537:(e,t,r)=>{"use strict";var n=r(80550),i=r(84428),o=r(10916).CONSTRUCTOR;e.exports=o||!i(function(e){n.all(e).then(void 0,function(){})})},90679:(e,t,r)=>{"use strict";var n=r(1625),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},90744:(e,t,r)=>{"use strict";var n=r(69565),i=r(79504),o=r(89228),s=r(28551),a=r(20034),u=r(67750),c=r(2293),l=r(57829),f=r(18014),d=r(655),p=r(55966),h=r(56682),g=r(58429),v=r(79039),m=g.UNSUPPORTED_Y,b=Math.min,y=i([].push),w=i("".slice),x=!v(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}),S="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;o("split",function(e,t,r){var i="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:n(t,this,e,r)}:t;return[function(t,r){var o=u(this),s=a(t)?p(t,e):void 0;return s?n(s,t,o,r):n(i,d(o),t,r)},function(e,n){var o=s(this),a=d(e);if(!S){var u=r(i,o,a,n,i!==t);if(u.done)return u.value}var p=c(o,RegExp),g=o.unicode,v=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(m?"g":"y"),x=new p(m?"^(?:"+o.source+")":o,v),E=void 0===n?4294967295:n>>>0;if(0===E)return[];if(0===a.length)return null===h(x,a)?[a]:[];for(var C=0,j=0,R=[];j{"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},90906:(e,t,r)=>{"use strict";r(27495);var n,i,o=r(46518),s=r(69565),a=r(94901),u=r(28551),c=r(655),l=(n=!1,(i=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&n),f=/./.test;o({target:"RegExp",proto:!0,forced:!l},{test:function(e){var t=u(this),r=c(e),n=t.exec;if(!a(n))return s(f,t,r);var i=s(n,t,r);return null!==i&&(u(i),!0)}})},91021:(e,t,r)=>{"use strict";var n=r(97751),i=r(69565),o=r(79504),s=r(76080),a=r(28551),u=r(79306),c=r(64117),l=r(55966),f=r(78227),d=f("asyncDispose"),p=f("dispose"),h=o([].push),g=function(e,t,r){return arguments.length<3&&!c(e)&&(r=u(function(e,t){if("async-dispose"===t){var r=l(e,d);return void 0!==r||void 0===(r=l(e,p))?r:function(){var e=this;return new(n("Promise"))(function(t){i(r,e),t(void 0)})}}return l(e,p)}(a(e),t))),void 0===r?function(){}:s(r,e)};e.exports=function(e,t,r,n){var i;if(arguments.length<4){if(c(t)&&"sync-dispose"===r)return;i=g(t,r)}else i=g(void 0,r,n);h(e.stack,i)}},91134:(e,t,r)=>{"use strict";var n=r(94644),i=r(43839).findLastIndex,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)})},91181:(e,t,r)=>{"use strict";var n,i,o,s=r(58622),a=r(44576),u=r(20034),c=r(66699),l=r(39297),f=r(77629),d=r(66119),p=r(30421),h="Object already initialized",g=a.TypeError,v=a.WeakMap;if(s||f.state){var m=f.state||(f.state=new v);m.get=m.get,m.has=m.has,m.set=m.set,n=function(e,t){if(m.has(e))throw new g(h);return t.facade=e,m.set(e,t),t},i=function(e){return m.get(e)||{}},o=function(e){return m.has(e)}}else{var b=d("state");p[b]=!0,n=function(e,t){if(l(e,b))throw new g(h);return t.facade=e,c(e,b,t),t},i=function(e){return l(e,b)?e[b]:{}},o=function(e){return l(e,b)}}e.exports={set:n,get:i,has:o,enforce:function(e){return o(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return r}}}},91191:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),o=r(91291),s=Date.prototype,a=i(s.getTime),u=i(s.setFullYear);n({target:"Date",proto:!0},{setYear:function(e){a(this);var t=o(e);return u(this,t>=0&&t<=99?t+1900:t)}})},91291:(e,t,r)=>{"use strict";var n=r(80741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},91296:(e,t,r)=>{"use strict";var n=r(4495);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},91354:(e,t,r)=>{"use strict";var n=r(91181),i=r(33994),o=r(62529),s=r(39297),a=r(71072),u=r(48981),c="Object Iterator",l=n.set,f=n.getterFor(c);e.exports=i(function(e,t){var r=u(e);l(this,{type:c,mode:t,object:r,keys:a(r),index:0})},"Object",function(){for(var e=f(this),t=e.keys;;){if(null===t||e.index>=t.length)return e.object=e.keys=null,o(void 0,!0);var r=t[e.index++],n=e.object;if(s(n,r)){switch(e.mode){case"keys":return o(r,!1);case"values":return o(n[r],!1)}return o([r,n[r]],!1)}}})},91385:(e,t,r)=>{"use strict";var n=r(9539);e.exports=function(e,t,r){for(var i=e.length-1;i>=0;i--)if(void 0!==e[i])try{r=n(e[i].iterator,t,r)}catch(e){t="throw",r=e}if("throw"===t)throw r;return r}},91550:(e,t,r)=>{"use strict";var n=r(46518),i=r(91354);n({target:"Object",stat:!0,forced:!0},{iterateEntries:function(e){return new i(e,"entries")}})},91625:(e,t,r)=>{"use strict";var n=r(79504),i=r(56279),o=r(3451).getWeakData,s=r(90679),a=r(28551),u=r(64117),c=r(20034),l=r(72652),f=r(59213),d=r(39297),p=r(91181),h=p.set,g=p.getterFor,v=f.find,m=f.findIndex,b=n([].splice),y=0,w=function(e){return e.frozen||(e.frozen=new x)},x=function(){this.entries=[]},S=function(e,t){return v(e.entries,function(e){return e[0]===t})};x.prototype={get:function(e){var t=S(this,e);if(t)return t[1]},has:function(e){return!!S(this,e)},set:function(e,t){var r=S(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=m(this.entries,function(t){return t[0]===e});return~t&&b(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,r,n){var f=e(function(e,i){s(e,p),h(e,{type:t,id:y++,frozen:null}),u(i)||l(i,e[n],{that:e,AS_ENTRIES:r})}),p=f.prototype,v=g(t),m=function(e,t,r){var n=v(e),i=o(a(t),!0);return!0===i?w(n).set(t,r):i[n.id]=r,e};return i(p,{delete:function(e){var t=v(this);if(!c(e))return!1;var r=o(e);return!0===r?w(t).delete(e):r&&d(r,t.id)&&delete r[t.id]},has:function(e){var t=v(this);if(!c(e))return!1;var r=o(e);return!0===r?w(t).has(e):r&&d(r,t.id)}}),i(p,r?{get:function(e){var t=v(this);if(c(e)){var r=o(e);if(!0===r)return w(t).get(e);if(r)return r[t.id]}},set:function(e,t){return m(this,e,t)}}:{add:function(e){return m(this,e,!0)}}),f}}},91706:(e,t,r)=>{"use strict";r(21903)},91955:(e,t,r)=>{"use strict";var n,i,o,s,a,u=r(44576),c=r(93389),l=r(76080),f=r(59225).set,d=r(18265),p=r(89544),h=r(44265),g=r(7860),v=r(38574),m=u.MutationObserver||u.WebKitMutationObserver,b=u.document,y=u.process,w=u.Promise,x=c("queueMicrotask");if(!x){var S=new d,E=function(){var e,t;for(v&&(e=y.domain)&&e.exit();t=S.get();)try{t()}catch(e){throw S.head&&n(),e}e&&e.enter()};p||v||g||!m||!b?!h&&w&&w.resolve?((s=w.resolve(void 0)).constructor=w,a=l(s.then,s),n=function(){a(E)}):v?n=function(){y.nextTick(E)}:(f=l(f,u),n=function(){f(E)}):(i=!0,o=b.createTextNode(""),new m(E).observe(o,{characterData:!0}),n=function(){o.data=i=!i}),x=function(e){S.head||n(),S.add(e)}}e.exports=x},92059:(e,t,r)=>{"use strict";var n=r(69565),i=r(1103),o=r(28551),s=r(2360),a=r(66699),u=r(56279),c=r(78227),l=r(91181),f=r(97751),d=r(55966),p=r(53982),h=r(62529),g=r(9539),v=f("Promise"),m=c("toStringTag"),b="AsyncIteratorHelper",y="WrapForValidAsyncIterator",w=l.set,x=function(e){var t=!e,r=l.getterFor(e?y:b),a=function(e){var n=i(function(){return r(e)}),o=n.error,s=n.value;return o||t&&s.done?{exit:!0,value:o?v.reject(s):v.resolve(h(void 0,!0))}:{exit:!1,value:s}};return u(s(p),{next:function(){var e=a(this),t=e.value;if(e.exit)return t;var r=i(function(){return o(t.nextHandler(v))}),n=r.error,s=r.value;return n&&(t.done=!0),n?v.reject(s):v.resolve(s)},return:function(){var t=a(this),r=t.value;if(t.exit)return r;r.done=!0;var s,u,c=r.iterator,l=i(function(){if(r.inner)try{g(r.inner.iterator,"normal")}catch(e){return g(c,"throw",e)}return d(c,"return")});return s=u=l.value,l.error?v.reject(u):void 0===s?v.resolve(h(void 0,!0)):(u=(l=i(function(){return n(s,c)})).value,l.error?v.reject(u):e?v.resolve(u):v.resolve(u).then(function(e){return o(e),h(void 0,!0)}))}})},S=x(!0),E=x(!1);a(E,m,"Async Iterator Helper"),e.exports=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?y:b,n.nextHandler=e,n.counter=0,n.done=!1,w(this,n)};return r.prototype=t?S:E,r}},92140:(e,t,r)=>{"use strict";var n={};n[r(78227)("toStringTag")]="z",e.exports="[object z]"===String(n)},92168:(e,t,r)=>{"use strict";r(70511)("isConcatSpreadable")},92405:(e,t,r)=>{"use strict";r(16468)("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},r(86938))},92744:(e,t,r)=>{"use strict";var n=r(79039);e.exports=!n(function(){return Object.isExtensible(Object.preventExtensions({}))})},92796:(e,t,r)=>{"use strict";var n=r(79039),i=r(94901),o=/#|\.prototype\./,s=function(e,t){var r=u[a(e)];return r===l||r!==c&&(i(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},u=s.data={},c=s.NATIVE="N",l=s.POLYFILL="P";e.exports=s},92804:e=>{"use strict";var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=t+"+/",n=t+"-_",i=function(e){for(var t={},r=0;r<64;r++)t[e.charAt(r)]=r;return t};e.exports={i2c:r,c2i:i(r),i2cUrl:n,c2iUrl:i(n)}},93153:(e,t,r)=>{"use strict";var n=r(46518),i=r(7740),o=Math.acosh,s=Math.log,a=Math.sqrt,u=Math.LN2;n({target:"Math",stat:!0,forced:!o||710!==Math.floor(o(Number.MAX_VALUE))||o(1/0)!==1/0},{acosh:function(e){var t=+e;return t<1?NaN:t>94906265.62425156?s(t)+u:i(t-1+a(t-1)*a(t+1))}})},93389:(e,t,r)=>{"use strict";var n=r(44576),i=r(43724),o=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return n[e];var t=o(n,e);return t&&t.value}},93438:(e,t,r)=>{"use strict";var n=r(28551),i=r(20034),o=r(36043);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},93514:(e,t,r)=>{"use strict";r(6469)("flat")},93515:(e,t,r)=>{"use strict";r(46518)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},93518:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),o=r(79306),s=r(97751),a=r(36043),u=r(1103),c=r(72652),l=r(90537),f="No one promise resolved";n({target:"Promise",stat:!0,forced:l},{any:function(e){var t=this,r=s("AggregateError"),n=a.f(t),l=n.resolve,d=n.reject,p=u(function(){var n=o(t.resolve),s=[],a=0,u=1,p=!1;c(e,function(e){var o=a++,c=!1;u++,i(n,t,e).then(function(e){c||p||(p=!0,l(e))},function(e){c||p||(c=!0,s[o]=e,--u||d(new r(s,f)))})}),--u||d(new r(s,f))});return p.error&&d(p.value),n.promise}})},93777:(e,t,r)=>{"use strict";var n=r(46518),i=r(76080),o=r(36194),s=r(26223);n({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=o(this),r=i(e,arguments.length>1?arguments[1]:void 0);return!1!==s(t,function(e,n){if(!r(e,n,t))return!1},!0)}})},93941:(e,t,r)=>{"use strict";var n=r(46518),i=r(20034),o=r(3451).onFreeze,s=r(92744),a=r(79039),u=Object.seal;n({target:"Object",stat:!0,forced:a(function(){u(1)}),sham:!s},{seal:function(e){return u&&i(e)?u(o(e)):e}})},93967:(e,t,r)=>{"use strict";var n=r(46518),i=r(20034),o=r(3451).onFreeze,s=r(92744),a=r(79039),u=Object.preventExtensions;n({target:"Object",stat:!0,forced:a(function(){u(1)}),sham:!s},{preventExtensions:function(e){return u&&i(e)?u(o(e)):e}})},94003:(e,t,r)=>{"use strict";var n=r(46518),i=r(79039),o=r(20034),s=r(22195),a=r(15652),u=Object.isFrozen;n({target:"Object",stat:!0,forced:a||i(function(){u(1)})},{isFrozen:function(e){return!o(e)||!(!a||"ArrayBuffer"!==s(e))||!!u&&u(e)}})},94052:(e,t,r)=>{"use strict";var n=r(46518),i=r(34124);n({target:"Object",stat:!0,forced:Object.isExtensible!==i},{isExtensible:i})},94170:(e,t,r)=>{"use strict";var n=r(46518),i=r(30566);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},94298:(e,t,r)=>{"use strict";var n=r(46518),i=r(77240);n({target:"String",proto:!0,forced:r(23061)("fixed")},{fixed:function(){return i(this,"tt","","")}})},94402:(e,t,r)=>{"use strict";var n=r(79504),i=Set.prototype;e.exports={Set,add:n(i.add),has:n(i.has),remove:n(i.delete),proto:i}},94483:(e,t,r)=>{"use strict";var n,i,o,s,a=r(44576),u=r(89429),c=r(1548),l=a.structuredClone,f=a.ArrayBuffer,d=a.MessageChannel,p=!1;if(c)p=function(e){l(e,{transfer:[e]})};else if(f)try{d||(n=u("worker_threads"))&&(d=n.MessageChannel),d&&(i=new d,o=new f(2),s=function(e){i.port1.postMessage(null,[e])},2===o.byteLength&&(s(o),0===o.byteLength&&(p=s)))}catch(e){}e.exports=p},94490:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),o=r(34376),s=i([].reverse),a=[1,2];n({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return o(this)&&(this.length=this.length),s(this)}})},94644:(e,t,r)=>{"use strict";var n,i,o,s=r(77811),a=r(43724),u=r(44576),c=r(94901),l=r(20034),f=r(39297),d=r(36955),p=r(16823),h=r(66699),g=r(36840),v=r(62106),m=r(1625),b=r(42787),y=r(52967),w=r(78227),x=r(33392),S=r(91181),E=S.enforce,C=S.get,j=u.Int8Array,R=j&&j.prototype,I=u.Uint8ClampedArray,T=I&&I.prototype,A=j&&b(j),O=R&&b(R),M=Object.prototype,D=u.TypeError,_=w("toStringTag"),P=x("TYPED_ARRAY_TAG"),k="TypedArrayConstructor",F=s&&!!y&&"Opera"!==d(u.opera),N=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},L={BigInt64Array:8,BigUint64Array:8},U=function(e){var t=b(e);if(l(t)){var r=C(t);return r&&f(r,k)?r[k]:U(t)}},H=function(e){if(!l(e))return!1;var t=d(e);return f(B,t)||f(L,t)};for(n in B)(o=(i=u[n])&&i.prototype)?E(o)[k]=i:F=!1;for(n in L)(o=(i=u[n])&&i.prototype)&&(E(o)[k]=i);if((!F||!c(A)||A===Function.prototype)&&(A=function(){throw new D("Incorrect invocation")},F))for(n in B)u[n]&&y(u[n],A);if((!F||!O||O===M)&&(O=A.prototype,F))for(n in B)u[n]&&y(u[n].prototype,O);if(F&&b(T)!==O&&y(T,O),a&&!f(O,_))for(n in N=!0,v(O,_,{configurable:!0,get:function(){return l(this)?this[P]:void 0}}),B)u[n]&&h(u[n],P,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:F,TYPED_ARRAY_TAG:N&&P,aTypedArray:function(e){if(H(e))return e;throw new D("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!y||m(A,e)))return e;throw new D(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(a){if(r)for(var i in B){var o=u[i];if(o&&f(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}O[e]&&!r||g(O,e,r?t:F&&R[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(a){if(y){if(r)for(n in B)if((i=u[n])&&f(i,e))try{delete i[e]}catch(e){}if(A[e]&&!r)return;try{return g(A,e,r?t:F&&A[e]||t)}catch(e){}}for(n in B)!(i=u[n])||i[e]&&!r||g(i,e,t)}},getTypedArrayConstructor:U,isView:function(e){if(!l(e))return!1;var t=d(e);return"DataView"===t||f(B,t)||f(L,t)},isTypedArray:H,TypedArray:A,TypedArrayPrototype:O}},94901:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},95115:(e,t,r)=>{"use strict";r(10838)},95477:(e,t,r)=>{"use strict";r(15823)("Int32",function(e){return function(t,r,n){return e(this,t,r,n)}})},95636:(e,t,r)=>{"use strict";var n=r(44576),i=r(79504),o=r(46706),s=r(57696),a=r(55169),u=r(67394),c=r(94483),l=r(1548),f=n.structuredClone,d=n.ArrayBuffer,p=n.DataView,h=Math.min,g=d.prototype,v=p.prototype,m=i(g.slice),b=o(g,"resizable","get"),y=o(g,"maxByteLength","get"),w=i(v.getInt8),x=i(v.setInt8);e.exports=(l||c)&&function(e,t,r){var n,i=u(e),o=void 0===t?i:s(t),g=!b||!b(e);if(a(e),l&&(e=f(e,{transfer:[e]}),i===o&&(r||g)))return e;if(i>=o&&(!r||g))n=m(e,0,o);else{var v=r&&!g&&y?{maxByteLength:y(e)}:void 0;n=new d(o,v);for(var S=new p(e),E=new p(n),C=h(o,i),j=0;j{"use strict";var n=r(46518),i=r(79504),o=r(63463),s=r(39297),a=r(60533).start,u=r(47452),c=Array,l=RegExp.escape,f=i("".charAt),d=i("".charCodeAt),p=i(1.1.toString),h=i([].join),g=/^[0-9a-z]/i,v=/^[$()*+./?[\\\]^{|}]/,m=RegExp("^[!\"#%&',\\-:;<=>@`~"+u+"]"),b=i(g.exec),y={"\t":"t","\n":"n","\v":"v","\f":"f","\r":"r"},w=function(e){var t=p(d(e,0),16);return t.length<3?"\\x"+a(t,2,"0"):"\\u"+a(t,4,"0")};n({target:"RegExp",stat:!0,forced:!l||"\\x61b"!==l("ab")},{escape:function(e){o(e);for(var t=e.length,r=c(t),n=0;n=56320||n+1>=t||56320!=(64512&d(e,n+1))?r[n]=w(i):(r[n]=i,r[++n]=f(e,n))}}return h(r,"")}})},96167:(e,t,r)=>{"use strict";var n=r(46518),i=r(69565),o=r(79306),s=r(36043),a=r(1103),u=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{allSettled:function(e){var t=this,r=s.f(t),n=r.resolve,c=r.reject,l=a(function(){var r=o(t.resolve),s=[],a=0,c=1;u(e,function(e){var o=a++,u=!1;c++,i(r,t,e).then(function(e){u||(u=!0,s[o]={status:"fulfilled",value:e},--c||n(s))},function(e){u||(u=!0,s[o]={status:"rejected",reason:e},--c||n(s))})}),--c||n(s)});return l.error&&c(l.value),r.promise}})},96319:(e,t,r)=>{"use strict";var n=r(28551),i=r(9539);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},96369:(e,t,r)=>{"use strict";r(46518)({target:"Math",stat:!0,forced:!0},{imulh:function(e,t){var r=65535,n=+e,i=+t,o=n&r,s=i&r,a=n>>16,u=i>>16,c=(a*s>>>0)+(o*s>>>16);return a*u+(c>>16)+((o*u>>>0)+(c&r)>>16)}})},96395:e=>{"use strict";e.exports=!1},96801:(e,t,r)=>{"use strict";var n=r(43724),i=r(48686),o=r(24913),s=r(28551),a=r(25397),u=r(71072);t.f=n&&!i?Object.defineProperties:function(e,t){s(e);for(var r,n=a(t),i=u(t),c=i.length,l=0;c>l;)o.f(e,r=i[l++],n[r]);return e}},96837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},96847:(e,t,r)=>{"use strict";r(91134)},97040:(e,t,r)=>{"use strict";var n=r(43724),i=r(24913),o=r(6980);e.exports=function(e,t,r){n?i.f(e,t,o(0,r)):e[t]=r}},97080:(e,t,r)=>{"use strict";var n=r(94402).has;e.exports=function(e){return n(e),e}},97324:(e,t,r)=>{"use strict";var n=r(44576),i=r(70511),o=r(24913).f,s=r(77347).f,a=n.Symbol;if(i("dispose"),a){var u=s(a,"dispose");u.enumerable&&u.configurable&&u.writable&&o(a,"dispose",{value:u.value,enumerable:!1,configurable:!1,writable:!1})}},97751:(e,t,r)=>{"use strict";var n=r(44576),i=r(94901);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},97812:(e,t,r)=>{"use strict";var n=r(46518),i=r(39297),o=r(10757),s=r(16823),a=r(25745),u=r(91296),c=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!u},{keyFor:function(e){if(!o(e))throw new TypeError(s(e)+" is not a symbol");if(i(c,e))return c[e]}})},97916:(e,t,r)=>{"use strict";var n=r(76080),i=r(69565),o=r(48981),s=r(96319),a=r(44209),u=r(33517),c=r(26198),l=r(97040),f=r(70081),d=r(50851),p=Array;e.exports=function(e){var t=o(e),r=u(this),h=arguments.length,g=h>1?arguments[1]:void 0,v=void 0!==g;v&&(g=n(g,h>2?arguments[2]:void 0));var m,b,y,w,x,S,E=d(t),C=0;if(!E||this===p&&a(E))for(m=c(t),b=r?new this(m):p(m);m>C;C++)S=v?g(t[C],C):t[C],l(b,C,S);else for(b=r?new this:[],x=(w=f(t,E)).next;!(y=i(x,w)).done;C++)S=v?s(w,g,[y.value,C],!0):y.value,l(b,C,S);return b.length=C,b}},98225:(e,t,r)=>{"use strict";var n=r(46518),i=r(79504),o=r(94901),s=r(33706),a=r(39297),u=r(43724),c=Object.getOwnPropertyDescriptor,l=/^\s*class\b/,f=i(l.exec);n({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(e){return o(e)&&!function(e){try{if(!u||!f(l,s(e)))return!1}catch(e){}var t=c(e,"prototype");return!!t&&a(t,"writable")&&!t.writable}(e)}})},98322:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}t.A=void 0;var i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(r(51609)),o=a(r(5556)),s=a(r(46430));function a(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;i--){var o=n[i],s=t[o];s!==r[o]&&(-1===b.indexOf(o)||Array.isArray(s)||(s=[s]),this.flatpickr.set(o,s))}!this.props.hasOwnProperty("value")||this.props.value&&Array.isArray(this.props.value)&&e.value&&Array.isArray(e.value)&&this.props.value.every(function(t,r){e[r]})||this.props.value===e.value||this.flatpickr.setDate(this.props.value,!1)}},{key:"componentDidMount",value:function(){this.createFlatpickrInstance()}},{key:"componentWillUnmount",value:function(){this.destroyFlatpickrInstance()}},{key:"render",value:function(){var e=this.props,t=e.options,r=e.defaultValue,n=e.value,o=e.children,s=e.render,a=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,["options","defaultValue","value","children","render"]);return b.forEach(function(e){delete a[e]}),w.forEach(function(e){delete a[e]}),s?s(d(d({},a),{},{defaultValue:r,value:n}),this.handleNodeChange):t.wrap?i.default.createElement("div",l({},a,{ref:this.handleNodeChange}),o):i.default.createElement("input",l({},a,{defaultValue:r,ref:this.handleNodeChange}))}}])&&p(t.prototype,r),c}(i.Component);function E(e,t){var r=d({},e);return b.forEach(function(e){if(t.hasOwnProperty(e)){var n;r[e]&&!Array.isArray(r[e])?r[e]=[r[e]]:r[e]||(r[e]=[]);var i=Array.isArray(t[e])?t[e]:[t[e]];(n=r[e]).push.apply(n,function(e){if(Array.isArray(e))return c(e)}(o=i)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}var o}),r}m(S,"propTypes",{defaultValue:o.default.string,options:o.default.object,onChange:y,onOpen:y,onClose:y,onMonthChange:y,onYearChange:y,onReady:y,onValueUpdate:y,onDayCreate:y,onCreate:x,onDestroy:x,value:o.default.oneOfType([o.default.string,o.default.array,o.default.object,o.default.number]),children:o.default.node,className:o.default.string,render:o.default.func}),m(S,"defaultProps",{options:{}});var C=S;t.A=C},98406:(e,t,r)=>{"use strict";r(23792),r(27337);var n=r(46518),i=r(44576),o=r(93389),s=r(97751),a=r(69565),u=r(79504),c=r(43724),l=r(67416),f=r(36840),d=r(62106),p=r(56279),h=r(10687),g=r(33994),v=r(91181),m=r(90679),b=r(94901),y=r(39297),w=r(76080),x=r(36955),S=r(28551),E=r(20034),C=r(655),j=r(2360),R=r(6980),I=r(70081),T=r(50851),A=r(62529),O=r(22812),M=r(78227),D=r(74488),_=M("iterator"),P="URLSearchParams",k=P+"Iterator",F=v.set,N=v.getterFor(P),B=v.getterFor(k),L=o("fetch"),U=o("Request"),H=o("Headers"),G=U&&U.prototype,z=H&&H.prototype,W=i.TypeError,V=i.encodeURIComponent,Y=String.fromCharCode,q=s("String","fromCodePoint"),K=parseInt,$=u("".charAt),J=u([].join),X=u([].push),Z=u("".replace),Q=u([].shift),ee=u([].splice),te=u("".split),re=u("".slice),ne=u(/./.exec),ie=/\+/g,oe=/^[0-9a-f]+$/i,se=function(e,t){var r=re(e,t,t+2);return ne(oe,r)?K(r,16):NaN},ae=function(e){for(var t=0,r=128;r>0&&0!==(e&r);r>>=1)t++;return t},ue=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ce=function(e){for(var t=(e=Z(e,ie," ")).length,r="",n=0;nt){r+="%",n++;continue}var o=se(e,n+1);if(o!=o){r+=i,n++;continue}n+=2;var s=ae(o);if(0===s)i=Y(o);else{if(1===s||s>4){r+="�",n++;continue}for(var a=[o],u=1;ut||"%"!==$(e,n));){var c=se(e,n+1);if(c!=c){n+=3;break}if(c>191||c<128)break;X(a,c),n+=2,u++}if(a.length!==s){r+="�";continue}var l=ue(a);null===l?r+="�":i=q(l)}}r+=i,n++}return r},le=/[!'()~]|%20/g,fe={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(e){return fe[e]},pe=function(e){return Z(V(e),le,de)},he=g(function(e,t){F(this,{type:k,target:N(e).entries,index:0,kind:t})},P,function(){var e=B(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,A(void 0,!0);var n=t[r];switch(e.kind){case"keys":return A(n.key,!1);case"values":return A(n.value,!1)}return A([n.key,n.value],!1)},!0),ge=function(e){this.entries=[],this.url=null,void 0!==e&&(E(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===$(e,0)?re(e,1):e:C(e)))};ge.prototype={type:P,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,o,s,u,c=this.entries,l=T(e);if(l)for(r=(t=I(e,l)).next;!(n=a(r,t)).done;){if(o=(i=I(S(n.value))).next,(s=a(o,i)).done||(u=a(o,i)).done||!a(o,i).done)throw new W("Expected sequence with length 2");X(c,{key:C(s.value),value:C(u.value)})}else for(var f in e)y(e,f)&&X(c,{key:f,value:C(e[f])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,i=te(e,"&"),o=0;o0?arguments[0]:void 0));c||(this.size=e.entries.length)},me=ve.prototype;if(p(me,{append:function(e,t){var r=N(this);O(arguments.length,2),X(r.entries,{key:C(e),value:C(t)}),c||this.length++,r.updateURL()},delete:function(e){for(var t=N(this),r=O(arguments.length,1),n=t.entries,i=C(e),o=r<2?void 0:arguments[1],s=void 0===o?o:C(o),a=0;at.key?1:-1}),e.updateURL()},forEach:function(e){for(var t,r=N(this).entries,n=w(e,arguments.length>1?arguments[1]:void 0),i=0;i1?we(arguments[1]):{})}}),b(U)){var xe=function(e){return m(this,G),new U(e,arguments.length>1?we(arguments[1]):{})};G.constructor=xe,xe.prototype=G,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:xe})}}e.exports={URLSearchParams:ve,getState:N}},98690:(e,t,r)=>{"use strict";var n=r(46518),i=r(53250),o=Math.exp;n({target:"Math",stat:!0},{tanh:function(e){var t=+e,r=i(t),n=i(-t);return r===1/0?1:n===1/0?-1:(r-n)/(o(t)+o(-t))}})},98721:(e,t,r)=>{"use strict";var n=r(43724),i=r(79504),o=r(62106),s=URLSearchParams.prototype,a=i(s.forEach);n&&!("size"in s)&&o(s,"size",{get:function(){var e=0;return a(this,function(){e++}),e},configurable:!0,enumerable:!0})},98992:(e,t,r)=>{"use strict";r(18111)},99209:(e,t,r)=>{"use strict";r(45876)},99449:(e,t,r)=>{"use strict";var n,i=r(46518),o=r(27476),s=r(77347).f,a=r(18014),u=r(655),c=r(60511),l=r(67750),f=r(41436),d=r(96395),p=o("".slice),h=Math.min,g=f("endsWith");i({target:"String",proto:!0,forced:!(!d&&!g&&(n=s(String.prototype,"endsWith"),n&&!n.writable)||g)},{endsWith:function(e){var t=u(l(this));c(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:h(a(r),n),o=u(e);return p(t,i-o.length,i)===o}})},99590:(e,t,r)=>{"use strict";var n=r(91291),i=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw new i("The argument can't be less than 0");return t}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};r.r(e),r.d(e,{columnsFetch:()=>P,setColumns:()=>F,setColumnsAbortController:()=>Q,setColumnsFetchingStatus:()=>q,setCurrentForm:()=>k,setCurrentRequestSubmissionsCount:()=>H,setDates:()=>J,setIsAllowedEdit:()=>ie,setLoadingForm:()=>V,setLoadingSubmissions:()=>Y,setPageCount:()=>W,setPageIndex:()=>z,setPageSize:()=>G,setRequestCount:()=>$,setSearchTerm:()=>X,setSelectedSubmissions:()=>Z,setSubmission:()=>B,setSubmissions:()=>N,setSubmissionsAbortController:()=>ee,setSubmissionsCount:()=>U,setSubmissionsFetchingStatus:()=>K,setSubmissionsSettings:()=>re,setSubmissionsStatus:()=>ne,setSubmissionsTotal:()=>L,submissionsFetch:()=>_,submissionsSettingsFetch:()=>te});var t={};r.r(t),r.d(t,{getColumns:()=>ae,getColumnsAbortController:()=>Ce,getCurrentForm:()=>se,getCurrentRequestSubCount:()=>de,getDates:()=>xe,getFetchStatus:()=>ye,getIsAllowedEdit:()=>Te,getLoadingForm:()=>me,getLoadingSubmissions:()=>be,getPageCount:()=>ve,getPageIndex:()=>ge,getPageSize:()=>he,getRequestCount:()=>we,getSearchTerm:()=>Se,getSelectedSubmissions:()=>Ee,getState:()=>oe,getSubmission:()=>ce,getSubmissions:()=>ue,getSubmissionsAbortController:()=>je,getSubmissionsCount:()=>fe,getSubmissionsData:()=>pe,getSubmissionsSettings:()=>Re,getSubmissionsStatus:()=>Ie,getSubmissionsTotal:()=>le});var n={};r.r(n),r.d(n,{COLUMNS_FETCH:()=>Oe,SUBMISSIONS_FETCH:()=>Ae,SUBMISSIONS_SETTINGS_FETCH:()=>Me});var i={};r.r(i),r.d(i,{getColumns:()=>Fe,getSubmissions:()=>Ne,getSubmissionsSettings:()=>Be});const o=window.wp.domReady;var s=r.n(o);const a=window.wp.apiFetch;var u=r.n(a);const c=window.wp.element,l=window.wp.data,f={currentForm:!1,columns:[],submissions:[],submission:{},submissionsTotal:0,submissionsCount:0,currentRequestSubCount:null,pageCount:null,pageSize:10,pageIndex:1,loadingForm:!1,loadingSubmissions:!1,columnsFetchingStatus:"",submissionsFetchingStatus:"",requestCount:0,dates:{},searchTerm:"",selectedSubmissions:[],columnsAbortController:new AbortController,submissionsAbortController:new AbortController,submissionsSettings:{},submissionsStatus:"completed",isAllowedEdit:"all"},d=window.lodash;var p=r.n(d);let h,g,v,m,b,y,w,x,S,E,C;"undefined"!=typeof nf_submissions&&(h=void 0!==nf_submissions.forms?nf_submissions.forms:{},x=void 0!==nf_submissions.dateFormat?nf_submissions.dateFormat:"",w=void 0!==nf_submissions.timeFormat?nf_submissions.timeFormat:"",g=void 0!==nf_submissions.siteUrl?nf_submissions.siteUrl:"",v=void 0!==nf_submissions.pluginsUrl?nf_submissions.pluginsUrl:"",m=void 0!==nf_submissions.adminUrl?nf_submissions.adminUrl:"",b=void 0!==nf_submissions.restUrl?nf_submissions.restUrl:"",y=void 0!==nf_submissions.token?nf_submissions.token:"",S=void 0!==nf_submissions.submissionsSettings?nf_submissions.submissionsSettings:{},E=void 0!==nf_submissions.nf_user_management_data_access?nf_submissions.nf_user_management_data_access:{},C=void 0!==nf_submissions.nf_user_management_current_user?nf_submissions.nf_user_management_current_user:{});let j=[];p().forEach(h,e=>{e&&Object.keys(e).length>0&&j.push(e)});const R={siteUrl:g,pluginsUrl:v,adminUrl:m,restUrl:b,token:y,forms:j,timeFormat:w,dateFormat:x,generateKey:()=>`nf_${(new Date).getTime()}`,submissionsSettings:S,userManagementAccess:E,currentUser:C},I=window.wp.i18n,T={action:"triggerEmailActions",title:(0,I.__)("Trigger Email Action Title","ninja-forms")},A={action:"bulkExport",title:(0,I.__)("Bulk Export Title","ninja-forms")},O={bulkActionsOptions:[{value:0,label:(0,I.__)("Bulk Actions","ninja-forms")},{value:"trash",label:(0,I.__)("Move to Trash","ninja-forms")},{value:"emailAction",label:(0,I.__)("Trigger Email Action","ninja-forms")},{value:"export",label:(0,I.__)("Export","ninja-forms")}]};let M,D;"undefined"!=typeof nfBeData&&(M=void 0!==nfBeData.restUrl?nfBeData.restUrl:"",D=void 0!==nfBeData.token?nfBeData.token:"");const _=e=>({type:"SUBMISSIONS_FETCH",path:e}),P=e=>({type:"COLUMNS_FETCH",path:e}),k=e=>({type:"SET_CURRENT_FORM",formID:e}),F=e=>({type:"SET_COLUMNS",columns:e}),N=e=>({type:"SET_SUBMISSIONS",submissions:e}),B=e=>({type:"SET_SUBMISSION",submission:e}),L=e=>({type:"SET_SUBMISSIONS_TOTAL",submissionsCount:e}),U=()=>({type:"SET_SUBMISSIONS_COUNT"}),H=e=>({type:"SET_CURRENT_REQUEST_SUBMISSIONS_COUNT",count:e}),G=e=>({type:"SET_PAGE_SIZE",pageSize:e}),z=e=>({type:"SET_PAGE_INDEX",pageIndex:e}),W=()=>({type:"SET_PAGE_COUNT"}),V=e=>({type:"SET_LOADING_FORM",loadingForm:e}),Y=e=>({type:"SET_LOADING_SUBMISSIONS",loadingSubmissions:e}),q=e=>({type:"SET_COLUMNS_FETCHING_STATUS",status:e}),K=e=>({type:"SET_SUBMISSIONS_FETCHING_STATUS",status:e}),$=()=>({type:"SET_REQUEST_COUNT"}),J=e=>({type:"SET_DATES",dates:e}),X=e=>({type:"SET_SEARCH_TERM",searchTerm:e}),Z=e=>({type:"SET_SELECTED_SUBMISSIONS",submissionsArray:e}),Q=e=>({type:"SET_COLUMNS_ABORT_CONTROLLER",abortController:e}),ee=e=>({type:"SET_SUBMISSIONS_ABORT_CONTROLLER",abortController:e}),te=()=>({type:"SUBMISSIONS_SETTINGS_FETCH"}),re=e=>({type:"SET_SUBMISSIONS_SETTINGS",settings:e}),ne=e=>({type:"SET_SUBMISSIONS_STATUS",status:e}),ie=()=>{let e="all",t=[];if(Object.entries(R.currentUser).length>0&&Object.entries(R.userManagementAccess).length>0){e="none";const r=JSON.parse(R.userManagementAccess);R.currentUser.roles.forEach(e=>{"administrator"===e?t.push("all"):(r.edit_others_submissions.indexOf(e)>=0&&t.push("others"),r.edit_own_submissions.indexOf(e)>=0&&t.push("own"))}),t.indexOf("all")>=0||t.indexOf("others")>=0&&t.indexOf("own")>=0?e="all":t.indexOf("others")>=0?e="others":t.indexOf("own")>=0&&(e="own")}return{type:"SET_ALLOWED_EDIT",status:e}};function oe(e){return e}function se(e){const{currentForm:t}=e;return t}function ae(e){const{columns:t}=e;return t}function ue(e){const{submissions:t}=e;return t}function ce(e){const{submission:t}=e;return t}function le(e){const{submissionsTotal:t}=e;return t}function fe(e){const{submissionsCount:t}=e;return t}function de(e){const{currentRequestSubCount:t}=e;return t}function pe(e){const{submissions:t,columns:r,pageCount:n,pageSize:i,pageIndex:o,requestCount:s,dates:a,searchTerm:u,submissionsStatus:c}=e;return{submissions:t,columns:r,pageCount:n,pageSize:i,pageIndex:o,requestCount:s,dates:a,searchTerm:u,submissionsStatus:c}}function he(e){const{pageSize:t}=e;return t}function ge(e){const{pageIndex:t}=e;return t}function ve(e){const{pageCount:t}=e;return t}function me(e){const{loadingForm:t}=e;return t}function be(e){const{loadingSubmissions:t}=e;return t}function ye(e){const{columnsFetchingStatus:t,submissionsFetchingStatus:r}=e;return{columnsFetchingStatus:t,submissionsFetchingStatus:r}}function we(e){const{requestCount:t}=e;return t}function xe(e){const{dates:t}=e;return t}function Se(e){const{searchTerm:t}=e;return t}function Ee(e){const{selectedSubmissions:t}=e;return t}function Ce(e){const{columnsAbortController:t}=e;return t}function je(e){const{submissionsAbortController:t}=e;return t}function Re(e){const{submissionsSettings:t}=e;return t}function Ie(e){const{submissionsStatus:t}=e;return t}function Te(e){const{isAllowedEdit:t}=e;return t}const Ae=e=>{(0,l.dispatch)("ninja-forms/submissions").setSubmissionsFetchingStatus("fetching");const t=(0,l.select)("ninja-forms/submissions").getSubmissionsAbortController();return u()({path:e.path,signal:t.signal}).then(e=>((0,l.dispatch)("ninja-forms/submissions").setSubmissionsFetchingStatus("ready"),e)).catch(e=>(console.log("Error: "+JSON.stringify(e)),e))},Oe=e=>{(0,l.dispatch)("ninja-forms/submissions").setColumnsFetchingStatus("fetching");const t=(0,l.select)("ninja-forms/submissions").getColumnsAbortController();return u()({path:e.path,signal:t.signal}).then(e=>((0,l.dispatch)("ninja-forms/submissions").setColumnsFetchingStatus("ready"),e)).catch(e=>(console.log("Error: "+JSON.stringify(e)),e))},Me=()=>u()({path:"ninja-forms-submissions/get-submissions-settings"}).then(e=>JSON.parse(e)).catch(e=>(console.log("Error: "+JSON.stringify(e)),e)),De=["submit","html","divider","hr","note","unknown","button","confirm"],_e=(e,t,r,n=10,i=1,o=0,s=0,a="",u="completed")=>((0,l.dispatch)("ninja-forms/submissions").setRequestCount(),"/ninja-forms-submissions/submissions/get?type=".concat(e,"&form_ids=",t,"&page_size=",n,"¤t_page=",i,"&start_date=",o,"&end_date=",s,"&search_term=",a,"&status=",u,"&request_count=",r)),Pe=e=>{const t=Object.values(e);let r=[{Header:"Form Submissions",columns:[{Header:"#",accessor:"seqID"}]}];return t.forEach(e=>{if(!De.includes(e.type)){let t=e.label;void 0!==e.adminLabel&&""!==e.adminLabel&&(t=e.adminLabel),r[0].columns.push({Header:t,accessor:e.slug,fieldSettings:e.original,options:e.options})}}),r[0].columns.push({Header:"Date",accessor:"timestamp"}),r},ke=e=>{let t=[],r=[];for(let[r,n]of Object.entries(e))n.key=r,t.push(n);return t.forEach(e=>{const t=Object.values(e.submissionFieldCollection);let n={key:e.key,submissionID:e.submissionRecordId,seqID:void 0!==e.seq_num?e.seq_num:e.submissionRecordId,timestamp:e.timestamp,dataSource:e.dataSource,formId:e.formId,types:{},extraValues:e.extraValues,extraHandlers:e.submissionHandlers,submissionObject:e,submitterId:e.submitterId};t.forEach(e=>{if("repeater"===e.type){const t=[];e.fieldsetRepeaterFields.map(e=>{t.push(e.id)}),"object"==typeof e.value&&Object.values(e.value).map(r=>{const n=r.id.substring(0,r.id.indexOf("_"));-1===t.indexOf(n)&&delete e.value[r.id]})}if("file_upload"===e.type){const t=e.value,r=e.value?Object.entries(e.value):[];n[e.slug]=r,n.originalValue=t,n.types[e.slug]=e.type}else De.includes(e.type)||("string"==typeof e.value&&(e.value=(e=>{let t=e;const r=["&","<",">",""",,"'"],n=["&","<",">",'"',"'","'"];return r.forEach(e=>{for(;t.indexOf(e)>=0&&(t=t.replaceAll(e,n[r.indexOf(e)]),0!=t.indexOf(e)););}),t})(e.value)),n[e.slug]=e.value,n.types[e.slug]=e.type)}),r.push(n)}),r};function*Fe(e,t){const r=_e("columns",e,t),n=yield P(r),i=n&&Object.keys(n).length>0?Pe(n):[n];return F(i)}function*Ne(e,t,r,n,i,o,s,a){const u=_e("data",e,t,r,n,i,o,s,a),c=yield _(u);let f;return f=c.count<=0?[]:c.data&&Object.keys(c.data).length>0?ke(c.data):[],i&&o||s?((0,l.dispatch)("ninja-forms/submissions").setCurrentRequestSubmissionsCount(c.count),(0,l.dispatch)("ninja-forms/submissions").setSubmissionsCount()):((0,l.dispatch)("ninja-forms/submissions").setCurrentRequestSubmissionsCount(null),(0,l.dispatch)("ninja-forms/submissions").setSubmissionsTotal(c.count),(0,l.dispatch)("ninja-forms/submissions").setSubmissionsCount()),N(f)}function*Be(){const e=yield te();return re(e)}var Le=r(5556),Ue=r.n(Le);const He=window.wp.components,Ge=window.ReactJSXRuntime,ze=e=>{const t=void 0!==e.forms?e.forms:{},r=[{value:0,label:"- "+(0,I.__)("Select a form","ninja-forms")+" "}];for(const[e,n]of Object.entries(t))r.push({value:n.formID,label:n.formTitle+" ( "+(0,I.__)("ID: ","ninja-forms")+n.formID+" ) "});return(0,Ge.jsx)(He.SelectControl,{className:"nf-submissions-select-form",style:e.style,hideLabelFromVision:e.hideLabelFromVision,labelPosition:e.labelPosition,label:e.label,multiple:e.multiple,options:r,onChange:t=>e.setForm(t),value:e.currentValue})};ze.propTypes={setForm:Ue().func.isRequired,forms:Ue().array,style:Ue().object,multiple:Ue().bool,label:Ue().string,labelPosition:Ue().string,hideLabelFromVision:Ue().bool,currentValue:Ue().oneOfType([Ue().string,Ue().number,Ue().bool])};const We=e=>(0,Ge.jsx)(Ge.Fragment,{children:(0,Ge.jsxs)(He.Modal,{className:"nf-modal",title:e.title,onRequestClose:()=>e.cancel(!1),children:[e.content&&(0,Ge.jsxs)("div",{className:"mb-2",children:[e.content,(0,Ge.jsx)("br",{})]}),(0,Ge.jsx)(He.Button,{isPrimary:!0,onClick:e.action,className:"mr-2",children:e.actionText}),e.cancel&&(0,Ge.jsx)(He.Button,{isSecondary:!0,onClick:()=>e.cancel(!1),children:e.cancelText})]})});We.propTypes={title:Ue().string,actionText:Ue().string,cancelText:Ue().string,action:Ue().func.isRequired,cancel:Ue().func.isRequired,content:Ue().string};const Ve=e=>{let t;return t=e.setDisplayNotice?()=>{e.setDisplayNotice(()=>!1)}:()=>{jQuery("#nf-trigger-emails-container .components-notice").remove(),jQuery("#nf-bulk-export-container .components-notice").remove()},(0,Ge.jsx)(Ge.Fragment,{children:(0,Ge.jsx)(He.Notice,{status:e.status,isDismissible:"true",children:e.text,politeness:"polite",onRemove:t})})};Ve.propTypes={isDismissible:Ue().string,status:Ue().string,text:Ue().string};var Ye=r(98322);const qe=e=>{const t=e.placeholder.length>0?e.placeholder:"";let r={dateFormat:e.dateFormat};e.maxDate&&(r.maxDate=e.maxDate),e.minDate&&(r.minDate=e.minDate),e.defaultDate&&Object.keys(e.defaultDate).length>0?r.defaultDate=e.defaultDate:r.defaultDate=[];const n=(0,c.useRef)(0);return(0,c.useEffect)(()=>{void 0!==e.defaultDate&&e.defaultDate.reset&&(n.current="reset",e.setDates({}))},[e.defaultDate]),(0,Ge.jsx)(Ye.A,{id:"nf-select-submissions-dates",disabled:e.disabled,"data-mode":"range",placeholder:t,options:r,onChange:t=>{e.setDates({date:t})},onValueUpdate:(e,t,r)=>{"reset"===n.current&&(r.clear(),n.current=0)}})};qe.propTypes={dateFormat:Ue().string.isRequired,setDates:Ue().func.isRequired,placeholder:Ue().string,maxDate:Ue().oneOfType([Ue().string,Ue().number,Ue().object]),minDate:Ue().oneOfType([Ue().string,Ue().number,Ue().object]),defaultDate:Ue().object};const Ke=e=>{const{text:t}=e;return(0,Ge.jsxs)("span",{className:"nf-processing",children:[t&&(0,Ge.jsx)("span",{className:"nf-loading-text",children:t}),(0,Ge.jsx)(He.Spinner,{})]})};function $e(e){return $e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$e(e)}function Je(e,t,r){return(t=function(e){var t=function(e){if("object"!=$e(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=$e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$e(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Ke.propTypes={text:Ue().string};class Xe extends c.Component{constructor(e){super(e),Je(this,"onChange",e=>{const{suggestions:t}=this.state,r=e.currentTarget.value,n=[];t.forEach(e=>{e.title.toLowerCase().indexOf(r.toLowerCase())>-1&&n.push(e)}),this.setState({activeSuggestion:0,filteredSuggestions:n,showSuggestions:!0,userInput:r})}),Je(this,"onKeyDown",e=>{const{activeSuggestion:t,filteredSuggestions:r}=this.state;if(13===e.keyCode)this.setState({activeSuggestion:0,showSuggestions:!1,userInput:r[t]});else if(38===e.keyCode){if(0===t)return;this.setState({activeSuggestion:t-1})}else if(40===e.keyCode){if(t-1===r.length)return;this.setState({activeSuggestion:t+1})}}),this.state={activeSuggestion:0,filteredSuggestions:[],showSuggestions:!1,userInput:"",suggestions:[]},this.setSuggestions=this.setSuggestions.bind(this),this.setForm=this.setForm.bind(this)}componentDidMount(){this.setSuggestions()}setSuggestions(){const{forms:e}=this.props;let t=[];e.forEach(e=>{t.push({title:e.formTitle+" ( ID: "+e.formID+" ) ",id:e.formID})}),this.setState({suggestions:t})}setForm(e){this.setState({activeSuggestion:0,filteredSuggestions:[],showSuggestions:!1,userInput:""}),(0,l.dispatch)("ninja-forms/submissions").setCurrentForm(e.id)}render(){const{onChange:e,setForm:t,onKeyDown:r,state:{activeSuggestion:n,filteredSuggestions:i,showSuggestions:o,userInput:s},props:{disabled:a}}=this;let u;return o&&s&&(u=i.length?(0,Ge.jsx)("div",{className:"nf-form-dropdown active",children:(0,Ge.jsx)("ul",{id:"nf_form_options",className:"suggestions widefat",children:i.map((e,r)=>{let i="nf-form-option";return r===n&&(i=i.concat(" suggestion-active")),(0,Ge.jsx)("li",{className:i,onClick:()=>t(e),children:(0,Ge.jsx)("span",{className:"nf-form-option",children:e.title})},e.id)})})}):(0,Ge.jsx)("div",{className:"no-suggestions",children:(0,Ge.jsx)("em",{children:(0,I.__)("No suggestions available.","ninja-forms")})})),(0,Ge.jsxs)("div",{className:"nf_form_filter_container",children:[(0,Ge.jsx)("input",{disabled:a,id:"nf_form_filter",className:"nf_filter_sub_input",placeholder:(0,I.__)("Filter Forms","ninja-forms"),type:"text",onChange:e,onKeyDown:r,value:s}),u]})}}const Ze=e=>{const{options:t,label:r,multiple:n,hideLabelFromVision:i,labelPosition:o,triggerAction:s}=e,a=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsStatus());return(0,c.useEffect)(()=>{"trash"===a?(t.forEach((e,r)=>{"trash"===e.value&&(t[r].label=(0,I.__)("Delete Permanently","ninja-forms")),"restore"===e.value&&delete t[r]}),t.push({value:"restore",label:(0,I.__)("Restore","ninja-forms")})):t.forEach((e,r)=>{"trash"===e.value&&(t[r].label=(0,I.__)("Move to Trash","ninja-forms")),"restore"===e.value&&(console.log(t),console.log(e),delete t[r],console.log(t))})},[a]),(0,Ge.jsx)(He.SelectControl,{className:"nf-submissions-select-action",hideLabelFromVision:i,labelPosition:o,label:r,multiple:n,options:t,onChange:e=>s(e)})};Ze.propTypes={triggerAction:Ue().func.isRequired,options:Ue().array,multiple:Ue().bool,label:Ue().string,labelPosition:Ue().string,hideLabelFromVision:Ue().bool,submissionsStatus:Ue().string};const Qe=e=>{const t=(0,l.select)("ninja-forms/submissions").getSubmissionsData(),r=(0,l.select)("ninja-forms/submissions").getCurrentForm();u().use(u().createNonceMiddleware(R.token)),u()({url:R.restUrl+"ninja-forms-submissions/submissions/delete",method:"POST",data:{submissions:e.submissions}}).then(e=>{const n=void 0!==t.dates.startDateTimestamp?t.dates.startDateTimestamp:0,i=void 0!==t.dates.endDateTimestamp?t.dates.endDateTimestamp:0;(0,l.select)("ninja-forms/submissions").getSubmissions(r,++t.requestCount,t.pageSize,t.pageIndex,n,i,t.searchTerm,t.submissionsStatus)}).catch(e=>{console.log("Deletion cancelled: "+e.message)})};Qe.propTypes={globalParams:Ue().object.isRequired};const et=e=>{const t=(0,l.select)("ninja-forms/submissions").getSubmissionsData(),r=(0,l.select)("ninja-forms/submissions").getCurrentForm();u().use(u().createNonceMiddleware(R.token)),u()({url:R.restUrl+"ninja-forms-submissions/submissions/restore",method:"POST",data:{submissions:e.submissions,restore:!0}}).then(e=>{const n=void 0!==t.dates.startDateTimestamp?t.dates.startDateTimestamp:0,i=void 0!==t.dates.endDateTimestamp?t.dates.endDateTimestamp:0;(0,l.select)("ninja-forms/submissions").getSubmissions(r,++t.requestCount,t.pageSize,t.pageIndex,n,i,t.searchTerm,t.submissionsStatus)}).catch(e=>{console.log("Restore cancelled: "+e.message)})};et.propTypes={globalParams:Ue().object.isRequired};const tt=e=>{u().use(u().createNonceMiddleware(R.token)),u()({url:R.restUrl+"ninja-forms-submissions/submissions/update",method:"POST",data:{singleSubmission:e.singleSubmission},signal:e.signal}).then(e=>{const t=(0,l.select)("ninja-forms/submissions").getSubmissionsData(),r=(0,l.select)("ninja-forms/submissions").getCurrentForm(),n=void 0!==t.dates.startDateTimestamp?t.dates.startDateTimestamp:0,i=void 0!==t.dates.endDateTimestamp?t.dates.endDateTimestamp:0;(0,l.select)("ninja-forms/submissions").getSubmissions(r,++t.requestCount,t.pageSize,t.pageIndex,n,i,t.searchTerm,t.submissionsStatus)}).catch(e=>{console.log("Update cancelled: "+e.message)})};tt.propTypes={singleSubmission:Ue().object.isRequired,signal:Ue().object};const rt=async e=>{e.setProcessing(!0),u().use(u().createNonceMiddleware(e.globalParams.token));const t=e.forms?e.forms.join(","):"",r=e.startDateTimestamp?JSON.stringify(e.startDateTimestamp):"",n=e.endDateTimestamp?JSON.stringify(e.endDateTimestamp):"",i=e.singleSubmission?JSON.stringify(e.singleSubmission):"",o=e.submissions?e.submissions:[];await u()({url:e.globalParams.restUrl+"ninja-forms-submissions/export",method:"POST",data:{form_ids:t,start_date:r,end_date:n,singleSubmission:i,submissions:o},signal:e.signal}).then(t=>{for(const[e,r]of Object.entries(t))nt(e,r);e.setExportSuccess(!0),e.setProcessing(!1)}).catch(t=>{console.log("Export cancelled: "+t.message),e.setExportError(!0),e.setProcessing(!1)})},nt=(e,t)=>{const r=new Blob([t]);let n=window.document.createElement("a");n.href=window.URL.createObjectURL(r,{encoding:"UTF-8",type:"text/csv;charset=UTF-8"}),n.download="nf-subs-"+e+".csv",document.body.appendChild(n),n.click(),document.body.removeChild(n)};rt.propTypes={globalParams:Ue().object.isRequired,forms:Ue().array.isRequired,startDateTimestamp:Ue().object,endDateTimestamp:Ue().object,setProcessing:Ue().func,setExportSuccess:Ue().func,setExportError:Ue().func,signal:Ue().object.isRequired,singleSubmission:Ue().object,submissions:Ue().array};var it=r(48287);const ot=e=>{const{singleSubmission:t,handleExtra:r}=e;u().use(u().createNonceMiddleware(R.token)),u()({url:R.restUrl+"ninja-forms-submissions/submissions/handle-extra",method:"POST",data:{singleSubmission:t,handleExtra:r}}).then(e=>{if("download"===e.responseType){const r=(e.blobType.endsWith("pdf"),".pdf"),n=""!==e.filename?e.filename:"form-"+t.formId+"-submission-"+t.submissionRecordId+r,i=it.hp.from(e.download,"base64"),o=new Blob([i],{type:e.blobType}),s=window.URL.createObjectURL(o),a=document.createElement("a");a.href=s,a.setAttribute("download",n),document.body.appendChild(a),a.click(),a.parentNode.removeChild(a)}}).catch(e=>{console.log("HandleExtra cancelled: "+e.message)})};ot.propTypes={singleSubmission:Ue().object.isRequired,handleExtra:Ue().object.isRequired};const st=async e=>{e.setProcessing(!0),u().use(u().createNonceMiddleware(e.globalParams.token));const t=e.forms?e.forms.join(","):"",r=!!e.fetchController&&e.fetchController.signal;await u()({url:e.globalParams.restUrl+"ninja-forms-submissions/download-all",method:"POST",data:{form_ids:t},signal:r}).then(t=>{const r=t.formId,n=t.downloadUrl,i=t.filePath;at(r,n),e.setProcessing(!1),e.setDisplayNotice({success:!0}),u()({url:e.globalParams.restUrl+"ninja-forms-submissions/delete-download-file",method:"POST",data:{file_path:i}}).then(e=>{e.result}).catch(e=>{console.log("Could not delete file: "+e.message)})}).catch(t=>{e.setProcessing(!1),e.setDisplayNotice({error:!0}),console.log("Export cancelled: "+t.message)})},at=(e,t)=>{fetch(t).then(e=>e.blob()).then(t=>{let r=window.document.createElement("a");r.href=window.URL.createObjectURL(t,{encoding:"UTF-8",type:"text/csv;charset=UTF-8"}),r.download="nf-subs-"+e+".csv",document.body.appendChild(r),r.click(),document.body.removeChild(r)})};st.propTypes={globalParams:Ue().object.isRequired,forms:Ue().array.isRequired,setProcessing:Ue().func,setDisplayNotice:Ue().func,fetchController:Ue().object.isRequired};const ut=(e,t,r)=>(u().use(u().createNonceMiddleware(R.token)),u()({url:R.restUrl+"ninja-forms-submissions/set-submissions-settings",method:"POST",data:{settingName:e,data:t,formID:r}}).then(e=>e).catch(e=>(console.log("Error: "+JSON.stringify(e)),e)));ut.propTypes={settingName:Ue().string.isRequired,data:Ue().object,formID:Ue().string};const ct=e=>{const{globalParams:t}=e,{forms:r,dateFormat:n}=t,i=e=>{(0,l.dispatch)("ninja-forms/submissions").setCurrentForm(e);const t=new URL(window.location);t.searchParams.set("form_id",e),window.history.pushState({},"",t)},o=(0,l.useSelect)(e=>e("ninja-forms/submissions").getCurrentForm()),s=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsStatus()),a=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSearchTerm()),u=(0,l.useSelect)(e=>e("ninja-forms/submissions").getDates()),f=(0,l.useSelect)(e=>e("ninja-forms/submissions").getColumnsAbortController()),d=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsAbortController());(0,c.useEffect)(()=>{const e=new URL(document.location).searchParams.get("form_id");return e&&void 0!==e&&e.length>0&&i(e),(0,l.dispatch)("ninja-forms/submissions").setIsAllowedEdit(),()=>{H.abort(),f.abort(),d.abort(),(0,l.dispatch)("ninja-forms/submissions").setLoadingSubmissions(!1),(0,l.dispatch)("ninja-forms/submissions").setLoadingForm(!1)}},[]);const p=(0,l.useSelect)(e=>e("ninja-forms/submissions").getLoadingForm()),h=(0,l.useSelect)(e=>e("ninja-forms/submissions").getLoadingSubmissions()),g=(0,l.useSelect)(e=>e("ninja-forms/submissions").getFetchStatus());(0,c.useEffect)(()=>{"ready"===g.columnsFetchingStatus&&"ready"===g.submissionsFetchingStatus?((0,l.dispatch)("ninja-forms/submissions").setLoadingForm(!1),(0,l.dispatch)("ninja-forms/submissions").setLoadingSubmissions(!1)):"fetching"!==g.columnsFetchingStatus&&"fetching"!==g.submissionsFetchingStatus||(0,l.dispatch)("ninja-forms/submissions").setLoadingSubmissions(!0)},[o,g]),(0,c.useEffect)(()=>{(0,l.dispatch)("ninja-forms/submissions").setLoadingForm(!0),(0,l.dispatch)("ninja-forms/submissions").setPageIndex(1)},[o]);const[v,m]=(0,c.useState)(!1),[b,y]=(0,c.useState)(!1),w=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSelectedSubmissions()),[x,S]=(0,c.useState)([]),[E,C]=(0,c.useState)([]),[j,R]=(0,c.useState)([]);(0,c.useEffect)(()=>{let e=[],t=[],r=[];w.forEach(n=>{const i=void 0!==n.submission.seqID?n.submission.seqID:n.submission.submissionID;let o={dataSource:n.submission.dataSource,submissionRecordId:n.submission.submissionID,seqID:i};e.push(o),t.push(n.submission.submissionID),r.push(i)}),S(e),C(t),R(r)},[w]);const[A,M]=(0,c.useState)(!1),[D,_]=(0,c.useState)(!1),P=(0,I.__)("Select one or more submissions before selecting the bulk action.","ninja-forms"),[k,F]=((0,I.__)("Feature not functional at the moment.","ninja-forms"),(0,c.useState)("")),[N,B]=(0,c.useState)({display:!1,position:""}),[L,U]=(0,c.useState)(!1),[H,G]=(0,c.useState)(new AbortController),[z,W]=(0,c.useState)(!1),V=()=>{U(!1)},Y=(e,t="top")=>{"0"===e?(B(!1),m(!1),y(!1)):E.length<=0?(F(P),"bottom"===t?y(!0):m(!0)):"trash"===e?(B(!1),m(!1),y(!1),M(!0)):"emailAction"===e?B({display:!0,position:t}):"export"===e?W(!0):"restore"===e&&(B(!1),m(!1),y(!1),_(!0))},q=(0,Ge.jsx)(gt,{globalParams:t,triggerEmailActionsParams:T,fetchController:new AbortController,setDisplayEmailActionsComponent:B,formID:o||"",submissionIds:E});return(0,Ge.jsxs)("div",{className:"wrap",children:[(0,Ge.jsx)(lt,{params:t}),(0,Ge.jsx)("br",{className:"clear"}),(0,Ge.jsxs)("div",{className:"tablenav top",children:[(0,Ge.jsxs)("div",{className:"nf-forms-actions actions",children:[(0,Ge.jsx)(ze,{forms:r,setForm:i,multiple:!1,label:(0,I.__)("Select Form","ninja-forms"),hideLabelFromVision:!0,currentValue:o}),(0,Ge.jsx)(Xe,{forms:r}),h&&(0,Ge.jsx)("div",{className:"nf-loading-submissions-top",children:(0,Ge.jsx)(Ke,{text:(0,I.__)("Loading Submissions","ninja-forms")})}),L&&(0,Ge.jsx)("div",{className:"nf-loading-submissions-top",children:(0,Ge.jsx)(Ke,{text:(0,I.__)("Exporting Submissions","ninja-forms")})})]}),(0,Ge.jsx)("br",{className:"clear"}),0!=o&&!p&&(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(Kt,{currentForm:o,dateFormat:n,triggerBulkAction:Y,submissionsLoading:h,submissionsStatus:s,searchTerm:a,dates:u}),v&&(0,Ge.jsx)(Ve,{status:"info",text:k,setDisplayNotice:m}),N.display&&"top"===N.position&&q]})]}),(0,Ge.jsx)(Bt,{currentForm:o}),A&&(0,Ge.jsx)(We,{title:(0,I._n)("Delete Submission","Delete Submissions",E.length,"ninja-forms"),actionText:(0,I.__)("Delete","ninja-forms"),cancelText:(0,I.__)("Cancel","ninja-forms"),action:()=>{Qe({submissions:x}),M(!1)},cancel:()=>M(!1),content:(0,I.sprintf)((0,I._n)("This action will delete submission %s","This action will delete submissions %s",j.length,"ninja-forms"),j)}),D&&(0,Ge.jsx)(We,{title:(0,I._n)("Restore Submission","Restore Submissions",E.length,"ninja-forms"),actionText:(0,I.__)("Restore","ninja-forms"),cancelText:(0,I.__)("Cancel","ninja-forms"),action:()=>{et({submissions:x}),_(!1)},cancel:()=>_(!1),content:(0,I.sprintf)((0,I._n)("This action will restore submission %s","This action will restore submissions %s",j.length,"ninja-forms"),j)}),z&&(0,Ge.jsx)(We,{title:(0,I._n)("Export Submission","Export Submissions",E.length,"ninja-forms"),actionText:(0,I.__)("Export","ninja-forms"),cancelText:(0,I.__)("Cancel","ninja-forms"),action:()=>{rt({globalParams:t,forms:[o],setProcessing:U,setExportSuccess:V,signal:H.signal,submissions:E}),W(!1)},cancel:()=>W(!1),content:(0,I.sprintf)((0,I._n)("Export submission %s to a .csv file","Export submissions %s to a .csv file",j.length,"ninja-forms"),j)}),(0,Ge.jsx)("br",{className:"clear"}),(0,Ge.jsx)(ft,{currentForm:o,options:O.bulkActionsOptions,triggerBulkAction:Y,formLoading:p}),N.display&&"bottom"===N.position&&q,b&&(0,Ge.jsx)(Ve,{status:"info",text:k,setDisplayNotice:y})]})};ct.propTypes={globalParams:Ue().object.isRequired};const lt=e=>(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsxs)("h1",{className:"wp-heading-inline",children:[(0,I.__)("Submissions","ninja-forms")," ",(0,Ge.jsx)("a",{href:"https://ninjaforms.com/docs/submission-management/?utm_source=Ninja+Forms+Plugin&utm_medium=Form+Builder&utm_campaign=Documentation&utm_content=Submissions+Documentation",target:"_blank",children:(0,Ge.jsx)("img",{src:`${e.params.pluginsUrl}/ninja-forms/assets/img/help_icon.png`,alt:"Ninja Forms Documentation HelpText",title:"Ninja Forms Submissions Documentation",style:{width:"25px",height:"25px"}})})]}),(0,Ge.jsx)("hr",{className:"wp-header-end"})]}),ft=e=>{const{currentForm:t,triggerBulkAction:r,options:n,formLoading:i}=e,[o,s]=(0,c.useState)(!1),[a,u]=(0,c.useState)({}),[l,f]=(0,c.useState)(new AbortController);return(0,c.useEffect)(()=>()=>l.abort(),[]),(0,Ge.jsx)(Ge.Fragment,{children:(0,Ge.jsx)("div",{className:"tablenav bottom",children:(0,Ge.jsxs)("div",{className:"actions",children:[!1!==t&&!i&&(0,Ge.jsx)("div",{className:"nf-f-child",children:(0,Ge.jsx)(Ze,{multiple:!1,options:n,triggerAction:e=>r(e,"bottom"),label:(0,I.__)("Select Bulk Action"),labelPosition:"top",hideLabelFromVision:!0})}),!1!==t&&!i&&(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(He.Button,{onClick:()=>{st({forms:[t],setProcessing:s,setDisplayNotice:u,globalParams:R,fetchController:l})},variant:"secondary",className:"nf-export-all-submissions button-secondary nf-download-all nf-f-child",children:(0,I.__)("Download All Submissions","ninja-forms")}),o&&(0,Ge.jsx)(Ke,{text:(0,I.sprintf)((0,I.__)("Exporting one CSV file of all submissions for form %d","ninja-forms"),parseInt(t))}),a&&a.error&&(0,Ge.jsx)(Ve,{status:"error",text:(0,I.__)("Submissions download failed.","ninja-forms"),setDisplayNotice:u}),a&&a.success&&(0,Ge.jsx)(Ve,{status:"success",text:(0,I.__)("Submissions downloaded in one CSV File.","ninja-forms"),setDisplayNotice:u})]}),(0,Ge.jsx)("div",{id:"nf-bulk-export-container nf-f-child",children:(0,Ge.jsx)(mt,{globalParams:R,bulkExportParams:A})})]})})})};ft.propTypes={currentForm:Ue().oneOfType([Ue().string,Ue().number,Ue().bool]).isRequired,triggerBulkAction:Ue().func.isRequired,options:Ue().array.isRequired,formLoading:Ue().bool.isRequired};const dt=e=>{const t=Object.keys(e.value).map(t=>{if(["label","to","email_subject"].includes(t)&&"string"==typeof e.value[t]&&e.value[t].length>0)return(0,Ge.jsxs)("li",{children:[(0,Ge.jsx)("b",{children:t}),": ",e.value[t]]},t)});return(0,Ge.jsx)("ul",{children:t})};dt.propTypes={value:Ue().object.isRequired};const pt=e=>{const t=void 0!==e.form?e.form.emailActions:{},r=[{value:null,name:"--",key:null}];for(const[e,n]of Object.entries(t))r.push({value:e,name:n.label,key:e});return(0,Ge.jsx)(He.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,I.__)("Select Email Action:","ninja-forms"),options:r,onChange:({selectedItem:r})=>{r.value?(t[r.value].value=r.value,e.setAction("action",t[r.value])):e.setAction("action",!1)}})};pt.propTypes={form:Ue().object,setAction:Ue().func.isRequired};const ht=async(e,t)=>{await u()({url:e.restUrl+"ninja-forms-submissions/email-action",method:"POST",data:{submission:t,action_settings:e.action,formID:e.formID},parse:!1,signal:e.signal}).then(t=>{if(e.setEmailProcessed(),t.ok)return t.json();console.log(t.json()),e.setNotSent(t.json())}).then(t=>{!0===t?e.setSent():e.setNotSent(t)})};ht.propTypes={restUrl:Ue().string.isRequired,action:Ue().object.isRequired,formID:Ue().number.isRequired,setSent:Ue().func.isRequired,setNotSent:Ue().func.isRequired,setEmailProcessed:Ue().func.isRequired,signal:Ue().object.isRequired};class gt extends c.Component{constructor(e){super(e),this.setForm(),this.state={action:!1,processing:!1,sent:-1,notSent:[],isModalOpen:!1,emailsProcessed:0,fetchAborted:!1},this.setStateNewValue=this.setStateNewValue.bind(this),this.setModalOpen=this.setModalOpen.bind(this),this.setProcessing=this.setProcessing.bind(this),this.setSent=this.setSent.bind(this),this.setNotSent=this.setNotSent.bind(this),this.setEmailProcessed=this.setEmailProcessed.bind(this),this.cancelComp=this.cancelComp.bind(this),this.resetProcessing=this.resetProcessing.bind(this),this.abortFetch=this.abortFetch.bind(this),this.triggerEmailAction=this.triggerEmailAction.bind(this)}setForm(){this.props.globalParams.forms.forEach(e=>{e.formID===parseInt(this.props.formID)&&(this.form=e,this.emailActionsLength=Object.keys(e.emailActions).length)})}componentDidMount(){if(this.form&&1===this.emailActionsLength){const e=Object.entries(this.form.emailActions);for(const[t,r]of e)r.value=t,this.setStateNewValue("action",r)}}componentDidUpdate(){this.state.processing&&void 0!==this.state.processing&&this.state.emailsProcessed===this.props.submissionIds.length&&this.setProcessing(!1)}componentWillUnmount(){this.abortFetch(),this.resetProcessing()}setStateNewValue(e,t){this.setState({[e]:t})}setProcessing(e){this.setState({processing:e})}setModalOpen(e){this.setState({isModalOpen:e})}setSent(e){"undefined"==e&&0===e?this.setState({sent:-1}):this.setState(e=>({sent:e.sent+1}))}setNotSent(e){if(e){const t=this.state.notSent.concat(e);this.setState({notSent:t})}else this.setState({notSent:[]})}setEmailProcessed(e){void 0!==e&&0===e?this.setState({emailsProcessed:0}):this.setState(e=>({emailsProcessed:e.emailsProcessed+1}))}resetProcessing(){this.setProcessing(!1),this.setEmailProcessed(0),this.setSent(-1),this.setNotSent(!1)}abortFetch(){this.props.fetchController.abort(),this.setState({fetchAborted:!0})}cancelComp(){this.state.processing?(this.setStateNewValue("isModalOpen",!1),this.setProcessing(!1),this.abortFetch()):(0,c.unmountComponentAtNode)(document.getElementById("nf-trigger-emails-container"))}async triggerEmailAction(){this.setProcessing(!0),this.setSent(0);const{state:e,props:t,form:r}=this,n=t.globalParams.restUrl,{action:i}=e,{submissionIds:o}=t,s=r.formID,a=t.fetchController.signal,u={restUrl:n,action:i,formID:s,setSent:this.setSent,setNotSent:this.setNotSent,setEmailProcessed:this.setEmailProcessed,signal:a};for(const[e,t]of Object.entries(o))await ht(u,t).catch(e=>{console.log("Email cancelled: "+e.message),this.setNotSent(t)})}render(){const{state:e,props:t,emailActionsLength:r,form:n}=this,{action:i,processing:o,sent:s,notSent:a,isModalOpen:u,fetchAborted:c}=e,{submissionIds:l,setDisplayEmailActionsComponent:f}=t;return(0,Ge.jsx)(Ge.Fragment,{children:(0,Ge.jsxs)(He.Card,{isElevated:!0,children:[(0,Ge.jsx)("br",{}),(0,Ge.jsx)("br",{}),(0,Ge.jsx)(He.CardHeader,{children:r>1&&(0,Ge.jsx)(pt,{form:n,setAction:this.setStateNewValue})}),(0,Ge.jsx)(He.CardBody,{children:i?(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsxs)("h3",{children:[(0,I.__)("Action Selected: ","ninja-forms"),i.label]}),(0,Ge.jsx)(dt,{value:i})]}):(0,Ge.jsx)("p",{children:(0,I.__)("No Email Action Selected","ninja-forms")})}),(0,Ge.jsx)(He.CardFooter,{children:(0,Ge.jsxs)("div",{children:[c&&(0,Ge.jsx)(He.Button,{isPrimary:!0,onClick:()=>this.setModalOpen(!0),children:(0,I.__)("Reopen to allow resending process","ninja-forms")}),i&&!o&&!c&&(0,Ge.jsx)(He.Button,{isPrimary:!0,onClick:()=>this.triggerEmailAction(),style:{marginRight:"1rem"},children:(0,I.__)("Resend ","ninja-forms")+l.length+(0,I.__)(" emails","ninja-forms")}),!c&&(0,Ge.jsx)(He.Button,{isSecondary:!0,onClick:()=>this.setModalOpen(!0),children:(0,I.__)("Cancel","ninja-forms")}),u&&(0,Ge.jsx)(We,{action:()=>f(!1),title:(0,I.__)("Cancel Email Action?","ninja-forms"),actionText:(0,I.__)("Yes","ninja-forms"),cancel:this.setModalOpen,cancelText:(0,I.__)("No","ninja-forms")}),o&&(0,Ge.jsx)(He.Spinner,{}),a.length>0&&(0,Ge.jsx)(Ve,{status:"error",isDismissible:"false",text:(0,I.__)("Emails failed to be sent for: ","ninja-forms")+Object.values(a)}),s>=0&&(0,Ge.jsx)(Ve,{isDismissible:"false",text:s+" / "+l.length+(0,I.__)(" emails sent","ninja-forms")})]})})]})})}}gt.propTypes={globalParams:Ue().object.isRequired,triggerEmailActionsParams:Ue().object.isRequired,fetchController:Ue().object.isRequired,formID:Ue().oneOfType([Ue().string,Ue().number]).isRequired,submissionIds:Ue().array.isRequired,setDisplayEmailActionsComponent:Ue().func};class vt extends c.Component{constructor(e){super(e),this.state={forms:!1,dates:!1,startDate:!1,endDate:!1,startDateTimestamp:!1,endDateTimestamp:!1,isModalOpen:!1,processing:!1,exportSuccess:!1,exportError:!1,fetchAborted:!1,displayFunctionalityNotice:!1,isExportReady:!1},this.setForms=this.setForms.bind(this),this.setDates=this.setDates.bind(this),this.closeModal=this.closeModal.bind(this),this.openModal=this.openModal.bind(this),this.setProcessing=this.setProcessing.bind(this),this.setExportSuccess=this.setExportSuccess.bind(this),this.setExportError=this.setExportError.bind(this),this.abortFetch=this.abortFetch.bind(this),this.cancelComp=this.cancelComp.bind(this),this.isExportReady=this.setIsExportReady.bind(this)}componentDidMount(){null!==document.getElementById("nf-trigger-emails-container")&&(0,c.unmountComponentAtNode)(document.getElementById("nf-trigger-emails-container"))}componentWillUnmount(){this.setForms(!1),this.abortFetch()}setForms(e){this.setState({forms:e}),this.setIsExportReady()}setDates(e){void 0!==e&&this.setState({dates:e}),void 0!==e.date[0]&&this.setState(()=>({startDate:e.date[0],startDateTimestamp:new Date(this.state.startDate).getTime()/1e3})),void 0!==e.date[1]&&this.setState(()=>({endDate:e.date[1],endDateTimestamp:new Date(e.date[1]).getTime()/1e3})),this.setIsExportReady()}closeModal(){this.setState({isModalOpen:!1})}openModal(){this.setState({isModalOpen:!0})}setProcessing(e){this.setState({processing:e})}setExportSuccess(e){this.setState({exportSuccess:e})}setExportError(e){this.setState({exportError:e})}abortFetch(){this.props.data.fetchController.abort(),this.setState({fetchAborted:!0})}cancelComp(){this.state.processing?(this.closeModal(),this.setProcessing(!1),this.abortFetch()):this.props.data.setClose()}setIsExportReady(){const e=!1!==this.state.endDateTimestamp&&!1!==this.state.startDateTimestamp&&!1!==this.state.forms;this.setState({isExportReady:e})}render(){const{state:e,props:t,cancelComp:r,setForms:n,setDates:i,setProcessing:o,setExportSuccess:s,setExportError:a}=this,{forms:u,dates:c,startDate:l,endDate:f,startDateTimestamp:d,endDateTimestamp:p,isModalOpen:h,processing:g,exportSuccess:v,exportError:m,fetchAborted:b,isExportReady:y}=e,{data:w}=t,x=w.props.globalParams,S=w.setClose,E=w.fetchController.signal;let C=!1,j=[];x.forms.forEach(e=>{j[e.formID]=e}),u&&(C=[],u.forEach(e=>{const t=" "+e+": "+j[e].formTitle;C.push(t)}));const R={globalParams:x,forms:u,startDateTimestamp:d,endDateTimestamp:p,setProcessing:o,setExportSuccess:s,setExportError:a,signal:E};return(0,Ge.jsx)("div",{id:"nf-DisplayBulkExport",style:{marginTop:"1rem",position:"relative",zIndex:"1111"},children:(0,Ge.jsxs)(He.Card,{elevation:"2",children:[(0,Ge.jsx)(He.CardHeader,{children:(0,Ge.jsx)("h3",{children:(0,I.__)("Bulk Form Exports","ninja-forms")})}),(0,Ge.jsxs)(He.CardBody,{children:[(0,Ge.jsx)("p",{children:(0,I.__)("Select Forms","ninja-forms")}),(0,Ge.jsx)(ze,{forms:x.forms,setForm:n,multiple:!0,label:(0,I.__)("Select Forms","ninja-forms"),hideLabelFromVision:!0,style:{minHeight:"10em"}}),(0,Ge.jsx)("p",{children:(0,I.__)("Select Dates","ninja-forms")}),(0,Ge.jsx)(qe,{placeholder:(0,I.__)("Select Dates...","ninja-forms"),setDates:i,dateFormat:x.dateFormat}),(0,Ge.jsxs)("div",{children:[C&&(0,Ge.jsx)("p",{style:{margin:"1.2rem 0 0 0"},children:(0,I.__)("Forms Selected: ","ninja-forms")+C}),l&&(0,I.__)("Start Date: ","ninja-forms")+l.toLocaleDateString(),(0,Ge.jsx)("br",{}),f&&(0,I.__)("End Date: ","ninja-forms")+f.toLocaleDateString()]})]}),(0,Ge.jsx)(He.CardFooter,{children:(0,Ge.jsxs)("div",{children:[u&&c&&!b&&(0,Ge.jsx)(He.Button,{style:{marginRight:"1rem"},isPrimary:!0,onClick:()=>{rt(R)},disabled:!y,children:y?(0,I.__)("Export","ninja-forms"):(0,I.__)("Reset form or dates","ninja-forms")}),(0,Ge.jsx)(He.Button,{isSecondary:!0,onClick:()=>this.openModal(),children:(0,I.__)("Cancel","ninja-forms")}),h&&(0,Ge.jsx)(We,{title:(0,I.__)("Cancel Bulk Export?","ninja-forms"),actionText:(0,I.__)("Yes","ninja-forms"),action:r,cancelText:(0,I.__)("No","ninja-forms"),cancel:()=>this.closeModal()}),g&&(0,Ge.jsx)(He.Spinner,{}),m&&(0,Ge.jsx)(Ve,{status:"error",isDismissible:"true",text:(0,I.__)("Exports failed","ninja-forms"),setDisplayNotice:()=>a(!1)}),v&&(0,Ge.jsx)(Ve,{isDismissible:"true",text:(0,I.__)("Export Processed","ninja-forms"),setDisplayNotice:()=>s(!1)}),b&&(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(Ve,{isDismissible:"true",status:"error",text:(0,I.__)("Export Aborted","ninja-forms")}),(0,Ge.jsx)(He.Button,{isSecondary:!0,onClick:()=>S(),children:(0,I.__)("Reopen to allow new bulk export process","ninja-forms")})]})]})})]})})}}vt.propTypes={data:Ue().object.isRequired};class mt extends c.Component{constructor(e){super(e),this.state={compOpen:!1},this.setOpen=this.setOpen.bind(this),this.setClose=this.setClose.bind(this)}setOpen(){this.setState({compOpen:!0})}setClose(){this.setState({compOpen:!1})}render(){const{state:e,props:t,setClose:r}=this,{compOpen:n}=e,i={fetchController:new AbortController,props:t,setClose:r};return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(He.Button,{className:"button-secondary nf-display-bulk-export",isSecondary:!0,onClick:this.setOpen,children:(0,I.__)("Bulk Form Exports","ninja-forms")}),n&&(0,Ge.jsx)(vt,{data:i})]})}}mt.propTypes={globalParams:Ue().object.isRequired,bulkExportParams:Ue().object.isRequired};const bt=e=>{const{fields:t,row:r,formID:n}=e;let i={formID:n},o=[];(0,c.useEffect)(()=>()=>{h.abort()},[]);const[s,a]=(0,c.useState)(!1),[u,f]=(0,c.useState)(!1),d=()=>{"nf_post"===r.dataSource?f(e=>!e):a(!0)},p=["key","submissionID","timestamp","dataSource","formId","selection","extraValues","seqID"];p.forEach(e=>{i[e]=r[e]}),t.forEach(e=>{if(!p.includes(e.column.id)){const t=r.types[e.column.id];o.push({field:e.column.Header,value:e.value,type:t,settings:e.column.fieldSettings})}});const[h,g]=(0,c.useState)(new AbortController),v=(0,l.useSelect)(e=>{let t;const n=e("ninja-forms/submissions").getIsAllowedEdit(),i=r.submitterId==R.currentUser.ID;switch(n){case"none":t=!1;break;case"own":t=i;break;case"others":t=!i;break;default:t=!0}return t}),m=(0,Ge.jsxs)("div",{className:"nf-submission-modal-content",children:[(0,Ge.jsx)(_t,{data:o,submissionObject:r.submissionObject}),(0,Ge.jsx)(Ft,{data:i})]});return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(He.Button,{variant:"tertiary","aria-label":(0,I.sprintf)((0,I.__)("Open submission %d details and edition interface","ninja-forms"),parseInt(r.key)),onClick:d,children:v?(0,I.__)("Edit","ninja-forms"):(0,I.__)("Open","ninja-forms")}),u&&(0,Ge.jsxs)(He.Modal,{title:v?(0,I.__)("Edit Submission","ninja-forms"):(0,I.__)("Submission","ninja-forms"),onRequestClose:d,shouldCloseOnClickOutside:!1,role:"region",className:"nf-submission-modal",children:[v?m:(0,Ge.jsx)(He.Disabled,{children:m}),(0,Ge.jsx)("br",{className:"clear"}),v&&(0,Ge.jsx)(He.Button,{isPrimary:!0,style:{marginRight:"1rem"},onClick:()=>{const e=(0,l.select)("ninja-forms/submissions").getSubmission();tt({singleSubmission:e,signal:h.signal}),d()},children:(0,I.__)("Update","ninja-forms")}),(0,Ge.jsx)(He.Button,{isSecondary:!0,onClick:d,children:(0,I.__)("Close","ninja-forms")})]}),s&&(0,Ge.jsx)(Ve,{status:"info",text:(0,I.__)("Only Submissions processed via Ninja Forms can be edited at the moment.","ninja-forms"),setDisplayNotice:a})]})};bt.propTypes={fields:Ue().array.isRequired,row:Ue().object.isRequired,formID:Ue().oneOfType([Ue().string,Ue().number])};var yt=r(32885);const wt=e=>{const{fieldType:t,disabled:r,label:n,labelPosition:i,hideLabel:o,value:s,setValue:a,index:u}=e;let c;switch(t){case"textbox":case"address":case"city":case"lastname":case"firstname":case"zip":case"hidden":c="text";break;case"phone":c="tel";break;default:c=t}return(0,Ge.jsx)(He.__experimentalInputControl,{id:"nf-value-"+u,type:c,disabled:r,label:n,labelPosition:i,hideLabelFromVision:o,value:s,onChange:e=>a(e,u),"aria-labelledby":"nf-label-"+u})};wt.propTypes={fieldType:Ue().string,disabled:Ue().bool,label:Ue().string,labelPosition:Ue().string,hideLabelFromVision:Ue().bool,value:Ue().any,setValue:Ue().func,index:Ue().string};const xt=({marked:e,starId:t})=>(0,Ge.jsx)("span",{"data-star-id":t,className:"nf-field-star",role:"button",children:e?"★":"☆"}),St=e=>{const{index:t,value:r,edit:n,settings:i,updateData:o}=e,[s,a]=(0,c.useState)(r),[u,l]=(0,c.useState)(null),[f,d]=(0,c.useState)({}),p=e=>{null===e?l(null):e&&e.target&&e.target.getAttribute("data-star-id")&&l(e.target.getAttribute("data-star-id"))};(0,c.useEffect)(()=>{n||d({onMouseOut:()=>!1,onMouseOver:()=>!1,onClick:()=>!1})},[]);const h=void 0!==i&&i.number_of_stars.length>0?i.number_of_stars:5;return(0,Ge.jsx)("span",{onMouseOut:()=>p(null),onClick:e=>{const n=void 0!==e.target.getAttribute("data-star-id")?e.target.getAttribute("data-star-id"):r;o(n,t),a(n)},onMouseOver:p,...f,children:Array.from({length:h},(e,t)=>(0,Ge.jsx)(xt,{starId:t+1,marked:u?u>=t+1:s>=t+1},`star_${t+1}`))})};St.propTypes={index:Ue().string,value:Ue().string,edit:Ue().bool,settings:Ue().object,updateData:Ue().func};const Et=e=>{const{index:t,value:r,settings:n,onChange:i,edit:o}=e,[s,a]=(0,c.useState)(r),u=e=>{const r=s.includes(e.value)?s.filter(t=>t!==e.value):[...s,e.value];a(r),i(r,t)};return(0,c.useEffect)(()=>{"string"==typeof r&&a(r.replace(/\s/g,"").split(","))},[]),void 0===n.options&&(n.options=n.image_options),(0,Ge.jsx)(Ge.Fragment,{children:n.options.map((e,t)=>(0,Ge.jsx)(He.CheckboxControl,{disabled:!o,"aria-disabled":!o,onChange:()=>{o&&u(e)},checked:null!=s&&s.includes(e.value),label:e.label},"nf-input-"+e.value+t))})};Et.propTypes={index:Ue().string,value:Ue().oneOfType([Ue().string,Ue().array]),edit:Ue().bool,settings:Ue().object,onChange:Ue().func};const Ct=e=>("0"+e).slice(-2),jt=e=>{const{edit:t,value:r,settings:n,updateData:i,index:o}=e;let s,a,u,c="default"===n.date_format?nf_submissions.dateFormat:n.date_format,l="";const f="date_and_time"===n.date_mode||"time_only"===n.date_mode,d="time_only"===n.date_mode,p=1===n.hours_24,h=r&&void 0!==r&&void 0!==r.ampm?r.ampm:"";var g;c=((e,t,r,n)=>{const i={"MM/DD/YYYY":"m/d/Y","MM-DD-YYYY":"m-d-Y","MM.DD.YYYY":"m.d.Y","DD/MM/YYYY":"d/m/Y","DD-MM-YYYY":"d-m-Y","DD.MM.YYYY":"d.m.Y","YYYY-MM-DD":"Y-m-d","YYYY/MM/DD":"Y/m/d","YYYY.MM.DD":"Y.m.d","dddd, MMMM D YYYY":"l, F d Y"};let o=void 0!==i[e]?i[e]:e;return o=t&&r?o+" H:i":t&&!r?o+" G:i":o,o=!r&&void 0!==n&&n.length>0?o+" K":o,o})(c,f,p,h),"array"==typeof r&&(r=r[0]),r&&"object"==typeof r&&(s=void 0!==r.date?r.date:"",a=void 0!==r.hour?parseInt(r.hour):"",a=!p&&a>12?((g=a).toString().startsWith(0)&&g.replace("0",""),(g+11)%12+1):a,u=void 0!==r.minute?parseInt(r.minute):"",l=void 0!==s?l.concat(s):l,l=void 0!==a?l.concat(" "+a):l,l=void 0!==u?l.concat(":"+u):l,l=void 0===r.ampm||p?l:l.concat(r.ampm));let v="string"==typeof r?r:l,m={defaultDate:f&&l?l:s||v,dateFormat:c,noCalendar:d,enableTime:f,time_24hr:p,minuteIncrement:n.minute_increment};return(0,Ge.jsx)(Ge.Fragment,{children:t?(0,Ge.jsx)(Ye.A,{options:m,onChange:e=>{(e=>{const t=e[0].getDate(),r=e[0].getMonth(),n=e[0].getFullYear(),s=e[0].getHours(),a=e[0].getMinutes(),u=s<12?"am":"pm",l=((e,t,r,n,i=!1,o=!1)=>{const s=Ct(t),a=Ct(r+1),u=!!o&&Ct(o);let c=e.replace("d",s);return c=c.replace("m",a),c=c.replace("Y",n),c=i?c.replace("G",i):c.replace("G",""),c=i?c.replace("H",i):c.replace("H",""),c=u?c.replace("i",u):c.replace("i",""),c=o||i?c:c.replace(":",""),c=o||i?c:c.replace("K",""),c})(c,t,r,n);i({original:e,date:l,hour:s,minute:a,ampm:u},o)})(e)},"aria-labelledby":"nf-label-"+o}):v})};jt.propTypes={edit:Ue().bool,updateData:Ue().func,settings:Ue().object.isRequired,value:Ue().oneOfType([Ue().string,Ue().object,Ue().array]),index:Ue().number};const Rt=e=>{const{edit:t,settings:r,value:n,updateData:i,hideLabelFromVision:o,index:s}=e,[a,u]=(0,c.useState)(n);return(0,Ge.jsx)(He.TextareaControl,{id:"nf-value-"+s,label:r.label,hideLabelFromVision:o,help:r.helpText,value:a,onChange:e=>{var r;t&&(u(r=e),i(r,s))},"aria-labelledby":"nf-label-"+s,disabled:!t,"aria-disabled":!t})};Rt.propTypes={value:Ue().string.isRequired,settings:Ue().object,updateData:Ue().func,hideLabelFromVision:Ue().bool,edit:Ue().bool,index:Ue().number};const It=e=>{const{index:t,edit:r,value:n,settings:i,onChange:o}=e,[s,a]=(0,c.useState)(n);return(0,c.useEffect)(()=>{a(0!=n&&n)},[]),(0,Ge.jsx)(He.CheckboxControl,{disabled:!r,"aria-disabled":!r,onChange:e=>{r&&(e=>{const r=e?1:0;a(r),o(r,t)})(e)},checked:s,label:i.label},"nf-input-"+i.key)};It.propTypes={index:Ue().string,value:Ue().oneOfType([Ue().string,Ue().bool]),edit:Ue().bool,hideLabelFromVision:Ue().bool,settings:Ue().object,onChange:Ue().func};const Tt=e=>{const{index:t,edit:r,value:n,settings:i,updateData:o,hideLabelFromVision:s}=e,a="listimage"===i.type?i.image_options:i.options,[u,l]=(0,c.useState)(n);return(0,Ge.jsx)(He.RadioControl,{disabled:!r,help:i.help,selected:u,options:a,onChange:e=>{var n;r&&(l(n=e),o(n,t))}})};Tt.propTypes={index:Ue().string,hideLabelFromVision:Ue().bool,edit:Ue().bool,updateData:Ue().func.isRequired,settings:Ue().object.isRequired,value:Ue().string};const At=[{value:"",label:" - Select Country - "},{value:"AF",label:" Afghanistan"},{value:"AL",label:" Albania"},{value:"DZ",label:" Algeria"},{value:"AS",label:" American Samoa"},{value:"AD",label:" Andorra"},{value:"AO",label:" Angola"},{value:"AI",label:" Anguilla"},{value:"AQ",label:" Antarctica"},{value:"AG",label:" Antigua And Barbuda"},{value:"AR",label:" Argentina"},{value:"AM",label:" Armenia"},{value:"AW",label:" Aruba"},{value:"AU",label:" Australia"},{value:"AT",label:" Austria"},{value:"AZ",label:" Azerbaijan"},{value:"BS",label:" Bahamas"},{value:"BH",label:" Bahrain"},{value:"BD",label:" Bangladesh"},{value:"BB",label:" Barbados"},{value:"BY",label:" Belarus"},{value:"BE",label:" Belgium"},{value:"BZ",label:" Belize"},{value:"BJ",label:" Benin"},{value:"BM",label:" Bermuda"},{value:"BT",label:" Bhutan"},{value:"BO",label:" Bolivia"},{value:"BA",label:" Bosnia And Herzegowina"},{value:"BW",label:" Botswana"},{value:"BV",label:" Bouvet Island"},{value:"BR",label:" Brazil"},{value:"IO",label:" British Indian Ocean Territory"},{value:"BN",label:" Brunei Darussalam"},{value:"BG",label:" Bulgaria"},{value:"BF",label:" Burkina Faso"},{value:"BI",label:" Burundi"},{value:"KH",label:" Cambodia"},{value:"CM",label:" Cameroon"},{value:"CA",label:" Canada"},{value:"CV",label:" Cape Verde"},{value:"KY",label:" Cayman Islands"},{value:"CF",label:" Central African Republic"},{value:"TD",label:" Chad"},{value:"CL",label:" Chile"},{value:"CN",label:" China"},{value:"CX",label:" Christmas Island"},{value:"CC",label:" Cocos (Keeling) Islands"},{value:"CO",label:" Colombia"},{value:"KM",label:" Comoros"},{value:"CG",label:" Congo"},{value:"CD",label:" Congo, The Democratic Republic Of The"},{value:"CK",label:" Cook Islands"},{value:"CR",label:" Costa Rica"},{value:"CI",label:" Cote D'Ivoire"},{value:"HR",label:" Croatia (Local Name: Hrvatska)"},{value:"CU",label:" Cuba"},{value:"CY",label:" Cyprus"},{value:"CZ",label:" Czech Republic"},{value:"DK",label:" Denmark"},{value:"DJ",label:" Djibouti"},{value:"DM",label:" Dominica"},{value:"DO",label:" Dominican Republic"},{value:"EC",label:" Ecuador"},{value:"EG",label:" Egypt"},{value:"SV",label:" El Salvador"},{value:"GQ",label:" Equatorial Guinea"},{value:"ER",label:" Eritrea"},{value:"EE",label:" Estonia"},{value:"ET",label:" Ethiopia"},{value:"FK",label:" Falkland Islands (Malvinas)"},{value:"FO",label:" Faroe Islands"},{value:"FJ",label:" Fiji"},{value:"FI",label:" Finland"},{value:"FR",label:" France"},{value:"FX",label:" France, Metropolitan"},{value:"GF",label:" French Guiana"},{value:"PF",label:" French Polynesia"},{value:"TF",label:" French Southern Territories"},{value:"GA",label:" Gabon"},{value:"GM",label:" Gambia"},{value:"GE",label:" Georgia"},{value:"DE",label:" Germany"},{value:"GH",label:" Ghana"},{value:"GI",label:" Gibraltar"},{value:"GR",label:" Greece"},{value:"GL",label:" Greenland"},{value:"GD",label:" Grenada"},{value:"GP",label:" Guadeloupe"},{value:"GU",label:" Guam"},{value:"GT",label:" Guatemala"},{value:"GN",label:" Guinea"},{value:"GW",label:" Guinea-Bissau"},{value:"GY",label:" Guyana"},{value:"HT",label:" Haiti"},{value:"HM",label:" Heard And Mc Donald Islands"},{value:"VA",label:" Holy See (Vatican City State)"},{value:"HN",label:" Honduras"},{value:"HK",label:" Hong Kong"},{value:"HU",label:" Hungary"},{value:"IS",label:" Iceland"},{value:"IN",label:" India"},{value:"ID",label:" Indonesia"},{value:"IR",label:" Iran (Islamic Republic Of)"},{value:"IQ",label:" Iraq"},{value:"IE",label:" Ireland"},{value:"IL",label:" Israel"},{value:"IT",label:" Italy"},{value:"JM",label:" Jamaica"},{value:"JP",label:" Japan"},{value:"JO",label:" Jordan"},{value:"KZ",label:" Kazakhstan"},{value:"KE",label:" Kenya"},{value:"KI",label:" Kiribati"},{value:"KP",label:" Korea, Democratic People's Republic Of"},{value:"KR",label:" Korea, Republic Of"},{value:"KW",label:" Kuwait"},{value:"KG",label:" Kyrgyzstan"},{value:"LA",label:" Lao People's Democratic Republic"},{value:"LV",label:" Latvia"},{value:"LB",label:" Lebanon"},{value:"LS",label:" Lesotho"},{value:"LR",label:" Liberia"},{value:"LY",label:" Libyan Arab Jamahiriya"},{value:"LI",label:" Liechtenstein"},{value:"LT",label:" Lithuania"},{value:"LU",label:" Luxembourg"},{value:"MO",label:" Macau"},{value:"MK",label:" Macedonia, Former Yugoslav Republic Of"},{value:"MG",label:" Madagascar"},{value:"MW",label:" Malawi"},{value:"MY",label:" Malaysia"},{value:"MV",label:" Maldives"},{value:"ML",label:" Mali"},{value:"MT",label:" Malta"},{value:"MH",label:" Marshall Islands"},{value:"MQ",label:" Martinique"},{value:"MR",label:" Mauritania"},{value:"MU",label:" Mauritius"},{value:"YT",label:" Mayotte"},{value:"MX",label:" Mexico"},{value:"FM",label:" Micronesia, Federated States Of"},{value:"MD",label:" Moldova, Republic Of"},{value:"MC",label:" Monaco"},{value:"MN",label:" Mongolia"},{value:"ME",label:" Montenegro"},{value:"MS",label:" Montserrat"},{value:"MA",label:" Morocco"},{value:"MZ",label:" Mozambique"},{value:"MM",label:" Myanmar"},{value:"NA",label:" Namibia"},{value:"NR",label:" Nauru"},{value:"NP",label:" Nepal"},{value:"NL",label:" Netherlands"},{value:"AN",label:" Netherlands Antilles"},{value:"NC",label:" New Caledonia"},{value:"NZ",label:" New Zealand"},{value:"NI",label:" Nicaragua"},{value:"NE",label:" Niger"},{value:"NG",label:" Nigeria"},{value:"NU",label:" Niue"},{value:"NF",label:" Norfolk Island"},{value:"MP",label:" Northern Mariana Islands"},{value:"NO",label:" Norway"},{value:"OM",label:" Oman"},{value:"PK",label:" Pakistan"},{value:"PW",label:" Palau"},{value:"PA",label:" Panama"},{value:"PG",label:" Papua New Guinea"},{value:"PY",label:" Paraguay"},{value:"PE",label:" Peru"},{value:"PH",label:" Philippines"},{value:"PN",label:" Pitcairn"},{value:"PL",label:" Poland"},{value:"PT",label:" Portugal"},{value:"PR",label:" Puerto Rico"},{value:"QA",label:" Qatar"},{value:"RE",label:" Reunion"},{value:"RO",label:" Romania"},{value:"RU",label:" Russian Federation"},{value:"RW",label:" Rwanda"},{value:"KN",label:" Saint Kitts And Nevis"},{value:"LC",label:" Saint Lucia"},{value:"VC",label:" Saint Vincent And The Grenadines"},{value:"WS",label:" Samoa"},{value:"SM",label:" San Marino"},{value:"ST",label:" Sao Tome And Principe"},{value:"SA",label:" Saudi Arabia"},{value:"SN",label:" Senegal"},{value:"RS",label:" Serbia"},{value:"SC",label:" Seychelles"},{value:"SL",label:" Sierra Leone"},{value:"SG",label:" Singapore"},{value:"SK",label:" Slovakia (Slovak Republic)"},{value:"SI",label:" Slovenia"},{value:"SB",label:" Solomon Islands"},{value:"SO",label:" Somalia"},{value:"ZA",label:" South Africa"},{value:"GS",label:" South Georgia, South Sandwich Islands"},{value:"ES",label:" Spain"},{value:"LK",label:" Sri Lanka"},{value:"SH",label:" St. Helena"},{value:"PM",label:" St. Pierre And Miquelon"},{value:"SD",label:" Sudan"},{value:"SR",label:" Suriname"},{value:"SJ",label:" Svalbard And Jan Mayen Islands"},{value:"SZ",label:" Swaziland"},{value:"SE",label:" Sweden"},{value:"CH",label:" Switzerland"},{value:"SY",label:" Syrian Arab Republic"},{value:"TW",label:" Taiwan"},{value:"TJ",label:" Tajikistan"},{value:"TZ",label:" Tanzania, United Republic Of"},{value:"TH",label:" Thailand"},{value:"TL",label:" Timor-Leste (East Timor)"},{value:"TG",label:" Togo"},{value:"TK",label:" Tokelau"},{value:"TO",label:" Tonga"},{value:"TT",label:" Trinidad And Tobago"},{value:"TN",label:" Tunisia"},{value:"TR",label:" Turkey"},{value:"TM",label:" Turkmenistan"},{value:"TC",label:" Turks And Caicos Islands"},{value:"TV",label:" Tuvalu"},{value:"UG",label:" Uganda"},{value:"UA",label:" Ukraine"},{value:"AE",label:" United Arab Emirates"},{value:"GB",label:" United Kingdom"},{value:"US",label:" United States"},{value:"UM",label:" United States Minor Outlying Islands"},{value:"UY",label:" Uruguay"},{value:"UZ",label:" Uzbekistan"},{value:"VU",label:" Vanuatu"},{value:"VE",label:" Venezuela"},{value:"VN",label:" Viet Nam"},{value:"VG",label:" Virgin Islands (British)"},{value:"VI",label:" Virgin Islands (U.S.)"},{value:"WF",label:" Wallis And Futuna Islands"},{value:"EH",label:" Western Sahara"},{value:"YE",label:" Yemen"},{value:"YU",label:" Yugoslavia"},{value:"ZM",label:" Zambia"},{value:"ZW",label:" Zimbabwe"}],Ot=e=>{const{edit:t,value:r,settings:n,updateData:i,hideLabelFromVision:o,fieldType:s,index:a}=e,[u,l]=(0,c.useState)(r),[f,d]=(0,c.useState)(n.options),p=e=>{l(e),i(e,a)};return(0,c.useEffect)(()=>{"listcountry"===s&&d(At)},[]),(0,Ge.jsx)(Ge.Fragment,{children:"listmultiselect"===s?(0,Ge.jsx)(He.SelectControl,{id:"nf-value-"+a,multiple:!0,hideLabelFromVision:o,label:n.label,help:n.help,value:u,onChange:e=>{t&&p(e)},"aria-labelledby":"nf-label-"+a,disabled:!t,"aria-disabled":!t,children:f.map(e=>(0,Ge.jsx)("option",{value:e.value,className:u.includes(e.value)?"selected":"",disabled:e.disabled,"aria-disabled":e.disabled,children:e.label},e.order))}):(0,Ge.jsx)(He.SelectControl,{id:"nf-value-"+a,hideLabelFromVision:o,label:n.label,help:n.help,value:u,options:f,onChange:e=>{t&&p(e)},"aria-labelledby":"nf-label-"+a,disabled:!t,"aria-disabled":!t})})};Ot.propTypes={fieldType:Ue().string.isRequired,hideLabelFromVision:Ue().bool,edit:Ue().bool,updateData:Ue().func.isRequired,settings:Ue().object.isRequired,value:Ue().oneOfType([Ue().string,Ue().array]),index:Ue().string};const Mt=e=>{const{settings:t,value:r,edit:n,setValue:i}=e,[o,s]=(0,c.useState)(r),a=(e,t)=>{let r=o;for(let[n,a]of Object.entries(o))n===t&&(r[n].value=e),s(r),i(r)};let u;if(o)if("string"==typeof o)u=(0,Ge.jsx)("li",{children:o},t.key);else{let e=Object.values(o);var l;e.map(e=>{let r;t.fields.forEach(t=>{e.id.startsWith(t.id)&&(r=t)}),e.label=r.label,e.type=r.type,"object"==typeof e.value&&"file_upload"===r.type?Array.isArray(e.value)||(e.value=Object.entries(e.value)):"object"==typeof e.value&&"date"===r.type?e.value=e.value.date:"object"==typeof e.value&&"file_upload"!==r.type?e.value=e.value.join(", "):"array"==typeof e.value&&"file_upload"!==r.type&&(e.value=e.value.toString())}),u=e.map((e,r,i)=>{const o=e.id.substring(0,e.id.indexOf("_")),s=t.fields.find(e=>e.id===o);let u=n?(0,Ge.jsx)(Ge.Fragment,{children:e.type&&"file_upload"===e.type?"string"==typeof e.value?(0,Ge.jsxs)(Ge.Fragment,{children:[e.label,": ",e.value]}):(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)(Dt,{index:e.id,value:e.value,edit:n,settings:s})]}):"textarea"===e.type?(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)(Rt,{label:s.label,index:e.id,edit:n,value:e.value,settings:s,hideLabelFromVision:!0,updateData:a})]}):"listcheckbox"===e.type?(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)(Et,{label:s.label,index:e.id,edit:n,value:e.value,settings:s,onChange:a})]}):"checkbox"===e.type?(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)(It,{index:e.id,edit:n,value:e.value,settings:s,onChange:a})]}):"listradio"===e.type?(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)(Tt,{index:e.id,edit:n,value:e.value,settings:s,updateData:a,hideLabelFromVision:!0})]}):"listimage"===e.type?s.allow_multi_select?(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)(Et,{index:e.id,edit:n,value:e.value,settings:s,onChange:a})]}):(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)(Tt,{index:e.id,edit:n,value:e.value,settings:s,updateData:a,hideLabelFromVision:!0})]}):"listselect"===e.type||"liststate"===e.type||"listcountry"===e.type||"listmultiselect"===e.type?(0,Ge.jsx)(Ot,{index:e.id,fieldType:e.type,edit:n,value:e.value,settings:s,updateData:a,hideLabelFromVision:!1}):"date"===e.type?(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)("br",{}),(0,Ge.jsx)(jt,{index:e.id,edit:n,value:e.value,settings:s,updateData:a})]}):"starrating"===e.type?(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("label",{id:"nf-label-"+e.id,for:"nf-label-"+e.id,children:s.label}),(0,Ge.jsx)("br",{}),(0,Ge.jsx)(St,{index:e.id,edit:n,value:e.value,settings:s,updateData:a})]}):(0,Ge.jsx)(wt,{fieldType:e.type,index:e.id,value:e.value,label:e.label,disabled:!n,hideLabelFromVision:!0,setValue:a})}):"string"!=typeof e.value&&e.type&&"file_upload"===e.type?(0,Ge.jsxs)(Ge.Fragment,{children:[e.label,":",(0,Ge.jsx)(Dt,{index:e.id,value:e.value,edit:n,settings:s})]}):(0,Ge.jsxs)("span",{children:[e.label,": ",e.value]}),c=(0,Ge.jsx)("li",{children:u},e.id);return 0===r?(l=++r,c=(0,Ge.jsxs)("li",{children:[(0,Ge.jsx)("p",{children:(0,Ge.jsxs)("strong",{children:[(0,I.__)("Fieldset","ninja-forms")," ",l]})}),u]},e.id)):r>0&&e.id.includes("_")&&i[r-1].id.split("_").pop()!==e.id.split("_").pop()&&(c=(0,Ge.jsxs)("li",{children:[(0,Ge.jsx)("hr",{}),(0,Ge.jsx)("p",{children:(0,Ge.jsxs)("strong",{children:[(0,I.__)("Fieldset","ninja-forms")," ",++l]})}),u]},e.id)),c})}else u=(0,Ge.jsx)("li",{children:(0,I.__)("No values entered in this field","ninja-forms")});return(0,Ge.jsx)("ul",{children:u})};Mt.propTypes={value:Ue().oneOfType([Ue().object,Ue().string]),settings:Ue().object,edit:Ue().bool};const Dt=e=>{const{edit:t,value:r}=e,n=r?r.map(e=>(0,Ge.jsx)("li",{children:t?(0,Ge.jsx)("a",{href:e[1],title:(0,I.__)("File Upload Link ","ninja-forms")+e[0],children:e[1]}):e[1]},e[0])):"";return(0,Ge.jsx)("ul",{children:n})};Dt.propTypes={edit:Ue().bool,settings:Ue().object,value:Ue().array};const _t=e=>{const{data:t,submissionObject:r}=e;(0,c.useEffect)(()=>((0,l.dispatch)("ninja-forms/submissions").setSubmission(r),()=>(0,l.dispatch)("ninja-forms/submissions").setSubmission({})),[]);const n=(0,c.useMemo)(()=>[{Header:"User Submitted Values",columns:[{Header:"Field",accessor:"field"},{Header:"Value",accessor:"value"}]}],[]);return(0,Ge.jsx)("div",{className:"nf-submission-content",children:(0,Ge.jsx)(kt,{columns:n,data:t})})},Pt=({value:e,row:{index:t,original:r}})=>{const n=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmission()),[i,o]=(0,c.useState)(e),s=e=>{o(e),e!==n.submissionFieldCollection[r.settings.key].value&&(n.submissionFieldCollection[r.settings.key].value=e,(0,l.dispatch)("ninja-forms/submissions").setSubmission(n))};let a;switch((0,c.useEffect)(()=>{o(e)},[e]),r.type){case"textarea":a=(0,Ge.jsx)(Rt,{index:t,edit:!0,value:i,settings:r.settings,hideLabelFromVision:!0,updateData:s});break;case"listcheckbox":a=(0,Ge.jsx)(Et,{index:t,edit:!0,value:i,settings:r.settings,onChange:s});break;case"checkbox":a=(0,Ge.jsx)(It,{index:t,edit:!0,value:i,settings:r.settings,onChange:s});break;case"listradio":case"listimage":a=r.settings.allow_multi_select?(0,Ge.jsx)(Et,{index:t,edit:!0,value:i,settings:r.settings,onChange:s}):(0,Ge.jsx)(Tt,{index:t,edit:!0,value:i,settings:r.settings,updateData:s,hideLabelFromVision:!0});break;case"listselect":case"liststate":case"listcountry":case"listmultiselect":a=(0,Ge.jsx)(Ot,{index:t,fieldType:r.type,edit:!0,value:i,settings:r.settings,updateData:s,hideLabelFromVision:!0});break;case"date":a=(0,Ge.jsx)(jt,{index:t,edit:!0,value:i,settings:r.settings,updateData:s});break;case"starrating":a=(0,Ge.jsx)(St,{index:t,edit:!0,value:i,settings:r.settings,updateData:s});break;case"repeater":a=(0,Ge.jsx)(Mt,{index:t,value:i,settings:r.settings,edit:!0,setValue:s});break;case"file_upload":a=(0,Ge.jsx)(Dt,{index:t,edit:!0,value:i,settings:r.settings});break;default:a=(0,Ge.jsx)(wt,{index:t,fieldType:r.type,disabled:!1,hideLabelFromVision:!0,value:i,setValue:s})}return a},kt=({columns:e,data:t})=>{const{getTableProps:r,getTableBodyProps:n,rows:i,headerGroups:o,prepareRow:s}=(0,yt.useTable)({columns:e,data:t,EditableCell:Pt});return(0,Ge.jsx)("div",{id:"nf-sub-fields",children:(0,Ge.jsxs)("table",{...r(),className:"nf-sub-custom-fields-table",children:[(0,Ge.jsx)("thead",{children:o.map(e=>(0,Ge.jsx)("tr",{...e.getHeaderGroupProps(),children:e.headers.map(e=>(0,Ge.jsx)("th",{...e.getHeaderProps(),children:e.render("Header")}))}))}),(0,Ge.jsx)("tbody",{...n(),children:i.map((e,t)=>(s(e),(0,Ge.jsx)("tr",{...e.getRowProps(),children:e.cells.map(e=>"value"===e.column.id?(0,Ge.jsx)("td",{...e.getCellProps(),children:e.render(Pt)}):(0,Ge.jsx)("td",{...e.getCellProps(),children:(0,Ge.jsx)("label",{id:"nf-label-"+e.row.index,htmlFor:"nf-value-"+e.row.index,children:e.render("Cell")})}))})))})]})})};_t.propTypes={data:Ue().array.isRequired};const Ft=e=>{const{data:t}=e,r=R.adminUrl.concat("post.php?post=").concat(t.submissionID).concat("&action=edit");return(0,Ge.jsxs)("div",{className:"nf-submission-meta",children:[(0,Ge.jsx)("span",{className:"nf-submission-meta-data-title",children:(0,I.__)("Submission's meta data","ninja-forms")}),(0,Ge.jsx)("div",{children:(0,Ge.jsxs)("span",{children:[(0,I.__)("Form ID","ninja-forms")," : ",t.formID]})}),(0,Ge.jsx)("div",{children:(0,Ge.jsxs)("span",{children:[(0,I.__)("Submission ID","ninja-forms")," : ",t.seqID]})}),t.submissionID&&(0,Ge.jsx)("div",{children:(0,Ge.jsxs)("span",{children:[(0,I.__)("Post ID","ninja-forms")," :"," ",(0,Ge.jsx)("a",{href:r,title:(0,I.__)("Link to Post edition page ","ninja-forms")+t.submissionID,children:t.submissionID})]})}),(0,Ge.jsx)("div",{children:(0,Ge.jsxs)("span",{children:[(0,I.__)("Key","ninja-forms")," : ",t.key]})}),(0,Ge.jsx)("div",{children:(0,Ge.jsxs)("span",{children:[(0,I.__)("Submitted at","ninja-forms")," : ",t.timestamp]})}),void 0!==t.formId&&(0,Ge.jsx)("div",{children:(0,Ge.jsxs)("span",{children:[(0,I.__)("Original Form ID","ninja-forms")," :"," ",t.formId]})}),(0,Ge.jsx)(Nt,{data:t.extraValues})]})};Ft.propTypes={data:Ue().object.isRequired};const Nt=e=>{const{data:t}=e,r=Object.keys(t);let n=[];return r.forEach(e=>{n.push((0,Ge.jsx)("h4",{children:t[e].title},e)),t[e].labelValueCollection.forEach((e,t)=>{let r="";"alert"===e.styling&&(r="nf-red-meta"),""==e.label?n.push((0,Ge.jsx)("div",{children:(0,Ge.jsx)("span",{className:r,children:e.value})},t)):n.push((0,Ge.jsxs)("div",{children:[(0,Ge.jsx)("span",{children:e.label})," :"," ",(0,Ge.jsx)("span",{className:r,children:e.value})]},t))})}),(0,Ge.jsx)("div",{className:"nf-submission-extra",children:(0,Ge.jsx)("div",{children:n})})};Nt.propTypes={data:Ue().oneOfType([Ue().object.isRequired,Ue().array.isRequired])};const Bt=e=>{const{currentForm:t}=e,r=(0,I.__)("Please select a form to view submissions","ninja-forms");return(0,Ge.jsx)(Ge.Fragment,{children:0!=t?(0,Ge.jsx)(Ut,{currentForm:t}):(0,Ge.jsx)(Lt,{content:r})})};Bt.propTypes={currentForm:Ue().oneOfType([Ue().string,Ue().number,Ue().bool])};const Lt=e=>{const{content:t,loadingText:r}=e;return(0,Ge.jsxs)("table",{className:"wp-list-table widefat fixed striped table-view-list nf-submissions-table",children:[(0,Ge.jsx)("thead",{children:(0,Ge.jsx)("tr",{})}),(0,Ge.jsx)("tbody",{id:"the-list",children:(0,Ge.jsx)("tr",{className:"no-items",children:(0,Ge.jsx)("td",{className:"colspanchange",colSpan:"0",children:r?(0,Ge.jsx)(Ke,{text:r}):t})})}),(0,Ge.jsx)("tfoot",{children:(0,Ge.jsx)("tr",{})})]})};Lt.propTypes={loadingText:Ue().string,content:Ue().string};const Ut=e=>{const{currentForm:t}=e;let r=(0,l.select)("ninja-forms/submissions").getPageIndex(),n=(0,l.select)("ninja-forms/submissions").getPageSize();const i=(0,l.useSelect)(e=>e("ninja-forms/submissions").getColumnsAbortController()),o=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsAbortController()),s=++(0,c.useRef)(0).current;(0,c.useEffect)(()=>()=>{i.abort(),o.abort(),(0,l.dispatch)("ninja-forms/submissions").setLoadingSubmissions(!1)},[]);const a=(0,l.useSelect)(e=>e("ninja-forms/submissions").getColumns(t,s),[t]),u=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsTotal(t,s),[t]),f=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissions(t,s,n,r),[t,n,r]),d=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsCount(),[f,n]),p=(0,l.useSelect)(e=>e("ninja-forms/submissions").getPageCount(),[d,n]);(0,l.subscribe)(()=>{const e=(0,l.select)("ninja-forms/submissions").getPageIndex();r!==e&&(r=e);const t=(0,l.select)("ninja-forms/submissions").getPageSize();n!==t&&(n=t)}),(0,c.useEffect)(()=>{(0,l.dispatch)("ninja-forms/submissions").setPageCount()},[d,n]),(0,c.useEffect)(()=>{(0,l.dispatch)("ninja-forms/submissions").setSubmissionsCount()},[f]);const h=(0,l.useSelect)(e=>e("ninja-forms/submissions").getLoadingForm(),[a,f,d,p,r,n]);return(0,Ge.jsx)(Ge.Fragment,{children:h?(0,Ge.jsx)(Lt,{loadingText:(0,I.__)("Loading Form","ninja-forms")}):u<=0?(0,Ge.jsx)(Lt,{content:(0,I.__)("This form has no submission.","ninja-forms")}):(0,Ge.jsx)(qt,{columns:a,data:f,pageCount:p,pageIndex:r,pageSize:n,submissionsCount:d,submissionsTotal:u,formID:t})})};Ut.propTypes={currentForm:Ue().oneOfType([Ue().string,Ue().number,Ue().bool])};const Ht=e=>{const{controlledPageIndex:t,submissionsLoading:r,controlledPageSize:n,controlledPageCount:i,submissionsCount:o,submissionsTotal:s}=e,a=t>1,u=t{(0,l.dispatch)("ninja-forms/submissions").setPageIndex(1)},"aria-label":(0,I.__)("Navigate to first page","ninja-forms"),disabled:!a||r,icon:"controls-skipback"})," ",(0,Ge.jsx)(He.Button,{className:"nf-submissions-pagination-button",onClick:()=>{(0,l.dispatch)("ninja-forms/submissions").setPageIndex(t-1)},"aria-label":(0,I.__)("Navigate to previous page","ninja-forms"),disabled:!a||r,icon:"arrow-left-alt2"})," ",(0,Ge.jsx)(He.Button,{className:"nf-submissions-pagination-button",onClick:()=>{(0,l.dispatch)("ninja-forms/submissions").setPageIndex(t+1)},"aria-label":(0,I.__)("Navigate to next page","ninja-forms"),disabled:!u||r,icon:"arrow-right-alt2"})," ",(0,Ge.jsx)(He.Button,{className:"nf-submissions-pagination-button",onClick:()=>{(0,l.dispatch)("ninja-forms/submissions").setPageIndex(i)},"aria-label":(0,I.__)("Navigate to last page","ninja-forms"),disabled:!u||r,icon:"controls-skipforward"})]}),(0,Ge.jsx)(He.FlexItem,{children:(0,Ge.jsxs)("span",{children:[(0,I.__)("Page ","ninja-forms"),(0,Ge.jsxs)("strong",{children:[t," ",(0,I.__)(" of ","ninja-forms")," ",i]})," "]})}),(0,Ge.jsx)(He.FlexItem,{children:(0,Ge.jsxs)("span",{children:[(0,I.__)(" Go to page: ","ninja-forms"),(0,Ge.jsx)("input",{"aria-label":(0,I.__)("Select number of page to navigate to","ninja-forms"),disabled:r,className:"nf-select-pageNumber",type:"number",min:"1",max:String(i),value:t,onChange:e=>{const t=Number(e.target.value);t>=0&&t<=i&&(0,l.dispatch)("ninja-forms/submissions").setPageIndex(t)}})]})}),(0,Ge.jsx)(He.FlexItem,{children:(0,Ge.jsx)("select",{"aria-label":(0,I.__)("Set number of submissions to display per page.","ninja-forms"),disabled:r,value:n,onChange:e=>{(0,l.dispatch)("ninja-forms/submissions").setPageSize(Number(e.target.value))},children:[5,10,20,30,40,50].map(e=>(0,Ge.jsxs)("option",{value:e,children:[(0,I.__)("Show ","ninja-forms"),e]},e))})})]})]})]})},Gt=e=>{const[t,r]=(0,c.useState)(!1),n=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsStatus()),i={submissionRecordId:e.row.submissionID,formId:e.formID,dataSource:e.row.dataSource},o=e.row.extraHandlers,s=(0,l.useSelect)(t=>{let r;const n=t("ninja-forms/submissions").getIsAllowedEdit(),i=e.row.submitterId==R.currentUser.ID;switch(n){case"none":r=!1;break;case"own":r=i;break;case"others":r=!i;break;default:r=!0}return r});return(0,Ge.jsxs)("span",{className:"row-actions",children:["trash"!==n&&(0,Ge.jsxs)("span",{className:"edit",children:[(0,Ge.jsx)(bt,{fields:e.fields,row:e.row,formID:e.formID}),"|"]}),s&&(0,Ge.jsxs)("span",{className:"trash",children:[(0,Ge.jsx)(Jt,{singleSubmission:i,submissionsStatus:n}),"|"]}),(0,Ge.jsx)("span",{className:"export",children:(0,Ge.jsx)($t,{singleSubmission:i})}),"trash"===n&&(0,Ge.jsx)("span",{className:"restore",children:(0,Ge.jsx)(Zt,{singleSubmission:i})}),Object.keys(o).length>0&&(0,Ge.jsxs)("span",{className:"handle-extra",children:["|",(0,Ge.jsx)(Xt,{singleSubmission:i,extraHandlers:o})]}),t&&(0,Ge.jsx)(Ve,{status:"info",text:(0,I.__)("Feature not functional at the moment.","ninja-forms"),setDisplayNotice:r})]})};Gt.propTypes={fields:Ue().array.isRequired,row:Ue().object.isRequired,formID:Ue().oneOfType([Ue().string,Ue().number])};const zt=e=>{const{columns:t,formID:r}=e,n=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsSettings()),[i,o]=(0,c.useState)(!1);let s=[];return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(He.ToggleControl,{label:(0,I.__)("Display Columns control","ninja-forms"),help:i&&(0,I.__)("Unselect to hide corresponding column","ninja-forms"),checked:i,onChange:()=>{o(e=>!e)}}),i&&(0,Ge.jsxs)("div",{className:"nf-hide-columns",children:[t.map(e=>"selection"!==e.id&&(0,Ge.jsx)("div",{children:(0,Ge.jsxs)("label",{children:[(0,Ge.jsx)("input",{type:"checkbox",onClick:i=>{((e,i)=>{if(t.forEach(e=>{!1===e.isVisible&&s.push(e.id)}),e.checked||s.includes(i)){if(e.checked&&s.includes(i)){const e=s.indexOf(i);e>-1&&s.splice(e,1)}}else s.push(i);(e=>{let t=n;t?void 0===t[r]?t[r]={hiddenColumns:e}:void 0!==t[r]&&(t[r].hiddenColumns=e):t={[r]:{hiddenColumns:e}},(0,l.dispatch)("ninja-forms/submissions").setSubmissionsSettings(t),ut("hiddenColumns",e,r)})(s)})(i.currentTarget,e.id)},...e.getToggleHiddenProps()})," ",e.isVisible,e.Header?e.Header:t.id]})},e.id)),(0,Ge.jsx)("br",{})]})]})};zt.propTypes={columns:Ue().array.isRequired,formID:Ue().oneOfType([Ue().string,Ue().number])};const Wt=["starrating","checkbox","listcheckbox","repeater","file_upload","date"],Vt=({value:e,column:t})=>{let r;switch(t.fieldSettings.type){case"starrating":r=(0,Ge.jsx)(St,{value:e,settings:t.fieldSettings});break;case"checkbox":r=(0,Ge.jsx)(It,{value:e,settings:t.fieldSettings});break;case"listcheckbox":r=(0,Ge.jsx)(Et,{value:e,settings:t.fieldSettings});break;case"repeater":r=(0,Ge.jsx)(Mt,{value:e,settings:t.fieldSettings,edit:!1});break;case"file_upload":r=(0,Ge.jsx)(Dt,{edit:!1,value:e,settings:t.fieldSettings});break;case"date":r=(0,Ge.jsx)(jt,{edit:!1,value:e,settings:t.fieldSettings});break;default:r=e}return r},Yt=(0,c.forwardRef)(({indeterminate:e,...t},r)=>{const n=(0,c.useRef)(),i=r||n;return(0,c.useEffect)(()=>{i.current.indeterminate=e},[i,e]),(0,Ge.jsx)(Ge.Fragment,{children:(0,Ge.jsx)("input",{type:"checkbox","aria-label":t.title,ref:i,...t})})}),qt=({columns:e,data:t,pageCount:r,pageIndex:n,pageSize:i,submissionsCount:o,submissionsTotal:s,formID:a})=>{const u=(0,l.useSelect)(e=>e("ninja-forms/submissions").getLoadingSubmissions(),[t,e,r,n,i,o,s]),{getTableProps:f,getTableBodyProps:d,headerGroups:p,prepareRow:h,page:g,selectedFlatRows:v,getToggleHiddenProps:m,allColumns:b,toggleHideColumn:y,setHiddenColumns:w}=(0,yt.useTable)({columns:e,data:t,pageIndex:n,pageSize:i,manualPagination:!0,pageCount:r,submissionsCount:o,formID:a},yt.usePagination,yt.useRowSelect,e=>{e.visibleColumns.push(e=>[{id:"selection",Header:({getToggleAllPageRowsSelectedProps:e})=>(0,Ge.jsx)("span",{children:(0,Ge.jsx)(Yt,{...e()})}),Cell:({row:e})=>(0,Ge.jsx)("span",{children:(0,Ge.jsx)(Yt,{...e.getToggleRowSelectedProps()})})},...e])}),x="wp-list-table widefat fixed striped table-view-list posts nf-submissions-table",S=u?x.concat(" nf-submissions-loading"):x;(0,c.useEffect)(()=>{let e=[];v.forEach(t=>{e.push({id:t.id,index:t.index,submission:t.original})}),(0,l.dispatch)("ninja-forms/submissions").setSelectedSubmissions(e)},[v]);const E=(0,c.useRef)(void 0!==R.submissionsSettings&&void 0!==R.submissionsSettings[a]&&void 0!==R.submissionsSettings[a].hiddenColumns?R.submissionsSettings[a].hiddenColumns:[]);(0,c.useEffect)(()=>{E.current&&w(E.current)},[]);const C=(0,l.useSelect)(e=>e("ninja-forms/submissions").getSubmissionsSettings());return(0,c.useEffect)(()=>{const e=void 0!==C&&void 0!==C[a]&&void 0!==C[a].hiddenColumns?C[a].hiddenColumns:E.current;w(e),E.current=e},[C,b]),(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("div",{className:"nf-table-controls",children:(0,Ge.jsx)(zt,{columns:b,formID:a})}),(0,Ge.jsxs)("div",{className:"nf-submissions-container",children:[o<=0?(0,Ge.jsx)(Lt,{content:(0,I.__)("No Submissions matching the request.","ninja-forms")}):(0,Ge.jsxs)("div",{className:"nf-outer-table",children:[u&&(0,Ge.jsx)("div",{className:"nf-loading-submissions-in",children:(0,Ge.jsx)("div",{className:"nf-loading--in",children:(0,Ge.jsx)(Ke,{text:(0,I.__)("Loading Submissions","ninja-forms")})})}),(0,Ge.jsxs)("table",{className:S,...f(),children:[(0,Ge.jsx)("thead",{children:p.map(e=>(0,Ge.jsx)("tr",{...e.getHeaderGroupProps(),children:e.headers.map(e=>(0,Ge.jsx)("th",{...e.getHeaderProps(),children:e.render("Header")}))}))}),(0,Ge.jsx)("tbody",{id:"the-list",...d(),children:g.map((e,t)=>(h(e),(0,Ge.jsx)("tr",{...e.getRowProps(),children:e.cells.map(t=>{const r=t.getCellProps();return void 0!==t.column.fieldSettings&&Wt.includes(t.column.fieldSettings.type)?(0,Ge.jsxs)("td",{...t.getCellProps(),children:[" ",(0,Ge.jsx)("div",{className:"nf-submissions-cell",children:t.render(Vt)})]}):(0,Ge.jsx)("td",{...t.getCellProps(),children:(0,Ge.jsxs)("div",{className:"nf-submissions-cell",children:[t.render("Cell"),r.key.endsWith("seqID")&&(0,Ge.jsx)(Gt,{fields:e.allCells,row:e.original,formID:a})]})})})})))})]})]}),(0,Ge.jsx)(Ht,{controlledPageIndex:n,submissionsLoading:u,controlledPageCount:r,controlledPageSize:i,submissionsCount:o,submissionsTotal:s})]})]})};qt.propTypes={columns:Ue().array.isRequired,data:Ue().array.isRequired,pageCount:Ue().number,pageIndex:Ue().number,pageSize:Ue().number,submissionsCount:Ue().number,submissionsTotal:Ue().number,formID:Ue().oneOfType([Ue().string,Ue().number])};const Kt=e=>{const{currentForm:t,triggerBulkAction:r,dateFormat:n,submissionsLoading:i,submissionsStatus:o,searchTerm:s,dates:a}=e,[u,f]=(0,c.useState)(a),[d,p]=(0,c.useState)(s),[h,g]=(0,c.useState)(o),v=()=>{const e=(0,l.select)("ninja-forms/submissions").getSubmissionsData();(0,l.select)("ninja-forms/submissions").getSubmissions(t,e.requestCount,e.pageSize,e.pageIndex,e.dates.startDateTimestamp,e.dates.endDateTimestamp,e.searchTerm,e.submissionsStatus)};return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)("hr",{}),(0,Ge.jsxs)("div",{className:"nf-submissions-actions actions",children:[(0,Ge.jsx)(Ze,{multiple:!1,options:O.bulkActionsOptions,triggerAction:e=>r(e,"top"),label:(0,I.__)("Select Bulk Action","ninja-forms"),labelPosition:"top",hideLabelFromVision:!0}),(0,Ge.jsxs)("div",{className:"nf-submissions-filters",children:[(0,Ge.jsx)(He.SelectControl,{name:"nf-submissions-status",label:(0,I.__)("Submissions Status","ninja-forms"),hideLabelFromVision:!0,value:h,options:[{label:"Completed",value:"completed"},{label:"Trash",value:"trash"}],onChange:e=>g(e)}),(0,Ge.jsx)(qe,{disabled:i,dateFormat:n,setDates:f,maxDate:"today",defaultDate:u,placeholder:(0,I.__)("Select Dates...","ninja-forms")}),(0,Ge.jsx)("input",{name:"nf-submissions-search-term",disabled:i,value:d,placeholder:(0,I.__)("Enter Search Term...","ninja-forms"),type:"text",onChange:e=>{p(e.currentTarget.value)}}),(0,Ge.jsx)(He.Button,{name:"nf-submissions-filter-button",disabled:i,variant:"primary",className:"nf-filter-submissions button-primary",onClick:()=>{(0,l.dispatch)("ninja-forms/submissions").setSubmissionsStatus(h),(0,l.dispatch)("ninja-forms/submissions").setSearchTerm(d),(0,l.dispatch)("ninja-forms/submissions").setDates(u),v()},children:(0,I.__)("Filter Submissions","ninja-forms")}),(0,Ge.jsx)(He.Button,{name:"nf-submissions-reset-button",disabled:i,variant:"secondary",className:"nf-reset-submissions-filters button-secondary",onClick:()=>{g("completed"),p(""),f({reset:!0}),(0,l.dispatch)("ninja-forms/submissions").setSubmissionsStatus("completed "),(0,l.dispatch)("ninja-forms/submissions").setSearchTerm(""),(0,l.dispatch)("ninja-forms/submissions").setDates({}),v()},children:(0,I.__)("Reset Filters","ninja-forms")})]})]})]})};Kt.propTypes={currentForm:Ue().string.isRequired,triggerBulkAction:Ue().func.isRequired,dateFormat:Ue().string,submissionsLoading:Ue().bool.isRequired,submissionsStatus:Ue().string,dates:Ue().object,searchTerm:Ue().string};const $t=e=>{const[t,r]=(0,c.useState)(!1),[n,i]=(0,c.useState)(!1),[o,s]=(0,c.useState)({}),[a,u]=(0,c.useState)(!1);(0,c.useEffect)(()=>{const e=new AbortController;return u(e.signal),()=>{e.abort()}},[]);const l={globalParams:R,singleSubmission:e.singleSubmission,setProcessing:i,setExportSuccess:()=>{s({status:"success",text:(0,I.__)("Submission successfully exported","ninja-forms")}),i(!1),r(!0)},setExportError:()=>{s({status:"error",text:(0,I.__)("The export failed. Contact developper or read logs if this failure persists.","ninja-forms")}),i(!1),r(!0)},signal:a};return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(He.Button,{onClick:()=>{rt(l)},variant:"link","aria-label":(0,I.sprintf)((0,I.__)("Export submission %d via CSV file","ninja-forms"),e.singleSubmission.submissionRecordId),children:(0,I.__)("Export","ninja-forms")}),n&&(0,Ge.jsx)(Ke,{}),t&&(0,Ge.jsx)(Ve,{status:o.status,text:o.text,setDisplayNotice:r})]})};$t.propTypes={singleSubmission:Ue().object.isRequired};const Jt=e=>{const{singleSubmission:t,submissionsStatus:r}=e,{submissionRecordId:n}=t,[i,o]=(0,c.useState)(!1),s={submissions:[t]};return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(He.Button,{onClick:()=>o(!0),variant:"link",className:"submitdelete","aria-label":(0,I.sprintf)((0,I.__)("Move submission %d to the Trash","ninja-forms"),n),children:"trash"===r?(0,I.__)("Delete Permanently","ninja-forms"):(0,I.__)("Trash","ninja-forms")}),i&&(0,Ge.jsx)(We,{title:(0,I.sprintf)((0,I.__)("Delete Submission %d","ninja-forms"),n),actionText:"trash"===r?(0,I.__)("Delete Submission Permanently","ninja-forms"):(0,I.__)("Delete Submission ","ninja-forms"),cancelText:(0,I.__)("Cancel","ninja-forms"),action:()=>{Qe(s),o(!1)},cancel:()=>o(!1)})]})};Jt.propTypes={singleSubmission:Ue().object.isRequired},r(44847);const Xt=e=>{const{singleSubmission:t,extraHandlers:r}=e;let n=[];return Object.entries(r).forEach((e,r)=>{const i=e[1].handlerLabel,o=e[1].handlerClassName,s={singleSubmission:t,handleExtra:o};n.push((0,Ge.jsx)(He.Button,{onClick:()=>{ot(s)},variant:"link",className:"handleExtra","aria-label":i,children:i},r))}),(0,Ge.jsx)(Ge.Fragment,{children:n})};Xt.propTypes={singleSubmission:Ue().object.isRequired,extraHandlers:Ue().object.isRequired};const Zt=e=>{const{singleSubmission:t}=e,{submissionRecordId:r}=t,[n,i]=(0,c.useState)(!1),o={submissions:[t]};return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(He.Button,{onClick:()=>i(!0),variant:"link",className:"submitrestore","aria-label":(0,I.sprintf)((0,I.__)("Restore submission %d","ninja-forms"),r),children:(0,I.__)("Restore","ninja-forms")}),n&&(0,Ge.jsx)(We,{title:(0,I.sprintf)((0,I.__)("Restore Submission %d","ninja-forms"),r),actionText:(0,I.__)("Restore Submission ","ninja-forms"),cancelText:(0,I.__)("Cancel","ninja-forms"),action:()=>{et(o),i(!1)},cancel:()=>i(!1)})]})};Zt.propTypes={singleSubmission:Ue().object.isRequired},u().use(u().createNonceMiddleware(R.token));const Qt=(0,l.createReduxStore)("ninja-forms/submissions",{reducer:function(e=f,t){switch(t.type){case"SET_CURRENT_FORM":return{...e,currentForm:t.formID};case"SET_COLUMNS":return{...e,columns:t.columns};case"SET_SUBMISSIONS":return{...e,submissions:t.submissions};case"SET_SUBMISSION":return{...e,submission:t.submission};case"SET_SUBMISSIONS_TOTAL":return{...e,submissionsTotal:t.submissionsCount};case"SET_CURRENT_REQUEST_SUBMISSIONS_COUNT":return{...e,currentRequestSubCount:t.count};case"SET_SUBMISSIONS_COUNT":return{...e,submissionsCount:null!==e.currentRequestSubCount?e.currentRequestSubCount:e.submissionsTotal};case"SET_PAGE_INDEX":return{...e,pageIndex:t.pageIndex};case"SET_PAGE_SIZE":return{...e,pageSize:t.pageSize};case"SET_PAGE_COUNT":return{...e,pageCount:Math.ceil(e.submissionsCount/e.pageSize)};case"SET_LOADING_FORM":return{...e,loadingForm:t.loadingForm};case"SET_LOADING_SUBMISSIONS":return{...e,loadingSubmissions:t.loadingSubmissions};case"SET_COLUMNS_FETCHING_STATUS":return{...e,columnsFetchingStatus:t.status};case"SET_SUBMISSIONS_FETCHING_STATUS":return{...e,submissionsFetchingStatus:t.status};case"SET_REQUEST_COUNT":return{...e,requestCount:e.requestCount+1};case"SET_DATES":let r,n;if(void 0!==t.dates.date){const e=void 0!==t.dates.date[0]?t.dates.date[0].getTimezoneOffset():0,i=Math.sign(e);r=new Date(t.dates.date[0]).setHours(0,0,0,0)/1e3,r=-1!==i?r-60*Math.abs(e):r+60*Math.abs(e),n=new Date(t.dates.date[1]).setHours(23,59,59,999)/1e3,n=-1!==i?n-60*Math.abs(e):n+60*Math.abs(e)}return{...e,dates:t.dates.date?{dates:t.dates,startDate:t.dates.date[0],endDate:t.dates.date[1],startDateTimestamp:r,endDateTimestamp:n}:t.dates};case"SET_SEARCH_TERM":return{...e,searchTerm:t.searchTerm};case"SET_SELECTED_SUBMISSIONS":return{...e,selectedSubmissions:t.submissionsArray};case"SET_COLUMNS_ABORT_CONTROLLER":return{...e,columnsAbortController:t.abortController};case"SET_SUBMISSIONS_ABORT_CONTROLLER":return{...e,submissionsAbortController:t.abortController};case"SET_SUBMISSIONS_SETTINGS":return{...e,submissionsSettings:t.settings};case"SET_SUBMISSIONS_STATUS":return{...e,submissionsStatus:t.status};case"SET_ALLOWED_EDIT":return{...e,isAllowedEdit:t.status}}return e},actions:e,selectors:t,controls:n,resolvers:i});(0,l.register)(Qt),s()(()=>{er()});const er=()=>{const e={globalParams:R},t=document.getElementById("nf-submissions-element"),r=(0,c.createElement)(ct,e);c.createRoot?(0,c.createRoot)(t).render(r):(0,c.render)(r,t)}})()})();