(()=>{"use strict";var e,t={28432:function(e,t,a){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=r(a(73609)),n={chooser:function(e,t){function a(t){o.default("a.task-type-choice, a.choose-different-task-type, a.task-choice",t).on("click",(function(){return e.loadUrl(this.href),!1})),o.default(".pagination a",t).on("click",(function(){return e=this.getAttribute("data-page"),t=o.default("#id_q").val().length?{q:o.default("#id_q").val(),p:e}:{p:e},r=o.default.ajax({url:n,data:t,success:function(e){r=null,o.default("#search-results").html(e),a(o.default("#search-results"))},error:function(){r=null}}),!1;var e,t})),o.default("a.create-one-now").on("click",(function(e){o.default('a[href="#new"]').tab("show"),e.preventDefault()}))}var r,n=o.default("form.task-search",e.body).attr("action");function l(){return r=o.default.ajax({url:n,data:{q:o.default("#id_q").val(),task_type:o.default("#id_task_type").val()},success:function(e){r=null,o.default("#search-results").html(e),a(o.default("#search-results"))},error:function(){r=null}}),!1}a(e.body),o.default("form.task-create",e.body).on("submit",(function(){var a=new FormData(this);return o.default.ajax({url:this.action,data:a,processData:!1,contentType:!1,type:"POST",dataType:"text",success:e.loadResponseText,error:function(e,a,r){var n=t.error_message+"<br />"+r+" - "+e.status;o.default("#new").append('<div class="help-block help-critical"><strong>'+t.error_label+": </strong>"+n+"</div>")}}),!1})),o.default("form.task-search",e.body).on("submit",l),o.default("#id_q").on("input",(function(){r&&r.abort(),clearTimeout(o.default.data(this,"timer"));var e=setTimeout(l,50);o.default(this).data("timer",e)})),o.default("#id_task_type").on("change",(function(){r&&r.abort(),clearTimeout(o.default.data(this,"timer"));var e=setTimeout(l,50);o.default(this).data("timer",e)}))},task_chosen:function(e,t){e.respond("taskChosen",t.result),e.close()}};window.TASK_CHOOSER_MODAL_ONLOAD_HANDLERS=n},73609:e=>{e.exports=jQuery}},a={};function r(e){var o=a[e];if(void 0!==o)return o.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return t[e].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.m=t,e=[],r.O=(t,a,o,n)=>{if(!a){var l=1/0;for(s=0;s<e.length;s++){for(var[a,o,n]=e[s],u=!0,i=0;i<a.length;i++)(!1&n||l>=n)&&Object.keys(r.O).every((e=>r.O[e](a[i])))?a.splice(i--,1):(u=!1,n<l&&(l=n));u&&(e.splice(s--,1),t=o())}return t}n=n||0;for(var s=e.length;s>0&&e[s-1][2]>n;s--)e[s]=e[s-1];e[s]=[a,o,n]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},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.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),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})},r.j=342,(()=>{var e={342:0};r.O.j=t=>0===e[t];var t=(t,a)=>{var o,n,[l,u,i]=a,s=0;for(o in u)r.o(u,o)&&(r.m[o]=u[o]);if(i)var d=i(r);for(t&&t(a);s<l.length;s++)n=l[s],r.o(e,n)&&e[n]&&e[n][0](),e[l[s]]=0;return r.O(d)},a=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})(),r.O(void 0,[876],(()=>r(28432)));var o=r.O(void 0,[876],(()=>r(90971)));o=r.O(o)})();
//# sourceMappingURL=task-chooser-modal.js.map