/*! For license information please see save.c7b304031bc09b162def.js.LICENSE.txt */
!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define([],t):"object"==typeofexports?exports.save=t():(e.swh=e.swh||{},e.swh.save=t())}(window,(function(){returnfunction(e){vart={};functionn(r){if(t[r])returnt[r].exports;vari=t[r]={i:r,l:!1,exports:{}};returne[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}returnn.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)returne;if(4&t&&"object"==typeofe&&e&&e.__esModule)returne;varr=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeofe)for(variine)n.d(r,i,function(t){returne[t]}.bind(null,i));returnr},n.n=function(e){vart=e&&e.__esModule?function(){returne.default}:function(){returne};returnn.d(t,"a",t),t},n.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},n.p="/static/",n(n.s=258)}({119:function(e,t){e.exports=function(e){returne.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){returne.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){returne.i}}),e.webpackPolyfill=1),e}},164:function(e,t){e.exports=function(){thrownewError("define cannot be used indirect")}},2:function(e,t,n){"use strict";functionr(e){if(!e.ok)throwe;returne}functioni(e){for(vart=0;t<e.length;++t)if(!e[t].ok)throwe[t];returne}functions(e){return"/static/"+e}functiono(e,t,n){returnvoid0===t&&(t={}),void0===n&&(n=null),t["X-CSRFToken"]=Cookies.get("csrftoken"),fetch(e,{credentials:"include",headers:t,method:"POST",body:n})}functiona(e,t){returnnewRegExp("(?:git|https?|git@)(?:\\:\\/\\/)?"+t+"[/|:][A-Za-z0-9-/]+?\\/[\\w\\.-]+\\/?(?!=.git)(?:\\.git(?:\\/?|\\#[\\w\\.\\-_]+)?)?$").test(e)}functionu(){history.replaceState("",document.title,window.location.pathname+window.location.search)}functionc(e,t){varn=window.getSelection();n.removeAllRanges();varr=document.createRange();r.setStart(e,0),"#text"!==t.nodeName?r.setEnd(t,t.childNodes.length):r.setEnd(t,t.textContent.length),n.addRange(r)}functionl(e,t,n){void0===n&&(n=!1);varr="",i="";returnn&&(r='<button type="button" class="close" data-dismiss="alert" aria-label="Close">\n <span aria-hidden="true">×</span>\n </button>',i="alert-dismissible"),'<div class="alert alert-'+e+" "+i+'" role="alert">'+t+r+"</div>"}n.d(t,"b",(function(){returnr})),n.d(t,"c",(function(){returni})),n.d(t,"h",(function(){returns})),n.d(t,"a",(function(){returno})),n.d(t,"e",(function(){returna})),n.d(t,"f",(function(){returnu})),n.d(t,"g",(function(){returnc})),n.d(t,"d",(function(){returnl}))},21:function(e,t,n){"use strict";n.d(t,"b",(function(){returni})),n.d(t,"a",(function(){returns})),n.d(t,"c",(function(){returno}));varr=n(2),i=768,s=992,o=Object(r.h)("img/swh-spinner.gif")},225:function(e,t,n){(function(e){(function(e,t,r){"use strict";vari=function(e,t,n){n=s.extend({},s.options,n);varr=s.runValidations(e,t,n);if(r.some((function(e){returns.isPromise(e.error)})))thrownewError("Use validate.async if you want support for promises");returni.processValidationResults(r,n)},s=i;s.extend=function(e){return[].slice.call(arguments,1).forEach((function(t){for(varnint)e[n]=t[n]})),e},s.extend(i,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){vare=s.format("%{major}.%{minor}.%{patch}",s.version);returns.isEmpty(s.version.metadata)||(e+="+"+s.version.metadata),e}},Promise:"undefined"!=typeofPromise?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(e,t,n){varr,i,o,a,u,c,l,f=[];for(rin(s.isDomElement(e)||s.isJqueryElement(e))&&(e=s.collectFormValues(e)),t)for(iino=s.getDeepObjectValue(e,r),a=s.result(t[r],o,e,r,n,t)){if(!(u=s.validators[i]))throwl=s.format("Unknown validator %{name}",{name:i}),newError(l);c=a[i],(c=s.result(c,o,e,r,n,t))&&f.push({attribute:r,value:o,validator:i,globalOptions:n,attributes:e,options:c,error:u.call(u,o,c,r,e,n)})}returnf},processValidationResults:function(e,t){e=s.pruneEmptyErrors(e,t),e=s.expandMultipleErrors(e,t),e=s.convertErrorMessages(e,t);varn=t.format||"grouped";if("function"!=typeofs.formatters[n])thrownewError(s.format("Unknown format %{format}",t));returne=s.formatters[n](e),s.isEmpty(e)?void0:e},async:function(e,t,n){varr=(n=s.extend({},s.async.options,n)).wrapErrors||function(e){returne};!1!==n.cleanAttributes&&(e=s.cleanAttributes(e,t));vari=s.runValidations(e,t,n);returnnews.Promise((function(o,a){s.waitForResults(i).then((function(){varu=s.processValidationResults(i,n);u?a(newr(u,n,e,t)):o(e)}),(function(e){a(e)}))}))},single:function(e,t,n){returnn=s.extend({},s.single.options,n,{format:"flat",fullMessages:!1}),s({single:e},{single:t},n)},waitForResults:function(e){returne.reduce((function(e,t){returns.isPromise(t.error)?e.then((function(){returnt.error.then((function(e){t.error=e||null}))})):e}),news.Promise((function(e){e()})))},result:function(e){vart=[].slice.call(arguments,1);return"function"==typeofe&&(e=e.apply(null,t)),e},isNumber:function(e){return"number"==typeofe&&!isNaN(e)},isFunction:function(e){return"function"==typeofe},isInteger:function(e){returns.isNumber(e)&&e%1==0},isBoolean:function(e){return"boolean"==typeofe},isObject:function(e){returne===Object(e)},isDate:function(e){returneinstanceofDate},isDefined:function(e){returnnull!=e},isPromise:function(e){return!!e&&s.isFunction(e.then)},isJqueryElement:function(e){returne&&s.isString(e.jquery)},isDomElement:function(e){return!!e&&(!(!e.querySelectorAll||!e.querySelector)&&(!(!s.isObject(document)||e!==document)||("object"==typeofHTMLElement?einstanceofHTMLElement:e&&"object"==typeofe&&null!==e&&1===e.nodeType&&"string"==typeofe.nodeName)))},isEmpty:function(e){vart;if(!s.isDefined(e))return!0;if(s.isFunction(e))return!1;if(s.isString(e))returns.EMPTY_STRING_REGEXP.test(e);if(s.isArray(e))return0===e.length;if(s.isDate(e))return!1;if(s.isObject(e)){for(tine)return!1;return!0}return!1},format:s.extend((function(e,t){returns.isString(e)?e.replace(s.format.FORMAT_REGEXP,(function(e,n,r){return"%"===n?"%{"+r+"}":String(t[r])})):e}),{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(e){returns.isNumber(e)?100*e%1==0?""+e:parseFloat(Math.round(100*e)/100).toFixed(2):s.isArray(e)?e.map((function(e){returns.prettify(e)})).join(", "):s.isObject(e)?s.isDefined(e.toString)?e.toString():JSON.stringify(e):(e=""+e).replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,(function(e,t,n){returnt+" "+n.toLowerCase()})).toLowerCase()},stringifyValue:function(e,t){return(t&&t.prettify||s.prettify)(e)},isString:function(e){return"string"==typeofe},isArray:function(e){return"[object Array]"==={}.toString.call(e)},isHash:function(e){returns.isObject(e)&&!s.isArray(e)&&!s.isFunction(e)},contains:function(e,t){return!!s.isDefined(e)&&(s.isArray(e)?-1!==e.indexOf(t):tine)},unique:function(e){returns.isArray(e)?e.filter((function(e,t,n){returnn.indexOf(e)==t})):e},forEachKeyInKeypath:function(e,t,n){if(s.isString(t)){varr,i="",o=!1;for(r=0;r<t.length;++r)switch(t[r]){case".":o?(o=!1,i+="."):(e=n(e,i,!1),i="");break;case"\\":o?(o=!1,i+="\\"):o=!0;break;default:o=!1,i+=t[r]}returnn(e,i,!0)}},getDeepObjectValue:function(e,t){if(s.isObject(e))returns.forEachKeyInKeypath(e,t,(function(e,t){if(s.isObject(e))returne[t]}))},collectFormValues:function(e,t){varn,r,i,o,a,u,c={};if(s.isJqueryElement(e)&&(e=e[0]),!e)returnc;for(t=t||{},o=e.querySelectorAll("input[name], textarea[name]"),n=0;n<o.length;++n)if(i=o.item(n),!s.isDefined(i.getAttribute("data-ignored"))){varl=i.name.replace(/\./g,"\\\\.");u=s.sanitizeFormValue(i.value,t),"number"===i.type?u=u?+u:null:"checkbox"===i.type?i.attributes.value?i.checked||(u=c[l]||null):u=i.checked:"radio"===i.type&&(i.checked||(u=c[l]||null)),c[l]=u}for(o=e.querySelectorAll("select[name]"),n=0;n<o.length;++n)if(i=o.item(n),!s.isDefined(i.getAttribute("data-ignored"))){if(i.multiple)for(rinu=[],i.options)(a=i.options[r])&&a.selected&&u.push(s.sanitizeFormValue(a.value,t));else{varf=void0!==i.options[i.selectedIndex]?i.options[i.selectedIndex].value:"";u=s.sanitizeFormValue(f,t)}c[i.name]=u}returnc},sanitizeFormValue:function(e,t){returnt.trim&&s.isString(e)&&(e=e.trim()),!1!==t.nullify&&""===e?null:e},capitalize:function(e){returns.isString(e)?e[0].toUpperCase()+e.slice(1):e},pruneEmptyErrors:function(e){returne.filter((function(e){return!s.isEmpty(e.error)}))},expandMultipleErrors:function(e){vart=[];returne.forEach((function(e){s.isArray(e.error)?e.error.forEach((function(n){t.push(s.extend({},e,{error:n}))})):t.push(e)})),t},convertErrorMessages:function(e,t){varn=[],r=(t=t||{}).prettify||s.prettify;returne.forEach((function(e){vari=s.result(e.error,e.value,e.attribute,e.options,e.attributes,e.globalOptions);s.isString(i)?("^"===i[0]?i=i.slice(1):!1!==t.fullMessages&&(i=s.capitalize(r(e.attribute))+" "+i),i=i.replace(/\\\^/g,"^"),i=s.format(i,{value:s.stringifyValue(e.value,t)}),n.push(s.extend({},e,{error:i}))):n.push(e)})),n},groupErrorsByAttribute:function(e){vart={};returne.forEach((function(e){varn=t[e.attribute];n?n.push(e):t[e.attribute]=[e]})),t},flattenErrorsToArray:function(e){returne.map((function(e){returne.error})).filter((function(e,t,n){returnn.indexOf(e)===t}))},cleanAttributes:function(e,t){functionn(e,t,n){returns.isObject(e[t])?e[t]:e[t]=!!n||{}}returns.isObject(t)&&s.isObject(e)?functione(t,n){if(!s.isObject(t))returnt;varr,i,o=s.extend({},t);for(iint)r=n[i],s.isObject(r)?o[i]=e(o[i],r):r||deleteo[i];returno}(e,t=function(e){vart,r={};for(tine)e[t]&&s.forEachKeyInKeypath(r,t,n);returnr}(t)):{}},exposeModule:function(e,t,n,r,i){n?(r&&r.exports&&(n=r.exports=e),n.validate=e):(t.validate=e,e.isFunction(i)&&i.amd&&i([],(function(){returne})))},warn:function(e){"undefined"!=typeofconsole&&console.warn&&console.warn("[validate.js] "+e)},error:function(e){"undefined"!=typeofconsole&&console.error&&console.error("[validate.js] "+e)}}),i.validators={presence:function(e,t){if(!1!==(t=s.extend({},this.options,t)).allowEmpty?!s.isDefined(e):s.isEmpty(e))returnt.message||this.message||"can't be blank"},length:function(e,t,n){if(s.isDefined(e)){varr,i=(t=s.extend({},this.options,t)).is,o=t.maximum,a=t.minimum,u=[],c=(e=(t.tokenizer||function(e){returne})(e)).length;returns.isNumber(c)?(s.isNumber(i)&&c!==i&&(r=t.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",u.push(s.format(r,{count:i}))),s.isNumber(a)&&c<a&&(r=t.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",u.push(s.format(r,{count:a}))),s.isNumber(o)&&c>o&&(r=t.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",u.push(s.format(r,{count:o}))),u.length>0?t.message||u:void0):t.message||this.notValid||"has an incorrect length"}},numericality:function(e,t,n,r,i){if(s.isDefined(e)){varo,a,u=[],c={greaterThan:function(e,t){returne>t},greaterThanOrEqualTo:function(e,t){returne>=t},equalTo:function(e,t){returne===t},lessThan:function(e,t){returne<t},lessThanOrEqualTo:function(e,t){returne<=t},divisibleBy:function(e,t){returne%t==0}},l=(t=s.extend({},this.options,t)).prettify||i&&i.prettify||s.prettify;if(s.isString(e)&&t.strict){varf="^-?(0|[1-9]\\d*)";if(t.onlyInteger||(f+="(\\.\\d+)?"),f+="$",!newRegExp(f).test(e))returnt.message||t.notValid||this.notValid||this.message||"must be a valid number"}if(!0!==t.noStrings&&s.isString(e)&&!s.isEmpty(e)&&(e=+e),!s.isNumber(e))returnt.message||t.notValid||this.notValid||this.message||"is not a number";if(t.onlyInteger&&!s.isInteger(e))returnt.message||t.notInteger||this.notInteger||this.message||"must be an integer";for(oinc)if(a=t[o],s.isNumber(a)&&!c[o](e,a)){vard="not"+s.capitalize(o),p=t[d]||this[d]||this.message||"must be %{type} %{count}";u.push(s.format(p,{count:a,type:l(o)}))}returnt.odd&&e%2!=1&&u.push(t.notOdd||this.notOdd||this.message||"must be odd"),t.even&&e%2!=0&&u.push(t.notEven||this.notEven||this.message||"must be even"),u.length?t.message||u:void0}},datetime:s.extend((function(e,t){if(!s.isFunction(this.parse)||!s.isFunction(this.format))thrownewError("Both the parse and format functions needs to be set to use the datetime/date validator");if(s.isDefined(e)){varn,r=[],i=(t=s.extend({},this.options,t)).earliest?this.parse(t.earliest,t):NaN,o=t.latest?this.parse(t.latest,t):NaN;returne=this.parse(e,t),isNaN(e)||t.dateOnly&&e%864e5!=0?(n=t.notValid||t.message||this.notValid||"must be a valid date",s.format(n,{value:arguments[0]})):(!isNaN(i)&&e<i&&(n=t.tooEarly||t.message||this.tooEarly||"must be no earlier than %{date}",n=s.format(n,{value:this.format(e,t),date:this.format(i,t)}),r.push(n)),!isNaN(o)&&e>o&&(n=t.tooLate||t.message||this.tooLate||"must be no later than %{date}",n=s.format(n,{date:this.format(o,t),value:this.format(e,t)}),r.push(n)),r.length?s.unique(r):void0)}}),{parse:null,format:null}),date:function(e,t){returnt=s.extend({},t,{dateOnly:!0}),s.validators.datetime.call(s.validators.datetime,e,t)},format:function(e,t){(s.isString(t)||tinstanceofRegExp)&&(t={pattern:t});varn,r=(t=s.extend({},this.options,t)).message||this.message||"is invalid",i=t.pattern;if(s.isDefined(e))returns.isString(e)?(s.isString(i)&&(i=newRegExp(t.pattern,t.flags)),(n=i.exec(e))&&n[0].length==e.length?void0:r):r},inclusion:function(e,t){if(s.isDefined(e)&&(s.isArray(t)&&(t={within:t}),t=s.extend({},this.options,t),!s.contains(t.within,e))){varn=t.message||this.message||"^%{value} is not included in the list";returns.format(n,{value:e})}},exclusion:function(e,t){if(s.isDefined(e)&&(s.isArray(t)&&(t={within:t}),t=s.extend({},this.options,t),s.contains(t.within,e))){varn=t.message||this.message||"^%{value} is restricted";returns.isString(t.within[e])&&(e=t.within[e]),s.format(n,{value:e})}},email:s.extend((function(e,t){varn=(t=s.extend({},this.options,t)).message||this.message||"is not a valid email";if(s.isDefined(e))returns.isString(e)&&this.PATTERN.exec(e)?void0:n}),{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(e,t,n,r,i){if(s.isDefined(e)){s.isString(t)&&(t={attribute:t});varo=(t=s.extend({},this.options,t)).message||this.message||"is not equal to %{attribute}";if(s.isEmpty(t.attribute)||!s.isString(t.attribute))thrownewError("The attribute must be a non empty string");vara=s.getDeepObjectValue(r,t.attribute),u=t.comparator||function(e,t){returne===t},c=t.prettify||i&&i.prettify||s.prettify;returnu(e,a,t,n,r)?void0:s.format(o,{attribute:c(t.attribute)})}},url:function(e,t){if(s.isDefined(e)){varn=(t=s.extend({},this.options,t)).message||this.message||"is not a valid url",r=t.schemes||this.schemes||["http","https"],i=t.allowLocal||this.allowLocal||!1,o=t.allowDataUrl||this.allowDataUrl||!1;if(!s.isString(e))returnn;vara="^(?:(?:"+r.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",u="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(i?u+="?":a+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",a+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+u+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",o){a="(?:"+a+")|(?:^data:(?:\\w+\\/[-+.\\w]+(?:;[\\w=]+)*)?(?:;base64)?,[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*$)"}returnnewRegExp(a,"i").exec(e)?void0:n}},type:s.extend((function(e,t,n,r,i){if(s.isString(t)&&(t={type:t}),s.isDefined(e)){varo,a=s.extend({},this.options,t),u=a.type;if(!s.isDefined(u))thrownewError("No type was specified");if(o=s.isFunction(u)?u:this.types[u],!s.isFunction(o))thrownewError("validate.validators.type.types."+u+" must be a function.");if(!o(e,a,n,r,i)){varc=t.message||this.messages[u]||this.message||a.message||(s.isFunction(u)?"must be of the correct type":"must be of type %{type}");returns.isFunction(c)&&(c=c(e,t,n,r,i)),s.format(c,{attribute:s.prettify(n),type:u})}}}),{types:{object:function(e){returns.isObject(e)&&!s.isArray(e)},array:s.isArray,integer:s.isInteger,number:s.isNumber,string:s.isString,date:s.isDate,boolean:s.isBoolean},messages:{}})},i.formatters={detailed:function(e){returne},flat:s.flattenErrorsToArray,grouped:function(e){vart;for(tine=s.groupErrorsByAttribute(e))e[t]=s.flattenErrorsToArray(e[t]);returne},constraint:function(e){vart;for(tine=s.groupErrorsByAttribute(e))e[t]=e[t].map((function(e){returne.validator})).sort();returne}},i.exposeModule(i,this,e,t,n(164))}).call(this,t,e,n(164))}).call(this,n(119)(e))},258:function(e,t,n){e.exports=n(259)},259:function(e,t,n){"use strict";n.r(t),n.d(t,"initOriginSave",(function(){returnl})),n.d(t,"validateSaveOriginUrl",(function(){returnf})),n.d(t,"initTakeNewSnapshot",(function(){returnd}));varr,i=n(2),s=n(21),o=n(225);functiona(e,t){varn;if("undefined"==typeofSymbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeofe)returnu(e,t);varn=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)returnArray.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))returnu(e,t)}(e))||t&&e&&"number"==typeofe.length){n&&(e=n);varr=0;returnfunction(){returnr>=e.length?{done:!0}:{done:!1,value:e[r++]}}}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}functionu(e,t){(null==t||t>e.length)&&(t=e.length);for(varn=0,r=newArray(t);n<t;n++)r[n]=e[n];returnr}functionc(e,t,n,r,s){varo=Urls.origin_save_request(e,t);$(".swh-processing-save-request").css("display","block"),Object(i.a)(o,{Accept:"application/json","Content-Type":"application/json"}).then(i.b).then((function(e){returne.json()})).then((function(e){$(".swh-processing-save-request").css("display","none"),"accepted"===e.save_request_status?n():r()})).catch((function(e){$(".swh-processing-save-request").css("display","none"),e.json().then((function(t){s(e.status,t)}))}))}functionl(){$(document).ready((function(){$.fn.dataTable.ext.errMode="none",fetch(Urls.origin_save_types_list()).then((function(e){returne.json()})).then((function(e){for(vart,n=a(e);!(t=n()).done;){varr=t.value;$("#swh-input-visit-type").append('<option value="'+r+'">'+r+"</option>")}})),r=$("#swh-origin-save-requests").on("error.dt",(function(e,t,n,r){$("#swh-origin-save-request-list-error").text("An error occurred while retrieving the save requests list"),console.log(r)})).DataTable({serverSide:!0,processing:!0,language:{processing:'<img src="'+s.c+'"></img>'},ajax:Urls.origin_save_requests_list("all"),searchDelay:1e3,columns:[{data:"save_request_date",name:"request_date",render:function(e,t,n){return"display"===t?newDate(e).toLocaleString():e}},{data:"visit_type",name:"visit_type"},{data:"origin_url",name:"origin_url",render:function(e,t,n){if("display"===t){varr="",i=$.fn.dataTable.render.text().display(e);if("succeed"===n.save_task_status){vars=Urls.browse_origin()+"?origin_url="+i;r+='<a href="'+(s+="&timestamp="+n.visit_date)+'">'+i+"</a>"}elser+=i;returnr+=' <a href="'+i+'"><i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>'}returne}},{data:"save_request_status",name:"status"},{data:"save_task_status",name:"loading_task_status"}],scrollY:"50vh",scrollCollapse:!0,order:[[0,"desc"]],responsive:{details:{type:"none"}}}),swh.webapp.addJumpToPagePopoverToDataTable(r),$("#swh-origin-save-requests-list-tab").on("shown.bs.tab",(function(){r.draw(),window.location.hash="#requests"})),$("#swh-origin-save-request-create-tab").on("shown.bs.tab",(function(){Object(i.f)()}));vare=Object(i.d)("success",'The "save code now" request has been accepted and will be processed as soon as possible.',!0),t=Object(i.d)("warning",'The "save code now" request has been put in pending state and may be accepted for processing after manual review.',!0),n=Object(i.d)("danger",'The rate limit for "save code now" requests has been reached. Please try again later.',!0),o=Object(i.d)("danger",'An unexpected error happened when submitting the "save code now request".',!0);$("#swh-save-origin-form").submit((function(r){(r.preventDefault(),r.stopPropagation(),$(".alert").alert("close"),r.target.checkValidity())?($(r.target).removeClass("was-validated"),c($("#swh-input-visit-type").val(),$("#swh-input-origin-url").val(),(function(){return$("#swh-origin-save-request-status").html(e)}),(function(){return$("#swh-origin-save-request-status").html(t)}),(function(e,t){if($("#swh-origin-save-request-status").css("color","red"),403===e){varr=Object(i.d)("danger","Error: "+t.detail);$("#swh-origin-save-request-status").html(r)}else429===e?$("#swh-origin-save-request-status").html(n):$("#swh-origin-save-request-status").html(o)}))):$(r.target).addClass("was-validated")})),$("#swh-show-origin-save-requests-list").on("click",(function(e){e.preventDefault(),$('.nav-tabs a[href="#swh-origin-save-requests-list"]').tab("show")})),$("#swh-input-origin-url").on("input",(function(e){vart=$(this).val().trim();$(this).val(t),$("#swh-input-visit-type option").each((function(){vare=$(this).val();e&&t.includes(e)&&$(this).prop("selected",!0)}))})),"#requests"===window.location.hash&&$('.nav-tabs a[href="#swh-origin-save-requests-list"]').tab("show")}))}functionf(e){vart=e.value.trim(),n=void0===Object(o.validate)({website:t},{website:{url:{schemes:["http","https","svn","git"]}}});if("git"===$("#swh-input-visit-type").val()&&n){varr=t.indexOf("://github.com"),s=t.indexOf("://gitlab."),a=t.indexOf("://git.code.sf.net"),u=t.indexOf("://bitbucket.org");if(-1!==r&&r<=5)n=Object(i.e)(t,"github.com");elseif(-1!==s&&s<=5){varc=s+3,l=t.indexOf("/",c);if(-1!==l){varf=t.substr(c,l-c);n=Object(i.e)(t,f)}elsen=!1}else-1!==a&&a<=5?n=Object(i.e)(t,"git.code.sf.net/p"):-1!==u&&u<=5&&(n=Object(i.e)(t,"bitbucket.org"))}n?e.setCustomValidity(""):e.setCustomValidity("The origin url is not valid or does not reference a code repository")}functiond(){vare=Object(i.d)("success",'The "take new snapshot" request has been accepted and will be processed as soon as possible.',!0),t=Object(i.d)("warning",'The "take new snapshot" request has been put in pending state and may be accepted for processing after manual review.',!0),n=Object(i.d)("danger",'The rate limit for "take new snapshot" requests has been reached. Please try again later.',!0),r=Object(i.d)("danger",'An unexpected error happened when submitting the "save code now request".',!0);$(document).ready((function(){$("#swh-take-new-snapshot-form").submit((function(s){s.preventDefault(),s.stopPropagation(),c($("#swh-input-visit-type").val(),$("#swh-input-origin-url").val(),(function(){return$("#swh-take-new-snapshot-request-status").html(e)}),(function(){return$("#swh-take-new-snapshot-request-status").html(t)}),(function(e,t){if($("#swh-take-new-snapshot-request-status").css("color","red"),403===e){vars=Object(i.d)("danger","Error: "+t.detail,!0);$("#swh-take-new-snapshot-request-status").html(s)}else429===e?$("#swh-take-new-snapshot-request-status").html(n):$("#swh-take-new-snapshot-request-status").html(r)}))}))}))}}})}));