Files
vgui-cicd/nested_admin/dist/nested_admin.min.js

3 lines
104 KiB
JavaScript

/*! For license information please see nested_admin.min.js.LICENSE.txt */
!function(){var t={4963:function(t){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},7722:function(t,e,i){var n=i(6314)("unscopables"),r=Array.prototype;null==r[n]&&i(7728)(r,n,{}),t.exports=function(t){r[n][t]=!0}},6793:function(t,e,i){"use strict";var n=i(4496)(!0);t.exports=function(t,e,i){return e+(i?n(t,e).length:1)}},3328:function(t){t.exports=function(t,e,i,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(i+": incorrect invocation!");return t}},7007:function(t,e,i){var n=i(5286);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},9315:function(t,e,i){var n=i(2110),r=i(875),o=i(2337);t.exports=function(t){return function(e,i,s){var a,l=n(e),c=r(l.length),h=o(s,c);if(t&&i!=i){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===i)return t||h||0;return!t&&-1}}},50:function(t,e,i){var n=i(741),r=i(9797),o=i(508),s=i(875),a=i(6886);t.exports=function(t,e){var i=1==t,l=2==t,c=3==t,h=4==t,u=6==t,d=5==t||u,f=e||a;return function(e,a,p){for(var m,g,v=o(e),_=r(v),y=n(a,p,3),b=s(_.length),x=0,w=i?f(e,b):l?f(e,0):void 0;b>x;x++)if((d||x in _)&&(g=y(m=_[x],x,v),t))if(i)w[x]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return x;case 2:w.push(m)}else if(h)return!1;return u?-1:c||h?h:w}}},2736:function(t,e,i){var n=i(5286),r=i(4302),o=i(6314)("species");t.exports=function(t){var e;return r(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!r(e.prototype)||(e=void 0),n(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},6886:function(t,e,i){var n=i(2736);t.exports=function(t,e){return new(n(t))(e)}},1488:function(t,e,i){var n=i(2032),r=i(6314)("toStringTag"),o="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,i,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),r))?i:o?n(e):"Object"==(s=n(e))&&"function"==typeof e.callee?"Arguments":s}},2032:function(t){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},9824:function(t,e,i){"use strict";var n=i(9275).f,r=i(2503),o=i(4408),s=i(741),a=i(3328),l=i(3531),c=i(2923),h=i(5436),u=i(2974),d=i(7057),f=i(4728).fastKey,p=i(1616),m=d?"_s":"size",g=function(t,e){var i,n=f(e);if("F"!==n)return t._i[n];for(i=t._f;i;i=i.n)if(i.k==e)return i};t.exports={getConstructor:function(t,e,i,c){var h=t((function(t,n){a(t,h,e,"_i"),t._t=e,t._i=r(null),t._f=void 0,t._l=void 0,t[m]=0,null!=n&&l(n,i,t[c],t)}));return o(h.prototype,{clear:function(){for(var t=p(this,e),i=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete i[n.i];t._f=t._l=void 0,t[m]=0},delete:function(t){var i=p(this,e),n=g(i,t);if(n){var r=n.n,o=n.p;delete i._i[n.i],n.r=!0,o&&(o.n=r),r&&(r.p=o),i._f==n&&(i._f=r),i._l==n&&(i._l=o),i[m]--}return!!n},forEach:function(t){p(this,e);for(var i,n=s(t,arguments.length>1?arguments[1]:void 0,3);i=i?i.n:this._f;)for(n(i.v,i.k,this);i&&i.r;)i=i.p},has:function(t){return!!g(p(this,e),t)}}),d&&n(h.prototype,"size",{get:function(){return p(this,e)[m]}}),h},def:function(t,e,i){var n,r,o=g(t,e);return o?o.v=i:(t._l=o={i:r=f(e,!0),k:e,v:i,p:n=t._l,n:void 0,r:!1},t._f||(t._f=o),n&&(n.n=o),t[m]++,"F"!==r&&(t._i[r]=o)),t},getEntry:g,setStrong:function(t,e,i){c(t,e,(function(t,i){this._t=p(t,e),this._k=i,this._l=void 0}),(function(){for(var t=this,e=t._k,i=t._l;i&&i.r;)i=i.p;return t._t&&(t._l=i=i?i.n:t._t._f)?h(0,"keys"==e?i.k:"values"==e?i.v:[i.k,i.v]):(t._t=void 0,h(1))}),i?"entries":"values",!i,!0),u(e)}}},5795:function(t,e,i){"use strict";var n=i(3816),r=i(2985),o=i(7234),s=i(4408),a=i(4728),l=i(3531),c=i(3328),h=i(5286),u=i(4253),d=i(7462),f=i(2943),p=i(266);t.exports=function(t,e,i,m,g,v){var _=n[t],y=_,b=g?"set":"add",x=y&&y.prototype,w={},j=function(t){var e=x[t];o(x,t,"delete"==t||"has"==t?function(t){return!(v&&!h(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return v&&!h(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,i){return e.call(this,0===t?0:t,i),this})};if("function"==typeof y&&(v||x.forEach&&!u((function(){(new y).entries().next()})))){var S=new y,P=S[b](v?{}:-0,1)!=S,I=u((function(){S.has(1)})),F=d((function(t){new y(t)})),C=!v&&u((function(){for(var t=new y,e=5;e--;)t[b](e,e);return!t.has(-0)}));F||((y=e((function(e,i){c(e,y,t);var n=p(new _,e,y);return null!=i&&l(i,g,n[b],n),n}))).prototype=x,x.constructor=y),(I||C)&&(j("delete"),j("has"),g&&j("get")),(C||P)&&j(b),v&&x.clear&&delete x.clear}else y=m.getConstructor(e,t,g,b),s(y.prototype,i),a.NEED=!0;return f(y,t),w[t]=y,r(r.G+r.W+r.F*(y!=_),w),v||m.setStrong(y,t,g),y}},5645:function(t){var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},741:function(t,e,i){var n=i(4963);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,r){return t.call(e,i,n,r)}}return function(){return t.apply(e,arguments)}}},1355:function(t){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},7057:function(t,e,i){t.exports=!i(4253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2457:function(t,e,i){var n=i(5286),r=i(3816).document,o=n(r)&&n(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},4430:function(t){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},2985:function(t,e,i){var n=i(3816),r=i(5645),o=i(7728),s=i(7234),a=i(741),l=function(t,e,i){var c,h,u,d,f=t&l.F,p=t&l.G,m=t&l.S,g=t&l.P,v=t&l.B,_=p?n:m?n[e]||(n[e]={}):(n[e]||{}).prototype,y=p?r:r[e]||(r[e]={}),b=y.prototype||(y.prototype={});for(c in p&&(i=e),i)u=((h=!f&&_&&void 0!==_[c])?_:i)[c],d=v&&h?a(u,n):g&&"function"==typeof u?a(Function.call,u):u,_&&s(_,c,u,t&l.U),y[c]!=u&&o(y,c,d),g&&b[c]!=u&&(b[c]=u)};n.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},4253:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},8082:function(t,e,i){"use strict";i(8269);var n=i(7234),r=i(7728),o=i(4253),s=i(1355),a=i(6314),l=i(1165),c=a("species"),h=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),u=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2===i.length&&"a"===i[0]&&"b"===i[1]}();t.exports=function(t,e,i){var d=a(t),f=!o((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=f?!o((function(){var e=!1,i=/a/;return i.exec=function(){return e=!0,null},"split"===t&&(i.constructor={},i.constructor[c]=function(){return i}),i[d](""),!e})):void 0;if(!f||!p||"replace"===t&&!h||"split"===t&&!u){var m=/./[d],g=i(s,d,""[t],(function(t,e,i,n,r){return e.exec===l?f&&!r?{done:!0,value:m.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}})),v=g[0],_=g[1];n(String.prototype,t,v),r(RegExp.prototype,d,2==e?function(t,e){return _.call(t,this,e)}:function(t){return _.call(t,this)})}}},3218:function(t,e,i){"use strict";var n=i(7007);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},3531:function(t,e,i){var n=i(741),r=i(8851),o=i(6555),s=i(7007),a=i(875),l=i(9002),c={},h={},u=t.exports=function(t,e,i,u,d){var f,p,m,g,v=d?function(){return t}:l(t),_=n(i,u,e?2:1),y=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(f=a(t.length);f>y;y++)if((g=e?_(s(p=t[y])[0],p[1]):_(t[y]))===c||g===h)return g}else for(m=v.call(t);!(p=m.next()).done;)if((g=r(m,_,p.value,e))===c||g===h)return g};u.BREAK=c,u.RETURN=h},18:function(t,e,i){t.exports=i(3825)("native-function-to-string",Function.toString)},3816:function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},9181:function(t){var e={}.hasOwnProperty;t.exports=function(t,i){return e.call(t,i)}},7728:function(t,e,i){var n=i(9275),r=i(681);t.exports=i(7057)?function(t,e,i){return n.f(t,e,r(1,i))}:function(t,e,i){return t[e]=i,t}},639:function(t,e,i){var n=i(3816).document;t.exports=n&&n.documentElement},1734:function(t,e,i){t.exports=!i(7057)&&!i(4253)((function(){return 7!=Object.defineProperty(i(2457)("div"),"a",{get:function(){return 7}}).a}))},266:function(t,e,i){var n=i(5286),r=i(7375).set;t.exports=function(t,e,i){var o,s=e.constructor;return s!==i&&"function"==typeof s&&(o=s.prototype)!==i.prototype&&n(o)&&r&&r(t,o),t}},9797:function(t,e,i){var n=i(2032);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},6555:function(t,e,i){var n=i(2803),r=i(6314)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||o[r]===t)}},4302:function(t,e,i){var n=i(2032);t.exports=Array.isArray||function(t){return"Array"==n(t)}},5286:function(t){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5364:function(t,e,i){var n=i(5286),r=i(2032),o=i(6314)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==r(t))}},8851:function(t,e,i){var n=i(7007);t.exports=function(t,e,i,r){try{return r?e(n(i)[0],i[1]):e(i)}catch(e){var o=t.return;throw void 0!==o&&n(o.call(t)),e}}},9988:function(t,e,i){"use strict";var n=i(2503),r=i(681),o=i(2943),s={};i(7728)(s,i(6314)("iterator"),(function(){return this})),t.exports=function(t,e,i){t.prototype=n(s,{next:r(1,i)}),o(t,e+" Iterator")}},2923:function(t,e,i){"use strict";var n=i(4461),r=i(2985),o=i(7234),s=i(7728),a=i(2803),l=i(9988),c=i(2943),h=i(468),u=i(6314)("iterator"),d=!([].keys&&"next"in[].keys()),f="keys",p="values",m=function(){return this};t.exports=function(t,e,i,g,v,_,y){l(i,e,g);var b,x,w,j=function(t){if(!d&&t in F)return F[t];switch(t){case f:case p:return function(){return new i(this,t)}}return function(){return new i(this,t)}},S=e+" Iterator",P=v==p,I=!1,F=t.prototype,C=F[u]||F["@@iterator"]||v&&F[v],E=C||j(v),O=v?P?j("entries"):E:void 0,T="Array"==e&&F.entries||C;if(T&&(w=h(T.call(new t)))!==Object.prototype&&w.next&&(c(w,S,!0),n||"function"==typeof w[u]||s(w,u,m)),P&&C&&C.name!==p&&(I=!0,E=function(){return C.call(this)}),n&&!y||!d&&!I&&F[u]||s(F,u,E),a[e]=E,a[S]=m,v)if(b={values:P?E:j(p),keys:_?E:j(f),entries:O},y)for(x in b)x in F||o(F,x,b[x]);else r(r.P+r.F*(d||I),e,b);return b}},7462:function(t,e,i){var n=i(6314)("iterator"),r=!1;try{var o=[7][n]();o.return=function(){r=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var i=!1;try{var o=[7],s=o[n]();s.next=function(){return{done:i=!0}},o[n]=function(){return s},t(o)}catch(t){}return i}},5436:function(t){t.exports=function(t,e){return{value:e,done:!!t}}},2803:function(t){t.exports={}},4461:function(t){t.exports=!1},4728:function(t,e,i){var n=i(3953)("meta"),r=i(5286),o=i(9181),s=i(9275).f,a=0,l=Object.isExtensible||function(){return!0},c=!i(4253)((function(){return l(Object.preventExtensions({}))})),h=function(t){s(t,n,{value:{i:"O"+ ++a,w:{}}})},u=t.exports={KEY:n,NEED:!1,fastKey:function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,n)){if(!l(t))return"F";if(!e)return"E";h(t)}return t[n].i},getWeak:function(t,e){if(!o(t,n)){if(!l(t))return!0;if(!e)return!1;h(t)}return t[n].w},onFreeze:function(t){return c&&u.NEED&&l(t)&&!o(t,n)&&h(t),t}}},2503:function(t,e,i){var n=i(7007),r=i(5588),o=i(4430),s=i(9335)("IE_PROTO"),a=function(){},l=function(){var t,e=i(2457)("iframe"),n=o.length;for(e.style.display="none",i(639).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;n--;)delete l.prototype[o[n]];return l()};t.exports=Object.create||function(t,e){var i;return null!==t?(a.prototype=n(t),i=new a,a.prototype=null,i[s]=t):i=l(),void 0===e?i:r(i,e)}},9275:function(t,e,i){var n=i(7007),r=i(1734),o=i(1689),s=Object.defineProperty;e.f=i(7057)?Object.defineProperty:function(t,e,i){if(n(t),e=o(e,!0),n(i),r)try{return s(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},5588:function(t,e,i){var n=i(9275),r=i(7007),o=i(7184);t.exports=i(7057)?Object.defineProperties:function(t,e){r(t);for(var i,s=o(e),a=s.length,l=0;a>l;)n.f(t,i=s[l++],e[i]);return t}},8693:function(t,e,i){var n=i(4682),r=i(681),o=i(2110),s=i(1689),a=i(9181),l=i(1734),c=Object.getOwnPropertyDescriptor;e.f=i(7057)?c:function(t,e){if(t=o(t),e=s(e,!0),l)try{return c(t,e)}catch(t){}if(a(t,e))return r(!n.f.call(t,e),t[e])}},616:function(t,e,i){var n=i(189),r=i(4430).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,r)}},468:function(t,e,i){var n=i(9181),r=i(508),o=i(9335)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),n(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},189:function(t,e,i){var n=i(9181),r=i(2110),o=i(9315)(!1),s=i(9335)("IE_PROTO");t.exports=function(t,e){var i,a=r(t),l=0,c=[];for(i in a)i!=s&&n(a,i)&&c.push(i);for(;e.length>l;)n(a,i=e[l++])&&(~o(c,i)||c.push(i));return c}},7184:function(t,e,i){var n=i(189),r=i(4430);t.exports=Object.keys||function(t){return n(t,r)}},4682:function(t,e){e.f={}.propertyIsEnumerable},681:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4408:function(t,e,i){var n=i(7234);t.exports=function(t,e,i){for(var r in e)n(t,r,e[r],i);return t}},7234:function(t,e,i){var n=i(3816),r=i(7728),o=i(9181),s=i(3953)("src"),a=i(18),l="toString",c=(""+a).split(l);i(5645).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,i,a){var l="function"==typeof i;l&&(o(i,"name")||r(i,"name",e)),t[e]!==i&&(l&&(o(i,s)||r(i,s,t[e]?""+t[e]:c.join(String(e)))),t===n?t[e]=i:a?t[e]?t[e]=i:r(t,e,i):(delete t[e],r(t,e,i)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[s]||a.call(this)}))},7787:function(t,e,i){"use strict";var n=i(1488),r=RegExp.prototype.exec;t.exports=function(t,e){var i=t.exec;if("function"==typeof i){var o=i.call(t,e);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==n(t))throw new TypeError("RegExp#exec called on incompatible receiver");return r.call(t,e)}},1165:function(t,e,i){"use strict";var n,r,o=i(3218),s=RegExp.prototype.exec,a=String.prototype.replace,l=s,c=(n=/a/,r=/b*/g,s.call(n,"a"),s.call(r,"a"),0!==n.lastIndex||0!==r.lastIndex),h=void 0!==/()??/.exec("")[1];(c||h)&&(l=function(t){var e,i,n,r,l=this;return h&&(i=new RegExp("^"+l.source+"$(?!\\s)",o.call(l))),c&&(e=l.lastIndex),n=s.call(l,t),c&&n&&(l.lastIndex=l.global?n.index+n[0].length:e),h&&n&&n.length>1&&a.call(n[0],i,(function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(n[r]=void 0)})),n}),t.exports=l},7375:function(t,e,i){var n=i(5286),r=i(7007),o=function(t,e){if(r(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{(n=i(741)(Function.call,i(8693).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return o(t,i),e?t.__proto__=i:n(t,i),t}}({},!1):void 0),check:o}},2974:function(t,e,i){"use strict";var n=i(3816),r=i(9275),o=i(7057),s=i(6314)("species");t.exports=function(t){var e=n[t];o&&e&&!e[s]&&r.f(e,s,{configurable:!0,get:function(){return this}})}},2943:function(t,e,i){var n=i(9275).f,r=i(9181),o=i(6314)("toStringTag");t.exports=function(t,e,i){t&&!r(t=i?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},9335:function(t,e,i){var n=i(3825)("keys"),r=i(3953);t.exports=function(t){return n[t]||(n[t]=r(t))}},3825:function(t,e,i){var n=i(5645),r=i(3816),o="__core-js_shared__",s=r[o]||(r[o]={});(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:n.version,mode:i(4461)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8364:function(t,e,i){var n=i(7007),r=i(4963),o=i(6314)("species");t.exports=function(t,e){var i,s=n(t).constructor;return void 0===s||null==(i=n(s)[o])?e:r(i)}},7717:function(t,e,i){"use strict";var n=i(4253);t.exports=function(t,e){return!!t&&n((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},4496:function(t,e,i){var n=i(1467),r=i(1355);t.exports=function(t){return function(e,i){var o,s,a=String(r(e)),l=n(i),c=a.length;return l<0||l>=c?t?"":void 0:(o=a.charCodeAt(l))<55296||o>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):o:t?a.slice(l,l+2):s-56320+(o-55296<<10)+65536}}},2337:function(t,e,i){var n=i(1467),r=Math.max,o=Math.min;t.exports=function(t,e){return(t=n(t))<0?r(t+e,0):o(t,e)}},1467:function(t){var e=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:e)(t)}},2110:function(t,e,i){var n=i(9797),r=i(1355);t.exports=function(t){return n(r(t))}},875:function(t,e,i){var n=i(1467),r=Math.min;t.exports=function(t){return t>0?r(n(t),9007199254740991):0}},508:function(t,e,i){var n=i(1355);t.exports=function(t){return Object(n(t))}},1689:function(t,e,i){var n=i(5286);t.exports=function(t,e){if(!n(t))return t;var i,r;if(e&&"function"==typeof(i=t.toString)&&!n(r=i.call(t)))return r;if("function"==typeof(i=t.valueOf)&&!n(r=i.call(t)))return r;if(!e&&"function"==typeof(i=t.toString)&&!n(r=i.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},3953:function(t){var e=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+i).toString(36))}},1616:function(t,e,i){var n=i(5286);t.exports=function(t,e){if(!n(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6314:function(t,e,i){var n=i(3825)("wks"),r=i(3953),o=i(3816).Symbol,s="function"==typeof o;(t.exports=function(t){return n[t]||(n[t]=s&&o[t]||(s?o:r)("Symbol."+t))}).store=n},9002:function(t,e,i){var n=i(1488),r=i(6314)("iterator"),o=i(2803);t.exports=i(5645).getIteratorMethod=function(t){if(null!=t)return t[r]||t["@@iterator"]||o[n(t)]}},8837:function(t,e,i){"use strict";var n=i(2985),r=i(50)(2);n(n.P+n.F*!i(7717)([].filter,!0),"Array",{filter:function(t){return r(this,t,arguments[1])}})},2310:function(t,e,i){"use strict";var n=i(2985),r=i(50)(5),o="find",s=!0;o in[]&&Array(1).find((function(){s=!1})),n(n.P+n.F*s,"Array",{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),i(7722)(o)},6997:function(t,e,i){"use strict";var n=i(7722),r=i(5436),o=i(2803),s=i(2110);t.exports=i(2923)(Array,"Array",(function(t,e){this._t=s(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,r(1)):r(0,"keys"==e?i:"values"==e?t[i]:[i,t[i]])}),"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},9371:function(t,e,i){"use strict";var n=i(2985),r=i(50)(1);n(n.P+n.F*!i(7717)([].map,!0),"Array",{map:function(t){return r(this,t,arguments[1])}})},110:function(t,e,i){"use strict";var n=i(2985),r=i(639),o=i(2032),s=i(2337),a=i(875),l=[].slice;n(n.P+n.F*i(4253)((function(){r&&l.call(r)})),"Array",{slice:function(t,e){var i=a(this.length),n=o(this);if(e=void 0===e?i:e,"Array"==n)return l.call(this,t,e);for(var r=s(t,i),c=s(e,i),h=a(c-r),u=new Array(h),d=0;d<h;d++)u[d]="String"==n?this.charAt(r+d):this[r+d];return u}})},75:function(t,e,i){"use strict";var n=i(2985),r=i(4963),o=i(508),s=i(4253),a=[].sort,l=[1,2,3];n(n.P+n.F*(s((function(){l.sort(void 0)}))||!s((function(){l.sort(null)}))||!i(7717)(a)),"Array",{sort:function(t){return void 0===t?a.call(o(this)):a.call(o(this),r(t))}})},6059:function(t,e,i){var n=i(9275).f,r=Function.prototype,o=/^\s*function ([^ (]*)/,s="name";s in r||i(7057)&&n(r,s,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},6253:function(t,e,i){"use strict";var n=i(1488),r={};r[i(6314)("toStringTag")]="z",r+""!="[object z]"&&i(7234)(Object.prototype,"toString",(function(){return"[object "+n(this)+"]"}),!0)},3946:function(t,e,i){var n=i(3816),r=i(266),o=i(9275).f,s=i(616).f,a=i(5364),l=i(3218),c=n.RegExp,h=c,u=c.prototype,d=/a/g,f=/a/g,p=new c(d)!==d;if(i(7057)&&(!p||i(4253)((function(){return f[i(6314)("match")]=!1,c(d)!=d||c(f)==f||"/a/i"!=c(d,"i")})))){c=function(t,e){var i=this instanceof c,n=a(t),o=void 0===e;return!i&&n&&t.constructor===c&&o?t:r(p?new h(n&&!o?t.source:t,e):h((n=t instanceof c)?t.source:t,n&&o?l.call(t):e),i?this:u,c)};for(var m=function(t){t in c||o(c,t,{configurable:!0,get:function(){return h[t]},set:function(e){h[t]=e}})},g=s(h),v=0;g.length>v;)m(g[v++]);u.constructor=c,c.prototype=u,i(7234)(n,"RegExp",c)}i(2974)("RegExp")},8269:function(t,e,i){"use strict";var n=i(1165);i(2985)({target:"RegExp",proto:!0,forced:n!==/./.exec},{exec:n})},1466:function(t,e,i){"use strict";var n=i(7007),r=i(875),o=i(6793),s=i(7787);i(8082)("match",1,(function(t,e,i,a){return[function(i){var n=t(this),r=null==i?void 0:i[e];return void 0!==r?r.call(i,n):new RegExp(i)[e](String(n))},function(t){var e=a(i,t,this);if(e.done)return e.value;var l=n(t),c=String(this);if(!l.global)return s(l,c);var h=l.unicode;l.lastIndex=0;for(var u,d=[],f=0;null!==(u=s(l,c));){var p=String(u[0]);d[f]=p,""===p&&(l.lastIndex=o(c,r(l.lastIndex),h)),f++}return 0===f?null:d}]}))},9357:function(t,e,i){"use strict";var n=i(7007),r=i(508),o=i(875),s=i(1467),a=i(6793),l=i(7787),c=Math.max,h=Math.min,u=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,f=/\$([$&`']|\d\d?)/g;i(8082)("replace",2,(function(t,e,i,p){return[function(n,r){var o=t(this),s=null==n?void 0:n[e];return void 0!==s?s.call(n,o,r):i.call(String(o),n,r)},function(t,e){var r=p(i,t,this,e);if(r.done)return r.value;var u=n(t),d=String(this),f="function"==typeof e;f||(e=String(e));var g=u.global;if(g){var v=u.unicode;u.lastIndex=0}for(var _=[];;){var y=l(u,d);if(null===y)break;if(_.push(y),!g)break;""===String(y[0])&&(u.lastIndex=a(d,o(u.lastIndex),v))}for(var b,x="",w=0,j=0;j<_.length;j++){y=_[j];for(var S=String(y[0]),P=c(h(s(y.index),d.length),0),I=[],F=1;F<y.length;F++)I.push(void 0===(b=y[F])?b:String(b));var C=y.groups;if(f){var E=[S].concat(I,P,d);void 0!==C&&E.push(C);var O=String(e.apply(void 0,E))}else O=m(S,d,P,I,C,e);P>=w&&(x+=d.slice(w,P)+O,w=P+S.length)}return x+d.slice(w)}];function m(t,e,n,o,s,a){var l=n+t.length,c=o.length,h=f;return void 0!==s&&(s=r(s),h=d),i.call(a,h,(function(i,r){var a;switch(r.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(l);case"<":a=s[r.slice(1,-1)];break;default:var h=+r;if(0===h)return i;if(h>c){var d=u(h/10);return 0===d?i:d<=c?void 0===o[d-1]?r.charAt(1):o[d-1]+r.charAt(1):i}a=o[h-1]}return void 0===a?"":a}))}}))},1876:function(t,e,i){"use strict";var n=i(5364),r=i(7007),o=i(8364),s=i(6793),a=i(875),l=i(7787),c=i(1165),h=i(4253),u=Math.min,d=[].push,f=4294967295,p=!h((function(){RegExp(f,"y")}));i(8082)("split",2,(function(t,e,i,h){var m;return m="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var r=String(this);if(void 0===t&&0===e)return[];if(!n(t))return i.call(r,t,e);for(var o,s,a,l=[],h=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),u=0,p=void 0===e?f:e>>>0,m=new RegExp(t.source,h+"g");(o=c.call(m,r))&&!((s=m.lastIndex)>u&&(l.push(r.slice(u,o.index)),o.length>1&&o.index<r.length&&d.apply(l,o.slice(1)),a=o[0].length,u=s,l.length>=p));)m.lastIndex===o.index&&m.lastIndex++;return u===r.length?!a&&m.test("")||l.push(""):l.push(r.slice(u)),l.length>p?l.slice(0,p):l}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)}:i,[function(i,n){var r=t(this),o=null==i?void 0:i[e];return void 0!==o?o.call(i,r,n):m.call(String(r),i,n)},function(t,e){var n=h(m,t,this,e,m!==i);if(n.done)return n.value;var c=r(t),d=String(this),g=o(c,RegExp),v=c.unicode,_=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(p?"y":"g"),y=new g(p?c:"^(?:"+c.source+")",_),b=void 0===e?f:e>>>0;if(0===b)return[];if(0===d.length)return null===l(y,d)?[d]:[];for(var x=0,w=0,j=[];w<d.length;){y.lastIndex=p?w:0;var S,P=l(y,p?d:d.slice(w));if(null===P||(S=u(a(y.lastIndex+(p?0:w)),d.length))===x)w=s(d,w,v);else{if(j.push(d.slice(x,w)),j.length===b)return j;for(var I=1;I<=P.length-1;I++)if(j.push(P[I]),j.length===b)return j;w=x=S}}return j.push(d.slice(x)),j}]}))},8184:function(t,e,i){"use strict";var n=i(9824),r=i(1616);t.exports=i(5795)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return n.def(r(this,"Set"),t=0===t?0:t,t)}},n)},9115:function(t,e,i){"use strict";var n=i(4496)(!0);i(2923)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})}))},1181:function(t,e,i){for(var n=i(6997),r=i(7184),o=i(7234),s=i(3816),a=i(7728),l=i(2803),c=i(6314),h=c("iterator"),u=c("toStringTag"),d=l.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=r(f),m=0;m<p.length;m++){var g,v=p[m],_=f[v],y=s[v],b=y&&y.prototype;if(b&&(b[h]||a(b,h,d),b[u]||a(b,u,v),l[v]=d,_))for(g in n)b[g]||o(b,g,n[g],!0)}}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,i),o.exports}i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,{a:e}),e},i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};!function(){"use strict";i.r(n),i.d(n,{default:function(){return C}}),i(8837),i(2310);var t=window.django.jQuery,e=window.grappelli,r=(i(9357),i(9371),i(110),i(1876),i(8184),i(9115),i(6253),i(6997),i(1181),i(6059),i(1466),i(75),i(3946),{});if(t.fn.djnData=function(e){var i=(t(this).data("inlineFormset")||{}).nestedOptions||{};return e?i[e]:i},t.fn.djangoPrefixIndex=function(){var t,e,i,n,o,s,a=this.length>1?this.first():this,l=a.attr("id"),c=a.attr("name"),h=a.attr("for");if((o=r[l])||(o=r[c])||(o=r[h]))return o;if(l&&!t&&(t=(l.match(/^(.*)\-group$/)||[null,null])[1]),l&&!t&&a.is(".djn-item")&&l.match(/\d+$/)){var u=l.match(/(.*?)\-(\d+)$/)||[null,null,null];n=u[0],t=u[1],s=u[2]}if(t){if("id_"==t.substr(0,3)&&(t=t.substr(3)),!document.getElementById(t+"-group"))return null}else if((e=a.closest(".djn-inline-form")).length){var d=e.attr("id").match(/(.*?)\-(\d+)$/)||[null,null,null];n=d[0],t=d[1],s=d[2]}else{if(!(i=a.closest(".djn-group")).length)return null;t=((i.attr("id")||"").match(/^(.*)\-group$/)||[null,null])[1]}return n&&(r[n]=[t,s]),[t,s]},t.fn.djangoFormPrefix=function(){var t=this.djangoPrefixIndex();return t&&t[1]?t[0]+"-"+t[1]+"-":null},t.fn.djangoFormIndex=function(){var t=this.djangoPrefixIndex();return t&&t[1]?parseInt(t[1],10):null},t.fn.djangoFormsetPrefix=function(){var t=this.djangoPrefixIndex();return t?t[0]:null},t.fn.djangoFormsetForms=function(){var e=[];return this.each((function(){var i,n=t(this).djangoFormsetPrefix(),r=n?t("#"+n+"-group"):null;if(n&&r.length){i=r.find(".djn-inline-form").filter((function(){return function(t,e,i){var n=t.getAttribute("id"),r=n.substr(i.length+1);return 0===n.indexOf(i)&&!r.match(/\D/)}(this,0,n)}));var o=i.toArray().sort((function(e,i){return t(e).djangoFormIndex()-t(i).djangoFormIndex}));Array.prototype.push.apply(e,o)}})),this.pushStack(e)},"function"!=typeof t.djangoFormField&&(t.djangoFormField=function(e,i,n){var r,o=t([]);if((r=i.match(/^(.+)\-(\d+)\-$/))&&(i=r[1],n=r[2]),n=parseInt(n,10),isNaN(n))return o;var s=i+"-"+n+"-";if("*"==e)return t('*[name^="'+s+'"]').filter((function(){return-1===t(this).attr("name").substring(s.length).indexOf("-")}));var a=t("#id_"+s+e);if(!a.length&&("pk"==e||"position"==e)){if(!(e=(t("#"+i+"-group").djnData("fieldNames")||{})[e]))return o;a=t("#id_"+s+e)}return a}),"function"!=typeof t.fn.djangoFormField&&(t.fn.djangoFormField=function(e,i){var n=this.djangoPrefixIndex(),r=t([]);if(!n)return r;var o=n[0];return void 0===i&&void 0===(i=n[1])?r:t.djangoFormField(e,o,i)}),"function"!=typeof t.fn.filterDjangoField){var o={};t.fn.filterDjangoField=function(e,i,n){var r,s;return void 0!==n?("string"==typeof n&&(n=parseInt(n,10)),"number"!=typeof n||isNaN(n)||(r=t("#id_"+e+"-"+n+"-"+i))):("object"!=typeof o[e]&&(o[e]={}),void 0===o[e][i]&&(o[e][i]=new RegExp("^"+e+"-\\d+-"+i+"$")),r=this.find('input[name$="'+i+'"]').filter((function(){return this.getAttribute("name").match(o[e][i])}))),r.length||"pk"!=i&&"position"!=i||((s=t("#"+e+"-group").djnData("fieldNames")||{})[i],s[i]!=i&&(r=t(this).filterDjangoField(e,s[i],n))),r}}var s,a,l,c,h,u=function(t){return(t+"").replace(/([\.\?\*\+\^\$\[\]\\\(\)\{\}\|\-])/g,"\\$1")};if(void 0===t.ui){var d=t;!function(t,e){function i(e,i){var r,o,s,a=e.nodeName.toLowerCase();return"area"===a?(o=(r=e.parentNode).name,!(!e.href||!o||"map"!==r.nodeName.toLowerCase())&&!!(s=t("img[usemap=#"+o+"]")[0])&&n(s)):(/input|select|textarea|button|object/.test(a)?!e.disabled:"a"===a&&e.href||i)&&n(e)}function n(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter((function(){return"hidden"===t.css(this,"visibility")})).length}var r=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,n){return"number"==typeof i?this.each((function(){var e=this;setTimeout((function(){t(e).focus(),n&&n.call(e)}),i)})):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter((function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))})).eq(0):this.parents().filter((function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))})).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var n,r,o=t(this[0]);o.length&&o[0]!==document;){if(("absolute"===(n=o.css("position"))||"relative"===n||"fixed"===n)&&(r=parseInt(o.css("zIndex"),10),!isNaN(r)&&0!==r))return r;o=o.parent()}return 0},uniqueId:function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++r)}))},removeUniqueId:function(){return this.each((function(){o.test(this.id)&&t(this).removeAttr("id")}))}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo((function(e){return function(i){return!!t.data(i,e)}})):function(e,i,n){return!!t.data(e,n[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var n=t.attr(e,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(e,!r)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],(function(i,n){function r(e,i,n,r){return t.each(o,(function(){i-=parseFloat(t.css(e,"padding"+this))||0,n&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),r&&(i-=parseFloat(t.css(e,"margin"+this))||0)})),i}var o="Width"===n?["Left","Right"]:["Top","Bottom"],s=n.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(i){return i===e?a["inner"+n].call(this):this.each((function(){t(this).css(s,r(this,i)+"px")}))},t.fn["outer"+n]=function(e,i){return"number"!=typeof e?a["outer"+n].call(this,e):this.each((function(){t(this).css(s,r(this,e,!0,i)+"px")}))}})),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",(function(t){t.preventDefault()}))},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,n){var r,o=t.ui[e].prototype;for(r in n)o.plugins[r]=o.plugins[r]||[],o.plugins[r].push([i,n[r]])},call:function(t,e,i){var n,r=t.plugins[e];if(r&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(n=0;r.length>n;n++)t.options[r[n][0]]&&r[n][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",r=!1;return e[n]>0||(e[n]=1,r=e[n]>0,e[n]=0,r)}})}(d),s=d,l=0,c=Array.prototype.slice,h=s.cleanData,s.cleanData=function(t){for(var e,i=0;null!=(e=t[i]);i++)try{s(e).triggerHandler("remove")}catch(t){}h(t)},s.widget=function(t,e,i){var n,r,o,l,c={},h=t.split(".")[0];t=t.split(".")[1],n=h+"-"+t,i||(i=e,e=s.Widget),s.expr[":"][n.toLowerCase()]=function(t){return!!s.data(t,n)},s[h]=s[h]||{},r=s[h][t],o=s[h][t]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),a):new o(t,e)},s.extend(o,r,{version:i.version,_proto:s.extend({},i),_childConstructors:[]}),(l=new e).options=s.widget.extend({},l.options),s.each(i,(function(t,i){return s.isFunction(i)?(c[t]=function(){var n=function(){return e.prototype[t].apply(this,arguments)},r=function(i){return e.prototype[t].apply(this,i)};return function(){var t,e=this._super,o=this._superApply;return this._super=n,this._superApply=r,t=i.apply(this,arguments),this._super=e,this._superApply=o,t}}(),a):(c[t]=i,a)})),o.prototype=s.widget.extend(l,{widgetEventPrefix:r?l.widgetEventPrefix:t},c,{constructor:o,namespace:h,widgetName:t,widgetFullName:n}),r?(s.each(r._childConstructors,(function(t,e){var i=e.prototype;s.widget(i.namespace+"."+i.widgetName,o,e._proto)})),delete r._childConstructors):e._childConstructors.push(o),s.widget.bridge(t,o)},s.widget.extend=function(t){for(var e,i,n=c.call(arguments,1),r=0,o=n.length;o>r;r++)for(e in n[r])i=n[r][e],n[r].hasOwnProperty(e)&&i!==a&&(t[e]=s.isPlainObject(i)?s.isPlainObject(t[e])?s.widget.extend({},t[e],i):s.widget.extend({},i):i);return t},s.widget.bridge=function(t,e){var i=e.prototype.widgetFullName||t;s.fn[t]=function(n){var r="string"==typeof n,o=c.call(arguments,1),l=this;return n=!r&&o.length?s.widget.extend.apply(null,[n].concat(o)):n,r?this.each((function(){var e,r=s.data(this,i);return r?s.isFunction(r[n])&&"_"!==n.charAt(0)?(e=r[n].apply(r,o))!==r&&e!==a?(l=e&&e.jquery?l.pushStack(e.get()):e,!1):a:s.error("no such method '"+n+"' for "+t+" widget instance"):s.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+n+"'")})):this.each((function(){var t=s.data(this,i);t?t.option(n||{})._init():s.data(this,i,new e(n,this))})),l}},s.Widget=function(){},s.Widget._childConstructors=[],s.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,e){e=s(e||this.defaultElement||this)[0],this.element=s(e),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=s.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=s(),this.hoverable=s(),this.focusable=s(),e!==this&&(s.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=s(e.style?e.ownerDocument:e.document||e),this.window=s(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:s.noop,_getCreateEventData:s.noop,_create:s.noop,_init:s.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(s.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:s.noop,widget:function(){return this.element},option:function(t,e){var i,n,r,o=t;if(0===arguments.length)return s.widget.extend({},this.options);if("string"==typeof t)if(o={},i=t.split("."),t=i.shift(),i.length){for(n=o[t]=s.widget.extend({},this.options[t]),r=0;i.length-1>r;r++)n[i[r]]=n[i[r]]||{},n=n[i[r]];if(t=i.pop(),e===a)return n[t]===a?null:n[t];n[t]=e}else{if(e===a)return this.options[t]===a?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,e,i){var n,r=this;"boolean"!=typeof t&&(i=e,e=t,t=!1),i?(e=n=s(e),this.bindings=this.bindings.add(e)):(i=e,e=this.element,n=this.widget()),s.each(i,(function(i,o){function l(){return t||!0!==r.options.disabled&&!s(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):a}"string"!=typeof o&&(l.guid=o.guid=o.guid||l.guid||s.guid++);var c=i.match(/^(\w+)\s*(.*)$/),h=c[1]+r.eventNamespace,u=c[2];u?n.delegate(u,h,l):e.bind(h,l)}))},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){var i=this;return setTimeout((function(){return("string"==typeof t?i[t]:t).apply(i,arguments)}),e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){s(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){s(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){s(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){s(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,e,i){var n,r,o=this.options[t];if(i=i||{},(e=s.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],r=e.originalEvent)for(n in r)n in e||(e[n]=r[n]);return this.element.trigger(e,i),!(s.isFunction(o)&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},s.each({show:"fadeIn",hide:"fadeOut"},(function(t,e){s.Widget.prototype["_"+t]=function(i,n,r){"string"==typeof n&&(n={effect:n});var o,a=n?!0===n||"number"==typeof n?e:n.effect||e:t;"number"==typeof(n=n||{})&&(n={duration:n}),o=!s.isEmptyObject(n),n.complete=r,n.delay&&i.delay(n.delay),o&&s.effects&&s.effects.effect[a]?i[t](n):a!==t&&i[a]?i[a](n.duration,n.easing,r):i.queue((function(e){s(this)[t](),r&&r.call(i[0]),e()}))}})),function(t){var e=!1;t(document).mouseup((function(){e=!1})),t.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,(function(t){return e._mouseDown(t)})).bind("click."+this.widgetName,(function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0})),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,r=1===i.which,o=!("string"!=typeof this.options.cancel||!i.target.nodeName)&&t(i.target).closest(this.options.cancel).length;return!(r&&!o&&this._mouseCapture(i)&&(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){n.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(i),!this._mouseStarted)?(i.preventDefault(),0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,0)))}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(d),function(t,e){function i(t,e,i){return[parseFloat(t[0])*(f.test(t[0])?e/100:1),parseFloat(t[1])*(f.test(t[1])?i/100:1)]}function n(e,i){return parseInt(t.css(e,i),10)||0}function r(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var o,s=Math.max,a=Math.abs,l=Math.round,c=/left|center|right/,h=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,f=/%$/,p=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==o)return o;var e,i,n=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=n.children()[0];return t("body").append(n),e=r.offsetWidth,n.css("overflow","scroll"),e===(i=r.offsetWidth)&&(i=n[0].clientWidth),n.remove(),o=e-i},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),n=e.isWindow?"":e.element.css("overflow-y"),r="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:r?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),n=t.isWindow(i[0]);return{element:i,isWindow:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:n?i.width():i.outerWidth(),height:n?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return p.apply(this,arguments);e=t.extend({},e);var o,f,m,g,v,_,y=t(e.of),b=t.position.getWithinInfo(e.within),x=t.position.getScrollInfo(b),w=(e.collision||"flip").split(" "),j={};return _=r(y),y[0].preventDefault&&(e.at="left top"),f=_.width,m=_.height,g=_.offset,v=t.extend({},g),t.each(["my","at"],(function(){var t,i,n=(e[this]||"").split(" ");1===n.length&&(n=c.test(n[0])?n.concat(["center"]):h.test(n[0])?["center"].concat(n):["center","center"]),n[0]=c.test(n[0])?n[0]:"center",n[1]=h.test(n[1])?n[1]:"center",t=u.exec(n[0]),i=u.exec(n[1]),j[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(n[0])[0],d.exec(n[1])[0]]})),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=f:"center"===e.at[0]&&(v.left+=f/2),"bottom"===e.at[1]?v.top+=m:"center"===e.at[1]&&(v.top+=m/2),o=i(j.at,f,m),v.left+=o[0],v.top+=o[1],this.each((function(){var r,c,h=t(this),u=h.outerWidth(),d=h.outerHeight(),p=n(this,"marginLeft"),_=n(this,"marginTop"),S=u+p+n(this,"marginRight")+x.width,P=d+_+n(this,"marginBottom")+x.height,I=t.extend({},v),F=i(j.my,h.outerWidth(),h.outerHeight());"right"===e.my[0]?I.left-=u:"center"===e.my[0]&&(I.left-=u/2),"bottom"===e.my[1]?I.top-=d:"center"===e.my[1]&&(I.top-=d/2),I.left+=F[0],I.top+=F[1],t.support.offsetFractions||(I.left=l(I.left),I.top=l(I.top)),r={marginLeft:p,marginTop:_},t.each(["left","top"],(function(i,n){t.ui.position[w[i]]&&t.ui.position[w[i]][n](I,{targetWidth:f,targetHeight:m,elemWidth:u,elemHeight:d,collisionPosition:r,collisionWidth:S,collisionHeight:P,offset:[o[0]+F[0],o[1]+F[1]],my:e.my,at:e.at,within:b,elem:h})})),e.using&&(c=function(t){var i=g.left-I.left,n=i+f-u,r=g.top-I.top,o=r+m-d,l={target:{element:y,left:g.left,top:g.top,width:f,height:m},element:{element:h,left:I.left,top:I.top,width:u,height:d},horizontal:0>n?"left":i>0?"right":"center",vertical:0>o?"top":r>0?"bottom":"middle"};u>f&&f>a(i+n)&&(l.horizontal="center"),d>m&&m>a(r+o)&&(l.vertical="middle"),l.important=s(a(i),a(n))>s(a(r),a(o))?"horizontal":"vertical",e.using.call(this,t,l)}),h.offset(t.extend(I,{using:c}))}))},t.ui.position={fit:{left:function(t,e){var i,n=e.within,r=n.isWindow?n.scrollLeft:n.offset.left,o=n.width,a=t.left-e.collisionPosition.marginLeft,l=r-a,c=a+e.collisionWidth-o-r;e.collisionWidth>o?l>0&&0>=c?(i=t.left+l+e.collisionWidth-o-r,t.left+=l-i):t.left=c>0&&0>=l?r:l>c?r+o-e.collisionWidth:r:l>0?t.left+=l:c>0?t.left-=c:t.left=s(t.left-a,t.left)},top:function(t,e){var i,n=e.within,r=n.isWindow?n.scrollTop:n.offset.top,o=e.within.height,a=t.top-e.collisionPosition.marginTop,l=r-a,c=a+e.collisionHeight-o-r;e.collisionHeight>o?l>0&&0>=c?(i=t.top+l+e.collisionHeight-o-r,t.top+=l-i):t.top=c>0&&0>=l?r:l>c?r+o-e.collisionHeight:r:l>0?t.top+=l:c>0?t.top-=c:t.top=s(t.top-a,t.top)}},flip:{left:function(t,e){var i,n,r=e.within,o=r.offset.left+r.scrollLeft,s=r.width,l=r.isWindow?r.scrollLeft:r.offset.left,c=t.left-e.collisionPosition.marginLeft,h=c-l,u=c+e.collisionWidth-s-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,f="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];0>h?(0>(i=t.left+d+f+p+e.collisionWidth-s-o)||a(h)>i)&&(t.left+=d+f+p):u>0&&((n=t.left-e.collisionPosition.marginLeft+d+f+p-l)>0||u>a(n))&&(t.left+=d+f+p)},top:function(t,e){var i,n,r=e.within,o=r.offset.top+r.scrollTop,s=r.height,l=r.isWindow?r.scrollTop:r.offset.top,c=t.top-e.collisionPosition.marginTop,h=c-l,u=c+e.collisionHeight-s-l,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,p=-2*e.offset[1];0>h?(n=t.top+d+f+p+e.collisionHeight-s-o,t.top+d+f+p>h&&(0>n||a(h)>n)&&(t.top+=d+f+p)):u>0&&(i=t.top-e.collisionPosition.marginTop+d+f+p-l,t.top+d+f+p>u&&(i>0||u>a(i))&&(t.top+=d+f+p))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,n,r,o,s=document.getElementsByTagName("body")[0],a=document.createElement("div");for(o in e=document.createElement(s?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},s&&t.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"}),n)e.style[o]=n[o];e.appendChild(a),(i=s||document.documentElement).insertBefore(e,i.firstChild),a.style.cssText="position: absolute; left: 10.7432222px;",r=t(a).offset().left,t.support.offsetFractions=r>10&&11>r,e.innerHTML="",i.removeChild(e)}()}(d)}t.widget("ui.djnsortable",t.ui.mouse,{version:"@VERSION",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_isOverAxis:function(t,e,i){return t>=e&&t<e+i},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===t.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display"))),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var n=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(e);var r=null;if(t(e.target).parents().each((function(){if(t.data(this,n.widgetName+"-item")==n)return r=t(this),!1})),t.data(e.target,n.widgetName+"-item")==n&&(r=t(e.target)),!r)return!1;if(this.options.handle&&!i){var o=!1,s=t.fn.addBack?"addBack":"andSelf";if(t(this.options.handle,r).find("*")[s]().each((function(){this==e.target&&(o=!0)})),!o)return!1}return this.currentItem=r,this._removeCurrentsFromItems(),!0},_mouseStart:function(e,i,n){var r=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&(t("body").css("cursor")&&(this._storedCursor=t("body").css("cursor")),t("body").css("cursor",r.cursor)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(var o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var i=this.options,n=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<i.scrollSensitivity?this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop+i.scrollSpeed:e.pageY-this.overflowOffset.top<i.scrollSensitivity&&(this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop-i.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<i.scrollSensitivity?this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft+i.scrollSpeed:e.pageX-this.overflowOffset.left<i.scrollSensitivity&&(this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft-i.scrollSpeed)):(e.pageY-t(document).scrollTop()<i.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-i.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<i.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+i.scrollSpeed)),e.pageX-t(document).scrollLeft()<i.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-i.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<i.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+i.scrollSpeed))),!1!==n&&t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)}this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(var r=this.items.length-1;r>=0;r--){var o=this.items[r],s=o.item[0],a=this._intersectsWithPointer(o);if(a&&o.instance===this.currentContainer&&!(s==this.currentItem[0]||this.placeholder[1==a?"next":"prev"]()[0]==s||t.contains(this.placeholder[0],s)||"semi-dynamic"==this.options.type&&t.contains(this.element[0],s))){if(this.direction=1==a?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(o))break;this._rearrange(e,o),this._trigger("change",e,this._uiHash());break}}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var n=this,r=this.placeholder.offset();this.reverting=!0,t(this.helper).animate({left:r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,(function(){n._clear(e)}))}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},t(i).each((function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/);i&&n.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))})),!n.length&&e.key&&n.push(e.key+"="),n.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},i.each((function(){n.push(t(e.item||this).attr(e.attribute||"id")||"")})),n},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,n=this.positionAbs.top,r=n+this.helperProportions.height,o=t.left,s=o+t.width,a=t.top,l=a+Math.max(10,t.height),c=this.offset.click.top,h=this.offset.click.left,u=n+c>a&&n+c<l&&e+h>o&&e+h<s;return"pointer"==this.options.tolerance||this.options.forcePointerForContainers||"pointer"!=this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?u:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<s&&a<n+this.helperProportions.height/2&&r-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,Math.max(10,t.height)),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=e&&i,r=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return!!n&&(this.floating?o&&"right"==o||"down"==r?2:1:r&&("down"==r?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+Math.max(10,t.height)/2,Math.max(10,t.height)),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return this.floating&&r?"right"==r&&i||"left"==r&&!i:n&&("down"==n&&e||"up"==n&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i=[],n=[],r=this._connectWith();if(r&&e)for(var o=r.length-1;o>=0;o--)for(var s=t(r[o]),a=s.length-1;a>=0;a--){var l=t.data(s[a],this.widgetName);l&&l!=this&&!l.options.disabled&&n.push([t.isFunction(l.options.items)?l.options.items.call(l.element):t(l.options.items,l.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),l])}for(n.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),o=n.length-1;o>=0;o--)n[o][0].each((function(){i.push(this)}));return t(i)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,(function(t){for(var i=0;i<e.length;i++)if(e[i]==t.item[0])return!1;return!0}))},_refreshItems:function(e){this.items=[],this.containers=[this];var i=this.items,n=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],r=this._connectWith();if(r&&this.ready)for(var o=r.length-1;o>=0;o--)for(var s=t(r[o]),a=s.length-1;a>=0;a--){var l=t.data(s[a],this.widgetName);l&&l!=this&&!l.options.disabled&&(n.push([t.isFunction(l.options.items)?l.options.items.call(l.element[0],e,{item:this.currentItem}):t(l.options.items,l.element),l]),this.containers.push(l))}for(o=n.length-1;o>=0;o--)for(var c=n[o][1],h=n[o][0],u=(a=0,h.length);a<u;a++){var d=t(h[a]);d.data(this.widgetName+"-item",c),i.push({item:d,instance:c,width:0,height:0,left:0,top:0})}},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var i=this.items.length-1;i>=0;i--){var n=this.items[i];if(n.instance==this.currentContainer||!this.currentContainer||n.item[0]==this.currentItem[0]){var r=this.options.toleranceElement?t(this.options.toleranceElement,n.item):n.item;e||(n.width=r.outerWidth(),n.height=r.outerHeight());var o=r.offset();n.left=o.left,n.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){var i=(e=e||this).options;if(!i.placeholder||i.placeholder.constructor==String){var n=i.placeholder;i.placeholder={element:function(){var i=t(document.createElement(e.currentItem[0].nodeName)).addClass(n||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return n||(i.style.visibility="hidden"),i},update:function(t,r){n&&!i.forcePlaceholderSize||(r.height()||r.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),r.width()||r.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}}e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),i.placeholder.update(e,e.placeholder)},_contactContainers:function(e){for(var i=null,n=null,r=this.containers.length-1;r>=0;r--)if(!t.contains(this.currentItem[0],this.containers[r].element[0]))if(this._intersectsWith(this.containers[r].containerCache)){if(i&&t.contains(this.containers[r].element[0],i.element[0]))continue;i=this.containers[r],n=r}else this.containers[r].containerCache.over&&(this.containers[r]._trigger("out",e,this._uiHash(this)),this.containers[r].containerCache.over=0);if(i)if(1===this.containers.length)this.containers[n]._trigger("over",e,this._uiHash(this)),this.containers[n].containerCache.over=1;else{for(var o=1e4,s=null,a=this.containers[n].floating?"left":"top",l=this.containers[n].floating?"width":"height",c=this.positionAbs[a]+this.offset.click[a],h=this.items.length-1;h>=0;h--)if(t.contains(this.containers[n].element[0],this.items[h].item[0])&&this.items[h].item[0]!=this.currentItem[0]){var u=this.items[h].item.offset()[a],d=!1;Math.abs(u-c)>Math.abs(u+Math.max(10,this.items[h][l])-c)&&(d=!0,u+=this.items[h][l]),Math.abs(u-c)<o&&(o=Math.abs(u-c),s=this.items[h],this.direction=d?"up":"down")}if(!s&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[n],s?this._rearrange(e,s,null,!0):this._rearrange(e,null,this.containers[n].element,!0),this._trigger("change",e,this._uiHash()),this.containers[n]._trigger("change",e,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[n]._trigger("over",e,this._uiHash(this)),this.containers[n].containerCache.over=1}},_createHelper:function(e){var i=this.options,n=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"==i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||t("parent"!=i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(""==n[0].style.width||i.forceHelperSize)&&n.width(this.currentItem.width()),(""==n[0].style.height||i.forceHelperSize)&&n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),"document"!=e.containment&&"window"!=e.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),!/^(document|window|parent)$/.test(e.containment)){var i=t(e.containment)[0],n=t(e.containment).offset(),r="hidden"!=t(i).css("overflow");this.containment=[n.left+(parseInt(t(i).css("borderLeftWidth"),10)||0)+(parseInt(t(i).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(i).css("borderTopWidth"),10)||0)+(parseInt(t(i).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t(i).css("borderLeftWidth"),10)||0)-(parseInt(t(i).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t(i).css("borderTopWidth"),10)||0)-(parseInt(t(i).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,i){i||(i=this.position);var n="absolute"==e?1:-1,r=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),o=/(html|body)/i.test(r[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():o?0:r.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():o?0:r.scrollLeft())*n}},_generatePosition:function(e){var i=this.options,n="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(n[0].tagName);"relative"!=this.cssPosition||this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());var o=e.pageX,s=e.pageY;if(this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),i.grid)){var a=this.originalPageY+Math.round((s-this.originalPageY)/i.grid[1])*i.grid[1];s=this.containment&&(a-this.offset.click.top<this.containment[1]||a-this.offset.click.top>this.containment[3])?a-this.offset.click.top<this.containment[1]?a+i.grid[1]:a-i.grid[1]:a;var l=this.originalPageX+Math.round((o-this.originalPageX)/i.grid[0])*i.grid[0];o=this.containment&&(l-this.offset.click.left<this.containment[0]||l-this.offset.click.left>this.containment[2])?l-this.offset.click.left<this.containment[0]?l+i.grid[0]:l-i.grid[0]:l}return{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():r?0:n.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():r?0:n.scrollLeft())}},_rearrange:function(t,e,i,n){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"==this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var r=this.counter;this._delay((function(){r==this.counter&&this.refreshPositions(!n)}))},_clear:function(e,i){this.reverting=!1;var n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]==this.currentItem[0]){for(var r in this._storedCSS)"auto"!=this._storedCSS[r]&&"static"!=this._storedCSS[r]||(this._storedCSS[r]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!i&&n.push((function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})),!this.fromOutside&&this.domPosition.prev==this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent==this.currentItem.parent()[0]||i||n.push((function(t){this._trigger("update",t,this._uiHash())})),this!==this.currentContainer&&(i||(n.push((function(t){this._trigger("remove",t,this._uiHash())})),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),r=this.containers.length-1;r>=0;r--)i||n.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over&&(n.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over=0);if(this._storedCursor&&t("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!i){for(this._trigger("beforeStop",e,this._uiHash()),r=0;r<n.length;r++)n[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(i||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null,!i){for(r=0;r<n.length;r++)n[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_delay:function(t,e){var i=this;return setTimeout((function(){return("string"==typeof t?i[t]:t).apply(i,arguments)}),e||0)},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),"function"!=typeof t.fn.nearest&&(t.fn.nearest=function(e){var i=[],n=this,r=1e4;return n.find(e).each((function(){var e=t(this).parentsUntil(n).length;e<r?(r=e,i=[this]):e==r&&i.push(this)})),this.pushStack(i,"nearest",[e])});var f=0,p="djn"+(""+Math.random()).replace(/\D/g,""),m=function(e,i){if(!e||!e.element||e.element[0]!=i){var n=t(i),r=t.extend({},e.options);if(r.connectWith=[e.element],!n.data(e.widgetName)){n[e.widgetName].call(n,r);for(var o=n.data(e.widgetName),s=0;s<e.options.connectWith.length;s++){var a=e.options.connectWith[s];o.addToConnectWith(a);var l=a.data(e.widgetName);l&&l.addToConnectWith(n)}return e.addToConnectWith(n),o}}};function g(e){var i,n=0,r=1,o=t("#"+e+"-group"),s=o.djnData(),a=s.fieldNames,l=s.formsetFkName,c=e.match(/^(.*)\-(\d+)-[^\-]+(?:\-\d+)?$/)||[],h=c[1],d=c[2],f=(s.sortableOptions||{}).sortableExcludes||[];if(f.push(l),h){var p=t("#"+h+"-group"),m=p.djnData("fieldNames").pk;i=p.filterDjangoField(h,m,d).val()}l&&void 0!==i&&o.filterDjangoField(e,l).val(i).trigger("change"),o.find(".djn-inline-form").each((function(){if(!this.id||"-empty"==this.id.substr(-6))return!0;var i=new RegExp("^(?:id_)?"+u(e)+"\\-\\d+$");if(!this.id.match(i))return!0;var o=t(this),s=o.djangoPrefixIndex()||[null,null],l=s[0],c=l+"-"+s[1]+"-";if(l){var h=o.find("> h3 > .inline_label");h.length&&h.html(h.html().replace(/(#\d+)/g,"#"+r)),r++;var d,p=o.djangoFormField("*"),m=!1;p.each((function(){var e=t(this);if(e.is(":input[type!=radio][type!=checkbox],input:checked")){var i=e.val()||"file"==e.attr("type")&&e.siblings("a").length,n=e.attr("name").substring(c.length);n==a.position&&(d=e),i&&-1===t.inArray(n,f)&&(m=!0)}})),m&&d&&(d.val(n).trigger("change"),n++)}}))}t.widget("ui.nestedSortable",t.ui.djnsortable,{options:{tabSize:20,disableNesting:"ui-nestedSortable-no-nesting",errorClass:"ui-nestedSortable-error",nestedContainerSelector:":not(*)",doNotClear:!1,createContainerElement:function(e){return t(document.createElement("ol"))},containerElementSelector:"ol",listItemSelector:"li",items:"> li",maxLevels:0,revertOnError:1,protectRoot:!1,rootID:null,rtl:!1,fixedNestingDepth:!1,showErrorDiv:!0,keepInParent:!1,isAllowed:function(t,e){return!0},canConnectWith:function(t,e,i){if(t.data("inlineModel")!==e.data("inlineModel"))return!1;var n=e.data(i.widgetName);return!(i.options.fixedNestingDepth||n&&n.options.fixedNestingDepth)||i._getLevel(t)===i._getLevel(e)}},_createWidget:function(e,i){var n=t(i||this.defaultElement||this),r=n.data("djnsortableOptions");return i=n[0],r&&(e=t.extend({},e,r)),t.ui.djnsortable.prototype._createWidget.call(this,e,i)},_create:function(){this.element.data("uiNestedSortable")&&this.element.data("nestedSortable",this.element.data("uiNestedSortable")),this.element.data("ui-nestedSortable")&&this.element.data("nestedSortable",this.element.data("ui-nestedSortable")),this.element.data("djnsortable",this.element.data("nestedSortable")),this.element.data("uiNestedSortable")&&this.element.data("uiSortable",this.element.data("nestedSortable")),t.ui.djnsortable.prototype._create.apply(this,arguments),this._connectWithMap={};var e=this,i=this.options,n=t(document),r=i.connectWith;if(!r||"string"==typeof r){if(this.options.connectWith=[],"string"==typeof r)for(var o=this._connectWith(),s=0;s<o.length;s++)this.addToConnectWith(t(o[s]));n.on("djnesting:init.nestedSortable",i.containerElementSelector,(function(t){m(e,this)})),this.element.find(i.containerElementSelector+":not(.subarticle-wrapper)").each((function(i,n){t(n).closest("[data-inline-formset]").attr("id").indexOf("-empty")>-1||m(e,n)}))}n.trigger("nestedSortable:created",[this]),n.on("nestedSortable:created.nestedSortable",(function(t,i){i.addToConnectWith(e.element),e.addToConnectWith(i.element)}))},addToConnectWith:function(e){var i,n=this,r=void 0!==e.selector?e:t(e);r.length>1?r.each((function(e,i){n.addToConnectWith(t(i))})):(void 0===(i=e[0][p])&&(i=e[0][p]=++f),"string"!=typeof this.options.connectWith&&(this._connectWithMap[i]||(this.options.connectWith.push(e),this._connectWithMap[i]=1)))},_destroy:function(){return this.element.removeData("nestedSortable").unbind(".nestedSortable"),t(document).unbind(".nestedSortable"),t.ui.djnsortable.prototype.destroy.apply(this,arguments)},_intersectsWithPointer:function(e){var i=e.item[0],n=this.options,r=t.ui.djnsortable.prototype._intersectsWithPointer.apply(this,arguments);if(this.lastItemElement=null,!r)return r;if(e.instance!==this.currentContainer)return!1;var o=t(i);return n.fixedNestingDepth&&this._getLevel(this.currentItem)===1+this._getLevel(o)&&(i=(o=function(){var e=n.containerElementSelector,i=o.find(".djn-item");if(1!=i.length)return o;if(!i.is(".djn-no-drag,.djn-thead"))return o;var r=o.closest(e);return r.length?r[0]!=i.closest(e).closest(e)[0]?o:t(i[0]):o}())[0]),!(i==this.currentItem[0]||this.placeholder[1==r?"next":"prev"]()[0]==i||t.contains(this.placeholder[0],i)||"semi-dynamic"==this.options.type&&t.contains(this.element[0],i)||n.keepInParent&&i.parentNode!=this.placeholder[0].parentNode||n.fixedNestingDepth&&this._getLevel(this.currentItem)!==this._getLevel(o)||!n.showErrorDiv&&!n.isAllowed.call(this,this.currentItem[0],i.parentNode,this.placeholder))&&(this.lastItemElement=i,r)},_contactContainers:function(e){this.lastItemElement&&this._clearEmpty(this.lastItemElement);var i=this.options,n=this.placeholder.closest(i.listItemSelector),r=n.length&&n.closest(".ui-sortable").length?n:null,o=this._getLevel(this.placeholder),s=this._getChildLevels(this.helper),a=this.placeholder.attr("class"),l=" "+a+" ";if(-1==l.indexOf(" ui-sortable-nested-level-"+o+" ")){var c,h=l.indexOf(" ui-sortable-nested-level-")-1;c=h>-1?a.substring(0,h):a,this.placeholder.attr("class",c+" ui-sortable-nested-level-"+o)}var u=this.placeholder[0].previousSibling?t(this.placeholder[0].previousSibling):null;if(null!=u)for(;!u.is(this.options.listItemSelector)||u[0]==this.currentItem[0]||u[0]==this.helper[0];){if(!u[0].previousSibling){u=null;break}u=t(u[0].previousSibling)}var d=this.placeholder[0].nextSibling?t(this.placeholder[0].nextSibling):null;if(null!=d)for(;!d.is(this.options.listItemSelector)||d[0]==this.currentItem[0]||d[0]==this.helper[0];){if(!d[0].nextSibling){d=null;break}d=t(d[0].nextSibling)}this.beyondMaxLevels=0;var f=this;if(this.refreshPositions(),!i.fixedNestingDepth&&null!=r&&null==d&&(i.rtl&&this.positionAbs.left+this.helper.outerWidth()>r.offset().left+r.outerWidth()||!i.rtl&&this.positionAbs.left<r.offset().left))r.after(this.placeholder[0]),f=r.closest(i.containerElementSelector).data(this.widgetName)||f,this._clearEmpty(r[0]),this.refreshPositions(),this._trigger("change",e,this._uiHash());else if(i.fixedNestingDepth||null==u||u.is(".djn-no-drag,.djn-thead")||!(i.rtl&&this.positionAbs.left+this.helper.outerWidth()<u.offset().left+u.outerWidth()-i.tabSize||!i.rtl&&this.positionAbs.left>u.offset().left+i.tabSize))this._isAllowed(r,o,o+s);else{if(this._isAllowed(u,o,o+s),this.beyondMaxLevels>0)return t.ui.djnsortable.prototype._contactContainers.apply(this,arguments);var p;(p=u.nearest(i.containerElementSelector).first()).length||u.closest(i.nestedContainerSelector).length||(p=this.options.createContainerElement(u[0]),u.append(p)),p.length&&(p.append(this.placeholder),(f=p.data(this.widgetName))||(f=m(this,p[0])),this.refreshPositions()),this._trigger("change",e,this._uiHash())}t.ui.djnsortable.prototype._contactContainers.call(this,e)},_rearrange:function(e,i,n,r){var o=this.options;if(i&&"object"==typeof i&&i.item&&(this.lastRearrangedElement=i.item[0]),i&&"object"==typeof i&&i.item&&this.placeholder.closest(o.nestedContainerSelector).length){var s=this.placeholder.closest(o.listItemSelector),a="down"==this.direction?s.next(o.nestedContainerSelector):s;if(a.length&&a[0]==i.item[0]){this.counter=this.counter?++this.counter:1;var l=this.counter;return void this._delay((function(){l==this.counter&&this.refreshPositions(!r)}))}}t.ui.djnsortable.prototype._rearrange.apply(this,arguments)},_convertPositionTo:function(e,i){return this.previousTopOffset=this.placeholder.offset().top,t.ui.djnsortable.prototype._convertPositionTo.apply(this,arguments)},_clear:function(){t.ui.djnsortable.prototype._clear.apply(this,arguments),"object"==typeof this.lastRearrangedElement&&this.lastRearrangedElement.ownerDocument&&this._clearEmpty(this.lastRearrangedElement)},_mouseStop:function(e,i){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?t(this.domPosition.prev).after(this.placeholder):t(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",e,this._uiHash()));for(var n=this.items.length-1;n>=0;n--){var r=this.items[n].item[0];this._clearEmpty(r)}t.ui.djnsortable.prototype._mouseStop.apply(this,arguments)},toArray:function(e){var i=(e=t.extend(!0,{},this.options,e||{})).startDepthCount||0,n=[],r=2;n.push({item_id:e.rootID,parent_id:"none",depth:i,left:"1",right:2*(t(e.listItemSelector,this.element).length+1)});var o=function r(o,s,a){var l,c,h=a+1,u=t(o).children(e.containerElementSelector).find(e.items);return u.length>0&&(s++,u.each((function(){h=r(t(this),s,h)})),s--),l=t(o).attr(e.attribute||"id").match(e.expression||/(.+)[-=_](.+)/),c=s===i+1?e.rootID:t(o).parent(e.containerElementSelector).parent(e.items).attr(e.attribute||"id").match(e.expression||/(.+)[-=_](.+)/)[2],l&&n.push({item_id:l[2],parent_id:c,depth:s,left:a,right:h}),h+1};return t(this.element).children(e.listItemSelector).each((function(){r=o(this,i+1,r)})),n=n.sort((function(t,e){return t.left-e.left})),n},_clearEmpty:function(e){if(!this.options.doNotClear){var i=t(e);i.nearest(this.options.containerElementSelector).each((function(e,i){var n=t(i);if(!n.children().length){var r=n.data(this.widgetName);"object"==typeof r&&r.destroy&&r.destroy(),n.remove()}})),i.children().length||i.remove()}},_getLevel:function(t){var e,i=1,n=this.options;if(n.containerElementSelector)for(e=t.closest(n.containerElementSelector);e&&e.length>0&&!e.parent().is(".djn-group-root");)i++,e=e.parent().closest(n.containerElementSelector);return i},_getChildLevels:function(e,i){var n=this,r=this.options,o=0;return i=i||0,t(e).nearest(r.containerElementSelector).first().find(r.items).each((function(e,r){t(r).is(".djn-no-drag,.djn-thead")||(o=Math.max(n._getChildLevels(r,i+1),o))})),i?o+1:o},_isAllowed:function(e,i,n){var r=this.options,o=!!t(this.domPosition.parent).hasClass("ui-sortable"),s=r.maxLevels;e&&"object"==typeof e&&void 0===e.selector&&(e=t(e)),!r.isAllowed.call(this,this.currentItem,e,this.placeholder)||e&&e.hasClass(r.disableNesting)||r.protectRoot&&(null==e&&!o||o&&i>1)?(this.placeholder.addClass(r.errorClass),this.beyondMaxLevels=s<n&&0!=s?n-s:1):s<n&&0!=s?(this.placeholder.addClass(r.errorClass),this.beyondMaxLevels=n-s):(this.placeholder.removeClass(r.errorClass),this.beyondMaxLevels=0)},_connectWith:function(){for(var e=t.ui.djnsortable.prototype._connectWith.apply(this,arguments),i=[],n=this,r=0;r<e.length;r++){var o=t(e[r]);o.each((function(e,r){r!=n.element[0]&&n.options.canConnectWith(n.element,t(r),n)&&i.push(r)}))}return i},_removeCurrentsFromItems:function(){for(var t=this.currentItem.find(":data(sortable-item)"),e=0;e<this.items.length;e++)for(var i=0;i<t.length&&!(t[i]==this.items[e].item[0]&&(this.items.splice(e,1),e>=this.items.length));i++);},createContainerElement:function(e){if(!e.childNodes)throw new Error("Invalid element 'parent' passed to createContainerElement.");var i=this.options.createContainerElement.apply(this,arguments);return e.appendChild(i[0]),t(i)}}),t.ui.nestedSortable.prototype.options=t.extend({},t.ui.djnsortable.prototype.options,t.ui.nestedSortable.prototype.options);var v=function e(i){if(void 0===window.grp)return t(i);if(window.grp.jQuery.fn.init===t.fn.init)return t(i);var n=t(i);return i.prevObject&&(n.prevObject=e(i.prevObject)),n},_=function e(i){if(void 0===window.grp)return t(i);if(window.grp.jQuery.fn.init===t.fn.init)return t(i);var n=window.grp.jQuery(i);return i.prevObject&&(n.prevObject=e(i.prevObject)),n},y=void 0!==window.DJNesting?window.DJNesting:{};function b(t){return t.replace(/^\#?id_/,"").split(/-(?:empty|__prefix__|\d+)-/g).slice(0,-1).join("-")}function x(){var t;window.SelectFilter.init=(t=window.SelectFilter.init,function(e,i,n){e.match(/\-empty\-/)||t.apply(this,arguments)})}y.regexQuote=u,y.createSortable=function(e){return e.is(".djn-is-polymorphic"),e.find("> .djn-items, > .djn-fieldset > .djn-items, > .tabular > .module > .djn-items").nestedSortable({handle:["> h3.djn-drag-handler","> .djn-tools .drag-handler","> .djn-td > .djn-tools .djn-drag-handler","> .djn-tr > .is-sortable > .djn-drag-handler","> .djn-tr > .grp-tools-container .djn-drag-handler"].join(", "),items:"> .djn-item",forcePlaceholderSize:!0,placeholder:{element:function(e){var i=t(document.createElement(e[0].nodeName)).addClass(e[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(e.is(".djn-tbody")){var n=e.children(".djn-tr").eq(0),r=n.prop("tagName").toLowerCase(),o=t("<"+r+"></"+r+">");o.addClass(n.attr("class"));var s=n.children(".djn-td").eq(0).prop("tagName").toLowerCase(),a=0;n.children(".djn-td").each((function(e,i){a+=parseInt(t(i).attr("colspan"),10)||1})),o.append(t("<"+s+' colspan="'+a+'" class="djn-td grp-td"></'+s+">")),i.appendChild(o[0])}return i},update:function(t,e){var i=t.currentItem;if(i){var n=t.options;if(!n.className||n.forcePlaceholderSize){if(e.is(".djn-tbody")&&(e=e.children(".djn-tr").eq(0).children(".djn-td").eq(0)),!e.height()){var r=i.innerHeight(),o=parseInt(i.css("paddingTop")||0,10),s=parseInt(i.css("paddingBottom")||0,10);e.height(r-o-s)}if(!e.width()){var a=i.innerWidth(),l=parseInt(i.css("paddingLeft")||0,10),c=parseInt(i.css("paddingRight")||0,10);e.width(a-l-c)}}}}},helper:"clone",opacity:.6,maxLevels:0,connectWith:".djn-items",tolerance:"intersection",isAllowed:function(t,e){if(e&&e.hasClass("predelete"))return!1;var i=e.closest(".djn-group"),n=i.data("inlineModel"),r=i.djnData("childModels"),o=t.data("inlineModel"),s=r&&-1!==r.indexOf(o);return!(o!==n&&!s)},fixedNestingDepth:!0,containerElementSelector:".djn-items",listItemSelector:".djn-item",start:function(t,e){e.item.addClass("djn-item-dragging"),e.item.show()},stop:function(t,e){e.item.removeClass("djn-item-dragging")},receive:function(e,i){t(this).closest(".djn-group").djangoFormset().spliceInto(i.item),g(i.item.djangoFormsetPrefix())},update:function(e,i){var n=i.item.nextAll(".djn-item").first();if(n.is(".djn-no-drag,.djn-thead")){var r=n[0],o=r.parentNode;o.insertBefore(r,o.firstChild)}var s=t(e.target).closest(".djn-group").attr("id"),a=i.item,l=a.closest("#"+s);"removed"==a.data("updateOperation")?a.removeAttr("data-update-operation"):l.length||a.attr("data-update-operation","removed"),g(a.djangoFormsetPrefix()),t(document).trigger("djnesting:mutate",[t("#"+a.djangoFormsetPrefix()+"-group")])}})},y.updatePositions=g,y.updateFormAttributes=function(e,i,n,r){r||(r=[":input","span","table","iframe","label","a","ul","p","img",".djn-group",".djn-inline-form",".cropduster-form",".dal-forward-conf"].join(","));var o=t.fn.addBack?"addBack":"andSelf";e.find(r)[o]().each((function(){var e=t(this);t.each(["id","name","for","href","class","onclick","data-inline-formset"],(function(t,r){var o=e.attr(r);o&&(e.attr(r,o.replace(i,n)),"data-inline-formset"===r&&e.data("inlineFormset",JSON.parse(e.attr(r))))}))})),e.find(".prepopulated_field").each((function(){var e=_(this);"function"!=typeof e.prepopulate&&(e=v(this));var r=t.makeArray(e.data("dependency_ids")||[]);e.data("dependency_ids",t.map(r,(function(t){return t.replace(i,n)})))}))},y.createContainerElement=function(){},y.initRelatedFields=function(e,i){if("object"==typeof y.LOOKUP_URLS&&y.LOOKUP_URLS.related){var n=y.LOOKUP_URLS,r=t("#"+e+"-group");i||(i=r.djnData());var o=i.lookupRelated;r.djangoFormsetForms().each((function(i,r){t.each(o.fk||[],(function(e,i){t(r).djangoFormField(i).each((function(){_(this).grp_related_fk({lookup_url:n.related})}))})),t.each(o.m2m||[],(function(e,i){t(r).djangoFormField(i).each((function(){_(this).grp_related_m2m({lookup_url:n.m2m})}))})),t.each(o.generic||[],(function(){var i=this[0],o=this[1];t(r).djangoFormField(o).each((function(){var r=t(this),s=r.djangoFormIndex();r.hasClass("grp-has-related-lookup")&&(r.parent().find("a.related-lookup").remove(),r.parent().find(".grp-placeholder-related-generic").remove()),_(r).grp_related_generic({content_type:"#id_"+e+"-"+s+"-"+i,object_id:"#id_"+e+"-"+s+"-"+o,lookup_url:n.related})}))}))}))}},y.initAutocompleteFields=function(e,i){if("object"==typeof y.LOOKUP_URLS&&y.LOOKUP_URLS.related){var n=y.LOOKUP_URLS,r=t("#"+e+"-group");i||(i=r.djnData());var o=i.lookupAutocomplete;r.djangoFormsetForms().each((function(i,r){t.each(o.fk||[],(function(e,i){t(r).djangoFormField(i).each((function(){var e=t(this),i=e.attr("id");t("#"+i+"-autocomplete").length||_(e).grp_autocomplete_fk({lookup_url:n.related,autocomplete_lookup_url:n.autocomplete})}))})),t.each(o.m2m||[],(function(e,i){t(r).djangoFormField(i).each((function(){var e=t(this),i=e.attr("id");t("#"+i+"-autocomplete").length||_(e).grp_autocomplete_m2m({lookup_url:n.m2m,autocomplete_lookup_url:n.autocomplete})}))})),t.each(o.generic||[],(function(){var i=this[0],o=this[1];t(r).djangoFormField(o).each((function(){var r=t(this),s=r.djangoFormIndex();t("#"+r.attr("id")+"-autocomplete").length||_(r).grp_autocomplete_generic({content_type:"#id_"+e+"-"+s+"-"+i,object_id:"#id_"+e+"-"+s+"-"+o,lookup_url:n.related,autocomplete_lookup_url:n.m2m})}))}))}))}},y.DjangoInlines={initPrepopulatedFields:function(e){var i=e.djangoFormPrefix();if(i){var n=t("#django-admin-prepopulated-fields-constants").data("prepopulatedFields"),r=new Set,o={};Array.isArray(n)&&(n.forEach((function(t){var e=t.id,i=t.name,n=t.dependency_list,s=t.maxLength,a=t.allowUnicode;r.add(i);var l=b(e);"object"!=typeof o[l]&&(o[l]={}),o[l][i]={dependency_list:n,maxLength:s,allowUnicode:a}})),r.forEach((function(i){e.find(".form-row .field-"+i+", .form-row.field-"+i).each((function(){var e=t(this),n=e.djangoFormPrefix();if(n){var r=b(n),s=(o[r]||{})[i];if(s){e.addClass("prepopulated_field");var a=e.is(":input")?e:e.find(":input");a.data("dependency_list",s.dependency_list),a.data("maxLength",s.maxLength),a.data("allowUnicode",s.allowUnicode)}}}))}))),i.match(/__prefix__/)||e.find(".prepopulated_field").each((function(){var e=t(this),i=e.is(":input")?e:e.find(":input"),n=_(i),r=i.djangoFormPrefix(),o=n.data("dependency_list")||[],s=[];r&&!r.match(/__prefix__/)&&(o.length&&n.prepopulate||(o=(n=v(i)).data("dependency_list")||[]),t.each(o,(function(t,e){s.push("#id_"+r+e)})),s.length&&n.prepopulate(s,n.data("maxLength")||n.attr("maxlength"),n.data("allowUnicode")))}))}},reinitDateTimeShortCuts:function(){void 0!==window.DateTimeShortcuts&&(t(".datetimeshortcuts").remove(),DateTimeShortcuts.init())},updateSelectFilter:function(t){void 0!==window.SelectFilter&&(t.find(".selectfilter").each((function(t,e){var i=e.name.split("-");SelectFilter.init(e.id,i[i.length-1],!1)})),t.find(".selectfilterstacked").each((function(t,e){var i=e.name.split("-");SelectFilter.init(e.id,i[i.length-1],!0)})))}},void 0!==window.SelectFilter?x():setTimeout((function(){void 0!==window.SelectFilter&&x()}),12),["prepopulate","djangoAdminSelect2"].forEach((function(e){!function i(n){var r;if(!(n>2))return void 0===t.fn[e]?setTimeout((function(){return i(++n)}),12):void(t.fn[e]=(r=t.fn[e],function(){return r.apply(this.filter(':not([id*="-empty-"]):not([id$="-empty"]):not([id*="__prefix__"])'),arguments)}))}(0)})),["grp_autocomplete_fk","grp_autocomplete_generic","grp_autocomplete_m2m","grp_collapsible","grp_collapsible_group","grp_inline","grp_related_fk","grp_related_generic","grp_related_m2m","grp_timepicker","datepicker","prepopulate","djangoAdminSelect2"].forEach((function(t){!function e(i){var n;if(!(i>2))return void 0===window.grp||void 0===window.grp.jQuery.fn[t]?setTimeout((function(){return e(++i)}),12):void(window.grp.jQuery.fn[t]=(n=window.grp.jQuery.fn[t],function(){return n.apply(this.filter(':not([id*="-empty-"]):not([id$="-empty"]):not([id*="__prefix__"])'),arguments)}))}(0)}));var w=y,j=window.grp,S=i.n(j),P="djangoFormset",I=function(){function i(e){this.opts={emptyClass:"empty-form grp-empty-form djn-empty-form",predeleteClass:"grp-predelete"},this.$inline=t(e),this.prefix=this.$inline.djangoFormsetPrefix(),this._$totalForms=this.$inline.find("#id_"+this.prefix+"-TOTAL_FORMS"),this._$totalForms.attr("autocomplete","off"),this._$template=t("#"+this.prefix+"-empty");var i=this.$inline.djnData("inlineModel"),n=".djn-model-"+i+".djn-level-"+this.$inline.djnData("nestingLevel");this.opts=t.extend({},this.opts,{childTypes:this.$inline.data("inlineFormset").options.childTypes,formsetFkModel:this.$inline.djnData("formsetFkModel"),addButtonSelector:".djn-add-handler"+n,removeButtonSelector:".djn-remove-handler"+n,deleteButtonSelector:".djn-delete-handler"+n,formClass:"dynamic-form grp-dynamic-form djn-dynamic-form-"+i,formClassSelector:".djn-dynamic-form-"+i}),w.initRelatedFields(this.prefix,this.$inline.djnData()),w.initAutocompleteFields(this.prefix,this.$inline.djnData()),this.opts.childTypes&&this._setupPolymorphic(),this._bindEvents(),this._initializeForms(),this.$inline.find('.djn-items:not([id*="-empty"])').trigger("djnesting:init"),this.$inline.find('.djn-group[id$="-group"][id^="'+this.prefix+'"][data-inline-formset]:not([id*="-empty"])').each((function(){t(this)[P]()})),this.$inline.is(".djn-group-root")&&w.createSortable(this.$inline),t(document).trigger("djnesting:initialized",[this.$inline,this])}var n=i.prototype;return n._setupPolymorphic=function(){if(!this.opts.childTypes)throw Error("The polymorphic fieldset options.childTypes is not defined!");var e='<div class="polymorphic-type-menu" style="display: none"><ul>';this.opts.childTypes.forEach((function(t){e+='<li><a href="#" data-type="'+t.type+'">'+t.name+"</a></li>"})),e+="</ul></div>";var i=this.$inline.find(this.opts.addButtonSelector),n=t(e);i.after(n)},n._initializeForms=function(){var t=this.mgmtVal("TOTAL_FORMS");this.mgmtVal("MAX_NUM_FORMS")<=t&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").hide();for(var e=0;e<t;e++)this._initializeForm("#"+this.prefix+"-"+e)},n._initializeForm=function(e){var i=t(e),n=i.djangoFormPrefix();i.addClass(this.opts.formClass),i.hasClass("has_original")&&t("#id_"+n+"DELETE:checked").toggleClass(this.opts.predeleteClass);var r=this.mgmtVal("MIN_NUM_FORMS"),o=this.mgmtVal("TOTAL_FORMS"),s=this,a=o<=r;this.$inline.djangoFormsetForms().each((function(){var e=a?"hide":"show";t(this).find(s.opts.removeButtonSelector)[e]()}))},n._bindEvents=function(e){var i=this;void 0===e&&(e=this.$inline);var n=e.find(this.opts.addButtonSelector);n.off("click.djnesting").on("click.djnesting",(function(e){e.preventDefault(),e.stopPropagation();var n=t(this).next(".polymorphic-type-menu");n.length?(n.is(":visible")||t(document).on("click",(function e(){n.hide(),t(document).off("click",e)})),n.show()):i.add()})),n.parent().find("> .polymorphic-type-menu a").off("click.djnesting").on("click.djnesting",(function(e){e.preventDefault(),e.stopPropagation();var n=t(this).attr("data-type");i.add(null,n);var r=t(e.target).closest(".polymorphic-type-menu");r.is(":visible")&&r.hide()})),e.find(this.opts.removeButtonSelector).filter((function(){return!t(this).closest(".djn-empty-form").length})).off("click.djnesting").on("click.djnesting",(function(e){e.preventDefault(),e.stopPropagation();var n=t(this).closest(i.opts.formClassSelector);i.remove(n)}));var r=function(e){e.preventDefault(),e.stopImmediatePropagation();var n=t(this).closest(i.opts.formClassSelector);t("#id_"+n.djangoFormPrefix()+"DELETE").is(":checked")?i.undelete(n):i.delete(n)},o=e.find(this.opts.deleteButtonSelector).filter((function(){return!t(this).closest(".djn-empty-form").length}));o.off("click.djnesting").on("click.djnesting",r),o.find('[id$="-DELETE"]').on("mousedown.djnesting",r)},n.remove=function(e){var i=t(e),n=this.mgmtVal("TOTAL_FORMS"),r=this.mgmtVal("MIN_NUM_FORMS"),o=this.mgmtVal("MAX_NUM_FORMS"),s=i.djangoFormIndex(),a=i.data("isInitial");i[0].innerHTML="",i.remove(),n-=1,this.mgmtVal("TOTAL_FORMS",n),o-n>=0&&this.$inline.find(this.opts.addButtonSelector).parent(".djn-add-item,li").show(),this._fillGap(s,a);var l=this,c=n<=r;this.$inline.djangoFormsetForms().each((function(){var e=c?"hide":"show";t(this).find(l.opts.removeButtonSelector)[e]()})),w.updatePositions(this.prefix),t(document).trigger("djnesting:mutate",[this.$inline]),t(document).trigger("formset:removed",[i,this.prefix]),document.dispatchEvent(new CustomEvent("formset:removed",{detail:{formsetName:this.prefix}}))},n.delete=function(e){var i=this,n=t(e),r=n.djangoFormPrefix(),o=t("#id_"+r+"DELETE");n.hasClass(this.opts.predeleteClass)||n.data("isInitial")&&(o.attr("checked","checked"),o.length&&(o[0].checked=!0),n.addClass(this.opts.predeleteClass),n.find(".djn-group").each((function(){var e=t(this),n=e.djangoFormset();e.djangoFormsetForms().each((function(){t(this).hasClass(i.opts.predeleteClass)?t(this).data("alreadyDeleted",!0):n.delete(this)}))})),n.find(".cropduster-form").each((function(){var e=t(this).djangoFormsetPrefix()+"-0-",i=t("#id_"+e+"DELETE");i.attr("checked","checked"),i.length&&(i[0].checked=!0)})),w.updatePositions(this.prefix),t(document).trigger("djnesting:mutate",[this.$inline]),t(document).trigger("formset:deleted",[n,this.prefix]))},n.undelete=function(e){var i=t(e),n=i.djangoFormPrefix(),r=t("#id_"+n+"DELETE");i.parent().closest("."+this.opts.predeleteClass).length||(i.hasClass("has_original")&&(r.removeAttr("checked"),r.length&&(r[0].checked=!1),i.removeClass(this.opts.predeleteClass)),i.data("alreadyDeleted",!1),i.find(".djn-group").each((function(){var e=t(this),i=e.djangoFormset();e.djangoFormsetForms().each((function(){t(this).data("alreadyDeleted")?t(this).data("alreadyDeleted",!1):i.undelete(this)}))})),i.find(".cropduster-form").each((function(){var e=t(this).djangoFormsetPrefix()+"-0-",i=t("#id_"+e+"DELETE");i.removeAttr("checked"),i.length&&(i[0].checked=!1)})),w.updatePositions(this.prefix),t(document).trigger("djnesting:mutate",[this.$inline]),t(document).trigger("formset:undeleted",[i,this.prefix]))},n.add=function(i,n){var r=this,o=n?t("#"+this.prefix+"-empty-"+n):this._$template,s=o.clone(!0);_(o).find(":data(dependency_ids)").each((function(){var e=t(this).attr("id"),i=s.find("#"+e);_(i).data(t.extend({},i.data(),_(this).data()))}));var a=this.mgmtVal("TOTAL_FORMS"),l=this.mgmtVal("MAX_NUM_FORMS"),c=this.$inline.hasClass("djn-group-nested");t(document).trigger("djnesting:beforeadded",[this.$inline,s]),s.removeClass(this.opts.emptyClass),s.addClass("djn-item"),s.attr("id",s.attr("id").replace(/\-empty.*?$/,"-"+a)),c&&s.append(w.createContainerElement()),w.updateFormAttributes(s,new RegExp('([#_]id_|[\\#]|^id_|"|^)'+u(this.prefix)+"\\-(?:__prefix__|empty)\\-","g"),"$1"+this.prefix+"-"+a+"-");var h=this._$template;if(this.opts.childTypes&&(h=o.closest(".djn-group").find('> .djn-items > [id*="-empty"], > .djn-fieldset > .djn-items > [id*="-empty"]').eq(0)),this.opts.childTypes){var d=this.$inline.djnData("compatibleParents")||{};s.find("> .djn-group").each((function(e,i){var r=t(i).djnData("formsetFkModel"),o=d[n]||[],s=t(i),a=s.djnData("inlineParentModel"),l=!!s.data("inlineFormset").options.childTypes;s.data("inlineFormset").options.prefix,(a!==n||l&&r!==n&&-1===o.indexOf(r))&&(s.find('input[id$="_FORMS"]').each((function(t,e){e.value=0,e.setAttribute("value","0"),i.parentNode.appendChild(e)})),i.parentNode.removeChild(i))}))}if(s.insertBefore(h),this.mgmtVal("TOTAL_FORMS",a+1),l-(a+1)<=0&&this.$inline.find(this.opts.addButtonSelector).parent(".djn-add-item,li").hide(),w.updatePositions(this.prefix),t.isNumeric(i)?this.spliceInto(s,i,!0):t(document).trigger("djnesting:mutate",[this.$inline]),e&&e.reinitDateTimeFields(_(s)),w.DjangoInlines.initPrepopulatedFields(v(s)),w.DjangoInlines.reinitDateTimeShortCuts(),w.DjangoInlines.updateSelectFilter(s),w.initRelatedFields(this.prefix),w.initAutocompleteFields(this.prefix),S()&&S().jQuery.fn.grp_collapsible){var f=S().jQuery.fn.addBack?"addBack":"andSelf";_(s).find('.grp-collapse:not([id$="-empty"]):not([id*="-empty-"])')[f]().grp_collapsible({toggle_handler_slctr:".grp-collapse-handler:first",closed_css:"closed grp-closed",open_css:"open grp-open",on_toggle:function(){t(document).trigger("djnesting:toggle",[r.$inline])}})}if("function"==typeof t.fn.curated_content_type&&s.find(".curated-content-type-select").each((function(){t(this).curated_content_type()})),this._initializeForm(s),this._bindEvents(s),n){var p=this.$inline.djnData("inlineModel"),m=s.attr("data-inline-model");s.find(".djn-model-"+p).addClass("djn-model-"+m),s.addClass("djn-dynamic-form-"+m)}s.find('.djn-group[id$="-group"][id^="'+this.prefix+'"][data-inline-formset]:not([id*="-empty"])').each((function(){t(this)[P]()})),t(document).trigger("djnesting:added",[this.$inline,s]),t(document).trigger("formset:added",[s,this.prefix]);try{s.get(0).dispatchEvent(new CustomEvent("formset:added",{bubbles:!0,detail:{formsetName:this.prefix}}))}catch(t){}return s},n._fillGap=function(e,i){var n,r,o=this.$inline.djangoFormsetForms().toArray();o.sort((function(e,i){return t(e).djangoFormIndex()-t(i).djangoFormIndex()})),o.forEach((function(i){var o=t(i);o.djangoFormIndex()<=e||(o.data("isInitial")?n=o:r=o)}));var s=i&&n||r;if(s){var a=s.djangoFormIndex(),l=new RegExp("([\\#_]|^)"+u(this.prefix+"-"+a)+"(?!\\-\\d)");s.attr("id",this.prefix+"-"+e),w.updateFormAttributes(s,l,"$1"+this.prefix+"-"+e),s.find(".djn-group").each((function(){var e=t(this);e.djangoFormset().prefix=e.djangoFormsetPrefix()})),t(document).trigger("djnesting:attrchange",[this.$inline,s]),i&&n&&r&&this._fillGap(a,!1)}},n._makeRoomForInsert=function(){var e=this.mgmtVal("INITIAL_FORMS"),i=this.mgmtVal("TOTAL_FORMS"),n=e,r=t("#"+this.prefix+"-"+n);if(r.length){var o=new RegExp("([\\#_]|^)"+u(this.prefix)+"-"+n+"(?!\\-\\d)");r.attr("id",this.prefix+"-"+i),w.updateFormAttributes(r,o,"$1"+this.prefix+"-"+i),r.find(".djn-group").each((function(){var e=t(this);e.djangoFormset().prefix=e.djangoFormsetPrefix()})),t(document).trigger("djnesting:attrchange",[this.$inline,r])}},n.spliceInto=function(e,i,n){var r,o=this.mgmtVal("INITIAL_FORMS"),s=this.mgmtVal("TOTAL_FORMS"),a=e.djangoFormsetPrefix(),l=this.prefix,c=e.data("isInitial");if(e.djangoFormsetPrefix()==this.prefix){if(e.prevAll(".djn-item:not(.djn-no-drag,.djn-thead)").length===i||void 0===i)return void w.updatePositions(l);this.$inline.find("> .djn-items, > .tabular > .module > .djn-items").find("> .djn-item:not(#"+e.attr("id")+")").eq(i).after(e)}else{var h=t("#"+a+"-group");e.closest(".djn-group").djangoFormsetPrefix()!=l&&this.$inline.find("> .djn-items, > .tabular > .module > .djn-items").find("> .djn-item").eq(i).after(e);var d=h.djangoFormset();if(d.mgmtVal("TOTAL_FORMS",d.mgmtVal("TOTAL_FORMS")-1),d._fillGap(e.djangoFormIndex(),c),c){d.mgmtVal("INITIAL_FORMS",d.mgmtVal("INITIAL_FORMS")-1);var f=this.$inline.parent().closest(".djn-group");if(f.length){var p=this.$inline.closest(".djn-inline-form"),m=(f.djnData("fieldNames")||{}).pk;p.djangoFormField(m).val()||(e.data("isInitial",!1),e.attr("data-is-initial","false"),c=!1,setTimeout((function(){e.find('[name^="'+e.djangoFormPrefix()+'"][name$="-INITIAL_FORMS"]').val("0").trigger("change")}),0))}}c&&this._makeRoomForInsert();var g=new RegExp("([\\#_]|^)"+u(e.attr("id"))+"(?!\\-\\d)");r=c?o:s,e.attr("id",l+"-"+r),w.updateFormAttributes(e,g,"$1"+l+"-"+r),e.find(".djn-group").each((function(){var e=t(this);e.djangoFormset().prefix=e.djangoFormsetPrefix()})),t(document).trigger("djnesting:attrchange",[this.$inline,e]),c&&this.mgmtVal("INITIAL_FORMS",o+1),this.mgmtVal("TOTAL_FORMS",s+1),w.updatePositions(a),t(document).trigger("djnesting:mutate",[h])}w.updatePositions(l),n||t(document).trigger("djnesting:mutate",[this.$inline])},n.mgmtVal=function(t,e){var i=this.$inline.find("#id_"+this.prefix+"-"+t);return void 0===e?parseInt(i.val(),10):parseInt(i.val(e).trigger("change").val(),10)},i}();t.fn[P]=function(){var e,i,n,r=this.eq(0);if(0===arguments.length||1===arguments.length&&"string"!=t.type(arguments[0])){e=arguments[0];var o=r.data(P);return o||(o=new I(r,e),r.data(P,o)),o}if(i=arguments[0],n=t.makeArray(arguments).slice(1),i in I.prototype)return r.data(P)[i](n);throw new Error("Unknown function call "+i+" for $.fn."+P)};var F=I;w.DjangoFormset=F,t(document).ready((function(){t("fieldset.grp-module, fieldset.module").filter((function(t,e){return 0==e.childNodes.length})).css("border-width","0"),t('input[name$="-DELETE"]:checked').not('[name*="__prefix__"]').closest(".djn-inline-form").addClass("grp-predelete"),t(document).on("djnesting:initialized djnesting:mutate",(function(e,i){var n=i.find("> .djn-items, > .tabular > .module > .djn-items").children(".djn-tbody");n.removeClass("row1 row2"),n.each((function(e,i){var n=1+e%2;t(i).addClass("row"+n)}))})),t(".djn-group-root").each((function(e,i){t(i).djangoFormset()})),t("form").on("submit.djnesting",(function(e){t(".djn-group").each((function(){w.updatePositions(t(this).djangoFormsetPrefix()),t(document).trigger("djnesting:mutate",[t(this).djangoFormset().$inline])}))}))}));var C=w}(),window.DJNesting=n}();
//# sourceMappingURL=nested_admin.min.js.map