text: (function(e){"use strict";function i(e,t,n){var r=undefined;if(e&&t){r=n.closest(e).find(t);if(r.length==0){r=undefined}}return r}function s(t,n){var r=n.data("success"),s=n.data("replace"),o=n.data("replace-closest"),u=n.data("replace-inner"),a=n.data("replace-closest-inner"),f=i(n.data("replace-father"),n.data("replace-child"),n),l=i(n.data("replace-father"),n.data("replace-child-inner"),n),c=n.data("append"),h=n.data("prepend"),p=n.data("refresh"),d=n.data("refresh-closest"),v=n.data("refresh-inner"),m=i(n.data("refresh-father"),n.data("refresh-child"),n),g=i(n.data("refresh-father"),n.data("refresh-child-inner"),n),y=n.data("clear"),b=n.data("clear-closest"),w=n.data("remove"),E=n.data("remove-closest");if(s){e(s).replaceWith(t.content)}if(o){n.closest(o).replaceWith(t.content)}if(u){e(u).html(t.content)}if(f){f.replaceWith(t.content)}if(l){l.html(t.content)}if(a){n.closest(a).html(t.content)}if(c){e(c).append(t.content)}if(h){e(h).prepend(t.content)}if(p){e.each(e(p),function(t,n){ajaxGet(e(n).data("refresh-url"),function(t){e(n).replaceWith(t)})})}if(v){e.each(e(v),function(t,n){ajaxGet(e(n).data("refresh-url"),function(t){e(n).html(t)})})}if(d){e.each(e(d),function(t,r){ajaxGet(e(r).data("refresh-url"),function(t){n.closest(e(r)).replaceWith(t)})})}if(m){e.each(m,function(t,n){ajaxGet(e(n).data("refresh-url"),function(t){e(n).replaceWith(t)})})}if(g){e.each(g,function(t,n){ajaxGet(e(n).data("refresh-url"),function(t){e(n).html(t)})})}if(y){e(y).html("")}if(w){e(w).remove()}if(b){n.closest(b).html("")}if(E){n.closest(E).remove()}if(r){try{r=window[r];e.isFunction(r)&&r(t.content)}catch(S){alert(S.name+"\n"+S.message)}}}var t="[data-ajax-submit]";var n="[data-ajax]",r=function(r){e(r).on("click",n,this.send);e(r).on("submit",t,this.submit)};r.prototype.send=function(t){var n=e(this),r=n.data("method"),i=n.attr("href")||n.data("href")||n.data("url")||null,o=n.data("data")||null,u=n.data("error")||null;if(t)t.preventDefault();if(!i){alert("href, data-href or data-url attribute not found!");return}if(u){try{u=window[u];if(!e.isFunction(u))u=null}catch(t){alert(t.name+"\n"+t.message)}}r=r?r.toLowerCase():"get";i=i&&i.replace(/.*(?=#[^\s]*$)/,"");o=o&&o.replace(/'/g,'"');try{o=e.parseJSON(o)}catch(t){alert(t.name+"\n"+t.message);return}if(ajax&&e.isFunction(ajax))ajax(i,{method:r,data:o,onSuccess:function(e){s(e,n)},onError:u});else alert("jquery.ajax.js is required")};r.prototype.submit=function(t){var n=e(this),r=n.attr("action"),i=n.attr("method"),o=n.serialize(),u=n.data("redirect-inner"),a=u?{onRedirect:function(t){ajaxGet(t,function(t){e(u).html(t)})}}:{};t.preventDefault();i=i?i.toLowerCase():"get";if(i=="post"){ajaxPost(r,o,function(e){var t={};t.content=e;s(t,n)},a)}else{ajaxGet(r,function(e){var t={};t.content=e;s(t,n)},a)}};var o=e.fn.ajax;e.fn.ajax=function(t){return this.each(function(){var n=e(this),i=n.data("django.ajax");if(!i)n.data("django.ajax",i=new r(this));if(typeof t=="string")i[t].call(n)})};e.fn.ajax.Constructor=r;e.fn.ajax.noConflict=function(){e.fn.ajax=o;return this};e(document).on("click.ajax.data-api",n,r.prototype.send);e(document).on("submit.ajax.data-api",t,r.prototype.submit)})(jQuery)