1"use strict";!function(e,t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):e.tudoforms=t()}(this,function(){var e,n={australia:{tz:"Australia/Sydney",currency:"AUD"},canada:{tz:"US/Eastern",currency:"CAD"},ireland:{tz:"Europe/London",currency:"eur"},new_zealand:{tz:"Pacific/Auckland",currency:"NZD"},united_kingdom:{tz:"Europe/London",currency:"GBP"},united_states:{tz:"US/Eastern",currency:"USD"},brazil:{tz:"America/Sao_Paulo",currency:"BRL"}},s="click tap",u="tudoforms_attachments",l="tudoforms_session",c={message:{}};e={queue:{},fired:[]};function p(e){if(e&&e.trim())return["#",e.replace("#","")].join("")}function d(e){!0===c.CONFIG.DEBUG&&console.log(e)}function f(e,t){if(e||t){t=new Date([e,t].join(" "));return"Invalid Date"===t?void 0:t}}"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(e){if(null===e)return!1;var t=e.length;if(this.length<t)return!1;for(--t;0<=t&&this[t]===e[t];--t)continue;return t<0});for(var h={phone:function(e,t){if(!e)return!1;return!!e.match(/^[+]*[(]{0,1}[0-9]{1,3}[)]{0,1}[-\s\./0-9]*$/g)},tel:function(e,t){if(c.tditi&&t.id)return!!c.tditi[t.id].getNumber();if(!e)return!1;return!!e.match(/^[+]*[(]{0,1}[0-9]{1,3}[)]{0,1}[-\s\./0-9]*$/g)},email:function(e,t){if(!e)return!1;return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},text:function(e,t){if(!e)return!1;return 1<=e.length&&e.length<=9999},number:function(e,t){return!!e&&!isNaN(e)},password:function(e,t){if(!e)return!1;return 6<=e.length&&e.length<=20},domain:function(e,t){if(!e)return!1;return!!(e.match(/^[a-z0-9]*$/)&&3<e.length&&e.length<25)},name:function(e,t){if(!e)return!1;return/^([a-zA-Z]{2,}\s[a-zA-z]{1,}'?-?[a-zA-Z]{2,}\s?([a-zA-Z]{1,})?)/.test(e)}},o=[],t=0;t<256;t++)o[t]=(t<16?"0":"")+t.toString(16);function m(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,a=4294967295*Math.random()|0;return o[255&e]+o[e>>8&255]+o[e>>16&255]+o[e>>24&255]+"-"+o[255&t]+o[t>>8&255]+"-"+o[t>>16&15|64]+o[t>>24&255]+"-"+o[63&r|128]+o[r>>8&255]+"-"+o[r>>16&255]+o[r>>24&255]+o[255&a]+o[a>>8&255]+o[a>>16&255]+o[a>>24&255]}function y(){c.leadform[0].reset(),c.leadform.find(".has-danger").removeClass("has-danger"),c.clearAttachments&&c.clearAttachments();try{var e=document.getElementById("intl-mobile");e&&c.tditi[e.id].setNumber(""),(e=document.getElementById("intl-phone"))&&c.tditi[e.id].setNumber("")}catch(e){console.log(e)}var t=JSON.parse(localStorage.getItem(l));t.submission_token=void 0,localStorage.setItem(l,JSON.stringify(t))}function v(e,r){var t,a,n=[],o={},i=(e=e[0],a=function(e){try{var t=document.getElementById("intl-mobile");t&&(e[t.name]=c.tditi[t.id].getNumber()),(t=document.getElementById("intl-phone"))&&(e[t.name]=c.tditi[t.id].getNumber())}catch(e){console.log(e)}return e}(a=formToObject(e)),c.leadform.find(".has-danger").removeClass("has-danger"),c.leadform.find("[required]").each(function(){!1===function(e){var t=$(e),r=t.attr("type"),e=t.attr("name");h.hasOwnProperty(r)||(r="text");return!0===h[r](a[e],t)||(t.closest(".form-group").addClass("has-danger"),!1)}(this)&&(!0!==t&&this.focus(),t=!0)}),t?null:a);if(!i)return r("Please complete all required fields marked red, then click SEND.");
1i.tags&&0<i.tags.length&&n.push(i.tags),Object.keys(i).forEach(function(e){var t,r,a;e.toLowerCase().startsWith("tag-")&&n.push(i[e]),e.toLowerCase().startsWith("item-")&&(t=i[e],r=e,a=m(),r=r.replace("item-",""),!function(e){return!isNaN(parseFloat(e))&&isFinite(e)}(t)?!0===function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(t)?(e=JSON.parse(t),o[a]={id:a,kind:"SHIP_LINE_ITEM",name:e.name,qty:e.qty||1,removed:0}):o[a]={id:a,kind:"SHIP_LINE_ITEM",name:t,qty:1,removed:0}:o[a]={id:a,kind:"SHIP_LINE_ITEM",name:r,qty:t,removed:0})}),i.tags=n.join(","),i.list_item=o,g(function(e,t){t&&(t="Submission rejected error. Max limit for submit 1 per user reached.",c.message.error(t),r(t)),function(t,e,r){e.submission_token=e.submission_token||m(),t.clientid=e.token,t.ip=e.ip||e.query,t.submission_token=e.submission_token,t.contact_name=[t.firstname,t.lastname].join(" "),t.referer=function(){var e=location.protocol.concat("//");return parent!==window?document.referrer:e.concat(window.location.hostname)}(),t.source=t.device||"WEBSITE",t.session_country=e.country,t.session_region=e.city===e.region_name?"":e.region_name,t.session_city=e.city,t.location=e.location,t.files=c.files;try{t.booking_start&&(t.booking_start=f(t.booking_start,t.booking_start_time)),t.booking_end&&(t.booking_end=f(t.booking_end,t.booking_end_time))}catch(e){t.booking_start=void 0,t.booking_end=void 0,t.booking_start_time=void 0,t.booking_end_time=void 0}if(c.files&&0<c.files.length&&(t.avatar=c.files[0].avatar),"TEST"===P)return setTimeout(function(){d(t),y(),r(null,"OK")},3e3);!function(e,t){if(!e)throw"Payload or function name missing http request object.";var r=[b,e.id].join("/"),a=new XMLHttpRequest;a.open("POST",r),a.setRequestHeader("Content-Type","application/json"),a.timeout=6e3,a.ontimeout=function(){return t.error({error:"Unable to send submission. Check connection and retry.",message:{}})},a.onload=function(){return 200===a.status&&t?t.success(JSON.parse(a.responseText)):t.error({error:"Submission failed or form is not accepting requests. You can try again.",message:JSON.parse(a.responseText)})},e=JSON.stringify(e),a.send(e)}(t,{success:function(e){d(e),y(),r(null,e)},error:function(e){d(e.message),alert(e.error||"Submission failed or form is not accepting requests. You can try again."),r(e.message)}})}(i,e,r)})}function g(r){var a=localStorage,e=JSON.parse(a.getItem(l));if(e)return d("Prefetched GEOIP from local device."),d(e),r(e);(function(e){e.token=m();try{var t=e.country_name;t&&(e.country=t,(t=n[t.replace(" ","_").toLowerCase()])&&(e.currency=t.currency,e.timezone=t.tz))}catch(e){console.log(e)}a.setItem(l,JSON.stringify(e)),d("Fetched GEOIP..."),r(e)})({})}var b,P="LIVE";for(o=[],t=0;t<256;t++)o[t]=(t<16?"0":"")+t.toString(16);var r;r=0;return{init:function(e){c.CONFIG=e,window.filepicker?filepicker.setKey("AvA8PZEw5SHeRvf3WJ-dyz"):d("filepicker.js not loaded"),b="https://api.tudocommerce.com/v1/forms",d((P=e.MODE||"LIVE")+" MODE."),console.log("%cððð https://www.tudodesk.com","color:#999999;font-size:24px")},uuid:m,postLeadForm:v,initLeadForm:function(n){(n=n||{}).success=n.success||function(){},n.error=n.error||function(){};var e,t,r=$(p(n.formId)),a=r.find(":submit");function o(e){var t=e.filename?e.filename.split(".")[0].split("_").join(" "):"",e={kind:"FILE",id:m(),name:t,avatar:e.url,fileName:e.filename,mimetype:e.mimetype,size:e.size};c.files.push(e)}function i(){c.attachmentsTemplate?c.attachmentsholder.html(Mustache.render(c.attachmentsTemplate,{files:c.files})):console.error("Failed to render attachments no template string specified.")}c.successform=$(p(n.successFormId)),c.contactform=$(p(n.contactFormId)),c.leadform=r,c.uploadbtn=$(p(n.attachmentsUploadBtnId)),c.resetbtn=$(p(n.resetBtnId)),c.restartbtn=$(p(n.restartBtnId)),c.attachmentsholder=$(p(n.attachmentsHolderId)),c.attachmentRemoveBtnStr=n.attachmentRemoveBtnStr||"REMOVE",c.attachmentsTemplate=n.attachmentsTemplate||"{{#files}}<div class='card card-landscape'><img src='{{avatar}}/convert?h=50&quality=90'><div class='card-block truncate'><b>{{name}}</b> <small class='text-muted'>{{mimetype}}</small><button type='button' class='btn btn-sm btn-secondary img-delete' data-index='{{id}}'>
1"+c.attachmentRemoveBtnStr+"</button></div></div>{{/files}}",c.submitBusyStr=n.submitBusyStr||"Sending...",c._uploads=!0,c.tditi_utilsScript=n.tditi_utilsScript||"/js/intl-input/js/utils.js",a.length<1||r.length<1?d("FAILED TO INIT FORM: "+n.formId+" or could not find a button of type SUBMIT. Check your html markup."):(c.attachmentsholder.length<1?(d("NO ATTACHMENTS HOLDER ELEMENT SPECIFIED. UPLOADS WILL BE DISABLED"),c._uploads=!1):(d("ATTACHMENTS HOLDER ELEMENT FOUND"),c.attachmentsTemplate&&Mustache.parse(c.attachmentsTemplate)),c.uploadbtn.length<1?(c._uploads=!1,d("NO ATTACHMENTS UPLOAD BUTTON SPECIFIED. UPLOADS WILL BE DISABLED")):d("ATTACHMENTS UPLOAD BUTTON FOUND"),[{id:"form-lifecycle-stage",name:"lifecycle_stage",val:"lead"},{id:"form-device",name:"device",val:"TUDOFORM SDK"},{id:"form-gdpr-consent",name:"consent_terms",val:"Your personal information provided to us will be used only for purposes of responding to your request and providing any subsequent services you agree to"}].forEach(function(e){var t,r,a;t=e.id,r=e.name,a=e.val,e=n.formId,document.getElementById(t)||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("name",r),t.setAttribute("value",a),document.getElementById(e).appendChild(t))}),g(function(e){var t=JSON.parse(localStorage.getItem(l));t&&t.envelope&&0<t.envelope.ids.length&&($("#form-send-alert").show(),submit.attr("disabled",!0))}),0!=c._uploads?(c.files=JSON.parse(localStorage.getItem(u))||[],i(),c.uploadbtn.click(function(){var e=c.uploadbtn.attr("data-filetype")||"image/*";filepicker.pickAndStore({mimetype:e,services:"WEBCAM,COMPUTER,URL,IMAGE_SEARCH,GOOGLE_DRIVE,BOX".split(","),container:"window"},{location:"S3"},function(e){!e||e.length<1||(e.forEach(o),i(),localStorage.setItem(u,JSON.stringify(c.files)))})}),c.attachmentsholder.on(s,".img-delete",function(){for(var e=c.files,t=this.getAttribute("data-index"),r=0;r<e.length;r++)if(e[r].id==t){e.splice(r,1);break}i(),localStorage.setItem(u,JSON.stringify(c.files))}),c.clearAttachments=function(){c.files=[],i(),localStorage.setItem(u,JSON.stringify(c.files))}):c.uploadbtn.attr("disabled",!0),a.click(function(e){e.preventDefault(),r.submit()}),r.submit(function(e){var t;e.preventDefault(),t=a.html(),a.html(c.submitBusyStr).attr("disabled",!0),v(r,function(e){return a.html(t).attr("disabled",!1),e?n.error(e):(c.showSuccess(),void n.success())})}),c.showSuccess=function(){d("Show success"),0<c.successform.length?(c.leadform.hide(),c.successform.show()[0].scrollIntoView()):alert("Form submission accepted: Thanks for filling out the form we will get back to you shortly.")},c.showForm=function(){d("Show form"),c.leadform.show(),0<c.successform.length&&c.successform.hide()},c.resetbtn.click(function(){y()}),c.restartbtn.click(function(){c.showForm()}),c.tditi={},e="intl-mobile",(t=document.getElementById(e))&&window.intlTelInput&&(c.tditi[e]=window.intlTelInput(t,{initialCountry:t.getAttribute("data-country")||"us",utilsScript:c.tditi_utilsScript})))},message:function(){return c.message},DEBUG:d}}),function(e,t){"object"==typeof exports&&exports&&"string"!=typeof exports.nodeName?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e.Mustache={},t(Mustache))}(this,function(P){var t=Object.prototype.toString,w=Array.isArray||function(e){return"[object Array]"===t.call(e)};function l(e){return"function"==typeof e}function E(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function s(e,t){return null!=e&&"object"==typeof e&&t in e}var r=RegExp.prototype.test;var a=/\S/;function _(e){return t=a,e=e,!r.call(t,e);var t}var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};var k=/\s*/,x=/\s+/,S=/\s*=/,O=/\s*\}/,A=/#|\^|\/|>|\{|&|=|!/;function o(e,t){if(!e)return[];var r,a,n,o=[],i=[],s=[],u=!1,l=!1;function c(e){if("string"==typeof e&&(e=e.split(x,2)),!w(e)||2!==e.length)throw new Error("Invalid tags: "+e);r=new RegExp(E(e[0])+"\\s*"),a=new RegExp("\\s*"+E(e[1])),n=new RegExp("\\s*"+E("}"+e[1]))}c(t||P.tags);for(var p,d,f,h,m,y,v=new I(e);!v.eos();){if(p=v.pos,f=v.scanUntil(r))for(var g=0,b=f.length;g<b;++g)_(h=f.charAt(g))?s.push(i.length):l=!0,i.push(["text",h,p,p+1]),p+=1,"\n"===h&&function(){if(u&&!l)for(;s.length;)delete i[s.pop()];else s=[];l=u=!1}();if(!v.scan(r))break;if(u=!0,d=v.scan(A)||"name",v.scan(k),"="===d?(f=v.scanUntil(S),v.scan(S),v.scanUntil(a)):"{"===d?(f=v.scanUntil(n),v.scan(O),v.scanUntil(a),d="&"):f=v.scanUntil(a),!v.scan(a))throw new Error("Unclosed tag at "+v.pos);if(m=[d,f,p,v.pos],i.push(m),"#"===d||"^"===d)o.push(m);else if("/"===d){if(!(y=o.pop()))throw new Error('Unopened section "'+f+'" at '+p);if(y[1]!==f)throw new Error('Unclosed section "'+y[1]+'" at '+p)}else"name"===d||"{"===d||"&"===d?l=!0:"="===d&&c(f)}if(y=o.pop())throw new Error('Unclosed section "'+y[1]+'" at '+v.pos);return function(e){for(var t,r=[],a=r,n=[],o=0,i=e.length;o<i;++o)switch((t=e[o])[0]){case"#":case"^":a.push(t),n.push(t),a=t[4]=[];break;case"/":n.pop()[5]=t[2],a=0<n.length?n[n.length-1][4]:r;break;default:a.push(t)}return r}(function(e){for(var t,r,a=[],n=0,o=e.length;n<o;++n)(t=e[n])&&("text"===t[0]&&r&&"text"===r[0]?(r[1]+=t[1],r[3]=t[3]):(a.push(t),r=t));return a}(i))}function I(e){this.string=e,this.tail=e,this.pos=0}function i(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function e(){this.cache={}}I.prototype.eos=function(){return""===this.tail},I.prototype.scan=function(e){e=this.tail.match(e);if(!e||0!==e.index)return"";e=e[0];return this.tail=this.tail.substring(e.length),this.pos+=e.length,e},I.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},i.prototype.push=function(e){return new i(e,this)},i.prototype.lookup=function(e){var t,r=this.cache;if(r.hasOwnProperty(e))t=r[e];else{for(var a,n,o=this,i=!1;o;){if(0<e.indexOf("."))for(t=o.view,a=e.split("."),n=0;null!=t&&n<a.length;)n===a.length-1&&(i=s(t,a[n])),t=t[a[n++]];else t=o.view[e],i=s(o.view,e);if(i)break;o=o.parent}r[e]=t}return l(t)&&(t=t.call(this.view)),t},e.prototype.clearCache=function(){this.cache={}},e.prototype.parse=function(e,t){var r=this.cache,a=r[e];return null==a&&(a=r[e]=o(e,t)),a},e.prototype.render=function(e,t,r){var a=this.parse(e),t=t instanceof i?t:new i(t);return this.renderTokens(a,t,r,e)},e.prototype.renderTokens=function(e,t,r,a){for(var n,o,i,s="",u=0,l=e.length;u<l;++u)i=void 0,"#"===(o=(n=e[u])[0])?i=this.renderSection(n,t,r,a):"^"===o?i=this.renderInverted(n,t,r,a):">"===o?i=this.renderPartial(n,t,r,a):"&"===o?i=this.unescapedValue(n,t):"name"===o?i=this.escapedValue(n,t):"text"===o&&(i=this.rawValue(n)),void 0!==i&&(s+=i);return s},e.prototype.renderSection=function(e,t,r,a){var n=this,o="",i=t.lookup(e[1]);if(i){if(w(i))for(var s=0,u=i.length;s<u;++s)o+=this.renderTokens(e[4],t.push(i[s]),r,a);else if("object"==typeof i||"string"==typeof i||"number"==typeof i)o+=this.renderTokens(e[4],t.push(i),r,a);else if(l(i)){if("string"!=typeof a)throw new Error("Cannot use higher-order sections without the original template");null!=(i=i.call(t.view,a.slice(e[3],e[5]),function(e){return n.render(e,t,r)}
1))&&(o+=i)}else o+=this.renderTokens(e[4],t,r,a);return o}},e.prototype.renderInverted=function(e,t,r,a){var n=t.lookup(e[1]);if(!n||w(n)&&0===n.length)return this.renderTokens(e[4],t,r,a)},e.prototype.renderPartial=function(e,t,r){if(r){e=l(r)?r(e[1]):r[e[1]];return null!=e?this.renderTokens(this.parse(e),t,r,e):void 0}},e.prototype.unescapedValue=function(e,t){e=t.lookup(e[1]);if(null!=e)return e},e.prototype.escapedValue=function(e,t){e=t.lookup(e[1]);if(null!=e)return P.escape(e)},e.prototype.rawValue=function(e){return e[1]},P.name="mustache.js",P.version="2.2.0",P.tags=["{{","}}"];var u=new e;P.clearCache=function(){return u.clearCache()},P.parse=function(e,t){return u.parse(e,t)},P.render=function(e,t,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(w(a=e)?"array":typeof a)+'" was given as the first argument for mustache#render(template, view, partials)');var a;return u.render(e,t,r)},P.to_html=function(e,t,r,a){r=P.render(e,t,r);if(!l(a))return r;a(r)},P.escape=function(e){return String(e).replace(/[&<>"'\/]/g,function(e){return n[e]})},P.Scanner=I,P.Context=i,P.Writer=e}),function(){function t(e){if(!(this instanceof t))return new t(e);if(!e)throw new Error("No DOM elements passed into Touche");return this.nodes=e,this}var r,i="ontouchstart"in window||"msmaxtouchpoints"in window.navigator;t.prototype.on=function(e,t){var o,r,a=this.nodes,n=a.length;if(i&&"click"===e&&(o=!0),r=function(e,t,r){function a(){!n&&(n=!0)&&r.apply(this,arguments)}var n;e.addEventListener(t,a,!1),o&&e.addEventListener("touchend",a,!1)},n)for(;n--;)r(a[n],e,t);else r(a,e,t);return this},window.Touche=t,window.jQuery&&i&&(r=jQuery.fn.on,jQuery.fn.on=function(){var e=arguments[0];return arguments[0]="click"===e?"touchend":e,r.apply(this,arguments),this})}(),function(v,a){var n=function(){if(!(this instanceof n)){var e=new n;return e.init.call(e,Array.prototype.slice.call(arguments))}var t=null,o={includeEmptyValuedElements:!1,w3cSuccesfulControlsOnly:!1},i=/[^\[\]]+|\[\]/g,s=null,u=[];function r(e){return Object.keys(e).filter(function(e){return!isNaN(parseInt(e,10))}).splice(-1)[0]}function l(e){e=r(e);return parseInt(e,10)}function c(e){e=r(e);return void 0===e?0:parseInt(e,10)+1}function p(e){var t,r;if("function"==typeof Object.keys)t=Object.keys(e).length;else for(r in e)e.hasOwnProperty(r)&&t++;return t}function d(e){return"INPUT"===e.nodeName&&"radio"===e.type}function f(e){return"INPUT"===e.nodeName&&"checkbox"===e.type}function h(e){return"SELECT"===e.nodeName&&"select-multiple"===e.type}function m(e){return e.checked}function y(e,t,r,a){t=t[0];if(d(e))return!1!==r&&(a[t]=r);if(f(e))return!1!==r&&(a[t]||(a[t]=[]),a[t].push(r));if(h(e)){if(!1===r)return;a[t]=r}return a[t]=r}return{init:function(e){return!(!e||"object"!=typeof e||!e[0])&&(t=e[0],void 0!==e[1]&&0<p(e[1])&&function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}(o,e[1]),!!function(){switch(typeof t){case"string":s=a.getElementById(t);break;case"object":!function(e){return"object"==typeof e&&"nodeType"in e&&1===e.nodeType}(t)||(s=t)}return s}()&&(!!(u=s.querySelectorAll("input, textarea, select")).length&&function(){var e,t,r,a=0,n={};for(a=0;a<u.length;a++)!(t=u[a]).name||""===t.name||t.disabled||d(t)&&!m(t)||!1===(r=function(e){if(d(e))return!!m(e)&&e.value;if(f(e))return!!m(e)&&e.value;if(function(e){return"INPUT"===e.nodeName&&"file"===e.type}(e))return!(!s.enctype||"multipart/form-data"!==s.enctype)&&(function(e){return v.FileList&&e.files instanceof v.FileList}(e)&&0<e.files.length?e.files:!(!e.value||""===e.value)&&e.value);if("TEXTAREA"===e.nodeName)return!(!e.value||""===e.value)&&e.value;if(h(e)){if(e.options&&0<e.options.length){var t=[];return function(e,t){if([].forEach)return[].forEach.call(e,t);for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(e,e[r])}(e.options,function(e){e.selected&&t.push(e.value)}),(o.includeEmptyValuedElements||!!t.length)&&t}return!1}if(function(e){return"BUTTON"===e.nodeName&&"submit"===e.type}(e))return e.value&&""!==e.value?e.value:!(!e.innerText||""===e.innerText)&&e.innerText;return void 0!==e.value&&((o.includeEmptyValuedElements||""!==e.value)&&e.value)}(t))&&!o.includeEmptyValuedElements||(1===(e=t.name.match(i)).length&&y(t,e,r||"",n),1<e.length&&function e(t,r,a,n){var o=r[0];if(1<r.length)return"[]"===o?(n[c(n)]={},e(t,r.splice(1,r.length),a,n[l(n)])):(n[o]&&0<p(n[o])||(n[o]={}),e(t,r.splice(1,r.length),a,n[o]));if(1===r.length)return"[]"===o?n[c(n)]=a:y(t,r,a,n),n}(t,e,r||"",n));return 0<p(n)&&n}()))}}};v.formToObject=n}(window,document),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("filepicker",["exports"],t):t(e.filepicker={})}(this,function(e){var i;function re(e){return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}i={urls:{fileApiUrl:"https://www.filestackapi.com/api/file",uploadApiUrl:"https://upload.filestackapi.com",cloudApiUrl:"https://cloud.filestackapi.com",cdnUrl:"https://cdn.filestackcontent.com",pickerUrl:"https://static.filestackapi.com/picker/1.4.4/picker.js"}};var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},g=function(){return(g=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function b(o,i,s,u){return new(s=s||Promise)(function(e,t){function r(e){try{n(u.next(e))}catch(e){t(e)}}function a(e){try{n(u.throw(e))}catch(e){t(e)}}function n(t){t.done?e(t.value):new s(function(e){e(t.value)}).then(r,a)}n((u=u.apply(o,i||[])).next())})}function P(r,a){var n,o,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,i&&(t=[2&t[0],i.value]),t[0]){case 0:case 1:i=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,o=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(i=0<(i=s.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&i[3]>t[1])){s.label=t[1];break}if(6===t[0]&&i[1]>s.label){s.label=i[1],i=t;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(t);break}i[2]&&s.ops.pop(),s.trys.pop();continue}t=a.call(r,s)}catch(e){t=[6,e],o=0}finally{n=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}var d=function(e){return"function"==typeof e},f=function(e){return null==e},c=function(e){return e.displayName||e.name||"<function"+e.length+">"};function a(e,t){return"function"==typeof t?c(t):t}function n(t){try{return JSON.stringify(t,a,2)}catch(e){return t+""}}function o(e,t){!0!==e&&(d(t)?t=t():f(t)&&(t='Assert failed (turn on "Pause on exceptions" in your Source panel)'),o.fail(t))}o.fail=function(e){throw new TypeError("[tcomb] "+e)},o.stringify=n;function s(e){return"string"==typeof e}function u(e,t){h(!(e instanceof t),function(){return"Cannot use the new operator to instantiate the type "+v(t)})}function l(e){return"number"==typeof e&&isFinite(e)&&!isNaN(e)}var h=o,p=function(e){return Array.isArray?Array.isArray(e):e instanceof Array},m=function(e){return!f(e)&&"object"===re(e)&&!p(e)},y=function(e){return d(e)&&m(e.meta)},v=function(e){return y(e)?e.displayName:c(e)},t=function(r,a){function n(e,t){return u(this,n),t=t||[r],h(a(e),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")}),e}return h(s(r),function(){return"Invalid argument name "+h.stringify(r)+" supplied to irreducible(name, predicate) (expected a string)"}),h(d(a),"Invalid argument predicate "+h.stringify(a)+" supplied to irreducible(name, predicate) (expected a function)"),n.meta={kind:"irreducible",name:r,predicate:a,identity:!0},n.displayName=r,n.is=a,n},w=t("Any",function(){return!0}),E=t("Array",p),_=function(e){return!0===e||!1===e},k=t("Boolean",_),x=t("Date",function(e){return e instanceof Date}),S=t("Error",function(e){return e instanceof Error}),O=t("Function",d),A=t("Nil",f),I=t("Number",l),F=function(e){return f(e)||s(e)},T=function(e){return!y(e)||(h(k.is(e.meta.identity),function(){return"Invalid meta identity "+h.stringify(e.meta.identity)+" supplied to type "+v(e)}),e.meta.identity)},j=function(e,t,r){return y(e)?e.meta.identity||"object"!==re(t)||null===t?e(t,r):new e(t,r):(r=r||[c(e)],h(t instanceof e,function(){return"Invalid value "+n(t)+" supplied to "+r.join("/")}),t)},D=function(e,t){return y(t)?t.is(e):e instanceof t};function R(e,t){return"{"+v(e)+" | "+c(t)+"}"}function $(a,n,e){h(d(a),function(){return"Invalid argument type "+h.stringify(a)+" supplied to refinement(type, predicate, [name]) combinator (expected a type)"}),h(d(n),function(){return"Invalid argument predicate supplied to refinement(type, predicate, [name]) combinator (expected a function)"}),h(F(e),function(){return"Invalid argument name "+h.stringify(e)+" supplied to refinement(type, predicate, [name]) combinator (expected a string)"});var o=e||R(a,n),i=T(a);function s(e,t){i&&u(this,s);var r=j(a,e,t=t||[o]);return h(n(r),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")}),r}return s.meta={kind:"subtype",type:a,predicate:n,name:e,identity:i},s.displayName=o,s.is=function(e){return D(e,a)&&n(e)},s.update=function(e,t){return s(h.update(e,t))},s}$.getDefaultName=R;
1var C=$,z=C(I,function(e){return e%1==0},"Integer"),N=t("Object",m),U=t("RegExp",function(e){return e instanceof RegExp}),q=t("String",s),L=t("Type",y);function M(e,t){return"{[key: "+v(e)+"]: "+v(t)+"}"}function V(s,u,e){h(d(s),function(){return"Invalid argument domain "+h.stringify(s)+" supplied to dict(domain, codomain, [name]) combinator (expected a type)"}),h(d(u),function(){return"Invalid argument codomain "+h.stringify(u)+" supplied to dict(domain, codomain, [name]) combinator (expected a type)"}),h(F(e),function(){return"Invalid argument name "+h.stringify(e)+" supplied to dict(domain, codomain, [name]) combinator (expected a string)"});var l=e||M(s,u),c=v(s),p=v(u),t=T(s)&&T(u);function r(e,t){t=t||[l],h(m(e),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")});var r,a,n,o=!0,i={};for(r in e)e.hasOwnProperty(r)&&(r=j(s,r,t.concat(c)),a=e[r],n=j(u,a,t.concat(r+": "+p)),o=o&&a===n,i[r]=n);return o&&(i=e),Object.freeze(i),i}return r.meta={kind:"dict",domain:s,codomain:u,name:e,identity:t},r.displayName=l,r.is=function(e){if(!m(e))return!1;for(var t in e)if(e.hasOwnProperty(t)&&(!D(t,s)||!D(e[t],u)))return!1;return!0},r.update=function(e,t){return r(h.update(e,t))},r}V.getDefaultName=M;function B(e,t,r){if(f(t))return e;for(var a in t)t.hasOwnProperty(a)&&(!0!==r&&h(!e.hasOwnProperty(a)||e[a]===t[a],function(){return'Invalid call to mixin(target, source, [overwrite]): cannot overwrite property "'+a+'" of target object'}),e[a]=t[a]);return e}function H(e){return y(e)&&"union"===e.meta.kind}var Q=V,J=1;function K(e){return Object.keys(e).map(function(e){return h.stringify(e)}).join(" | ")}function G(r,e){h(m(r),function(){return"Invalid argument map "+h.stringify(r)+" supplied to enums(map, [name]) combinator (expected a dictionary of String -> String | Number)"}),h(F(e),function(){return"Invalid argument name "+h.stringify(e)+" supplied to enums(map, [name]) combinator (expected a string)"});var a=e||K(r);function n(e,t){return u(this,n),t=t||[a],h(n.is(e),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")+" (expected one of "+h.stringify(Object.keys(r))+")"}),e}return n.meta={kind:"enums",map:r,name:e,identity:!0},n.displayName=a,n.is=function(e){return r.hasOwnProperty(e)},n}G.of=function(e,t){e=s(e)?e.split(" "):e;var r={};return e.forEach(function(e){r[e]=e}),G(r,t)},G.getDefaultName=K;var Z=G;function W(e){return"Array<"+v(e)+">"}function X(u,e){h(d(u),function(){return"Invalid argument type "+h.stringify(u)+" supplied to list(type, [name]) combinator (expected a type)"}),h(F(e),function(){return"Invalid argument name "+h.stringify(e)+" supplied to list(type, [name]) combinator (expected a string)"});var l=e||W(u),c=v(u),t=T(u);function r(e,t){t=t||[l],h(p(e),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")+" (expected an array of "+c+")"});for(var r=!0,a=[],n=0,o=e.length;n<o;n++){var i=e[n],s=j(u,i,t.concat(n+": "+c)),r=r&&i===s;a.push(s)}return r&&(a=e),Object.freeze(a),a}return r.meta={kind:"list",type:u,name:e,identity:t},r.displayName=l,r.is=function(e){return p(e)&&e.every(function(e){return D(e,u)})},r.update=function(e,t){return r(h.update(e,t))},r}X.getDefaultName=W;var Y=X;function ee(e){return"?"+v(e)}function te(r,e){if(y(t=r)&&"maybe"===t.meta.kind||r===w||r===A)return r;h(d(r),function(){return"Invalid argument type "+h.stringify(r)+" supplied to maybe(type, [name]) combinator (expected a type)"}),h(F(e),function(){return"Invalid argument name "+h.stringify(e)+" supplied to maybe(type, [name]) combinator (expected a string)"});var t=e||ee(r),a=T(r);function n(e,t){return a&&u(this,n),A.is(e)?e:j(r,e,t)}return n.meta={kind:"maybe",type:r,name:e,identity:a},n.displayName=t,n.is=function(e){return A.is(e)||D(e,r)},n}te.getDefaultName=ee;var ae=te,ne=function(t){return"{"+Object.keys(t).map(function(e){return e+": "+v(t[e])}).join(", ")+"}"};function oe(e){return y(e)&&"subtype"===e.meta.kind}var ie=function(e,t,r){h(d(e),function(){return"Invalid argument combinator supplied to extend(combinator, mixins, options), expected a function"}),h(p(t),function(){return"Invalid argument mixins supplied to extend(combinator, mixins, options), expected an array"});var n={},o={},i=[],s={};t.forEach(function(e,t){var r,a,e={predicates:function e(t){return oe(t)?[t.meta.predicate].concat(e(t.meta.type)):[]}(r=e),unrefinedType:function e(t){return oe(t)?e(t.meta.type):t}(r)},r=e.unrefinedType;h(m(r)||y(a=r)&&"struct"===a.meta.kind||y(a=r)&&"interface"===a.meta.kind,function(){return"Invalid argument mixins["+t+"] supplied to extend(combinator, mixins, options), expected an object, struct, interface or a refinement (of struct or interface)"}),Array.prototype.push.apply(i,e.predicates),B(n,m(e=r)?e:e.meta.props),B(o,r.prototype),B(s,m(r=r)?null:r.meta.defaultProps,!0)}),(r=e.getOptions(r)).defaultProps=B(s,r.defaultProps,!0);r=function(e,t,r){t=e.reduce(function(e,t){return C(e,t)},t);return r&&(t.displayName=r,t.meta.name=r),t}(i,e(n,{strict:r.strict,defaultProps:r.defaultProps}),r.name);return B(r.prototype,o),r};function se(e){return"Struct"+ne(e)}function ue(e,t){return ie(ce,e,t)}function le(e){return m(e)||(e=f(e)?{}:{name:e}
1),e.hasOwnProperty("strict")||(e.strict=ce.strict),e.hasOwnProperty("defaultProps")||(e.defaultProps={}),e}function ce(o,e){var t=(e=le(e)).name,i=e.strict,s=e.defaultProps;h(Q(q,O).is(o),function(){return"Invalid argument props "+h.stringify(o)+" supplied to struct(props, [options]) combinator (expected a dictionary String -> Type)"}),h(F(t),function(){return"Invalid argument name "+h.stringify(t)+" supplied to struct(props, [options]) combinator (expected a string)"}),h(_(i),function(){return"Invalid argument strict "+h.stringify(i)+" supplied to struct(props, [options]) combinator (expected a boolean)"}),h(m(s),function(){return"Invalid argument defaultProps "+h.stringify(s)+" supplied to struct(props, [options]) combinator (expected an object)"});var u=t||se(o);function l(e,t){if(l.is(e))return e;if(t=t||[u],h(m(e),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")+" (expected an object)"}),i)for(r in e)e.hasOwnProperty(r)&&h(o.hasOwnProperty(r),function(){return'Invalid additional prop "'+r+'" supplied to '+t.join("/")});if(!(this instanceof l))return new l(e,t);for(var r in o){var a,n;o.hasOwnProperty(r)&&(a=o[r],void 0===(n=e[r])&&(n=s[r]),this[r]=j(a,n,t.concat(r+": "+v(a))))}Object.freeze(this)}return l.meta={kind:"struct",props:o,name:t,identity:!1,strict:i,defaultProps:s},l.displayName=u,l.is=function(e){return e instanceof l},l.update=function(e,t){return new l(h.update(e,t))},l.extend=function(e,t){return ue([l].concat(e),t)},l}ce.strict=!1,ce.getOptions=le,ce.getDefaultName=se,ce.extend=ue;var pe=ce;function de(e){return"["+e.map(v).join(", ")+"]"}function fe(u,e){h(p(u)&&u.every(d),function(){return"Invalid argument types "+h.stringify(u)+" supplied to tuple(types, [name]) combinator (expected an array of types)"}),h(F(e),function(){return"Invalid argument name "+h.stringify(e)+" supplied to tuple(types, [name]) combinator (expected a string)"});var l=e||de(u),t=u.every(T);function r(e,t){t=t||[l],h(p(e)&&e.length===u.length,function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")+" (expected an array of length "+u.length+")"});for(var r=!0,a=[],n=0,o=u.length;n<o;n++){var i=u[n],s=e[n],i=j(i,s,t.concat(n+": "+v(i))),r=r&&s===i;a.push(i)}return r&&(a=e),Object.freeze(a),a}return r.meta={kind:"tuple",types:u,name:e,identity:t},r.displayName=l,r.is=function(r){return p(r)&&r.length===u.length&&u.every(function(e,t){return D(r[t],e)})},r.update=function(e,t){return r(h.update(e,t))},r}fe.getDefaultName=de;var he=fe;function me(e){return e.map(v).join(" | ")}function ye(o,e){h(p(o)&&o.every(d)&&2<=o.length,function(){return"Invalid argument types "+h.stringify(o)+" supplied to union(types, [name]) combinator (expected an array of at least 2 types)"}),h(F(e),function(){return"Invalid argument name "+h.stringify(e)+" supplied to union(types, [name]) combinator (expected a string)"});var a=e||me(o),n=o.every(T);function i(e,t){var r=i.dispatch(e);return!r&&i.is(e)?e:(n&&u(this,i),t=t||[a],h(d(r),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")+" (no constructor returned by dispatch)"}),t[t.length-1]+="("+v(r)+")",j(r,e,t))}return i.meta={kind:"union",types:o,name:e,identity:n},i.displayName=a,i.is=function(t){return o.some(function(e){return D(t,e)})},i.dispatch=function(e){for(var t=0,r=o.length;t<r;t++){var a=o[t];if(H(a)){var n=a.dispatch(e);if(!f(n))return n}else if(D(e,a))return a}},i.update=function(e,t){return i(h.update(e,t))},i}ye.getDefaultName=me;var ve=ye;function ge(e,t){return"("+e.map(v).join(", ")+") => "+v(t)}function be(e){return O.is(e)&&m(e.instrumentation)}function Pe(e){for(var t=e.length,r=!1,a=t-1;0<=a;a--){var n=e[a];if(!y(n)||"maybe"!==n.meta.kind)return a+1;r=!0}return r?0:t}function we(o,i,e){o=p(o)?o:[o],h(Y(O).is(o),function(){return"Invalid argument domain "+h.stringify(o)+" supplied to func(domain, codomain, [name]) combinator (expected an array of types)"}),h(O.is(i),function(){return"Invalid argument codomain "+h.stringify(i)+" supplied to func(domain, codomain, [name]) combinator (expected a type)"}),h(F(e),function(){return"Invalid argument name "+h.stringify(e)+" supplied to func(domain, codomain, [name]) combinator (expected a string)"});var s=e||ge(o,i),u=o.length,l=Pe(o);function r(e,t){return be(e)?(t=t||[s],h(r.is(e),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")}),e):r.of(e)}return r.meta={kind:"func",domain:o,codomain:i,name:e,identity:!0},r.displayName=s,r.is=function(e){return be(e)&&e.instrumentation.domain.length===u&&e.instrumentation.domain.every(function(e,t){return e===o[t]})&&e.instrumentation.codomain===i},r.of=function(a,n){return h(O.is(a),function(){return"Invalid argument f supplied to func.of "+s+" (expected a function)"}),h(f(n)||_(n),function(){return"Invalid argument curried "+h.stringify(n)+" supplied to func.of "+s+" (expected a boolean)"}),r.is(a)?a:(e.instrumentation={domain:o,codomain:i,f:a},e.displayName=c(a),e);function e(){var e=Array.prototype.slice.call(arguments),t=e.length;if(he(o.slice(0,n?t:Math.max(t,l)),"arguments of function "+s)(e),n&&t<u){h(0<t,"Invalid arguments.length = 0 for curried function "+s);var r=Function.prototype.bind.apply(a,[this].concat(e));return we(o.slice(t),i).of(r,!0)}return j(i,a.apply(this,e))}},r}we.getDefaultName=ge,we.getOptionalArgumentsIndex=Pe;var Ee=we,_e=T;function ke(e){return e.map(v).join(" & ")}function xe(e,t){h(p(e)&&e.every(d)&&2<=e.length,function(){return"Invalid argument types "+h.stringify(e)+" supplied to intersection(types, [name]) combinator (expected an array of at least 2 types)"}),h(F(t),function(){return"Invalid argument name "+h.stringify(t)+" supplied to intersection(types, [name]) combinator (expected a string)"});var r=t||ke(e),a=e.every(_e);function n(e,t){return a&&T(this,n),t=t||[r],h(n.is(e),function(){return"Invalid value "+h.stringify(e)+" supplied to "+t.join("/")}),e}return n.meta={kind:"intersection",types:e,name:t,identity:a},n.displayName=r,n.is=function(t){return e.every(function(e){return D(t,e)})},n.update=function(e,t){return n(h.update(e,t))},n}xe.getDefaultName=ke;var Se=xe,Oe=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e};function Ae(e,t){return ie(Fe,e,t)}function Ie(e){return m(e)||(e=f(e)?{}:{name:e}
1),e.hasOwnProperty("strict")||(e.strict=Fe.strict),e}function Fe(u,e){var t=(e=Ie(e)).name,l=e.strict;h(Q(q,O).is(u),function(){return"Invalid argument props "+h.stringify(u)+" supplied to interface(props, [options]) combinator (expected a dictionary String -> Type)"}),h(F(t),function(){return"Invalid argument name "+h.stringify(t)+" supplied to interface(props, [options]) combinator (expected a string)"}),h(_(l),function(){return"Invalid argument strict "+h.stringify(l)+" supplied to struct(props, [options]) combinator (expected a boolean)"});var c=t||ne(u),p=Object.keys(u).map(function(e){return u[e]}).every(T);function r(e,t){if(t=t||[c],h(!f(e),function(){return"Invalid value "+e+" supplied to "+t.join("/")}),l)for(var r in e)h(u.hasOwnProperty(r),function(){return'Invalid additional prop "'+r+'" supplied to '+t.join("/")});var a,n=!0,o=p?{}:Oe({},e);for(a in u){var i=u[a],s=e[a],i=j(i,s,t.concat(a+": "+v(i))),n=n&&s===i;o[a]=i}return n&&(o=e),Object.freeze(o),o}return r.meta={kind:"interface",props:u,name:t,identity:p,strict:l},r.displayName=c,r.is=function(e){if(f(e))return!1;if(l)for(var t in e)if(!u.hasOwnProperty(t))return!1;for(var r in u)if(!D(e[r],u[r]))return!1;return!0},r.update=function(e,t){return r(h.update(e,t))},r.extend=function(e,t){return Ae([r].concat(e),t)},r}Fe.strict=!1,Fe.getOptions=Ie,Fe.getDefaultName=ne,Fe.extend=Ae;var Te=Fe;function je(e){return m(e)?e instanceof Date||e instanceof RegExp?e:Oe({},e):p(e)?e.concat():e}function De(e,t){h(m(t),function(){return"Invalid argument patch "+h.stringify(t)+" supplied to function update(instance, patch): expected an object c
1ontaining commands"});var r,a,n,o=e,i=!1;for(r in t)t.hasOwnProperty(r)&&(n=r,De.commands.hasOwnProperty(n)?o=(a=(a=r,De.commands[a])(t[r],o))!==e?(i=!0,a):e:(o===e&&(o=je(e)),a=De(o[r],t[r]),i=i||a!==o[r],o[r]=a));return i?o:e}De.commands={$apply:function(e,t){return h(d(e),"Invalid argument f supplied to immutability helper { $apply: f } (expected a function)"),e(t)},$push:function(e,t){return h(p(e),"Invalid argument elements supplied to immutability helper { $push: elements } (expected an array)"),h(p(t),"Invalid value supplied to immutability helper $push (expected an array)"),0<e.length?t.concat(e):t},$remove:function(e,t){if(h(p(e),"Invalid argument keys supplied to immutability helper { $remove: keys } (expected an array)"),h(m(t),"Invalid value supplied to immutability helper $remove (expected an object)"),0<e.length){t=je(t);for(var r=0,a=e.length;r<a;r++)delete t[e[r]]}return t},$set:function(e){return e},$splice:function(e,t){return h(p(e)&&e.every(p),"Invalid argument splices supplied to immutability helper { $splice: splices } (expected an array of arrays)"),h(p(t),"Invalid value supplied to immutability helper $splice (expected an array)"),0<e.length?(t=je(t),e.reduce(function(e,t){return e.splice.apply(e,t),e},t)):t},$swap:function(e,t){var r;return h(m(e),"Invalid argument config supplied to immutability helper { $swap: config } (expected an object)"),h(l(e.from),"Invalid argument config.from supplied to immutability helper { $swap: config } (expected a number)"),h(l(e.to),"Invalid argument config.to supplied to immutability helper { $swap: config } (expected a number)"),h(p(t),"Invalid value supplied to immutability helper $swap (expected an array)"),e.from!==e.to&&(r=(t=je(t))[e.to],t[e.to]=t[e.from],t[e.from]=r),t},$unshift:function(e,t){return h(p(e),"Invalid argument elements supplied to immutability helper {$unshift: elements} (expected an array)"),h(p(t),"Invalid value supplied to immutability helper $unshift (expected an array)"),0<e.length?e.concat(t):t},$merge:function(e,t){var r,a=!1,n=je(t);for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r],a=a||n[r]!==t[r]);return a?n:t}};var Re=De;h.Any=w,h.Array=E,h.Boolean=k,h.Date=x,h.Error=S,h.Function=O,h.Nil=A,h.Number=I,h.Integer=z,h.IntegerT=h.Integer,h.Object=N,h.RegExp=U,h.String=q,h.Type=L,h.TypeT=h.Type,h.Arr=h.Array,h.Bool=h.Boolean,h.Dat=h.Date,h.Err=h.Error,h.Func=h.Function,h.Num=h.Number,h.Obj=h.Object,h.Re=h.RegExp,h.Str=h.String,h.dict=Q,h.declare=function(r){var a;function n(e,t){return h(!f(a),function(){return"Type declared but not defined, don't forget to call .define on every declared type"}),H(a)&&h(a.dispatch===n.dispatch,function(){return"Please define the custom "+r+".dispatch function before calling "+r+".define()"}),a(e,t)}return h(F(r),function(){return"Invalid argument name "+r+" supplied to declare([name]) (expected a string)"}),n.define=function(e){return h(y(e),function(){return"Invalid argument type "+h.stringify(e)+" supplied to define(type) (expected a type)"}),h(f(a),function(){return"Declare.define(type) can only be invoked once"}),H(e)&&n.hasOwnProperty("dispatch")&&(e.dispatch=n.dispatch),B(n,a=e,!0),r&&(a.displayName=n.displayName=r,n.meta.name=r),n.meta.identity=a.meta.identity,n.prototype=a.prototype,n},n.displayName=r||v(n)+"$"+J++,n.meta={identity:!1},n.prototype=null,n},h.enums=Z,h.irreducible=t,h.list=Y,h.maybe=ae,h.refinement=C,h.struct=pe,h.tuple=he,h.union=ve,h.func=Ee,h.intersection=Se,h.subtype=h.refinement,h.inter=Te,h.interface=h.inter,(h.assert=h).update=Re,h.mixin=B,h.isType=y,h.is=D,h.getTypeName=v,h.match=function(e){for(var t,r,a,n,o=1,i=arguments.length;o<i;)if(t=arguments[o],r=arguments[o+1],d(a=arguments[o+2])&&!y(a)?o+=3:(a=r,r=w.is,o+=2),n=(n||0)+1,h(y(t),function(){return"Invalid type in clause #"+n}),h(d(r),function(){return"Invalid guard in clause #"+n}),h(d(a),function(){return"Invalid block in clause #"+n}),t.is(e)&&r(e))return a(e);h.fail("Match error")};var $e=h,Ce=$e.stringify,ze={},Ne=$e.struct({message:$e.Any,actual:$e.Any,expected:$e.Any,path:$e.list($e.union([$e.String,$e.Number]))},"ValidationError");Ne.of=function(e,t,r,a){return new Ne({message:(n=e,o=t,i=r,a=a,$e.Function.is(o.getValidationErrorMessage)?o.getValidationErrorMessage(n,i,a):(n=n,i=i,o=$e.getTypeName(o),o=i.length?"/"+i.join("/")+": "+o:o,"Invalid value "+Ce(n)+" supplied to "+o)),actual:e,expected:t,path:r});var n,o,i};var Ue=$e.struct({errors:$e.list(Ne),value:$e.Any},"ValidationResult");function qe(e,t,r){var a=$e.Array.is(r=r||{})?r:r.path||[];return new Ue(Le(e,t,a,r))}function Le(e,t,r,a){return $e.isType(t)?Me[t.meta.kind](e,t,r,a):Me.es6classes(e,t,r,a)}Ue.prototype.isValid=function(){return!this.errors.length},Ue.prototype.firstError=function(){return this.isValid()?null:this.errors[0]},Ue.prototype.toString=function(){return this.isValid()?"[ValidationResult, true, "+Ce(this.value)+"]":"[ValidationResult, false, ("+this.errors.map(function(e){return Ce(e.message)}).join(", ")+")]"};var Me=qe.validators={};Me.es6classes=function(e,t,r,a){return{value:e,errors:e instanceof t?[]:[Ne.of(e,t,r,a.
1context)]}},Me.irreducible=Me.enums=function(e,t,r,a){return{value:e,errors:t.is(e)?[]:[Ne.of(e,t,r,a.context)]}},Me.list=function(e,t,r,a){if(!$e.Array.is(e))return{value:e,errors:[Ne.of(e,t,r,a.context)]};for(var n={value:[],errors:[]},o=0,i=e.length;o<i;o++){var s=Le(e[o],t.meta.type,r.concat(o),a);n.value[o]=s.value,n.errors=n.errors.concat(s.errors)}return n},Me.subtype=function(e,t,r,a){var n=Le(e,t.meta.type,r,a);return n.errors.length||t.meta.predicate(n.value)||(n.errors=[Ne.of(e,t,r,a.context)]),n},Me.maybe=function(e,t,r,a){return $e.Nil.is(e)?{value:e,errors:[]}:Le(e,t.meta.type,r,a)},Me.struct=function(e,t,r,a){if(!$e.Object.is(e))return{value:e,errors:[Ne.of(e,t,r,a.context)]};if(t.is(e))return{value:e,errors:[]};var n,o,i={value:{},errors:[]},s=t.meta.props,u=t.meta.defaultProps||ze;for(n in s)s.hasOwnProperty(n)&&(void 0===(o=e[n])&&(o=u[n]),o=Le(o,s[n],r.concat(n),a),i.value[n]=o.value,i.errors=i.errors.concat(o.errors));if((a.hasOwnProperty("strict")?a:t.meta).strict)for(var l in e)e.hasOwnProperty(l)&&!s.hasOwnProperty(l)&&i.errors.push(Ne.of(e[l],$e.Nil,r.concat(l),a.context));return i.errors.length||(i.value=new t(i.value)),i},Me.tuple=function(e,t,r,a){var n=t.meta.types,o=n.length;if(!$e.Array.is(e)||e.length>
1o)return{value:e,errors:[Ne.of(e,t,r,a.context)]};for(var i={value:[],errors:[]},s=0;s<o;s++){var u=Le(e[s],n[s],r.concat(s),a);i.value[s]=u.value,i.errors=i.errors.concat(u.errors)}return i},Me.dict=function(e,t,r,a){if(!$e.Object.is(e))return{value:e,errors:[Ne.of(e,t,r,a.context)]};var n,o,i,s={value:{},errors:[]};for(n in e)e.hasOwnProperty(n)&&(i=r.concat(n),o=Le(n,t.meta.domain,i,a),i=Le(e[n],t.meta.codomain,i,a),s.value[n]=i.value,s.errors=s.errors.concat(o.errors,i.errors));return s},Me.union=function(e,t,r,a){var n=t.dispatch(e);return $e.Function.is(n)?Le(e,n,r.concat(t.meta.types.indexOf(n)),a):{value:e,errors:[Ne.of(e,t,r,a.context)]}},Me.intersection=function(e,t,r,a){for(var n=t.meta.types,o=n.length,i={value:e,errors:[]},s=0,u=0;u<o;u++){"struct"===n[u].meta.kind&&s++;var l=Le(e,n[u],r,a);i.errors=i.errors.concat(l.errors)}return 1<s&&i.errors.push(Ne.of(e,t,r,a.context)),i},Me.interface=function(e,t,r,a){if(!$e.Object.is(e))return{value:e,errors:[Ne.of(e,t,r,a.context)]};var n,o={value:{},errors:[]},i=t.meta.props;for(n in i){var s=Le(e[n],i[n],r.concat(n),a);o.value[n]=s.value,o.errors=o.errors.concat(s.errors)}if((a.hasOwnProperty("strict")?a:t.meta).strict)for(var u in e)i.hasOwnProperty(u)||$e.Nil.is(e[u])||o.errors.push(Ne.of(e[u],$e.Nil,r.concat(u),a.context));return o},$e.mixin($e,{ValidationError:Ne,ValidationResult:Ue,validate:qe});var Ve=$e.Boolean,Be=$e.Function,He=$e.Integer,Qe=$e.Number,Je=$e.String,Ke=$e.enums,Ge=$e.refinement,Ze=$e.union,We=$e.struct,Xe=$e.validate,Ye=$e.list,et="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function tt(e,t){return e(t={exports:{}},t.exports),t.exports}function rt(e){return e&&e.default||e}function at(e){return null!==e&&"object"===re(e)}var nt=tt(function(e){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}(e.exports=r).prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,a=this._callbacks["$"+e];if(!a)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n=0;a.length>n;n++)if((r=a[n])===t||r.fn===t){a.splice(n,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r)for(var a=0,n=(r=r.slice(0)).length;a<n;++a)r[a].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}),ot=it;function it(e){if(e)return function(e){for(var t in it.prototype)e[t]=it.prototype[t];return e}(e)}it.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},it.prototype.parse=function(e){return this._parser=e,this},it.prototype.responseType=function(e){return this._responseType=e,this},it.prototype.serialize=function(e){return this._serializer=e,this},it.prototype.timeout=function(e){if(!e||"object"!==re(e))return this._timeout=e,this._responseTimeout=0,this;for(var t in e)switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;default:console.warn("Unknown timeout option",t)}return this},it.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),0<e||(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var st=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];it.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(e,t);if(!0===r)return!0;
1if(!1===r)return!1}catch(e){console.error(e)}if(t&&t.status&&500<=t.status&&501!=t.status)return!0;if(e){if(e.code&&~st.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},it.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},it.prototype.then=function(e,t){var n;return this._fullfilledPromise||((n=this)._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(r,a){n.end(function(e,t){e?a(e):r(t)})})),this._fullfilledPromise.then(e,t)},it.prototype.catch=function(e){return this.then(void 0,e)},it.prototype.use=function(e){return e(this),this},it.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},it.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):200<=e.status&&e.status<300)},it.prototype.getHeader=it.prototype.get=function(e){return this._header[e.toLowerCase()]},it.prototype.set=function(e,t){if(at(e)){for(var r in e)this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},it.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},it.prototype.field=function(e,t){if(null==e)throw Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),at(e)){for(var r in e)this.field(r,e[r]);return this}if(Array.isArray(t)){for(var a in t)this.field(e,t[a]);return this}if(null==t)throw Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},it.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},it.prototype._auth=function(e,t,r,a){switch(r.type){case"basic":this.set("Authorization","Basic "+a(e+":"+t));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer "+e)}return this},it.prototype.withCredentials=function(e){return null==e&&(e=!0),this._withCredentials=e,this},it.prototype.redirects=function(e){return this._maxRedirects=e,this},it.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},it.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},it.prototype.send=function(e){var t=at(e),r=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&at(this._data))for(var a in e)this._data[a]=e[a];else"string"==typeof e?(r||this.type("form"),this._data="application/x-www-form-urlencoded"==(r=this._header["content-type"])?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||r||this.type("json"),this},it.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},it.prototype._finalizeQueryString=function(){var e,t=this._query.join("&");t&&(this.url+=(this.url.indexOf("?")<0?"?":"&")+t),this._query.length=0,this._sort&&0<=(e=this.url.indexOf("?"))&&(t=this.url.substring(e+1).split("&"),"function"==typeof this._sort?t.sort(this._sort):t.sort(),this.url=this.url.substring(0,e)+"?"+t.join("&"))},it.prototype._appendQueryString=function(){console.trace("Unsupported")},it.prototype._timeoutError=function(e,t,r){this._aborted||((e=Error(e+t+"ms exceeded")).timeout=t,e.code="ECONNABORTED",e.errno=r,this.timedout=!0,this.abort(),this.callback(e))},it.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))};var ut=lt;function lt(e){if(e)return function(e){for(var t in lt.prototype)e[t]=lt.prototype[t];return e}(e)}function ct(){this._defaults=[]}lt.prototype.get=function(e){return this.header[e.toLowerCase()]},lt.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=t.split(/ *; */).shift();var r,a=t.split(/ *; */).reduce(function(e,t){var r=t.split(/ *= */),t=r.shift(),r=r.shift();return t&&r&&(e[t]=r),e},{});for(r in a)this[r]=a[r];this.links={};try{e.link&&(this.links=e.link.split(/ *, */).reduce(function(e,t){var r=t.split(/ *; */),t=r[0].slice(1,-1);return e[r[1].split(/ *= */)[1].slice(1,-1)]=t,e},{}))}catch(e){}},lt.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.redirect=3==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.created=201==e,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.forbidden=403==e,this.notFound=404==e,this.unprocessableEntity=422==e},["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(e){ct.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}}
1),ct.prototype._setDefaults=function(t){this._defaults.forEach(function(e){t[e.fn].apply(t,e.arguments)})};function pt(e,t){return yt[e](t).set("Filestack-Source","JS-1.14.6")}var dt=ct,t=tt(function(e,r){var t;function a(){}t="undefined"!=typeof window?window:"undefined"!=typeof self?self:(console.warn("Using browser-only version of superagent in non-browser environment"),et);var s=r=e.exports=function(e,t){return"function"==typeof t?new r.Request("GET",e).end(t):1==arguments.length?new r.Request("GET",e):new r.Request(e,t)};r.Request=c,s.getXHR=function(){if(!(!t.XMLHttpRequest||t.location&&"file:"==t.location.protocol&&t.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only version of superagent could not find XHR")};var u="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function n(e){if(!at(e))return e;var t,r=[];for(t in e)!function t(r,a,e){if(null!=e)if(Array.isArray(e))e.forEach(function(e){t(r,a,e)});else if(at(e))for(var n in e)t(r,a+"["+n+"]",e[n]);else r.push(encodeURIComponent(a)+"="+encodeURIComponent(e));else null===e&&r.push(encodeURIComponent(a))}(r,t,e[t]);return r.join("&")}function o(e){for(var t,r,a={},n=e.split("&"),o=0,i=n.length;o<i;++o)-1==(r=(t=n[o]).indexOf("="))?a[decodeURIComponent(t)]="":a[decodeURIComponent(t.slice(0,r))]=decodeURIComponent(t.slice(r+1));return a}function l(e){return/[\/+]json($|[^-\w])/.test(e)}function i(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.header=this.headers=function(e){for(var t,r,a,n=e.split(/\r?\n/),o={},i=0,s=n.length;i<s;++i)-1!==(a=(t=n[i]).indexOf(":"))&&(r=t.slice(0,a).toLowerCase(),a=u(t.slice(a+1)),o[r]=a);return o}(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),this.body=null===this.text&&e._responseType?this.xhr.response:"HEAD"!=this.req.method?this._parseBody(this.text||this.xhr.response):null}function c(e,t){var a=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e,t=null,r=null;try{r=new i(a)}catch(e){return(t=Error("Parser is unable to parse the response")).parse=!0,t.original=e,a.xhr?(t.rawResponse=void 0===a.xhr.responseType?a.xhr.responseText:a.xhr.response,t.status=a.xhr.status||null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),a.callback(t)}a.emit("response",r);try{a._isResponseOK(r)||(e=Error(r.statusText||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=r.status,a.callback(e,r)):a.callback(null,r)})}function p(e,t,r){e=s("DELETE",e);return"function"==typeof t&&(r=t,t=null),t&&e.send(t),r&&e.end(r),e}s.serializeObject=n,s.parseString=o,s.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},s.serialize={"application/x-www-form-urlencoded":n,"application/json":JSON.stringify},s.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},ut(i.prototype),i.prototype._parseBody=function(e){var t=s.parse[this.type];
1return this.req._parser?this.req._parser(this,e):(!t&&l(this.type)&&(t=s.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null)},i.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,e=Error("cannot "+t+" "+r+" ("+this.status+")");return e.status=this.status,e.method=t,e.url=r,e},s.Response=i,nt(c.prototype),ot(c.prototype),c.prototype.type=function(e){return this.set("Content-Type",s.types[e]||e),this},c.prototype.accept=function(e){return this.set("Accept",s.types[e]||e),this},c.prototype.auth=function(e,t,r){return 1===arguments.length&&(t=""),"object"===re(t)&&null!==t&&(r=t,t=""),r=r||{type:"function"==typeof btoa?"basic":"auto"},this._auth(e,t,r,function(e){if("function"==typeof btoa)return btoa(e);throw Error("Cannot use basic auth, btoa is not a function")})},c.prototype.query=function(e){return"string"!=typeof e&&(e=n(e)),e&&this._query.push(e),this},c.prototype.attach=function(e,t,r){if(t){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,r||t.name)}return this},c.prototype._getFormData=function(){return this._formData||(this._formData=new t.FormData),this._formData},c.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var r=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),r(e,t)},c.prototype.crossDomainError=function(){var e=Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},c.prototype.buffer=c.prototype.ca=c.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},c.prototype.pipe=c.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},c.prototype._isHost=function(e){return e&&"object"===re(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},c.prototype.end=function(e){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||a,this._finalizeQueryString(),this._end()},c.prototype._end=function(){var r=this,a=this.xhr=s.getXHR(),e=this._formData||this._data;this._setTimeouts(),a.onreadystatechange=function(){var t,e=a.readyState;if(2<=e&&r._responseTimeoutTimer&&clearTimeout(r._responseTimeoutTimer),4==e){try{t=a.status}catch(e){t=0}if(!t)return r.timedout||r._aborted?void 0:r.crossDomainError();r.emit("end")}};function t(e,t){0<t.total&&(t.percent=t.loaded/t.total*100),t.direction=e,r.emit("progress",t)}var n,o,i;if(this.hasListeners("progress"))try{a.onprogress=t.bind(null,"download"),a.upload&&(a.upload.onprogress=t.bind(null,"upload"))}catch(r){}try{this.username&&this.password?a.open(this.method,this.url,!0,this.username,this.password):a.open(this.method,this.url,!0)}catch(r){return this.callback(r)}for(i in this._withCredentials&&(a.withCredentials=!0),this._formData||"GET"==this.method||"HEAD"==this.method||"string"==typeof e||this._isHost(e)||(n=this._header["content-type"],!(o=this._serializer||s.serialize[n?n.split(";")[0]:""])&&l(n)&&(o=s.serialize["application/json"]),o&&(e=o(e))),this.header)null!=this.header[i]&&this.header.hasOwnProperty(i)&&a.setRequestHeader(i,this.header[i]);return this._responseType&&(a.responseType=this._responseType),this.emit("request",this),a.send(void 0!==e?e:null),this},s.agent=function(){return new dt},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(r){dt.prototype[r.toLowerCase()]=function(e,t){e=new s.Request(r,e);return this._setDefaults(e),t&&e.end(t),e}}),dt.prototype.del=dt.prototype.delete,s.get=function(e,t,r){e=s("GET",e);return"function"==typeof t&&(r=t,t=null),t&&e.query(t),r&&e.end(r),e},s.head=function(e,t,r){e=s("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&e.query(t),r&&e.end(r),e},s.options=function(e,t,r){e=s("OPTIONS",e);return"function"==typeof t&&(r=t,t=null),t&&e.send(t),r&&e.end(r),e},s.del=p,s.delete=p,s.patch=function(e,t,r){e=s("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&e.send(t),r&&e.end(r),e},s.post=function(e,t,r){e=s("POST",e);return"function"==typeof t&&(r=t,t=null),t&&e.send(t),r&&e.end(r),e},s.put=function(e,t,r){e=s("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&e.send(t),r&&e.end(r),e}}),ft=t.get,ht=t.put,mt=t.delete,yt=Object.freeze({default:t,__moduleExports:t,get:ft,post:t.post,put:ht,delete:mt,head:t.head,Request:t.Request}),vt=function(e,t,r,a){this.resolve=e,this.fn=t,this.self=r||null,this.args=a},gt=(bt.prototype.push=function(e){this._s1.push(e)},bt.prototype.shift=function(){var e=this._s2;if(0===e.length){var t=this._s1;if(0===t.length)return;this._s1=e,e=this._s2=t.reverse()}return e.pop()},bt.prototype.isEmpty=function(){return!this._s1.length&&!this._s2.length},bt);function bt(){this._s1=[],this._s2=[]}function Pt(n,r){var o=new gt;function a(t,r,a){if(n){n--;var e=new Promise(function(e){e(t.apply(r,a))});return e.then(i,i),e}return new Promise(function(e){o.push(new vt(e,t,r,a))})}function i(){var e;n++,o.isEmpty()||(e=o.shift()).resolve(a(e.fn,e.self,e.args))}if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected throat fn to be a function but got "+re(r));return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a(r,this,e)}}function wt(e,t){var r,a=e;return t&&(r=/filestackapi.com|filestackcontent.com/i,Object.keys(r).forEach(function(e){a[e]=r[e].replace(r,t)})),a}function Et(t,e,r){void 0===r&&(r={});var a=Object.keys(r),n=e.map(function(e){return e.name}),o=n.join(", ");return a.forEach(function(e){if(n.indexOf(e)<0)throw Error(e+" is not a valid option for "+t+". Valid options are: "+o)}),e.forEach(function(e){var t=r[e.name];if("location"===e.name&&"string"==typeof t&&(t=t.toLowerCase()),void 0!==t){e=Xe(t,e.type);if(!e.isValid()){e=e.firstError();if(e&&e.message)throw Error(e.message)}}}),a}function _t(e){var t=g({},e);return Object.keys(t).forEach(function(e){return!t[e]&&void 0!==t[e]&&delete t[e]}),t}function kt(a,n,o){var i,s=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i=!!o&&!s;var r=this;if(s||(s=!0,setTimeout(function(){if(s=!1,!o)return a.apply(r,e)},n)),i)return a.apply(this,arguments)}}function xt(e,t,r,a){if(!t||"string"!=typeof t)throw Error("A valid Filestack handle is required for remove");
1if(!(e.policy&&e.signature||a&&a.policy&&a.signature))throw Error("Security policy and signature are required for remove");var n=e.urls.fileApiUrl+"/"+t,o={key:e.apikey,policy:a&&a.policy||e.policy,signature:a&&a.signature||e.signature};return r&&(o.skip_storage=!0),new Promise(function(r,a){mt(n).query(o).end(function(e,t){e?a(e):r(t)})})}var St,Ot;(ae=St=St||{}).get="get",ae.head="head",(pe=Ot=Ot||{}).blob="blob";var At={$schema:"http://json-schema.org/draft-07/schema#",title:"Filestack Transformations",description:"Filestack transformations parameters",type:"object",additionalProperties:!(pe.json="json"),definitions:{securityCallDef:{$id:"#securityCallDef",type:"string",enum:["pick","read","stat","write","writeUrl","store","convert","remove","exif","runWorkflow"]},regionsDef:{$id:"#regionsDef",type:"string",enum:["us-east-1","us-west-1","us-west-2","eu-west-1","eu-central-1","ap-northeast-1","ap-northeast-2","ap-southeast-1","ap-southeast-2","sa-east-1"]},locationsDef:{$id:"#locationsDef",type:"string",enum:["s3","S3","rackspace","gcs","azure"," dropbox"]},colorDef:{$id:"#colorDef",oneOf:[{type:"string",pattern:"^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"},{type:"string",enum:["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fractal","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray0","gray1","gray2","gray3","gray4","gray5","gray6","gray7","gray8","gray9","gray10","gray11","gray12","gray13","gray14","gray15","gray16","gray17","gray18","gray19","gray20","gray21","gray22","gray23","gray24","gray25","gray26","gray27","gray28","gray29","gray30","gray31","gray32","gray33","gray34","gray35","gray36","gray37","gray38","gray39","gray40","gray41","gray42","gray43","gray44","gray45","gray46","gray47","gray48","gray49","gray50","gray51","gray52","gray53","gray54","gray55","gray56","gray57","gray58","gray59","gray60","gray61","gray62","gray63","gray64","gray65","gray66","gray67","gray68","gray69","gray70","gray71","gray72","gray73","gray74","gray75","gray76","gray77","gray78","gray79","gray80","gray81","gray82","gray83","gray84","gray85","gray86","gray87","gray88","gray89","gray90","gray91","gray92","gray93","gray94","gray95","gray96","gray97","gray98","gray99","gray100","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","none","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]}]},pageFormatDef:{$id:"#pageFormatDef",type:"string",enum:["a2","a3","a4","a5","b4","b5","letter","legal","tabloid"]},pageRangeDef:{$id:"#pageRangeDef",type:"array",uniqueItems:!0,items:[{oneOf:[{type:"integer",minimum:1},{type:"string",pattern:"^(\\d+(?:-\\d+)?)$|^(-\\d+)$|^(\\d+-)$",errorMessage:'Param should be provided in one of the following formats: "1,2,3,5", "1-3", "1-", "-2" '}]}]},facesDef:{$id:"#facesDef",oneOf:[{type:"string",enum:["all"]},{type:"integer",minimum:1,maximum:1e3},{type:"array",uniqueItems:!0,items:[{type:"integer",minimum:1,maximum:1e3}]}]},objectsDef:{$id:"#objectsDef",type:"array",minItems:1,maxItems:50,items:[{type:"array",additionalItems:!1,minItems:4,items:[{type:"integer",minimum:0,maximum:1e4},{type:"integer",minimum:0,maximum:1e4},{type:"integer",minimum:1,maximum:1e4},{type:"integer",minimum:1,maximum:1e4}]}]},positionDef:{$id:"#positionDef",default:["middle","center"],oneOf:[{type:"string",enum:["top","middle","bottom","left","center","right"]},{type:"array",uniqueItems:!0,additionalItems:!1,minItems:2,default:["middle","center"],items:[{type:"string",enum:["top","middle","bottom"]},{type:"string",enum:["left","center","right"]}]}]}},properties:{flip:{type:"boolean",additionalProperties:!1},no_metadata:{type:"boolean",additionalProperties:!1},compress:{additionalProperties:!1,oneOf:[{type:"boolean"},{type:"object",properties:{metadata:{type:"boolean",default:!1}}}]},flop:{type:"boolean",additionalProperties:!1},enchance:{type:"boolean",additionalProperties:!1},redeye:{type:"boolean",additionalProperties:!1},monochrome:{type:"boolean",additionalProperties:!1},negative:{type:"boolean",additionalProperties:!1},tags:{type:"boolean",additionalProperties:!1},sfw:{type:"boolean",additionalProperties:!1},imagesize:{type:"boolean",additionalProperties:!1},metadata:{type:"object",params:{type:"array",items:{type:"string",enum:["filename","mimetype","size","width","height","writeable","path","container","cloud","exif","source_url","md5","sha256","sha1","sha512"]},minItems:0,uniqueItems:!0,additionalItems:!1},additionalProperties:!1},resize:{type:"object",properties:{width:{type:"number",minimum:0,maximum:1e4},height:{type:"number",minimum:0,maximum:1e4},fit:{type:"string",enum:["clip","crop","scale","max"],default:"clip"},align:{$ref:"#positionDef",default:"center"}},additionalProperties:!1,anyOf:[{required:["width"]}
1,{required:["height"]}]},crop:{type:"object",properties:{dim:{type:"array",additionalItems:!1,minItems:4,items:[{type:"integer",minimum:0,maximum:1e5},{type:"integer",minimum:0,maximum:1e5},{type:"integer",minimum:1,maximum:1e5},{type:"integer",minimum:1,maximum:1e5}]}},required:["dim"]},rotate:{type:"object",properties:{deg:{oneOf:[{type:"string",enum:["exif"]},{type:"number",minimum:0,maximum:359}]},exif:{type:"boolean"},background:{$ref:"#colorDef",default:"FFFFFFFF"}},additionalProperties:!1},detect_faces:{oneOf:[{type:"boolean"},{type:"object",properties:{maxsize:{type:"number",minimum:0,maximum:1e4,default:.35},minsize:{type:"number",minimum:0,maximum:1e4,default:.35},export:{type:"boolean"},color:{$ref:"#colorDef",default:"000000FF"}},additionalProperties:!1}]},crop_faces:{oneOf:[{type:"boolean"},{type:"object",properties:{faces:{default:1,$ref:"#facesDef"},width:{type:"number",minimum:1,maximum:1e4},height:{type:"number",minimum:1,maximum:1e4},maxsize:{type:"number",minimum:0,maximum:1e4,default:.35},minsize:{type:"number",minimum:0,maximum:1e4,default:.35},buffer:{type:"integer",minimum:0,maximum:1e4},mode:{type:"string",enum:["crop","thumb","fill"],default:"thumb"}},additionalProperties:!1}]},pixelate_faces:{oneOf:[{type:"boolean"},{type:"object",properties:{faces:{$ref:"#facesDef",default:"all"},maxsize:{type:"number",minimum:0,maximum:1e4,default:.35},minsize:{type:"number",minimum:0,maximum:1e4,default:.35},buffer:{type:"integer",minimum:0,maximum:1e4},amount:{type:"integer",minimum:2,maximum:100,default:10},blur:{type:"number",minimum:0,maximum:20,default:4},type:{type:"string",enum:["rect","oval"],default:"rect"}},additionalProperties:!1}]},blur_faces:{oneOf:[{type:"boolean"},{type:"object",properties:{faces:{$ref:"#facesDef",default:"all"},maxsize:{type:"number",minimum:0,maximum:1e4,default:.35},minsize:{type:"number",minimum:0,maximum:1e4,default:.35},buffer:{type:"integer",minimum:0,maximum:1e4},amount:{type:"number",minimum:0,maximum:10,default:10},blur:{type:"number",minimum:0,maximum:20,default:4},type:{type:"string",enum:["rect","oval"],default:"rect"}},additionalProperties:!1}]},rounded_corners:{oneOf:[{type:"boolean"},{type:"object",properties:{radius:{oneOf:[{type:"integer",minimum:1,maximum:1e4},{type:"string",enum:["max"]}]},blur:{type:"number",minimum:0,maximum:20,default:.3},background:{$ref:"#colorDef"}},additionalProperties:!1}]},vignette:{oneOf:[{type:"boolean"},{type:"object",properties:{amount:{type:"integer",minimum:0,maximum:100,default:20},blurmode:{type:"string",enum:["gaussian","linear"],default:"gaussian"},background:{$ref:"#colorDef"}},additionalProperties:!1}]},polaroid:{oneOf:[{type:"boolean"},{type:"object",properties:{rotate:{type:"integer",minimum:0,maximum:359},color:{$ref:"#colorDef",default:"snow"},background:{$ref:"#colorDef"}},additionalProperties:!1}]},torn_edges:{oneOf:[{type:"boolean"},{type:"object",properties:{spread:{type:"array",additionalItems:!1,minItems:2,items:[{type:"integer",minimum:1,maximum:1e4,default:1},{type:"integer",minimum:1,maximum:1e4,default:10}]},background:{$ref:"#colorDef"}},additionalProperties:!1}]},shadow:{oneOf:[{type:"boolean"},{type:"object",properties:{blur:{type:"number",minimum:0,maximum:20,default:100},opacity:{type:"integer",minimum:0,maximum:100,default:60},vector:{type:"array",additionalItems:!1,minItems:2,items:[{type:"integer",minimum:-1e3,maximum:1e3,default:4},{type:"integer",minimum:-1e3,maximum:1e3,default:4}]},color:{$ref:"#colorDef"},background:{$ref:"#colorDef"}},additionalProperties:!1}]},circle:{oneOf:[{type:"boolean"},{type:"object",properties:{background:{$ref:"#colorDef"}},additionalProperties:!1}]},border:{oneOf:[{type:"boolean"},{type:"object",properties:{color:{$ref:"#colorDef"},background:{$ref:"#colorDef"},width:{type:"integer",minimum:0,maximum:1e3}},additionalProperties:!1}]},sharpen:{oneOf:[{type:"boolean"},{type:"object",properties:{amount:{type:"integer",minimum:0,maximum:20,default:2}},additionalProperties:!1}]},blur:{oneOf:[{type:"boolean"},{type:"object",properties:{amount:{type:"integer",minimum:0,maximum:20,default:2}},additionalProperties:!1}]},blackwhite:{oneOf:[{type:"boolean"},{type:"object",properties:{threshold:{type:"integer",minimum:0,maximum:100,default:50}},additionalProperties:!1}]},sepia:{oneOf:[{type:"boolean"},{type:"object",properties:{tone:{type:"integer",minimum:0,maximum:100,default:80}},additionalProperties:!1}]},pixelate:{oneOf:[{type:"boolean"},{type:"object",properties:{amount:{type:"integer",minimum:2,maximum:100,default:2}},additionalProperties:!1}]},oil_paint:{oneOf:[{type:"boolean"},{type:"object",properties:{amount:{type:"integer",minimum:2,maximum:100,default:2}},additionalProperties:!1}]},modulate:{oneOf:[{type:"boolean"},{type:"object",properties:{brightness:{type:"integer",minimum:0,maximum:1e4,default:100},saturation:{type:"integer",minimum:0,maximum:1e4,default:100},hue:{type:"integer",minimum:0,maximum:359,default:0}},additionalProperties:!1}]},asci:{oneOf:[{type:"boolean"},{type:"object",properties:{foreground:{$ref:"#colorDef",default:"000000FF"},background:{$ref:"#colorDef",default:"FFFFFFFF"},colored:{type:"boolean",default:!1},size:{type:"integer",minimum:10,maximum:100,default:100},reverse:{type:"boolean",default:!1}},additionalProperties:!1}]},collage:{type:"object",properties:{files:{type:"array",additionalItems:!1,minItems:1,items:[{type:"string"}]},margin:{type:"integer",minimum:1,maximum:100,default:10},width:{type:"integer",minimum:0,maximum:1e4},height:{type:"integer",minimum:0,maximum:1e4},color:{$ref:"#colorDef",default:"FFFFFFFF"},fit:{type:"string",enum:["auto","crop"]},autorotate:{type:"boolean",default:!1}},required:["width","height","files"],additionalProperties:!1},urlscreenshot:{oneOf:[{type:"boolean"},{type:"object",properties:{agent:{type:"string",enum:["desktop","mobile"],default:"desktop"},width:{type:"integer",minimum:1,maximum:1920,default:1024},height:{type:"integer",minimum:1,maximum:8e3,default:768},mode:{type:"string",enum:["all","window"],default:"all"},delay:{type:"integer",minimum:0,maximum:2e4,default:1e3},orientation:{type:"string",enum:["portrait","landscape"],default:"portrait"},device:{type:"string",default:""}},additionalProperties:!1}]},upscale:{oneOf:[{type:"boolean"},{type:"object",properties:{noise:{type:"string",enum:["none","low","medium","high"],default:"none"},upscale:{type:"boolean",default:!0},style:{type:"string",enum:["artwork","photo"],default:"photo"}},additionalProperties:!1}]},output:{type:"object",additionalProperties:!1,properties:{format:{type:"string",enum:["doc","docx","html","jpg","odp","ods","odt","pjpg","pdf","png","ppt","pptx","svg","txt","webp","xls","xlsx"]},page:{type:"integer",minimum:1,maximum:99999},density:{type:"integer",minimum:1,maximum:500},compress:{type:"boolean"},quality:{oneOf:[{type:"string",enum:["input"]},{type:"integer",minimum:1,maximum:100,default:95}]},secure:{type:"boolean",default:!1},docinfo:{type:"boolean",default:!1},strip:{type:"boolean",default:!1},colorspace:{type:"string",enum:["rgb","cmyk","input"],default:"rgb"},background:{$ref:"#colorDef"},pageformat:{type:"string",enum:["a2","a3","a4","a5","b4","b5","letter","legal","tabloid"]},pageorientation:{type:"string",enum:["landscape","portrait"]}}}
1,pjpg:{oneOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{quality:{type:"integer",minimum:0,maximum:100},metadata:{type:"boolean",default:!1}}}]},quality:{type:"object",additionalProperties:!1,properties:{value:{type:"integer",minimum:1,maximum:100}}},cache:{oneOf:[{type:"boolean"},{type:"object",properties:{expiry:{type:"integer"}}}]},video_convert:{type:"object",additionalProperties:!1,properties:{width:{type:"integer",minimum:1,maximum:4096},height:{type:"integer",minimum:1,maximum:4096},preset:{type:"string"},force:{type:"boolean"},title:{type:"string"},extname:{type:"string"},upscale:{type:"boolean"},aspect_mode:{type:"string",enum:["letterbox","pad","crop","preserve","constrain"],default:"letterbox"},audio_sample_rate:{type:"integer",minimum:1,maximum:99999},two_pass:{type:"boolean"},video_bitrate:{type:"integer",minimum:1,maximum:5e3},fps:{type:"integer",minimum:1,maximum:300},keyframe_interval:{type:"integer",minimum:250,maximum:250},audio_bitrate:{type:"integer",minimum:1,maximum:999},audio_channels:{type:"integer",minimum:1,maximum:12},clip_length:{type:"string",pattern:"^([0-1]?\\d|2[0-3])(?::([0-5]?\\d))?(?::([0-5]?\\d))?$"},clip_offset:{type:"string",pattern:"^([0-1]?\\d|2[0-3])(?::([0-5]?\\d))?(?::([0-5]?\\d))?$"},watermark_url:{type:"string"},watermark_top:{type:"integer",minimum:0,maximum:9999},watermark_right:{type:"integer",minimum:0,maximum:9999},watermark_bottom:{type:"integer",minimum:0,maximum:9999},watermark_left:{type:"integer",minimum:0,maximum:9999},frame_count:{type:"integer",minimum:1,maximum:1,default:1},filename:{type:"string"},location:{$ref:"#locationsDef"},path:{type:"string"},container:{type:"string"},access:{type:"string",enum:["public","private"],default:"public"}}},store:{oneOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{filename:{type:"string"},location:{$ref:"#locationsDef"},path:{type:"string"},container:{type:"string"},region:{$ref:"#regionsDef"},access:{type:"string",enum:["public","private"],default:"private"},base64decode:{type:"boolean"},workflows:{type:"array",additionalItems:!1,minItems:1,maxItems:20,items:[{type:"string"},{type:"object",additionalProperties:!1,properties:{id:{type:"string"}}}]}}}]},watermark:{type:"object",properties:{file:{type:"string"},size:{type:"number",minimum:0,maximum:500},position:{$ref:"#positionDef"}},required:["file"],additionalProperties:!1},partial_blur:{type:"object",properties:{objects:{$ref:"#objectsDef"},amount:{type:"number",minimum:0,maximum:20},blur:{type:"number",minimum:0,maximum:20},type:{type:"string",enum:["rect","oval"]}},required:["objects"]},partial_pixelate:{type:"object",properties:{objects:{$ref:"#objectsDef"},amount:{type:"number",minimum:2,maximum:100},blur:{type:"number",minimum:0,maximum:20},type:{type:"string",enum:["rect","oval"]}},required:["objects"]},security:{type:"object",additionalProperties:!1,properties:{policy:{type:"string"},signature:{type:"string"}},required:["policy","signature"]},pdfinfo:{oneOf:[{type:"boolean"},{type:"object",properties:{colorinfo:{type:"boolean"}}}]},pdfconvert:{type:"object",additionalProperties:!1,properties:{pageorientation:{type:"string",enum:["portrait","landscape"]},pageformat:{$ref:"#pageFormatDef"},pages:{$ref:"#pageRangeDef"}},anyOf:[{required:["pageorientation"]},{required:["pageformat"]},{required:["pages"]}]}}},It=tt(function(e,t){function y(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(1<t.length){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n<a;++n)t[n]=t[n].slice(1,-1);return t[a]=t[a].slice(1),t.join("")}return t[0]}function v(e){return"(?:"+e+")"}function a(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function h(e){return e.toUpperCase()}function r(e){var t=y("[0-9]","[A-Fa-f]"),r=v(v("%[EFef]"+t+"%"+t+t+"%"+t+t)+"|"+v("%[89A-Fa-f]"+t+"%"+t+t)+"|"+v("%"+t+t)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",n=y("[\\:\\/\\?\\#\\[\\]\\@]",a),o=e?"[\\uE000-\\uF8FF]":"[]",i=y("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),s=(y("[A-Za-z]","[0-9]","[\\+\\-\\.]"),v(r+"|"+y(i,a,"[\\:]")),"(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9][0-9])|(?:0?[1-9][0-9])|0?0?[0-9])"),u=v(s+"\\."+s+"\\."+s+"\\."+s),l=v(t+"{1,4}"),c=v(v(l+"\\:"+l)+"|"+u),p=v(v(l+"\\:")+"{6}"+c),d=v("\\:\\:"+v(l+"\\:")+"{5}"+c),f=v(v(l)+"?\\:\\:"+v(l+"\\:")+"{4}"+c),h=v(v(v(l+"\\:")+"{0,1}"+l)+"?\\:\\:"+v(l+"\\:")+"{3}"+c),m=v(v(v(l+"\\:")+"{0,2}"+l)+"?\\:\\:"+v(l+"\\:")+"{2}"+c),e=v(v(v(l+"\\:")+"{0,3}"+l)+"?\\:\\:"+l+"\\:"+c),s=v(v(v(l+"\\:")+"{0,4}"+l)+"?\\:\\:"+c),c=v(v(v(l+"\\:")+"{0,5}"+l)+"?\\:\\:"+l),l=v(v(v(l+"\\:")+"{0,6}"+l)+"?\\:\\:"),s=v([p,d,f,h,m,e,s,c,l].join("|")),c=v(v(i+"|"+r)+"+"),l=(y(i,a,"[\\:]"),v(r+"|"+y(i,a)),v(r+"|"+y(i,a,"[\\:\\@]")));return v(r+"|"+y(i,a,"[\\@]")),v(l+"|"+y("[\\/\\?]",o)),{NOT_SCHEME:RegExp(y("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:RegExp(y("[^\\%\\:]",i,a),"g"),NOT_HOST:RegExp(y("[^\\%\\[\\]\\:]",i,a),"g"),NOT_PATH:RegExp(y("[^\\%\\/\\:\\@]",i,a),"g"),NOT_PATH_NOSCHEME:RegExp(y("[^\\%\\/\\@]",i,a),"g"),NOT_QUERY:RegExp(y("[^\\%]",i,a,"[\\:\\@\\/\\?]",o),"g"),NOT_FRAGMENT:RegExp(y("[^\\%]",i,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:RegExp(y("[^]",i,a),"g"),UNRESERVED:RegExp(i,"g"),OTHER_CHARS:RegExp(y("[^\\%]",i,n),"g"),PCT_ENCODED:RegExp(r,"g"),IPV4ADDRESS:RegExp("^("+u+")$"),IPV6ADDRESS:RegExp("^\\[?("+s+")"+v(v("\\%25|\\%(?!"+t+"{2})")+"("+c+")")+"?\\]?$")}}function F(e){throw new RangeError(I[e])}function n(e,t){var r=e.split("@"),a="";return 1<r.length&&(a=r[0]+"@",e=r[1]),a+function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(A,".")).split("."),t).join(".")}function T(e){for(var t=[],r=0,a=e.length;r<a;){var n,o=e.charCodeAt(r++);o<55296||56319<o||a<=r?t.push(o):56320==(64512&(n=e.charCodeAt(r++)))?t.push(((1023&o)<<10)+(1023&n)+65536):(t.push(o),r--)}return t}function j(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function D(e,t,r){var a=0;for(e=r?$(e/700):e>>1,e+=$(e/t);455<e;a+=36)e=$(e/35);return $(a+36*e/(e+38))}function o(e){var t=[],r=e.length,a=0,n=128,o=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var s=0;s<i;++s)e.charCodeAt(s)<128||F("not-basic"),t.push(e.charCodeAt(s));for(var u=0<i?i+1:0;u<r;){for(var l=a,c=1,p=36;;p+=36){u<r||F("invalid-input");var d=(f=e.charCodeAt(u++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36;d<36&&d<=$((R-a)/c)||F("overflow"),a+=d*c;var f=o<p?p<o+26?p-o:26:1;if(d<f)break;f=36-f;c>$(R/f)&&F("overflow"),c*=f}var h=t.length+1,o=D(a-l,h,0==l);$(a/h)>R-n&&F("overflow"),n+=$(a/h),a%=h,t.splice(a++,0,n)}return String.fromCodePoint.apply(String,t)}function i(e){var t=[],r=(e=T(e)).length,a=128,n=0,o=72,i=!0,s=!1,u=void 0;try{for(var l=e[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var c=c.value;c<128&&t.push(C(c))}}catch(e){s=!0,u=e}finally{try{!i&&l.return&&l.return()}finally{if(s)throw u}}var p=t.length,d=p;for(p&&t.push("-");d<r;){var f=R,h=!0,m=!1,y=void 0;try{for(var v=e[Symbol.iterator]();!(h=(g=v.next()).done);h=!0){var g=g.value;a<=g&&g<f&&(f=g)}}catch(e){m=!0,y=e}finally{try{!h&&v.return&&v.return()}finally{if(m)throw y}}var b=d+1;f-a>$((R-n)/b)&&F("overflow"),n+=(f-a)*b,a=f;var P=!0,w=!1,E=void 0;try{for(var _=e[Symbol.iterator]();!(P=(k=_.next()).done);P=!0){var k=k.value;if(k<a&&++n>R&&F("overflow"),k==a){for(var x=n,S=36;;S+=36){var O=o<S?S<o+26?S-o:26:1;if(x<O)break;var A=x-O,I=36-O;t.push(C(j(O+A%I,0))),x=$(A/I)}t.push(C(j(x,0))),o=D(n,b,d==p),n=0,++d}}}catch(e){w=!0,E=e}finally{try{!P&&_.return&&_.return()}finally{if(w)throw E}}++n,++a}return t.join("")}function m(e){e=e.charCodeAt(0);return e<16?"%0"+e.toString(16).toUpperCase():e<128?"%"+e.toString(16).toUpperCase():e<2048?"%"+(e>>6|192).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase():"%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase()}function u(e){for(var t="",r=0,a=e.length;r<a;){var n,o,i=parseInt(e.substr(r+1,2),16);i<128?(t+=String.fromCharCode(i),r+=3):194<=i&&i<224?(a-r<6?t+=e.substr(r,6):(o=parseInt(e.substr(r+4,2),16),t+=String.fromCharCode((31&i)<<6|63&o)),r+=6):i<224?(t+=e.substr(r,3),r+=3):(a-r<9?t+=e.substr(r,9):(n=parseInt(e.substr(r+4,2),16),o=parseInt(e.substr(r+7,2),16),t+=String.fromCharCode((1
15&i)<<12|(63&n)<<6|63&o)),r+=9)}return t}function l(e,r){function t(e){var t=u(e);return t.match(r.UNRESERVED)?t:e}return e.scheme&&(e.scheme=(e.scheme+"").replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=(e.userinfo+"").replace(r.PCT_ENCODED,t).replace(r.NOT_USERINFO,m).replace(r.PCT_ENCODED,h)),void 0!==e.host&&(e.host=(e.host+"").replace(r.PCT_ENCODED,t).toLowerCase().replace(r.NOT_HOST,m).replace(r.PCT_ENCODED,h)),void 0!==e.path&&(e.path=(e.path+"").replace(r.PCT_ENCODED,t).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,m).replace(r.PCT_ENCODED,h)),void 0!==e.query&&(e.query=(e.query+"").replace(r.PCT_ENCODED,t).replace(r.NOT_QUERY,m).replace(r.PCT_ENCODED,h)),void 0!==e.fragment&&(e.fragment=(e.fragment+"").replace(r.PCT_ENCODED,t).replace(r.NOT_FRAGMENT,m).replace(r.PCT_ENCODED,h)),e}function p(e){return e.replace(/^0*(.*)/,"$1")||"0"}function d(e,t){t=e.match(t.IPV4ADDRESS)||[],t=x(t,2)[1];return t?t.split(".").map(p).join("."):e}function c(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=x(r,3),n=a[1],r=a[2];if(n){for(var a=n.toLowerCase().split("::").reverse(),n=x(a,2),a=n[0],n=n[1],o=n?n.split(":").map(p):[],i=a.split(":").map(p),n=t.IPV4ADDRESS.test(i[i.length-1]),s=n?7:8,u=i.length-s,l=Array(s),c=0;c<s;++c)l[c]=o[c]||i[u+c]||"";n&&(l[s-1]=d(l[s-1],t));a=l.reduce(function(e,t,r){return t&&"0"!==t||((t=e[e.length-1])&&t.index+t.length===r?t.length++:e.push({index:r,length:1})),e},[]).sort(function(e,t){return t.length-e.length})[0],n=void 0;return n=a&&1<a.length?(t=l.slice(0,a.index),a=l.slice(a.index+a.length),t.join(":")+"::"+a.join(":")):l.join(":"),r&&(n+="%"+r),n}return e}function s(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?k:_;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(U);if(n){q?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=c(d(r.host,a),a)),r.reference=void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?"relative":void 0===r.fragment?"absolute":"uri":"same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");n=N[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||n&&n.unicodeSupport)l(r,a);else{if(r.host&&(t.domainHost||n&&n.domainHost))try{r.host=z.toASCII(r.host.replace(a.PCT_ENCODED,u).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}l(r,_)}n&&n.parse&&n.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function f(e){for(var t=[];e.length;)if(e.match(L))e=e.replace(L,"");else if(e.match(M))e=e.replace(M,"/");else if(e.match(V))e=e.replace(V,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(B);if(!r)throw Error("Unexpected dot segment condition");r=r[0];e=e.slice(r.length),t.push(r)}return t.join("")}function g(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?k:_,a=[],n=N[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host&&!r.IPV6ADDRESS.test(e.host)&&(t.domainHost||n&&n.domainHost))try{e.host=t.iri?z.toUnicode(e.host):z.toASCII(e.host.replace(r.PCT_ENCODED,u).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}l(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var o,i,s,o=(o=e,i=!1!==t.iri?k:_,s=[],void 0!==o.userinfo&&(s.push(o.userinfo),s.push("@")),void 0!==o.host&&s.push(c(d(o.host+"",i),i).replace(i.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"==typeof o.port&&(s.push(":"),s.push(o.port.toString(10))),s.length?s.join(""):void 0);return void 0!==o&&("suffix"!==t.reference&&a.push("//"),a.push(o),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path&&(s=e.path,t.absolutePath||n&&n.absolutePath||(s=f(s)),void 0===o&&(s=s.replace(/^\/\//,"/%2F")),a.push(s)),void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function b(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=s(g(e,r),r),t=s(g(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=f(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=f(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=f(t.path):(a.path=void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:t.path:"/"+t.path,a.path=f(a.path)),a.query=t.query):(a.path=e.path,a.query=(void 0!==t.query?t:e).query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function P(e,t){return e&&(""+e).replace((t&&t.iri?k:_).PCT_ENCODED,u)}function w(e){var t=u(e);return t.match(Z)?t:e}var E,_,k,x,R,S,O,A,I,$,C,z,N,U,q,L,M,V,B,H,Q,J,K,G,Z,W,X,Y,ee,te,re;E=t,_=r(!1),k=r(!0),x=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],a=!0,n=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(a=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);a=!0);}catch(e){n=!0,o=e}finally{try{!a&&s.return&&s.return()}finally{if(n)throw o}}return r}(e,t);
1throw new TypeError("Invalid attempt to destructure non-iterable instance")},R=2147483647,S=/^xn--/,O=/[^\0-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$=Math.floor,C=String.fromCharCode,z={version:"2.1.0",ucs2:{decode:T,encode:function(e){return String.fromCodePoint.apply(String,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);e.length>t;t++)r[t]=e[t];return r}return Array.from(e)}(e))}},decode:o,encode:i,toASCII:function(e){return n(e,function(e){return O.test(e)?"xn--"+i(e):e})},toUnicode:function(e){return n(e,function(e){return S.test(e)?o(e.slice(4).toLowerCase()):e})}},N={},U=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,q=void 0==="".match(/(){0}/)[1],L=/^\.\.?\//,M=/^\/\.(\/|$)/,V=/^\/\.\.(\/|$)/,B=/^\/?(?:.|\n)*?(?=\/|$)/,Q={scheme:"https",domainHost:(H={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}
1,serialize:function(e,t){return e.port!==("https"!==(e.scheme+"").toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}}).domainHost,parse:H.parse,serialize:H.serialize},J={},K="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",v(v("%[EFef][0-9A-Fa-f]%"+(G="[0-9A-Fa-f]")+G+"%"+G+G)+"|"+v("%[89A-Fa-f][0-9A-Fa-f]%"+G+G)+"|"+v("%"+G+G)),t=y("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=RegExp(K,"g"),W=RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),X=RegExp(y("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',t),"g"),Y=RegExp(y("[^]",K,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ee=Y,G={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,o={},i=r.query.split("&"),s=0,u=i.length;s<u;++s){var l=i[s].split("=");switch(l[0]){case"to":for(var c=l[1].split(","),p=0,d=c.length;p<d;++p)a.push(c[p]);break;case"subject":r.subject=P(l[1],t);break;case"body":r.body=P(l[1],t);break;default:n=!0,o[P(l[0],t)]=P(l[1],t)}}n&&(r.headers=o)}r.query=void 0;for(var f=0,h=a.length;f<h;++f){var m=a[f].split("@");if(m[0]=P(m[0]),t.unicodeSupport)m[1]=P(m[1],t).toLowerCase();else try{m[1]=z.toASCII(P(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}a[f]=m.join("@")}return r},serialize:function(e,t){var r,a=e,n=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(n){for(var o=0,i=n.length;o<i;++o){var s=n[o]+"",u=s.lastIndexOf("@"),l=s.slice(0,u).replace(W,w).replace(W,h).replace(X,m),c=s.slice(u+1);try{c=t.iri?z.toUnicode(c):z.toASCII(P(c,t).toLowerCase())}catch(e){a.error=a.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[o]=l+"@"+c}a.path=n.join(",")}var p=e.headers=e.headers||{};e.subject&&(p.subject=e.subject),e.body&&(p.body=e.body);var d,f=[];for(d in p)p[d]!==J[d]&&f.push(d.replace(W,w).replace(W,h).replace(Y,m)+"="+p[d].replace(W,w).replace(W,h).replace(ee,m));return f.length&&(a.query=f.join("&")),a}},te=/^([^\:]+)\:(.*)/,t={scheme:"urn",parse:function(e,t){var r,a=e.path&&e.path.match(te),n=e;return a?(r=t.scheme||n.scheme||"urn",e=a[1].toLowerCase(),a=a[2],r=r+":"+(t.nid||e),r=N[r],n.nid=e,n.nss=a,n.path=void 0,r&&(n=r.parse(n,t))):n.error=n.error||"URN can not be parsed.",n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",a=e.nid,r=r+":"+(t.nid||a),r=N[r];r&&(e=r.serialize(e,t));r=e,e=e.nss;return r.path=(a||t.nid)+":"+e,r}},re=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,K={scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&e.uuid.match(re)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}},N[H.scheme]=H,N[Q.scheme]=Q,N[G.scheme]=G,N[t.scheme]=t,N[K.scheme]=K,E.SCHEMES=N,E.pctEncChar=m,E.pctDecChars=u,E.parse=s,E.removeDotSegments=f,E.serialize=g,E.resolveComponents=b,E.resolve=function(e,t,r){r=function(e){var t={scheme:"null"};if(e)for(var r in e)t[r]=e[r];return t}(r);return g(b(s(e,r),s(t,r),r,!0),r)},E.normalize=function(e,t){return"string"==typeof e?e=g(s(e,t),t):"object"===a(e)&&(e=s(g(e,t),t)),e},E.equal=function(e,t,r){return"string"==typeof e?e=g(s(e,r),r):"object"===a(e)&&(e=g(e,r)),"string"==typeof t?t=g(s(t,r),r):"object"===a(t)&&(t=g(t,r)),e===t},E.escapeComponent=function(e,t){return e&&(""+e).replace((t&&t.iri?k:_).ESCAPE,m)},E.unescapeComponent=P,Object.defineProperty(E,"__esModule",{value:!0})});It&&It.__esModule&&Object.prototype.hasOwnProperty.call(It,"default");function Ft(e,t){if(e===t)return!0;if(e&&t&&"object"==re(e)&&"object"==re(t)){var r,a,n,o=Tt(e),i=Tt(t);if(o&&i){if((a=e.length)!=t.length)return!1;for(r=a;0!=r--;)if(!Ft(e[r],t[r]))return!1;return!0}if(o!=i)return!1;o=e instanceof Date,i=t instanceof Date;if(o!=i)return!1;if(o&&i)return e.getTime()==t.getTime();o=e instanceof RegExp,i=t instanceof RegExp;if(o!=i)return!1;if(o&&i)return""+e==""+t;var s=jt(e);if((a=s.length)!==jt(t).length)return!1;for(r=a;0!=r--;)if(!Dt.call(t,s[r]))return!1;for(r=a;0!=r--;)if(!Ft(e[n=s[r]],t[n]))return!1;return!0}return e!=e&&t!=t}var Tt=Array.isArray,jt=Object.keys,Dt=Object.prototype.hasOwnProperty,Rt={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:$t,checkDataTypes:function(e,t){if(1===e.length)return $t(e[0],t,!0);var r,a="",e=zt(e);for(r in e.array&&e.object&&(a=e.null?"(":"(!"+t+" || ",a+="typeof "+t+' !== "object")',delete e.null,delete e.array,delete e.object),e.number&&delete e.integer,e)a+=(a?" && ":"")+$t(r,t,!0);return a},coerceToTypes:function(e,t){if(!Array.isArray(t))return Ct[t]?[t]:"array"===e&&"array"===t?["array"]:void 0;for(var r=[],a=0;t.length>a;a++){var n=t[a];(Ct[n]||"array"===e&&"array"===n)&&(r[r.length]=n)}return r.length?r:void 0},toHash:zt,getProperty:qt,escapeQuotes:Lt,equal:Ft,ucs2length:function(e){for(var t,r=0,a=e.length,n=0;n<a;)r++,(t=e.charCodeAt(n++))<55296||56319<t||a<=n||56320==(64512&(t=e.charCodeAt(n)))&&n++;return r},varOccurences:function(e,t){t=e.match(RegExp(t+="[^0-9]","g"));return t?t.length:0},varReplace:function(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(RegExp(t,"g"),r+"$1")},cleanUpCode:function(e){return e.replace(Mt,"").replace(Vt,"").replace(Bt,"if (!($1))")},finalCleanUpCode:function(e,t){var r=e.match(Ht);return r&&2==r.length&&(e=t?e.replace(Jt,"").replace(Zt,Wt):e.replace(Qt,"").replace(Kt,Gt)),(r=e.match(Xt))&&3===r.length?e.replace(Yt,""):e},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0},schemaHasRulesExcept:function(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var a in e)if(a!=r&&t[a])return!0},toQuotedString:er,getPathExpr:function(e,t,r,a){return ar(e,r?"'/' + "+t+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,r){return ar(e,er(r?"/"+nr(t):qt(t)))},getData:function(e,t,r){var a,n,o;
1if(""===e)return"rootData";if("/"==e[0]){if(!tr.test(e))throw Error("Invalid JSON-pointer: "+e);a=e,n="rootData"}else{if(!(o=e.match(rr)))throw Error("Invalid JSON-pointer: "+e);if(e=+o[1],"#"==(a=o[2])){if(t<=e)throw Error("Cannot access property/index "+e+" levels up, current level is "+t);return r[t-e]}if(t<e)throw Error("Cannot access data "+e+" levels up, current level is "+t);if(n="data"+(t-e||""),!a)return n}for(var i=n,s=a.split("/"),u=0;s.length>u;u++){var l=s[u];l&&(i+=" && "+(n+=qt(or(l))))}return i},unescapeFragment:function(e){return or(decodeURIComponent(e))},unescapeJsonPointer:or,escapeFragment:function(e){return encodeURIComponent(nr(e))},escapeJsonPointer:nr};function $t(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",o=r?"!":"",i=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+n+"typeof "+t+a+'"object"'+n+i+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+i+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}var Ct=zt(["string","number","integer","boolean","null"]);function zt(e){for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t}var Nt=/^[a-z$_][a-z$_0-9]*$/i,Ut=/'|\\/g;function qt(e){return"number"==typeof e?"["+e+"]":Nt.test(e)?"."+e:"['"+Lt(e)+"']"}function Lt(e){return e.replace(Ut,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}var Mt=/else\s*{\s*}/g,Vt=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,Bt=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g,Ht=/[^v.]errors/g,Qt=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,Jt=/var errors = 0;|var vErrors = null;/g,Kt="return errors === 0;",Gt="validate.errors = null; return true;",Zt=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,Wt="return data;",Xt=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,Yt=/if \(rootData === undefined\) rootData = data;/;function er(e){return"'"+Lt(e)+"'"}var tr=/^\/(?:[^~]|~0|~1)*$/,rr=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ar(e,t){return'""'==e?t:(e+" + "+t).replace(/' \+ '/g,"")}function nr(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function or(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var ir=function(e){Rt.copy(e,this)},sr=tt(function(e){var m=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),function e(t,r,a,n,o,i,s,u,l,c){if(n&&"object"==re(n)&&!Array.isArray(n)){for(var p in r(n,o,i,s,u,l,c),n){var d=n[p];if(Array.isArray(d)){if(p in m.arrayKeywords)for(var f=0;d.length>f;f++)e(t,r,a,d[f],o+"/"+p+"/"+f,i,o,p,n,f)}else if(p in m.propsKeywords){if(d&&"object"==re(d))for(var h in d)e(t,r,a,d[h],o+"/"+p+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),i,o,p,n,h)}else(p in m.keywords||t.allKeys&&!(p in m.skipKeywords))&&e(t,r,a,d,o+"/"+p,i,o,p,n)}a(n,o,i,s,u,l,c)}}(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};m.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},m.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},m.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},m.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}}),ur=lr;function lr(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return lr.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof ir)return hr(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,o,i,r=cr.call(this,t,r);return r&&(n=r.schema,t=r.root,i=r.baseId),n instanceof ir?o=n.validate||e.call(this,n.schema,t,void 0,i):void 0!==n&&(o=hr(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,i)),o}function cr(e,t){var r=It.parse(t),a=yr(r),n=mr(this._getId(e.schema));if(0===Object.keys(e.schema).length||a!==n){var o=gr(a),a=this._refs[o];if("string"==typeof a)return function(e,t,r){var a=cr.call(this,e,t);if(a){var n=a.schema,t=a.baseId;e=a.root;a=this._getId(n);return a&&(t=br(t,a)),dr.call(this,r,t,n,e)}}.call(this,e,a,r);if(a instanceof ir)a.validate||this._compile(a),e=a;else{if(!((a=this._schemas[o])instanceof ir))return;if(a.validate||this._compile(a),o==gr(t))return{schema:a,root:e,baseId:n};e=a}if(!e.schema)return;n=mr(this._getId(e.schema))}return dr.call(this,r,n,e.schema,e)}lr.normalizeId=gr,lr.fullPath=mr,lr.url=br,lr.ids=function(e){var t=gr(this._getId(e)),l={"":t},c={"":mr(t,!1)},p={},d=this;return sr(e,{allKeys:!0},function(e,t,r,a,n,o,i){if(""!==t){var s=d._getId(e),u=l[a],n=c[a]+"/"+n;if(void 0!==i&&(n+="/"+("number"==typeof i?i:Rt.escapeFragment(i))),"string"==typeof s){s=u=gr(u?It.resolve(u,s):s);i=d._refs[s];if("string"==typeof i&&(i=d._refs[i]),i&&i.schema){if(!Ft(e,i.schema))throw Error('id "'+s+'" resolves to more than one schema')}else if(s!=gr(n))if("#"==s[0]){if(p[s]&&!Ft(e,p[s]))throw Error('id "'+s+'" resolves to more than one schema');p[s]=e}else d._refs[s]=n}l[t]=u,c[t]=n}}),p},lr.inlineRef=hr,lr.schema=cr;var pr=Rt.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function dr(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;n.length>o;o++){var i,s=n[o];if(s){if(void 0===(r=r[s=Rt.unescapeFragment(s)]))break;
1!pr[s]&&((i=this._getId(r))&&(t=br(t,i)),r.$ref)&&(i=br(t,r.$ref),(i=cr.call(this,a,i))&&(r=i.schema,a=i.root,t=i.baseId))}}return void 0!==r&&r!==a.schema?{schema:r,root:a,baseId:t}:void 0}}var fr=Rt.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function hr(e,t){return!1!==t&&(void 0===t||!0===t?function e(t){var r;if(Array.isArray(t)){for(var a=0;t.length>a;a++)if("object"==re(r=t[a])&&!e(r))return!1}else for(var n in t){if("$ref"==n)return!1;if("object"==re(r=t[n])&&!e(r))return!1}return!0}(e):t?function e(t){var r,a=0;if(Array.isArray(t)){for(var n=0;t.length>n;n++)if("object"==re(r=t[n])&&(a+=e(r)),a==1/0)return 1/0}else for(var o in t){if("$ref"==o)return 1/0;if(fr[o])a++;else if("object"==re(r=t[o])&&(a+=e(r)+1),a==1/0)return 1/0}return a}(e)<=t:void 0)}function mr(e,t){return!1!==t&&(e=gr(e)),yr(It.parse(e))}function yr(e){return It.serialize(e).split("#")[0]+"#"}var vr=/#\/?$/;function gr(e){return e?e.replace(vr,""):""}function br(e,t){return t=gr(t),It.resolve(e,t)}var Pr={Validation:Er(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:Er(wr)};function wr(e,t,r){this.message=r||wr.message(e,t),this.missingRef=ur.url(e,t),this.missingSchema=ur.normalizeId(ur.fullPath(this.missingRef))}function Er(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e}wr.message=function(e,t){return"can't resolve reference "+t+" from id "+e};function _r(a,e,t){var r="",n=!0===a.schema.$async,o=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),i=a.self._getId(a.schema);if(a.isTop&&(r+=" var validate = ",n&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",i&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+i+" */ ")),"boolean"==typeof a.schema||!o&&!a.schema.$ref){var s,u=a.level,l=a.dataLevel,c=a.schema["false schema"],p=a.schemaPath+a.util.getProperty("false schema"),d=a.errSchemaPath+"/false schema",f=!a.opts.allErrors,h="data"+(l||""),m="valid"+u;return!1===a.schema?(a.isTop?f=!0:r+=" var "+m+" = false; ",(L=L||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+h+" "),r+=" } "):r+=" {} ",s=r,r=L.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+s+"]); ":" validate.errors = ["+s+"]; return false; ":" var err = "+s+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):r+=a.isTop?n?" return data; ":" validate.errors = null; return true; ":" var "+m+" = true; ",a.isTop&&(r+=" }; return validate; "),r}if(a.isTop){var y=a.isTop,u=a.level=0,l=a.dataLevel=0,h="data";a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{if(u=a.level,h="data"+((l=a.dataLevel)||""),i&&(a.baseId=a.resolve.url(a.baseId,i)),n&&!a.async)throw Error("async schema in sync schema");r+=" var errs_"+u+" = errors;"}m="valid"+u,f=!a.opts.allErrors;var v,g="",b="",P=a.schema.type,w=Array.isArray(P);if(w&&1==P.length&&(P=P[0],w=!1),a.schema.$ref&&o){if("fail"==a.opts.extendRefs)throw Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(o=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),P){a.opts.coerceTypes&&(v=a.util.coerceToTypes(a.opts.coerceTypes,P));var E=a.RULES.types[P];if(v||w||!0===E||E&&!Q(E)){if(p=a.schemaPath+".type",d=a.errSchemaPath+"/type",p=a.schemaPath+".type",d=a.errSchemaPath+"/type",r+=" if ("+a.util[w?"checkDataTypes":"checkDataType"](P,h,!0)+") { ",v){var _="dataType"+u,k="coerced"+u;r+=" var "+_+" = typeof "+h+"; ","array"==a.opts.coerceTypes&&(r+=" if ("+_+" == 'object' && Array.isArray("+h+")) "+_+" = 'array'; "),r+=" var "+k+" = undefined; ";var x="",S=v;if(S)for(var O,A=-1,I=S.length-1;A<I;)O=S[A+=1],A&&(r+=" if ("+k+" === undefined) { ",x+="}"),"array"==a.opts.coerceTypes&&"array"!=O&&(r+=" if ("+_+" == 'array' && "+h+".length == 1) { "+k+" = "+h+" = "+h+"[0]; "+_+" = typeof "+h+"; } "),"string"==O?r+=" if ("+_+" == 'number' || "+_+" == 'boolean') "+k+" = '' + "+h+"; else if ("+h+" === null) "+k+" = ''; ":"number"==O||"integer"==O?(r+=" if ("+_+" == 'boolean' || "+h+" === null || ("+_+" == 'string' && "+h+" && "+h+" == +"+h+" ","integer"==O&&(r+=" && !("+h+" % 1)"),r+=")) "+k+" = +"+h+"; "):"boolean"==O?r+=" if ("+h+" === 'false' || "+h+" === 0 || "+h+" === null) "+k+" = false; else if ("+h+" === 'true' || "+h+" === 1) "+k+" = true; ":"null"==O?r+=" if ("+h+" === '' || "+h+" === 0 || "+h+" === false) "+k+" = null; ":"array"==a.opts.coerceTypes&&"array"==O&&(r+=" if ("+_+" == 'string' || "+_+" == 'number' || "+_+" == 'boolean' || "+h+" == null) "+k+" = ["+h+"]; ");(L=L||[]).push(r+=" "+x+" if ("+k+" === undefined) { "),r="",!1!==a.createErrors?(r
1+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=w?""+P.join(","):""+P,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=w?""+P.join(","):""+P,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+h+" "),r+=" } "):r+=" {} ",s=r,r=L.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+s+"]); ":" validate.errors = ["+s+"]; return false; ":" var err = "+s+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ";i=l?"data"+(l-1||""):"parentData";r+=" "+h+" = "+k+"; ",l||(r+="if ("+i+" !== undefined)"),r+=" "+i+"["+(l?a.dataPathArr[l]:"parentDataProperty")+"] = "+k+"; } "}else(L=L||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=w?""+P.join(","):""+P,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=w?""+P.join(","):""+P,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+h+" "),r+=" } "):r+=" {} ",s=r,r=L.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+s+"]); ":" validate.errors = ["+s+"]; return false; ":" var err = "+s+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";r+=" } "}}if(a.schema.$ref&&!o)r+=" "+a.RULES.all.$ref.code(a,"$ref")+" ",f&&(r+=" } if (errors === ",r+=y?"0":"errs_"+u,r+=") { ",b+="}");else{var F=a.RULES;if(F)for(var T=-1,j=F.length-1;T<j;)if(Q(E=F[T+=1])){if(E.type&&(r+=" if ("+a.util.checkDataType(E.type,h)+") { "),a.opts.useDefaults&&!a.compositeRule)if("object"==E.type&&a.schema.properties){var D=Object.keys(c=a.schema.properties);if(D)for(var R,$=-1,C=D.length-1;$<C;)void 0!==(N=c[R=D[$+=1]]).default&&(r+=" if ("+(U=h+a.util.getProperty(R))+" === undefined) "+U+" = ",r+="shared"==a.opts.useDefaults?" "+a.useDefault(N.default)+" ":" "+JSON.stringify(N.default)+" ",r+="; ")}else if("array"==E.type&&Array.isArray(a.schema.items)){var z=a.schema.items;if(z){A=-1;for(var N,U,q=z.length-1;A<q;)void 0!==(N=z[A+=1]).default&&(r+=" if ("+(U=h+"["+A+"]")+" === undefined) "+U+" = ",r+="shared"==a.opts.useDefaults?" "+a.useDefault(N.default)+" ":" "+JSON.stringify(N.default)+" ",r+="; ")}}var L,M=E.rules;if(M)for(var V,B=-1,H=M.length-1;B<H;)!J(V=M[B+=1])||(V=V.code(a,V.keyword,E.type))&&(r+=" "+V+" ",f&&(g+="}"));f&&(r+=" "+g+" ",g=""),E.type&&(r+=" } ",P&&P===E.type&&!v)&&(p=a.schemaPath+".type",d=a.errSchemaPath+"/type",(L=L||[]).push(r+=" else { "),r="",!1!==a.createErrors?(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: { type: '",r+=w?""+P.join(","):""+P,r+="' } ",!1!==a.opts.messages&&(r+=" , message: 'should be ",r+=w?""+P.join(","):""+P,r+="' "),a.opts.verbose&&(r+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+h+" "),r+=" } "):r+=" {} ",s=r,r=L.pop(),r+=!a.compositeRule&&f?a.async?" throw new ValidationError(["+s+"]); ":" validate.errors = ["+s+"]; return false; ":" var err = "+s+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "),f&&(r+=" if (errors === ",r+=y?"0":"errs_"+u,r+=") { ",b+="}")}}function Q(e){for(var t=e.rules,r=0;t.length>r;r++)if(J(t[r]))return 1}function J(r){return void 0!==a.schema[r.keyword]||r.implements&&function(){for(var e=r.implements,t=0;e.length>t;t++)if(void 0!==a.schema[e[t]])return 1}()}return f&&(r+=" "+b+" "),y?(n?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+m+" = errors === errs_"+u+";",r=a.util.cleanUpCode(r),y&&(r=a.util.finalCleanUpCode(r,n)),r}function kr(e,s,u,t){var l=this,c=this._opts,p=[void 0],d={},f=[],r={},h=[],a={},m=[],n=function(e,t,r){var a=Ar.call(this,e,t,r);return a<0?(this._compilations[a=this._compilations.length]={schema:e,root:t,baseId:r},{index:a,compiling:!1}):{index:a,compiling:!0}}.call(this,e,s=s||{schema:e,refVal:p,refs:d},t),o=this._compilations[n.index];if(n.compiling)return o.callValidate=function e(){var t=o.validate,r=t.apply(this,arguments);return e.errors=t.errors,r};var y=this._formats,v=this.RULES;try{var i=b(e,s,u,t);o.validate=i;var g=o.callValidate;return g&&(g.schema=i.schema,g.errors=null,g.refs=i.refs,g.refVal=i.refVal,g.root=i.root,g.$async=i.$async,c.sourceCode&&(g.source=i.source)),i}finally{(function(e,t,r){r=Ar.call(this,e,t,r);r<0||this._compilations.splice(r,1)}).call(this,e,s,t)}function b(e,t,r,a){var n=!t||t&&t.schema==e;if(t.schema!=s.schema)return kr.call(l,e,t,r,a);var r=!0===e.$async,o=_r({isTop:!0,schema:e,isRoot:n,baseId:a,root:t,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Pr.MissingRef,RULES:v,validate:_r,util:Rt,resolve:ur,resolveRef:P,usePattern:_,useDefault:k,useCustomRule:x,opts:c,formats:y,logger:l.logger,self:l}),o=Dr(p,Tr)+Dr(f,Ir)+Dr(h,Fr)+Dr(m,jr)+o;c.processCode&&(o=c.processCode(o));try{var i=Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",o)(l,v,y,s,p,h,m,Ft,Sr,Or);p[0]=i}catch(e){throw l.logger.error("Error compiling schema, function code:",o),e}return i.schema=e,i.errors=null,i.refs=d,i.refVal=p,i.root=n?i:t,r&&(i.$async=!0),!0===c.sourceCode&&(i.source={code:o,patterns:f,defaults:h}),i}function P(e,t,r){t=ur.url(e,t);var a,n=d[t];if(void 0!==n)return E(i=p[n],a="refVal["+n+"]");if(!r&&s.refs){var o=s.refs[t];
1if(void 0!==o)return a=w(t,i=s.refVal[o]),E(i,a)}a=w(t);var i,o=ur.call(l,b,s,t);if(void 0!==o||(i=u&&u[t])&&(o=ur.inlineRef(i,c.inlineRefs)?i:kr.call(l,i,s,u,e)),void 0!==o)return E(p[d[t]]=o,a);delete d[t]}function w(e,t){var r=p.length;return p[r]=t,"refVal"+(d[e]=r)}function E(e,t){return"object"==re(e)||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function _(e){var t=r[e];return void 0===t&&(t=r[e]=f.length,f[t]=e),"pattern"+t}function k(e){switch(re(e)){case"boolean":case"number":return""+e;case"string":return Rt.toQuotedString(e);case"object":if(null===e)return"null";var t=xr(e),r=a[t];return void 0===r&&(r=a[t]=h.length,h[r]=e),"default"+r}}function x(e,t,r,a){var n=e.definition.validateSchema;if(n&&!1!==l._opts.validateSchema&&!n(t)){var o="keyword schema is invalid: "+l.errorsText(n.errors);if("log"!=l._opts.validateSchema)throw Error(o);l.logger.error(o)}var i,s=e.definition.compile,n=e.definition.inline,o=e.definition.macro;if(s)i=s.call(l,t,r,a);else if(o)i=o.call(l,t,r,a),!1!==c.validateSchema&&l.validateSchema(i,!0);else if(n)i=n.call(l,a,e.keyword,t,r);else if(!(i=e.definition.validate))return;if(void 0===i)throw Error('custom keyword "'+e.keyword+'"failed to compile');e=m.length;return{code:"customRule"+e,validate:m[e]=i}}}var xr=function(e,t){"function"==typeof(t=t||{})&&(t={cmp:t});var a,u="boolean"==typeof t.cycles&&t.cycles,l=t.cmp&&(a=t.cmp,function(r){return function(e,t){return a({key:e,value:r[e]},{key:t,value:r[t]})}}),c=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!==re(t))return JSON.stringify(t);if(Array.isArray(t)){for(n="[",o=0;t.length>o;o++)o&&(n+=","),n+=e(t[o])||"null";return n+"]"}if(null===t)return"null";if(-1!==c.indexOf(t)){if(u)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}for(var r=c.push(t)-1,a=Object.keys(t).sort(l&&l(t)),n="",o=0;a.length>o;o++){var i=a[o],s=e(t[i]);s&&(n&&(n+=","),n+=JSON.stringify(i)+":"+s)}return c.splice(r,1),"{"+n+"}"}}(e)},Sr=Rt.ucs2length,Or=Pr.Validation;function Ar(e,t,r){for(var a=0;this._compilations.length>a;a++){var n=this._compilations[a];if(n.schema==e&&n.root==t&&n.baseId==r)return a}return-1}function Ir(e,t){return"var pattern"+e+" = new RegExp("+Rt.toQuotedString(t[e])+");"}function Fr(e){return"var default"+e+" = defaults["+e+"];"}function Tr(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function jr(e){return"var customRule"+e+" = customRules["+e+"];"}function Dr(e,t){if(!e.length)return"";for(var r="",a=0;e.length>a;a++)r+=t(a,e);return r}var Rr=tt(function(e){e=e.exports=function(){this._cache={}};e.prototype.put=function(e,t){this._cache[e]=t},e.prototype.get=function(e){return this._cache[e]},e.prototype.del=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}}}),$r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Cr=[0,31,28,31,30,31,30,31,31,30,31,30,31],zr=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i,Nr=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,Ur=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,ve=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Ee=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2F
1FF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,Se=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Te=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Re=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,t=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,qr=Lr;function Lr(e){return Rt.copy(Lr[e="full"==e?"full":"fast"])}function Mr(e){var t=e.match($r);if(!t)return!1;var r=+t[2],e=+t[3];return!(r<1||12<r||e<1||e>(2!=r||((t=+t[1])%4!=0||t%100==0&&t%400!=0)?Cr[r]:29))}function Vr(e,t){var r=e.match(zr);if(!r)return!1;var a=r[1],n=r[2],e=r[3];return(a<=23&&n<=59&&e<=59||23==a&&59==n&&60==e)&&(!t||r[5])}Lr.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":ve,url:Ee,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:Nr,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:Jr,uuid:Se,"json-pointer":Te,"json-pointer-uri-fragment":Re,"relative-json-pointer":t},Lr.full={date:Mr,time:Vr,"date-time":function(e){e=e.split(Br);
1return 2==e.length&&Mr(e[0])&&Vr(e[1],!0)},uri:function(e){return Hr.test(e)&&Ur.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":ve,url:Ee,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&Nr.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:Jr,uuid:Se,"json-pointer":Te,"json-pointer-uri-fragment":Re,"relative-json-pointer":t};var Br=/t|\s/i,Hr=/\/|:/,Qr=/[^\\]\\Z/;function Jr(e){if(Qr.test(e))return!1;try{return!0}catch(e){return!1}}function Kr(e,t,r){var a,n,o,i,s=" ",u=e.level,l=e.dataLevel,c=e.schema[t],p=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,h="data"+(l||""),m="valid"+u,y="errs__"+u,v=e.opts.$data&&c&&c.$data,g=v?(s+=" var schema"+u+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ","schema"+u):c,b="definition"+u,P=this.definition,w="";if(v&&P.$data){var E=P.validateSchema;s+=" var "+b+" = RULES.custom['"+t+"'].definition; var "+(i="keywordValidate"+u)+" = "+b+".validate;"}else{if(!(k=e.useCustomRule(this,c,e.schema,e)))return;g="validate.schema"+p,i=k.code,a=P.compile,n=P.inline,o=P.macro}var _,k,x,S,O,A=i+".errors",I="i"+u,t="ruleErr"+u;if((c=P.async)&&!e.async)throw Error("async keyword in sync schema");return n||o||(s+=A+" = null;"),s+="var "+y+" = errors;var "+m+";",v&&P.$data&&(w+="}",s+=" if ("+g+" === undefined) { "+m+" = true; } else { ",E&&(w+="}",s+=" "+m+" = "+b+".validateSchema("+g+"); if ("+m+") { ")),n?s+=P.statements?" "+k.validate+" ":" "+m+" = "+k.validate+"; ":o?(w="",(E=e.util.copy(e)).level++,_="valid"+E.level,E.schema=k.validate,E.schemaPath="",b=e.compositeRule,e.compositeRule=E.compositeRule=!0,k=e.validate(E).replace(/validate\.schema/g,i),e.compositeRule=E.compositeRule=b,s+=" "+k):((O=O||[]).push(s),s="",s+=" "+i+".call( ",s+=e.opts.passContext?"this":"self",s+=a||!1===P.schema?" , "+h+" ":" , "+g+" , "+h+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath),l=s+=" , "+(x=l?"data"+(l-1||""):"parentData")+" , "+(S=l?e.dataPathArr[l]:"parentDataProperty")+" , rootData ) ",s=O.pop(),!1===P.errors?(s+=" "+m+" = ",c&&(s+="await "),s+=l+"; "):s+=c?" var "+(A="customErrors"+u)+" = null; try { "+m+" = await "+l+"; } catch (e) { "+m+" = false; if (e instanceof ValidationError) "+A+" = e.errors; else throw e; } ":" "+A+" = null; "+m+" = "+l+"; "),P.modifying&&(s+=" if ("+x+") "+h+" = "+x+"["+S+"];"),s+=""+w,P.valid?f&&(s+=" if (true) { "):(s+=" if ( ",void 0===P.valid?(s+=" !",s+=o?""+_:m):s+=" "+!P.valid+" ",_=this.keyword,(O=O||[]).push(s+=") { "),(O=O||[]).push(s=""),s="",!1!==e.createErrors?(s+=" { keyword: '"+(_||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",m=s,s=O.pop(),m=s+=!e.compositeRule&&f?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s=O.pop(),n?P.errors?"full"!=P.errors&&(s+=" for (var "+I+"="+y+"; "+I+"<errors; "+I+"++) { var "+t+" = vErrors["+I+"]; if ("+t+".dataPath === undefined) "+t+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+t+".schemaPath === undefined) { "+t+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+t+".schema = "+g+"; "+t+".data = "+h+"; "),s+=" } "):!1===P.errors?s+=" "+m+" ":(s+=" if ("+y+" == errors) { "+m+" } else { for (var "+I+"="+y+"; "+I+"<errors; "+I+"++) { var "+t+" = vErrors["+I+"]; if ("+t+".dataPath === undefined) "+t+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+t+".schemaPath === undefined) { "+t+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+t+".schema = "+g+"; "+t+".data = "+h+"; "),s+=" } } "):o?(s+=" var err = ",!1!==e.createErrors?(s+=" { keyword: '"+(_||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(s+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; ")):!1===P.errors?s+=" "+m+" ":(s+=" if (Array.isArray("+A+")) { if (vErrors === null) vErrors = "+A+"; else vErrors = vErrors.concat("+A+"); errors = vErrors.length; for (var "+I+"="+y+"; "+I+"<errors; "+I+"++) { var "+t+" = vErrors["+I+"]; if ("+t+".dataPath === undefined) "+t+".dataPath = (dataPath || '') + "+e.errorPath+"; "+t+'.schemaPath = "'+d+'"; ',e.opts.verbose&&(s+=" "+t+".schema = "+g+"; "+t+".data = "+h+"; "),s+=" } } else { "+m+" } "),s+=" } ",f&&(s+=" else { ")),s}var ae=function(e,t,r){var a,n,o,i,s,u,l,c=" ",p=e.level,d=e.dataLevel,f=e.schema[t],h=e.schemaPath+e.util.getProperty(t),m=e.errSchemaPath+"/"+t,y=!e.opts.allErrors,v="data"+(d||""),g=e.opts.$data&&f&&f.$data,b=g?(c+=" var schema"+p+" = "+e.util.getData(f.$data,d,e.dataPathArr)+"; ","schema"+p):f,P="maximum"==t,w=P?"exclusiveMaximum":"exclusiveMinimum",E=e.schema[w],_=e.opts.$data&&E&&E.$data,k=P?"<":">",x=P?">":"<",S=void 0;return _?(o="exclIsNumber"+p,l="' + "+(u="op"+p)+" + '",c+=" var schemaExcl"+p+" = "+(a=e.util.getData(E.$data,d,e.dataPathArr))+"; ",S=w,(i=i||[]).push(c+=" var "+(n="exclusive"+p)+"; var "+(d="exclType"+p)+" = typeof "+(a="schemaExcl"+p)+"; if ("+d+" != 'boolean' && "+d+" != 'undefined' && "+d+" != 'number') { "),c="",!1!==e.createErrors?(c+=" { keyword: '"+(S||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: {} ",!1!==e.opts.messages&&(c+=" , message: '"+w+" should be boolean' "),e.opts.verbose&&(c+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ",s=c,c=i.pop(),c+=!e.compositeRule&&y?e.async?" throw new ValidationError(["+s+"]); ":" validate.errors = ["+s+"]; return false; ":" var err = "+s+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } else if ( ",g&&(c+=" ("+b+" !== undefined && typeof "+b+" != 'number') || "),c+=" "+d+" == 'number' ? ( ("+n+" = "+b+" === undefined || "+a+" "+k+"= "+b+") ? "+v+" "+x+"= "+a+" : "+v+" "+x+" "+b+" ) : ( ("+n+" = "+a+" === true) ? "+v+" "+x+"= "+b+" : "+v+" "+x+" "+b+" ) || "+v+" !== "+v+") { var op"+p+" = "+n+" ? '"+k+"' : '"+k+"='; ",void 0===f&&(S=w,m=e.errSchemaPath+"/"+w,b=a,g=_)):(l=k,(o="number"==typeof E)&&g?(u="'"+l+"'",c+=" if ( ",g&&(c+=" ("+b+" !== undefined && typeof "+b+" != 'number') || "),c+=" ( "+b+" === undefined || "+E+" "+k+"= "+b+" ? "+v+" "+x+"= "+E+" : "+v+" "+x+" "+b+" ) || "+v+" !== "+v+") { "):(o&&void 0===f?(n=!0,S=w,m=e.errSchemaPath+"/"+w,b=E,x+="="):(o&&(b=Math[P?"min":"max"](E,f)),E===(!o||b)?(n=!0,S=w,m=e.errSchemaPath+"/"+w,x+="="):(n=!1,l+="=")),u="'"+l+"'",c+=" if ( ",g&&(c+=" ("+b+" !== undefined && typeof "+b+" != 'number') || "),c+=" "+v+" "+x+" "+b+" || "+v+" !== "+v+") { ")),S=S||t,(i=i||[]).push(c),c="",!1!==e.createErrors?(c+=" { keyword: '"+(S||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: { comparison: "+u+", limit: "+b+", exclusive: "+n+" } ",!1!==e.opts.messages&&(c+=" , message: 'should be "+l+" ",c+=g?"' + "+b:b+"'"),e.opts.verbose&&(c+=" , schema: ",c+=g?"validate.schema"+h:""+f,c+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ",s=c,c=i.pop(),c+=!e.compositeRule&&y?e.async?" throw new ValidationError(["+s+"]); ":" validate.errors = ["+s+"]; return false; ":" var err = "+s+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } ",y&&(c+=" else { "),c},pe=function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.sc
1hemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p=e.opts.$data&&i&&i.$data,o=p?(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i;a+="if ( ",p&&(a+=" ("+o+" !== undefined && typeof "+o+" != 'number') || ");var n=t,d=d||[];d.push(a+=" "+c+".length "+("maxItems"==t?">":"<")+" "+o+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(n||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxItems"==t?"more":"fewer",a+=" than ",a+=p?"' + "+o+" + '":""+i,a+=" items' "),e.opts.verbose&&(a+=" , schema: ",a+=p?"validate.schema"+s:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=d.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},ve=function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p=e.opts.$data&&i&&i.$data,o=p?(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i;a+="if ( ",p&&(a+=" ("+o+" !== undefined && typeof "+o+" != 'number') || "),a+=!1===e.opts.unicode?" "+c+".length ":" ucs2length("+c+") ";var n=t,d=d||[];d.push(a+=" "+("maxLength"==t?">":"<")+" "+o+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(n||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be ",a+="maxLength"==t?"longer":"shorter",a+=" than ",a+=p?"' + "+o+" + '":""+i,a+=" characters' "),e.opts.verbose&&(a+=" , schema: ",a+=p?"validate.schema"+s:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=d.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},Ee=function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p=e.opts.$data&&i&&i.$data,o=p?(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i;a+="if ( ",p&&(a+=" ("+o+" !== undefined && typeof "+o+" != 'number') || ");var n=t,d=d||[];d.push(a+=" Object.keys("+c+").length "+("maxProperties"==t?">":"<")+" "+o+") { "),a="",!1!==e.createErrors?(a+=" { keyword: '"+(n||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxProperties"==t?"more":"fewer",a+=" than ",a+=p?"' + "+o+" + '":""+i,a+=" properties' "),e.opts.verbose&&(a+=" , schema: ",a+=p?"validate.schema"+s:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=d.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},Gr={$ref:function(e,t,r){var a,n,o,i=" ",s=e.dataLevel,u=e.schema[t],l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(s||""),d="valid"+e.level;if("#"==u||"#/"==u)n=e.isRoot?(a=e.async,"validate"):(a=!0===e.root.schema.$async,"root.refVal[0]");else{t=e.resolveRef(e.baseId,u,e.isRoot);if(void 0===t){var f=e.MissingRefError.message(e.baseId,u);if("fail"==e.opts.missingRefs){e.logger.error(f),(o=o||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(u)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(u)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(u)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var h=i,i=o.pop();i+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+h+"]); ":" validate.errors = ["+h+"]; return false; ":" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,u,f);e.logger.warn(f),c&&(i+=" if (true) { ")}}else t.inline?((h=e.util.copy(e)).level++,f="valid"+h.level,h.schema=t.schema,h.schemaPath="",h.errSchemaPath=u,i+=" "+e.validate(h).replace(/validate\.schema/g,t.code)+" ",c&&(i+=" if ("+f+") { ")):(a=!0===t.$async||e.async&&!1!==t.$async,n=t.code)}if(n){(o=o||[]).push(i),i="",i+=e.opts.passContext?" "+n+".call(this, ":" "+n+"( ",i+=" "+p+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);s=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=o.pop(),a){if(!e.async)throw Error("async schema referenced by sync schema");c&&(i+=" var "+d+";
1 "),i+=" try { await "+s+"; ",c&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+d+" = false; "),i+=" } ",c&&(i+=" if ("+d+") { ")}else i+=" if (!"+s+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i},allOf:function(e,t,r){var a=" ",n=e.schema[t],o=e.schemaPath+e.util.getProperty(t),i=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,u=e.util.copy(e),l="";u.level++;var c="valid"+u.level,p=u.baseId,d=!0,f=n;if(f)for(var h,m=-1,y=f.length-1;m<y;)h=f[m+=1],e.util.schemaHasRules(h,e.RULES.all)&&(d=!1,u.schema=h,u.schemaPath=o+"["+m+"]",u.errSchemaPath=i+"/"+m,a+=" "+e.validate(u)+" ",u.baseId=p,s&&(a+=" if ("+c+") { ",l+="}"));return s&&(a+=d?" if (true) { ":" "+l.slice(0,-1)+" "),e.util.cleanUpCode(a)},anyOf:function(t,e,r){var a=" ",n=t.level,o=t.dataLevel,i=t.schema[e],s=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,l=!t.opts.allErrors,e="data"+(o||""),c="valid"+n,o="errs__"+n,p=t.util.copy(t),d="";p.level++;var f="valid"+p.level;if(i.every(function(e){return t.util.schemaHasRules(e,t.RULES.all)})){var h=p.baseId;a+=" var "+o+" = errors; var "+c+" = false; ";n=t.compositeRule;t.compositeRule=p.compositeRule=!0;var m=i;if(m)for(var y,v=-1,g=m.length-1;v<g;)y=m[v+=1],p.schema=y,p.schemaPath=s+"["+v+"]",p.errSchemaPath=u+"/"+v,a+=" "+t.validate(p)+" ",p.baseId=h,a+=" "+c+" = "+c+" || "+f+"; if (!"+c+") { ",d+="}";t.compositeRule=p.compositeRule=n,a+=" "+d+" if (!"+c+") { var err = ",!1!==t.createErrors?(a+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: {} ",!1!==t.opts.messages&&(a+=" , message: 'should match some schema in anyOf' "),t.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+e+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&l&&(a+=t.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),a+=" } else { errors = "+o+"; if (vErrors !== null) { if ("+o+") vErrors.length = "+o+"; else vErrors = null; } ",t.opts.allErrors&&(a+=" } "),a=t.util.cleanUpCode(a)}else l&&(a+=" if (true) { ");return a},$comment:function(e,t,r){var a=" ",n=e.errSchemaPath+"/"+t,t=e.util.toQuotedString(e.schema[t]);return!0===e.opts.$comment?a+=" console.log("+t+");":"function"==typeof e.opts.$comment&&(a+=" self._opts.$comment("+t+", "+e.util.toQuotedString(n)+", validate.root.schema);"),a},const:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p="valid"+n,t=e.opts.$data&&i&&i.$data;t&&(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; "),t||(a+=" var schema"+n+" = validate.schema"+s+";");var d=d||[];d.push(a+="var "+p+" = equal("+c+", schema"+n+"); if (!"+p+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to constant' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=d.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",l&&(a+=" else { "),a},contains:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p="valid"+n,d="errs__"+n,f=e.util.copy(e);f.level++;var h="valid"+f.level,m="i"+n,y=f.dataLevel=e.dataLevel+1,t="data"+y,o=e.baseId,n=e.util.schemaHasRules(i,e.RULES.all);a+="var "+d+" = errors;var "+p+";",n?(p=e.compositeRule,e.compositeRule=f.compositeRule=!0,f.schema=i,f.schemaPath=s,f.errSchemaPath=u,a+=" var "+h+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0),i=c+"["+m+"]",f.dataPathArr[y]=m,m=e.validate(f),f.baseId=o,e.util.varOccurences(m,t)<2?a+=" "+e.util.varReplace(m,t,i)+" ":a+=" var "+t+" = "+i+"; "+m+" ",a+=" if ("+h+") break; } ",e.compositeRule=f.compositeRule=p,a+=" if (!"+h+") {"):a+=" if ("+c+".length == 0) {";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=v.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",n&&(a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),e.util.cleanUpCode(a)},dependencies:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.sc
1hemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),o="errs__"+n,p=e.util.copy(e),d="";p.level++;var f="valid"+p.level,h={},m={},y=e.opts.ownProperties;for(T in i){var v=Array.isArray(j=i[T])?m:h;v[T]=j}a+="var "+o+" = errors;";var g=e.errorPath;for(T in a+="var missing"+n+";",m)if((v=m[T]).length){if(a+=" if ( "+c+e.util.getProperty(T)+" !== undefined ",y&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(T)+"') "),l){a+=" && ( ";var b=v;if(b)for(var P=-1,w=b.length-1;P<w;)S=b[P+=1],P&&(a+=" || "),a+=" ( ( "+(F=c+(I=e.util.getProperty(S)))+" === undefined ",y&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(S)+"') "),a+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?S:I)+") ) ";a+=")) { ";var E="missing"+n,_="' + "+E+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(g,E,!0):g+" + "+E);var k=k||[];k.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(T)+"', missingProperty: '"+_+"', depsCount: "+v.length+", deps: '"+e.util.escapeQuotes(1==v.length?v[0]:v.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",a+=1==v.length?"property "+e.util.escapeQuotes(v[0]):"properties "+e.util.escapeQuotes(v.join(", ")),a+=" when property "+e.util.escapeQuotes(T)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";E=a,a=k.pop();a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+E+"]); ":" validate.errors = ["+E+"]; return false; ":" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{a+=" ) { ";var x=v;if(x)for(var S,O=-1,A=x.length-1;O<A;){S=x[O+=1];var I=e.util.getProperty(S),F=(_=e.util.escapeQuotes(S),c+I);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(g,S,e.opts.jsonPointers)),a+=" if ( "+F+" === undefined ",y&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(S)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(T)+"', missingProperty: '"+_+"', depsCount: "+v.length+", deps: '"+e.util.escapeQuotes(1==v.length?v[0]:v.join(", "))+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should have ",a+=1==v.length?"property "+e.util.escapeQuotes(v[0]):"properties "+e.util.escapeQuotes(v.join(", ")),a+=" when property "+e.util.escapeQuotes(T)+" is present' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}a+=" } ",l&&(d+="}",a+=" else { ")}e.errorPath=g;var T,j,D=p.baseId;for(T in h)e.util.schemaHasRules(j=h[T],e.RULES.all)&&(a+=" "+f+" = true; if ( "+c+e.util.getProperty(T)+" !== undefined ",y&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(T)+"') "),a+=") { ",p.schema=j,p.schemaPath=s+e.util.getProperty(T),p.errSchemaPath=u+"/"+e.util.escapeFragment(T),a+=" "+e.validate(p)+" ",p.baseId=D,a+=" } ",l&&(a+=" if ("+f+") { ",d+="}"));return l&&(a+=" "+d+" if ("+o+" == errors) {"),e.util.cleanUpCode(a)},enum:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p="valid"+n,t=e.opts.$data&&i&&i.$data;t&&(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ");i="i"+n,o="schema"+n;t||(a+=" var "+o+" = validate.schema"+s+";"),a+="var "+p+";",t&&(a+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),a+=p+" = false;for (var "+i+"=0; "+i+"<"+o+".length; "+i+"++) if (equal("+c+", "+o+"["+i+"])) { "+p+" = true; break; }",t&&(a+=" } ");var d=d||[];d.push(a+=" if (!"+p+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=d.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",l&&(a+=" else { "),a},format:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.sc
1hemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||"");if(!1===e.opts.format)return l&&(a+=" if (true) { "),a;var p=e.opts.$data&&i&&i.$data,d=p?(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i,t=e.opts.unknownFormats,o=Array.isArray(t);if(p)a+=" var "+(m="format"+n)+" = formats["+d+"]; var "+(f="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+n)+" = "+f+" && "+m+".type || 'string'; if ("+f+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",p&&(a+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),a+=" (","ignore"!=t&&(a+=" ("+d+" && !"+m+" ",o&&(a+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),a+=") || "),a+=" ("+m+" && "+y+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",a+=e.async?" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {";else{if(!(m=e.formats[i])){if("ignore"==t)return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(a+=" if (true) { "),a;if(o&&0<=t.indexOf(i))return l&&(a+=" if (true) { "),a;throw Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var f,h,m,y=(f="object"==re(m)&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(f&&(h=!0===m.async,m=m.validate),y!=r)return l&&(a+=" if (true) { "),a;if(h){if(!e.async)throw Error("async format in sync schema");a+=" if (!(await "+(v="formats"+e.util.getProperty(i)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var v="formats"+e.util.getProperty(i);f&&(v+=".validate"),a+="function"==typeof m?" "+v+"("+c+") ":" "+v+".test("+c+") ",a+=") { "}}var g=g||[];g.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",a+=p?""+d:""+e.util.toQuotedString(i),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=p?"' + "+d+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=p?"validate.schema"+s:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=g.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l&&(a+=" else { "),a},if:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p="valid"+n,d="errs__"+n,f=e.util.copy(e);f.level++;var h,m="valid"+f.level,y=e.schema.then,t=e.schema.else,o=void 0!==y&&e.util.schemaHasRules(y,e.RULES.all),y=void 0!==t&&e.util.schemaHasRules(t,e.RULES.all),t=f.baseId;return o||y?(f.createErrors=!1,f.schema=i,f.schemaPath=s,f.errSchemaPath=u,a+=" var "+d+" = errors; var "+p+" = true; ",i=e.compositeRule,e.compositeRule=f.compositeRule=!0,a+=" "+e.validate(f)+" ",f.baseId=t,f.createErrors=!0,a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=f.compositeRule=i,o?(a+=" if ("+m+") { ",f.schema=e.schema.then,f.schemaPath=e.schemaPath+".then",f.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(f)+" ",f.baseId=t,a+=" "+p+" = "+m+"; ",o&&y?a+=" var "+(h="ifClause"+n)+" = 'then'; ":h="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+m+") { ",y&&(f.schema=e.schema.else,f.schemaPath=e.schemaPath+".else",f.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(f)+" ",f.baseId=t,a+=" "+p+" = "+m+"; ",o&&y?a+=" var "+(h="ifClause"+n)+" = 'else'; ":h="'else'",a+=" } "),a+=" if (!"+p+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+h+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+h+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(a+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),a+=" } ",l&&(a+=" else { "),a=e.util.cleanUpCode(a)):l&&(a+=" if (true) { "),a},items:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.sc
1hemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p="valid"+n,d="errs__"+n,f=e.util.copy(e),h="";f.level++;var m="valid"+f.level,t="i"+n,y=f.dataLevel=e.dataLevel+1,v="data"+y,g=e.baseId;if(a+="var "+d+" = errors;var "+p+";",Array.isArray(i)){var b,o=e.schema.additionalItems;!1===o&&(a+=" "+p+" = "+c+".length <= "+i.length+"; ",n=u,u=e.errSchemaPath+"/additionalItems",(b=b||[]).push(a+=" if (!"+p+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+i.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",p=a,a=b.pop(),a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u=n,l&&(h+="}",a+=" else { "));var P=i;if(P)for(var w=-1,E=P.length-1;w<E;){var _,k,x=P[w+=1];e.util.schemaHasRules(x,e.RULES.all)&&(a+=" "+m+" = true; if ("+c+".length > "+w+") { ",_=c+"["+w+"]",f.schema=x,f.schemaPath=s+"["+w+"]",f.errSchemaPath=u+"/"+w,f.errorPath=e.util.getPathExpr(e.errorPath,w,e.opts.jsonPointers,!0),f.dataPathArr[y]=w,k=e.validate(f),f.baseId=g,e.util.varOccurences(k,v)<2?a+=" "+e.util.varReplace(k,v,_)+" ":a+=" var "+v+" = "+_+"; "+k+" ",a+=" } ",l&&(a+=" if ("+m+") { ",h+="}"))}"object"==re(o)&&e.util.schemaHasRules(o,e.RULES.all)&&(f.schema=o,f.schemaPath=e.schemaPath+".additionalItems",f.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+i.length+") { for (var "+t+" = "+i.length+"; "+t+" < "+c+".length; "+t+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,t,e.opts.jsonPointers,!0),_=c+"["+t+"]",f.dataPathArr[y]=t,k=e.validate(f),f.baseId=g,e.util.varOccurences(k,v)<2?a+=" "+e.util.varReplace(k,v,_)+" ":a+=" var "+v+" = "+_+"; "+k+" ",l&&(a+=" if (!"+m+") break; "),a+=" } } ",l&&(a+=" if ("+m+") { ",h+="}"))}else e.util.schemaHasRules(i,e.RULES.all)&&(f.schema=i,f.schemaPath=s,f.errSchemaPath=u,a+=" for (var "+t+" = 0; "+t+" < "+c+".length; "+t+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,t,e.opts.jsonPointers,!0),_=c+"["+t+"]",f.dataPathArr[y]=t,k=e.validate(f),f.baseId=g,e.util.varOccurences(k,v)<2?a+=" "+e.util.varReplace(k,v,_)+" ":a+=" var "+v+" = "+_+"; "+k+" ",l&&(a+=" if (!"+m+") break; "),a+=" }");return l&&(a+=" "+h+" if ("+d+" == errors) {"),e.util.cleanUpCode(a)},maximum:ae,minimum:ae,maxItems:pe,minItems:pe,maxLength:ve,minLength:ve,maxProperties:Ee,minProperties:Ee,multipleOf:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),t=e.opts.$data&&i&&i.$data,o=t?(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i;a+="var division"+n+";if (",t&&(a+=" "+o+" !== undefined && ( typeof "+o+" != 'number' || "),a+=" (division"+n+" = "+c+" / "+o+", ",a+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+n+" !== parseInt(division"+n+") ",a+=" ) ",t&&(a+=" ) ");var p=p||[];p.push(a+=" ) { "),a="",!1!==e.createErrors?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+o+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be multiple of ",a+=t?"' + "+o:o+"'"),e.opts.verbose&&(a+=" , schema: ",a+=t?"validate.schema"+s:""+i,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=p.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},not:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.sc
1hemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),t="errs__"+n,o=e.util.copy(e);o.level++;var p,d,n="valid"+o.level;return e.util.schemaHasRules(i,e.RULES.all)?(o.schema=i,o.schemaPath=s,o.errSchemaPath=u,a+=" var "+t+" = errors; ",i=e.compositeRule,e.compositeRule=o.compositeRule=!0,o.createErrors=!1,o.opts.allErrors&&(p=o.opts.allErrors,o.opts.allErrors=!1),a+=" "+e.validate(o)+" ",o.createErrors=!0,p&&(o.opts.allErrors=p),e.compositeRule=o.compositeRule=i,(d=d||[]).push(a+=" if ("+n+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",n=a,a=d.pop(),a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+n+"]); ":" validate.errors = ["+n+"]; return false; ":" var err = "+n+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+t+"; if (vErrors !== null) { if ("+t+") vErrors.length = "+t+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")):(a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(a+=" if (false) { ")),a},oneOf:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,t="data"+(o||""),c="valid"+n,o="errs__"+n,p=e.util.copy(e),d="";p.level++;var f="valid"+p.level,h=p.baseId,m="prevValid"+n,y="passingSchemas"+n;a+="var "+o+" = errors , "+m+" = false , "+c+" = false , "+y+" = null; ";n=e.compositeRule;e.compositeRule=p.compositeRule=!0;var v=i;if(v)for(var g,b=-1,P=v.length-1;b<P;)g=v[b+=1],e.util.schemaHasRules(g,e.RULES.all)?(p.schema=g,p.schemaPath=s+"["+b+"]",p.errSchemaPath=u+"/"+b,a+=" "+e.validate(p)+" ",p.baseId=h):a+=" var "+f+" = true; ",b&&(a+=" if ("+f+" && "+m+") { "+c+" = false; "+y+" = ["+y+", "+b+"]; } else { ",d+="}"),a+=" if ("+f+") { "+c+" = "+m+" = true; "+y+" = "+b+"; }";return e.compositeRule=p.compositeRule=n,a+=d+"if (!"+c+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+t+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(a+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),a+="} else { errors = "+o+"; if (vErrors !== null) { if ("+o+") vErrors.length = "+o+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a},pattern:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),t=e.opts.$data&&i&&i.$data,o=t?(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+n):i,n=t?"(new RegExp("+o+"))":e.usePattern(i);a+="if ( ",t&&(a+=" ("+o+" !== undefined && typeof "+o+" != 'string') || ");var p=p||[];p.push(a+=" !"+n+".test("+c+") ) { "),a="",!1!==e.createErrors?(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",a+=t?""+o:""+e.util.toQuotedString(i),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match pattern \"",a+=t?"' + "+o+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=t?"validate.schema"+s:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";c=a,a=p.pop();return a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+c+"]); ":" validate.errors = ["+c+"]; return false; ":" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},properties:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.sc
1hemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p="errs__"+n,d=e.util.copy(e),f="";d.level++;var h,m,y,v,g,b,P="valid"+d.level,w="key"+n,E="idx"+n,_=d.dataLevel=e.dataLevel+1,k="data"+_,x="dataProperties"+n,S=Object.keys(i||{}),O=e.schema.patternProperties||{},A=Object.keys(O),I=e.schema.additionalProperties,F=S.length||A.length,T=!1===I,j="object"==re(I)&&Object.keys(I).length,D=e.opts.removeAdditional,t=T||j||D,R=e.opts.ownProperties,$=e.baseId,o=e.schema.required;if(o&&(!e.opts.$data||!o.$data)&&e.opts.loopRequired>o.length&&(h=e.util.toHash(o)),a+="var "+p+" = errors;var "+P+" = true;",R&&(a+=" var "+x+" = undefined;"),t){if(a+=R?" "+x+" = "+x+" || Object.keys("+c+"); for (var "+E+"=0; "+E+"<"+x+".length; "+E+"++) { var "+w+" = "+x+"["+E+"]; ":" for (var "+w+" in "+c+") { ",F){if(a+=" var isAdditional"+n+" = !(false ",S.length)if(8<S.length)a+=" || validate.schema"+s+".hasOwnProperty("+w+") ";else{var C=S;if(C)for(var z=-1,N=C.length-1;z<N;)Z=C[z+=1],a+=" || "+w+" == "+e.util.toQuotedString(Z)+" "}if(A.length){var U=A;if(U)for(var q=-1,L=U.length-1;q<L;)te=U[q+=1],a+=" || "+e.usePattern(te)+".test("+w+") "}a+=" ); if (isAdditional"+n+") { "}"all"==D?a+=" delete "+c+"["+w+"]; ":(m=e.errorPath,n="' + "+w+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,w,e.opts.jsonPointers)),T?D?a+=" delete "+c+"["+w+"]; ":(y=u,u=e.errSchemaPath+"/additionalProperties",(K=K||[]).push(a+=" "+P+" = false; "),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+n+"' } ",!1!==e.opts.messages&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is an invalid additional property":"should NOT have additional properties",a+="' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",v=a,a=K.pop(),a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=y,l&&(a+=" break; ")):j&&("failing"==D?(a+=" var "+p+" = errors; ",D=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.schema=I,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,w,e.opts.jsonPointers),g=c+"["+w+"]",d.dataPathArr[_]=w,b=e.validate(d),d.baseId=$,e.util.varOccurences(b,k)<2?a+=" "+e.util.varReplace(b,k,g)+" ":a+=" var "+k+" = "+g+"; "+b+" ",a+=" if (!"+P+") { errors = "+p+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+c+"["+w+"]; } ",e.compositeRule=d.compositeRule=D):(d.schema=I,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,w,e.opts.jsonPointers),g=c+"["+w+"]",d.dataPathArr[_]=w,b=e.validate(d),d.baseId=$,e.util.varOccurences(b,k)<2?a+=" "+e.util.varReplace(b,k,g)+" ":a+=" var "+k+" = "+g+"; "+b+" ",l&&(a+=" if (!"+P+") break; "))),e.errorPath=m),F&&(a+=" } "),a+=" } ",l&&(a+=" if ("+P+") { ",f+="}")}var M=e.opts.useDefaults&&!e.compositeRule;if(S.length){var V=S;if(V)for(var B=-1,H=V.length-1;B<H;){var Q,J,K,G,Z=V[B+=1];e.util.schemaHasRules(ee=i[Z],e.RULES.all)&&(g=c+(Q=e.util.getProperty(Z)),G=M&&void 0!==ee.default,d.schema=ee,d.schemaPath=s+Q,d.errSchemaPath=u+"/"+e.util.escapeFragment(Z),d.errorPath=e.util.getPath(e.errorPath,Z,e.opts.jsonPointers),d.dataPathArr[_]=e.util.toQuotedString(Z),b=e.validate(d),d.baseId=$,e.util.varOccurences(b,k)<2?(b=e.util.varReplace(b,k,g),J=g):a+=" var "+(J=k)+" = "+g+"; ",G?a+=" "+b+" ":(h&&h[Z]?(a+=" if ( "+J+" === undefined ",R&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(Z)+"') "),a+=") { "+P+" = false; ",m=e.errorPath,y=u,G=e.util.escapeQuotes(Z),e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(m,Z,e.opts.jsonPointers)),u=e.errSchemaPath+"/required",(K=K||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+G+"' } ",!1!==e.opts.messages&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+G+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",v=a,a=K.pop(),a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=y,e.errorPath=m,a+=" } else { "):l?(a+=" if ( "+J+" === undefined ",R&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(Z)+"') "),a+=") { "+P+" = true; } else { "):(a+=" if ("+J+" !== undefined ",R&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(Z)+"') "),a+=" ) { "),a+=" "+b+" } ")),l&&(a+=" if ("+P+") { ",f+="}")}}if(A.length){var W=A;if(W)for(var X=-1,Y=W.length-1;X<Y;){var ee,te=W[X+=1];e.util.schemaHasRules(ee=O[te],e.RULES.all)&&(d.schema=ee,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(te),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(te),a+=R?" "+x+" = "+x+" || Ob
1ject.keys("+c+"); for (var "+E+"=0; "+E+"<"+x+".length; "+E+"++) { var "+w+" = "+x+"["+E+"]; ":" for (var "+w+" in "+c+") { ",a+=" if ("+e.usePattern(te)+".test("+w+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,w,e.opts.jsonPointers),g=c+"["+w+"]",d.dataPathArr[_]=w,b=e.validate(d),d.baseId=$,e.util.varOccurences(b,k)<2?a+=" "+e.util.varReplace(b,k,g)+" ":a+=" var "+k+" = "+g+"; "+b+" ",l&&(a+=" if (!"+P+") break; "),a+=" } ",l&&(a+=" else "+P+" = true; "),a+=" } ",l&&(a+=" if ("+P+") { ",f+="}"))}}return l&&(a+=" "+f+" if ("+p+" == errors) {"),e.util.cleanUpCode(a)},propertyNames:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p="errs__"+n,d=e.util.copy(e);d.level++;var f,h,m,y,v,g="valid"+d.level;return a+="var "+p+" = errors;",e.util.schemaHasRules(i,e.RULES.all)&&(d.schema=i,d.schemaPath=s,d.errSchemaPath=u,v="idx"+n,h="i"+n,m="' + "+(f="key"+n)+" + '",y="data"+(d.dataLevel=e.dataLevel+1),t="dataProperties"+n,o=e.opts.ownProperties,i=e.baseId,o&&(a+=" var "+t+" = undefined; "),a+=o?" "+t+" = "+t+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+t+".length; "+v+"++) { var "+f+" = "+t+"["+v+"]; ":" for (var "+f+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ",o=f,t=e.compositeRule,e.compositeRule=d.compositeRule=!0,v=e.validate(d),d.baseId=i,e.util.varOccurences(v,y)<2?a+=" "+e.util.varReplace(v,y,o)+" ":a+=" var "+y+" = "+o+"; "+v+" ",e.compositeRule=d.compositeRule=t,a+=" if (!"+g+") { for (var "+h+"=startErrs"+n+"; "+h+"<errors; "+h+"++) { vErrors["+h+"].propertyName = "+f+"; } var err = ",!1!==e.createErrors?(a+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+m+"' } ",!1!==e.opts.messages&&(a+=" , message: 'property name \\'"+m+"\\' is invalid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(a+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),l&&(a+=" break; "),a+=" } }"),l&&(a+=" if ("+p+" == errors) {"),e.util.cleanUpCode(a)},required:function(e,t,r){var a=" ",n=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),p="valid"+n,t=e.opts.$data&&i&&i.$data;t&&(a+=" var schema"+n+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ");o="schema"+n;if(!t)if(e.opts.loopRequired>i.length&&e.schema.properties&&Object.keys(e.schema.properties).length){var d=[],f=i;if(f)for(var h,m=-1,y=f.length-1;m<y;){h=f[m+=1];var v=e.schema.properties[h];v&&e.util.schemaHasRules(v,e.RULES.all)||(d[d.length]=h)}}else d=i;if(t||d.length){var g,b=e.errorPath,i=t||d.length>=e.opts.loopRequired,P=e.opts.ownProperties;if(l)if(a+=" var missing"+n+"; ",i){t||(a+=" var "+o+" = validate.schema"+s+"; ");var w="' + "+(g="schema"+n+"["+(x="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,g,e.opts.jsonPointers)),a+=" var "+p+" = true; ",t&&(a+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),a+=" for (var "+x+" = 0; "+x+" < "+o+".length; "+x+"++) { "+p+" = "+c+"["+o+"["+x+"]] !== undefined ",P&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+o+"["+x+"]) "),a+="; if (!"+p+") break; } ",t&&(a+=" } "),(_=_||[]).push(a+=" if (!"+p+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+w+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a,a=_.pop();a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+E+"]); ":" validate.errors = ["+E+"]; return false; ":" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var _,k=d;if(k)for(var x=-1,S=k.length-1;x<S;)A=k[x+=1],x&&(a+=" || "),a+=" ( ( "+(j=c+(T=e.util.getProperty(A)))+" === undefined ",P&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(A)+"') "),a+=") && (missing"+n+" = "+e.util.toQuotedString(e.opts.jsonPointers?A:T)+") ) ";a+=") { ",w="' + "+(g="missing"+n)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,g,!0):b+" + "+g),(_=_||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+w+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",E=a,a=_.pop(),a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+E+"]); ":" validate.errors = ["+E+"]; return false; ":" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else if(i)t||(a+=" var "+o+" = validate.schema"+s+"; "),w="' + "+(g="schema"+n+"["+(x="i"+n)+"]")+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,g,e.opts.jsonPointers)),t&&(a+=" if ("+o+" && !Array.isArray("+o+")) { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+w+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+o+" !== undefined) { "),a+=" for (var "+x+" = 0; "+x+" < "+o+".length; "+x+"++) { if ("+c+"["+o+"["+x+"]] === undefined ",P&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+o+"["+x+"]) "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+w+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",t&&(a+=" } ");else{var O=d;if(O)for(var A,I=-1,F=O.length-1;I<F;){A=O[I+=1];var T=e.util.getProperty(A),j=(w=e.util.escapeQuotes(A),c+T);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,A,e.opts.jsonPointers)),a+=" if ( "+j+" === undefined ",P&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(A)+"') "),a+=") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+w+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=b}else l&&(a+=" if (true) {");return a},uniqueItems:function(e,t,r){var a,n=" ",o=e.level,i=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(i||""),d="valid"+o,t=e.opts.$data&&s&&s.$data,i=t?(n+=" var schema"+o+" = "+e.util.getData(s.$data,i,e.dataPathArr)+"; ","schema"+o):s;return(s||t)&&!1!==e.opts.uniqueItems?(t&&(n+=" var "+d+"; if ("+i+" === false || "+i+" === undefined) "+d+" = true; else if (typeof "+i+" != 'boolean') "+d+" = false; else { "),n+=" var i = "+p+".length , "+d+" = true , j; if (i > 1) { ",o=e.schema.items&&e.schema.items.type,i=Array.isArray(o),o&&"object"!=o&&"array"!=o&&(!i||o.indexOf("object")<0&&o.indexOf("array")<0)?(n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i];
1 ",n+=" if ("+e.util["checkDataType"+(i?"s":"")](o,"item",!0)+") continue; ",i&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "):n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+d+" = false; break outer; } } } ",n+=" } ",t&&(n+=" } "),(a=a||[]).push(n+=" if (!"+d+") { "),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=t?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ",p=n,n=a.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")):c&&(n+=" if (true) { "),n},validate:_r},Zr=Rt.toHash,Wr=function(){var a=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],n=["type","$comment"];return a.all=Zr(n),a.types=Zr(["number","integer","string","array","object","boolean","null"]),a.forEach(function(e){e.rules=e.rules.map(function(e){var t,r;return"object"==re(e)&&(r=e[t=Object.keys(e)[0]],e=t,r.forEach(function(e){n.push(e),a.all[e]=!0})),n.push(e),a.all[e]={keyword:e,code:Gr[e],implements:r}}),a.all.$comment={keyword:"$comment",code:Gr.$comment},e.type&&(a.types[e.type]=e)}),a.keywords=Zr(n.concat(["$schema","$id","id","$data","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),a.custom={},a},Xr=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],Yr=function(e,t){for(var r=0;t.length>r;r++){e=JSON.parse(JSON.stringify(e));for(var a=t[r].split("/"),n=e,o=1;a.length>o;o++)n=n[a[o]];for(o=0;o<Xr.length;o++){var i=Xr[o],s=n[i];s&&(n[i]={anyOf:[s,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]})}}return e},ea=Pr.MissingRef,Se=function t(r,i,a){var s=this;if("function"!=typeof this._opts.loadSchema)throw Error("options.loadSchema should be a function");"function"==typeof i&&(a=i,i=void 0);var e=u(r).then(function(){var e=s._addSchema(r,void 0,i);return e.validate||function(n){try{return s._compile(n)}catch(e){if(e instanceof ea)return function(e){var t=e.missingSchema;if(a(t))throw Error("Schema "+t+" is loaded but "+e.missingRef+" cannot be resolved");e=s._loadingSchemas[t];return e||(e=s._loadingSchemas[t]=s._opts.loadSchema(t)).then(r,r),e.then(function(e){if(!a(t))return u(e).then(function(){a(t)||s.addSchema(e,t,void 0,i)})}).then(function(){return function n(o){try{return s._compile(o)}catch(n){if(n instanceof ea)return function(e){var t=e.missingSchema;if(a(t))throw Error("Schema "+t+" is loaded but "+e.missingRef+" cannot be resolved");e=s._loadingSchemas[t];return e||(e=s._loadingSchemas[t]=s._opts.loadSchema(t)).then(r,r),e.then(function(e){if(!a(t))return u(e).then(function(){a(t)||s.addSchema(e,t,void 0,i)})}).then(function(){return n(o)});function r(){delete s._loadingSchemas[t]}function a(e){return s._refs[e]||s._schemas[e]}}(n);throw n}}(n)});function r(){delete s._loadingSchemas[t]}function a(e){return s._refs[e]||s._schemas[e]}}(e);throw e}}(e)});return a&&e.then(function(e){a(null,e)},a),e;function u(e){e=e.$schema;return e&&!s.getSchema(e)?t.call(s,{$ref:e},!0):Promise.resolve()}},ta=/^[a-z_$][a-z0-9_$-]*$/i,Te="http://json-schema.org/draft-07/schema#",Re="https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#",t="Meta-schema for $data reference (JSON Schema extension proposal)",ae=["$data"],pe={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ve=Object.freeze({$schema:Te,$id:Re,description:t,type:"object",required:ae,properties:pe,additionalProperties:!1,default:{$schema:Te,$id:Re,description:t,type:"object",required:ae,properties:pe,additionalProperties:!1}}),Ee="http://json-schema.org/draft-07/schema#",Te="http://json-schema.org/draft-07/schema#",Re="Core schema meta-schema",t={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},ae=["object","boolean"],pe={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"}
1,const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},pe=Object.freeze({$schema:Ee,$id:Te,title:Re,definitions:t,type:ae,properties:pe,default:{$schema:Ee,$id:Te,title:Re,definitions:t,type:ae,properties:pe,default:!0}}),ra=rt(ve),aa=rt(pe),pe=sa;sa.prototype.validate=function(e,t){if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error('no schema with key or ref "'+e+'"')}else var e=this._addSchema(e),r=e.validate||this._compile(e);t=r(t);return!0!==r.$async&&(this.errors=r.errors),t},sa.prototype.compile=function(e,t){t=this._addSchema(e,void 0,t);return t.validate||this._compile(t)},sa.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var n=0;e.length>n;n++)this.addSchema(e[n],void 0,r,a);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw Error("schema id must be string");return fa(this,t=ur.normalizeId(t||o)),this._schemas[t]=this._addSchema(e,r,a,!0),this},sa.prototype.addMetaSchema=function(e,t,r){return this.addSchema(e,t,r,!0),this},sa.prototype.validateSchema=function(e,t){var r,a=e.$schema;if(void 0!==a&&"string"!=typeof a)throw Error("$schema must be a string");if(!(a=a||this._opts.defaultMeta||(r=(o=this)._opts.meta,o._opts.defaultMeta="object"==re(r)?o._getId(r)||r:o.getSchema(na)?na:void 0,o._opts.defaultMeta)))return this.logger.warn("meta-schema not available"),!(this.errors=null);var n,o=this._formats.uri;this._formats.uri="function"==typeof o?this._schemaUriFormatFunc:this._schemaUriFormat;try{n=this.validate(a,e)}finally{this._formats.uri=o}if(!n&&t){t="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw Error(t);this.logger.error(t)}return n},sa.prototype.getSchema=function(e){var t=ua(this,e);switch(re(t)){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var r=ur.schema.call(e,{schema:{}},t);if(r){var a=r.schema,n=r.root,o=r.baseId,r=kr.call(e,a,n,void 0,o);return e._fragments[t]=new ir({ref:t,fragment:!0,schema:a,root:n,baseId:o,validate:r}),r}}(this,e)}},sa.prototype.removeSchema=function(e){if(e instanceof RegExp)return la(this,this._schemas,e),la(this,this._refs,e),this;switch(re(e)){case"undefined":return la(this,this._schemas),la(this,this._refs),this._cache.clear(),this;case"string":var t=ua(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":t=this._opts.serialize,t=t?t(e):e;this._cache.del(t);t=this._getId(e);t&&(t=ur.normalizeId(t),delete this._schemas[t],delete this._refs[t])}return this},sa.prototype.addFormat=function(e,t){return"string"==typeof t&&(t=RegExp(t)),this._formats[e]=t,this},sa.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var r=void 0===(t=t||{}).separator?", ":t.separator,a=void 0===t.dataVar?"data":t.dataVar,n="",o=0;e.length>
1o;o++){var i=e[o];i&&(n+=a+i.dataPath+" "+i.message+r)}return n.slice(0,-r.length)},sa.prototype._addSchema=function(e,t,r,a){if("object"!=re(e)&&"boolean"!=typeof e)throw Error("schema should be object or boolean");var n=this._opts.serialize,o=n?n(e):e,i=this._cache.get(o);if(i)return i;a=a||!1!==this._opts.addUsedSchema;n=ur.normalizeId(this._getId(e));n&&a&&fa(this,n);var s,i=!1!==this._opts.validateSchema&&!t;i&&!(s=n&&n==ur.normalizeId(e.$schema))&&this.validateSchema(e,!0);t=ur.ids.call(this,e),r=new ir({id:n,schema:e,localRefs:t,cacheKey:o,meta:r});return"#"!=n[0]&&a&&(this._refs[n]=r),this._cache.put(o,r),i&&s&&this.validateSchema(e,!0),r},sa.prototype._compile=function(r,e){if(r.compiling)return(r.validate=n).schema=r.schema,n.errors=null,n.root=e||n,!0===r.schema.$async&&(n.$async=!0),n;var t,a;r.compiling=!0,r.meta&&(t=this._opts,this._opts=this._metaOpts);try{a=kr.call(this,r.schema,e,r.localRefs)}catch(e){throw delete r.validate,e}finally{r.compiling=!1,r.meta&&(this._opts=t)}return r.validate=a,r.refs=a.refs,r.refVal=a.refVal,r.root=a.root,a;function n(){var e=r.validate,t=e.apply(this,arguments);return n.errors=e.errors,t}},sa.prototype.compileAsync=Se,sa.prototype.addKeyword=function(e,t){var i=this.RULES;if(i.keywords[e])throw Error("Keyword "+e+" is already defined");if(!ta.test(e))throw Error("Keyword "+e+" is not a valid identifier");if(t){if(t.macro&&void 0!==t.valid)throw Error('"valid" option cannot be used with macro keywords');var r=t.type;if(Array.isArray(r)){for(var a=r.length,n=0;n<a;n++)l(r[n]);for(n=0;n<a;n++)u(e,r[n],t)}else r&&l(r),u(e,r,t);var o=!0===t.$data&&this._opts.$data;if(o&&!t.validate)throw Error('$data support: "validate" function is not defined');var s=t.metaSchema;s&&(o&&(s={anyOf:[s,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(s,!0))}function u(e,t,r){for(var a,n=0;i.length>n;n++){var o=i[n];if(o.type==t){a=o;break}}a||i.push(a={type:t,rules:[]});r={keyword:e,definition:r,custom:!0,code:Kr,implements:r.implements};a.rules.push(r),i.custom[e]=r}function l(e){if(!i.types[e])throw Error("Unknown type "+e)}return i.keywords[e]=i.all[e]=!0,this},sa.prototype.getKeyword=function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},sa.prototype.removeKeyword=function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;t.length>r;r++)for(var a=t[r].rules,n=0;a.length>n;n++)if(a[n].keyword==e){a.splice(n,1);break}return this},sa.ValidationError=Pr.Validation,sa.MissingRefError=Pr.MissingRef,sa.$dataMetaSchema=Yr;var na="http://json-schema.org/draft-07/schema",oa=["removeAdditional","useDefaults","coerceTypes"],ia=["/properties"];function sa(e){if(!(this instanceof sa))return new sa(e);e=this._opts=Rt.copy(e)||{},function(e){var t=e._opts.logger;if(!1===t)e.logger={log:ha,warn:ha,error:ha};else{if(void 0===t&&(t=console),!("object"==re(t)&&t.log&&t.warn&&t.error))throw Error("logger must implement log, warn and error methods");e.logger=t}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=qr(e.format);var t,r,a=this._schemaUriFormat=this._formats["uri-reference"];this._schemaUriFormatFunc=function(e){return a.test(e)},this._cache=e.cache||new Rr,this._loadingSchemas={},this._compilations=[],this.RULES=Wr(),this._getId=function(){switch(e.schemaId){case"auto":return da;case"id":return ca;default:return pa}}(),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=xr),this._metaOpts=function(e){for(var t=Rt.copy(e._opts),r=0;oa.length>r;r++)delete t[oa[r]];return t}(this),e.formats&&function(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}(this),(t=this)._opts.$data&&t.addMetaSchema(ra,ra.$id,!0),!1!==t._opts.meta&&(r=aa,t._opts.$data&&(r=Yr(r,ia)),t.addMetaSchema(r,na,!0),t._refs["http://json-schema.org/schema"]=na),"object"==re(e.meta)&&this.addMetaSchema(e.meta),function(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}(this)}function ua(e,t){return t=ur.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function la(e,t,r){for(var a in t){var n=t[a];n.meta||r&&!r.test(a)||(e._cache.del(n.cacheKey),delete t[a])}}function ca(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function pa(e){return e.id&&this.logger.warn("schema id ignored",e.i
1d),e.$id}function da(e){if(e.$id&&e.id&&e.$id!=e.id)throw Error("schema $id is different from id");return e.$id||e.id}function fa(e,t){if(e._schemas[t]||e._refs[t])throw Error('schema with key or id "'+t+'" already exists')}function ha(){}Object.freeze({default:pe,__moduleExports:pe,Ajv:pe.Ajv});var ma,ya,va=pe,ga=(ma=Error,r(ya=ba,Se=ma),ya.prototype=null===Se?Object.create(Se):(Pa.prototype=Se.prototype,new Pa),ba);function ba(e,t){e=ma.call(this,e)||this;return Object.setPrototypeOf(e,ba.prototype),e.details=t,e}function Pa(){this.constructor=ya}(pe=e.AlignOptions||(e.AlignOptions={})).left="left",pe.right="right",pe.center="center",pe.bottom="bottom",pe.top="top",(Se=e.AlignFacesOptions||(e.AlignFacesOptions={})).left="left",Se.right="right",Se.center="center",Se.bottom="bottom",Se.top="top",Se.faces="faces",(pe=e.FitOptions||(e.FitOptions={})).clip="clip",pe.crop="crop",pe.scale="scale",pe.max="max",(Se=e.BlurMode||(e.BlurMode={})).linear="linear",Se.gaussian="gaussian",(pe=e.ShapeType||(e.ShapeType={})).oval="oval",pe.rect="rect",(Se=e.NoiseType||(e.NoiseType={})).none="none",Se.low="low",Se.medium="medium",Se.high="high",(pe=e.StyleType||(e.StyleType={})).artwork="artwork",pe.photo="photo",(Se=e.ColorspaceType||(e.ColorspaceType={})).RGB="RGB",Se.CMYK="CMYK",Se.Input="Input",(pe=e.CropfacesType||(e.CropfacesType={})).thumb="thumb",pe.crop="crop",pe.fill="fill",(Se=e.VideoTypes||(e.VideoTypes={})).h264="h264",Se.h264_hi="h264.hi",Se.webm="webm",Se["webm-hi"]="webm.hi",Se.ogg="ogg",Se["ogg-hi"]="ogg.hi",Se["hls-variant"]="hls.variant",Se.mp3="mp3",Se.oga="oga",Se.m4a="m4a",Se.aac="aac",Se.hls="hls.variant.audio",(pe=e.URLScreenshotAgent||(e.URLScreenshotAgent={})).desktop="desktop",pe.mobile="mobile",(Se=e.URLScreenshotMode||(e.URLScreenshotMode={})).all="all",Se.window="window",(pe=e.URLScreenshotOrientation||(e.URLScreenshotOrientation={})).portrait="portrait",pe.landscape="landscape",(Se=e.Locations||(e.Locations={})).s3="s3",Se.azure="azure",Se.gcs="gcs",Se.rackspace="rackspace",Se.dropbox="dropbox",(pe=e.VideoAccess||(e.VideoAccess={})).private="private",pe.public="public",(Se=e.VideoAccessMode||(e.VideoAccessMode={})).preserve="preserve",Se.constrain="constrain",Se.letterbox="letterbox",Se.pad="pad",Se.crop="crop";var wa=/^[\w\-]{20}$/,Ea=(_a.prototype.setBase64=function(e){return this.b64=e,this},_a.prototype.setCname=function(e){return this.cname=e,this},_a.prototype.setCustomDomain=function(e){return this.customDomain=e,this},_a.prototype.getValidationSchema=function(){return At},_a.prototype.getTransformations=function(){return this.transforms},_a.prototype.toString=function(){var e=[];e.push(this.getCdnHost()),this.apikey&&e.push(this.apikey);var t=this.generateTransformString(),r=this.source,r=this.b64?(0<this.transforms.length&&(t="b64/"+btoa(JSON.stringify(this.transforms))),Array.isArray(r)&&(r=this.arrayToString(r)),"b64://"+btoa(r)):Array.isArray(r)?this.arrayToString(r):this.escapeValue(r);return t.length&&e.push(t),e.push(r),e.join("/")},_a.prototype.addTask=function(e,t){if(this.validateTask(e,t),"cache"!==e&&"boolean"==typeof t){if(!t)return this;t=void 0}else"object"!==re(t)||Object.keys(t).length||(t=void 0);return this.transforms.push({name:e,params:t}),this},_a.prototype.reset=function(){return this.transforms=[],this},_a.prototype.flip=function(){return this.addTask("flip",!0)},_a.prototype.flop=function(){return this.addTask("flop",!0)},_a.prototype.enhance=function(){return this.addTask("enhance",!0)},_a.prototype.redeye=function(){return this.addTask("redeye",!0)},_a.prototype.monochrome=function(){return this.addTask("monochrome",!0)},_a.prototype.negative=function(){return this.addTask("negative",!0)},_a.prototype.tags=function(){return this.addTask("tags",!0)},_a.prototype.sfw=function(){return this.addTask("sfw",!0)},_a.prototype.store=function(e){return this.addTask("store",e)},_a.prototype.cache=function(e){return this.addTask("cache",e)},_a.prototype.resize=function(e){return this.addTask("resize",e)},_a.prototype.crop=function(e){return this.addTask("crop",e)},_a.prototype.rotate=function(e){return this.addTask("rotate",e)},_a.prototype.detectFaces=function(e){return this.addTask("detect_faces",e)},_a.prototype.cropFaces=function(e){return this.addTask("crop_faces",e)},_a.prototype.pixelateFaces=function(e){return this.addTask("pixelate_faces",e)},_a.prototype.blurFaces=function(e){return this.addTask("blur_faces",e)},_a.prototype.roundedCorners=function(e){return this.addTask("roun
1ded_corners",e)},_a.prototype.polaroid=function(e){return this.addTask("polaroid",e)},_a.prototype.vignette=function(e){return this.addTask("vignette",e)},_a.prototype.tornEdges=function(e){return this.addTask("torn_edges",e)},_a.prototype.shadow=function(e){return this.addTask("shadow",e)},_a.prototype.circle=function(e){return this.addTask("circle",e)},_a.prototype.border=function(e){return this.addTask("border",e)},_a.prototype.sharpen=function(e){return this.addTask("sharpen",e)},_a.prototype.blur=function(e){return this.addTask("blur",e)},_a.prototype.blackwhite=function(e){return this.addTask("blackwhite",e)},_a.prototype.sepia=function(e){return this.addTask("sepia",e)},_a.prototype.pixelate=function(e){return this.addTask("pixelate",e)},_a.prototype.oilPaint=function(e){return this.addTask("oil_paint",e)},_a.prototype.modulate=function(e){return this.addTask("modulate",e)},_a.prototype.partialPixelate=function(e){return this.addTask("partial_pixelate",e)},_a.prototype.partialBlur=function(e){return this.addTask("partial_blur",e)},_a.prototype.collage=function(e){return this.addTask("collage",e)},_a.prototype.upscale=function(e){return this.addTask("upscale",e)},_a.prototype.ascii=function(e){return this.addTask("ascii",e)},_a.prototype.quality=function(e){return this.addTask("quality",e)},_a.prototype.security=function(e){return this.addTask("security",e)},_a.prototype.output=function(e){return this.addTask("output",e)},_a.prototype.videoConvert=function(e){return this.addTask("video_convert",e)},_a.prototype.URLScreenshot=function(e){return this.addTask("urlscreenshot",e)},_a.prototype.PDFInfo=function(e){return this.addTask("pdfinfo",e)},_a.prototype.PDFConvert=function(e){return this.addTask("pdfconvert",e)},_a.prototype.isSourceExternal=function(){if(!this.source)throw new ga("Source not Set");var e,t=Array.isArray(this.source)?this.source:[this.source];for(e in t)if(t.hasOwnProperty(e)&&(0===t[e].indexOf("src:")||0===t[e].indexOf("http")))return!0;return!1},_a.prototype.validateTask=function(e,t){var r={};if(r[e]=t,!this.validator(r))throw new ga('Task "'+e+'" validation error, Params: '+JSON.stringify(t),this.validator.errors)},_a.prototype.getCdnHost=function(){var e=i.urls;return this.customDomain&&(e.cdnUrl=this.customDomain),(e=wt(e,this.cname)).cdnUrl},_a.prototype.generateTransformString=function(){var t=this,r=[];
1return this.transforms.forEach(function(e){r.push(t.optionToString(e.name,e.params))}),r.join("/")},_a.prototype.optionToString=function(e,t){var r=this,a=[];return void 0!==t&&("object"!==re(t)||Object.keys(t).length)?"boolean"==typeof t?t?e:"cache"===e?"cache=false":"":(Object.keys(t).forEach(function(e){a.push(Array.isArray(t[e])?e+":"+r.arrayToString(t[e]):e+":"+r.escapeValue(t[e]))}),e+"="+a.join(",")):e},_a.prototype.escapeValue=function(e){return"string"==typeof e&&-1<e.indexOf("/")?'"'+e+'"':e},_a.prototype.arrayToString=function(e){var t=this;return"["+e.map(function(e){return Array.isArray(e)?t.arrayToString(e):t.escapeValue(e)})+"]"},_a);function _a(e,t){var r;this.validator=(r=At,va().compile(r)),this.transforms=[],this.b64=!1,this.source=e;e=this.isSourceExternal();if(e&&!t)throw new ga("External sources requires apikey to handle transforms");if(!e&&"string"==typeof this.source&&!wa.test(this.source))throw new ga("Invalid filestack source provided");this.apikey=t}(pe=e.EAlignOptions||(e.EAlignOptions={})).left="left",pe.right="right",pe.center="center",pe.bottom="bottom",pe.top="top",(Se=e.EAlignFacesOptions||(e.EAlignFacesOptions={})).left="left",Se.right="right",Se.center="center",Se.bottom="bottom",Se.top="top",Se.faces="faces",(pe=e.EFitOptions||(e.EFitOptions={})).clip="clip",pe.crop="crop",pe.scale="scale",pe.max="max",(Se=e.EBlurMode||(e.EBlurMode={})).linear="linear",Se.gaussian="gaussian",(pe=e.EShapeType||(e.EShapeType={})).oval="oval",pe.rect="rect",(Se=e.ENoiseType||(e.ENoiseType={})).none="none",Se.low="low",Se.medium="medium",Se.high="high",(pe=e.EStyleType||(e.EStyleType={})).artwork="artwork",pe.photo="photo",(Se=e.EColorspaceType||(e.EColorspaceType={})).RGB="RGB",Se.CMYK="CMYK",Se.Input="Input",(pe=e.ECropfacesType||(e.ECropfacesType={})).thumb="thumb",pe.crop="crop",pe.fill="fill",(Se=e.EVideoTypes||(e.EVideoTypes={})).h264="h264",Se.h264_hi="h264.hi",Se.webm="webm",Se["webm-hi"]="webm.hi",Se.ogg="ogg",Se["ogg-hi"]="ogg.hi",Se["hls-variant"]="hls.variant",Se.mp3="mp3",Se.oga="oga",Se.m4a="m4a",Se.aac="aac",Se.hls="hls.variant.audio",(pe=e.EUrlscreenshotAgent||(e.EUrlscreenshotAgent={})).desktop="desktop",pe.mobile="mobile",(Se=e.EUrlscreenshotMode||(e.EUrlscreenshotMode={})).all="all",Se.window="window",(pe=e.EUrlscreenshotOrientation||(e.EUrlscreenshotOrientation={})).portrait="portrait",pe.landscape="landscape",(Se=e.EVideoLocations||(e.EVideoLocations={})).s3="s3",Se.azure="azure",Se.gcs="gcs",Se.rackspace="rackspace",Se.dropbox="dropbox",(pe=e.EVideoAccess||(e.EVideoAccess={})).private="private",pe.public="public",(Se=e.EVideoAccessMode||(e.EVideoAccessMode={})).preserve="preserve",Se.constrain="constrain",Se.letterbox="letterbox",Se.pad="pad",Se.crop="crop";function ka(e,t,r,a){void 0===r&&(r={}),void 0===a&&(a=!1),r=function e(t){for(var r={},a=Object.keys(t),n=0;a.length>n;n++)r[a[n].split(/(?=[A-Z])/).join("_").toLowerCase()]="object"!==re(t[a[n]])||Array.isArray(t[a[n]])?t[a[n]]:e(t[a[n]]);return r}(r),e.policy&&e.signature&&(r.security={policy:e.policy,signature:e.signature});var n=new Ea(t,e.apikey);return n.setCname(e.cname),n.setBase64(a),-1<e.urls.cdnUrl.indexOf("localhost")&&n.setCustomDomain(e.urls.cdnUrl),Object.keys(r).forEach(function(e){"boolean"==typeof r[e]&&!r[e]&&"cache"!==e||n.addTask(e,r[e])}),""+n}function xa(e){return Na(Ua.hash(e,!0))}function Sa(t,e){return r=e,a=t.number,e=r.config,e={start:a=a*e.partSize,end:Math.min(a+e.partSize,r.file.size)},n=r.file.slice(e.start,e.end),new Promise(function(e,t){var r;File&&FileReader&&Blob?((r=new FileReader).onloadend=e,r.onerror=t,r.readAsArrayBuffer(n)):t(Error("The File APIs are not fully supported by your browser"))}).then(function(e){e=e.target.result;return g({},t,{buffer:e,size:e.byteLength,md5:xa(e)})});var r,a,n}function Oa(e,t){return t.customName||e.name}function Aa(e){return e&&"https://"+e}function Ia(t,e){var r=e.store,a={};return Object.keys(t).forEach(function(e){"object"===re(t[e])&&(t[e]=JSON.stringify(t[e])),t[e]&&(a[e]=t[e])}),Object.keys(r).forEach(function(e){"object"===re(r[e])&&(r[e]=JSON.stringify(r[e])),r[e]&&(a[e]=r[e])}),a}function Fa(e,t){var r=t.config,a=t.params,n=Aa(a.location_url),t=a.location_region,a=g({apikey:r.apikey,part:e.number+1,size:e.size,md5:e.md5},a);void 0!==e.offset&&(a.multipart=!0,a.offset=0===e.offset?"0":e.offset);var a=Ia(a,r),o=pt("post",n+"/multipart/upload");return t&&o.set("Filestack-Upload-Region",t),o.timeout(r.timeout),o.field(a),new Promise(function(r,a){o.end(function(e,t){return e?a(e):r(t)})})}function Ta(e,t,r,a){return a=a.timeout||e.byteLength/100,e=ht(t.url).set(t.headers).timeout(a).send(e),r?e.on("progress",r):e}function ja(a,n){return function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"failed"===a.state.status?Promise.resolve():new Promise(function(t){!function e(){a.state.status===La?setTimeout(e,100):t(n.apply(void 0,r))}()})}}function Da(s,u){return b(void 0,void 0,void 0,function(){var n,o,i;return P(this,function(e){switch(e.label){case 0:return!0===(n=u.config).intelligent||s.intelligentOverride?(o=ja(u,function(e){return a=e,n=u,b(void 0,void 0,void 0,function(){var t,r;return P(this,function(e){switch(e.label){case 0:return[4,Fa(a,n)];case 1:return t=e.sent().body,n.config.onProgress&&(r=kt(function(e){e.loaded>a.loaded&&(a.loaded=e.loaded)},n.config.progressInterval)),a.request=Ta(a.buffer,t,r,n.config),[4,a.request];case 2:return e.sent(),a.loaded=a.size,[2,a.request]}})});var a,n}),s.chunks=function(e,t){for(var r=0,a=[];e.size>r;){var n=e.buffer.slice(r,Math.min(r+t,e.size)),n={buffer:n,offset:r,size:n.byteLength,number:e.number,md5:xa(n)};a.push(n),r+=t}return a}(s,s.chunkSize),[4,Promise.all(s.chunks.map(Pt(n.concurrency,o)))]):[3,2];case 1:return e.sent(),[2,(t=u.config,r=Aa(u.params.location_url),a=g({apikey:t.apikey,part:s.number+1,size:u.file.size},u.params),a=Ia(a,t),pt("post",r+"/multipart/commit").timeout(t.timeout).field(a))];case 2:return[4,Fa(s,u)];case 3:return o=e.sent().body,n.onProgress&&(i=kt(function(e){e.loaded>s.loaded&&(s.loaded=e.loaded)},n.progressInterval)),s.request=Ta(s.buffer,o,i,n),[2,s.request]}var t,r,a})})}function Ra(e){e.buffer=void 0,e.request=void 0,e.chunks&&e.chunks.length&&e.chunks.forEach(Ra)}function $a(y,v){return b(void 0,void 0,void 0,function(){var u,l,c,t,r,a,p,n,d,i,s,o,f,h,m=this;return P(this,function(e){switch(e.label){case 0:return u=y.file,l=y.state,c=y.config,t=function(t){t&&(l.progressTick=setInterval(function(){var e=function(e){var t=e.config,r=e.state,a=e.file,n=Object.keys(r.parts).map(function(e){return r.parts[e]}),o=n.map(function(e){return e.loaded}),e=n.map(function(e){return e.chunks}).reduce(function(e,t){return e.concat(t)},[]).map(function(e){return e.loaded}).filter(function(e){return e}),o=o;!0===t.intelligent&&(o=e),"fallback"===t.intelligent&&(o=n.filter(function(e){return!e.intelligentOverride}).map(function(e){return e.loaded}).concat(e));e=o.reduce(function(e,t){return e+t},0),o=Math.round(e/a.size*100),a={totalBytes:e,totalPercent:o},e=r.previousPayload||{};return o<e.totalPercent&&(a.totalBytes=e.totalBytes,a.totalPercent=e.totalPercent),r.previousPayload=a}(y);100===e.totalPercent&&clearInterval(l.progressTick),t(e)},c.progressInterval))},r=function(e){e&&(e({totalBytes:u.size,totalPercent:100}),clearInterval(l.progressTick))}
1,v.pause=function(){l.status===qa&&(l.status=La,clearInterval(l.progressTick))},v.resume=function(){l.status===La&&(l.status=qa,t(c.onProgress))},a=function(){Object.keys(l.parts).map(function(e){return l.parts[e]}).forEach(function(e){e.request&&e.request.abort(),e.chunks.forEach(function(e){e.request&&e.request.abort()}),Ra(e)})},p=function(){a(),clearInterval(l.progressTick),l.status="failed",u.buffer&&(u.buffer=null)},n=new Promise(function(e,t){v.cancel=function(){l.status!==qa&&l.status!==La||(p(),t(Error("Upload cancelled")))}}),d=function(e){return Promise.race([n,e])},i=function(r,a,n,o){var i=l.retries[r]||0,s=Math.min(c.retryMaxTime,1e3*Math.pow(c.retryFactor,i)),e=new Promise(function(e,t){if(i===c.retry||400===n.status&&"PUT"!==n.method||401===n.status||403===n.status||404===n.status||o&&o.chunkSize<=32768)return p(),t(n);t=function(){return setTimeout(function(){return e(a())},s)};return o&&(c.intelligent||o.intelligentOverride)&&("PUT"===n.method&&(n.crossDomain||400===n.status)||"ECONNABORTED"===n.code&&n.timeout||"ECONNRESET"===n.code||"ETIMEDOUT"===n.code)?(o.chunkSize/=2,c.onRetry&&c.onRetry({location:r,parts:l.parts,filename:Oa(u,c),chunkSize:o.chunkSize,attempt:void 0}),"fallback"===c.intelligent&&(o.intelligentOverride=!0)):(l.retries[r]=i+=1,c.onRetry&&c.onRetry({location:r,parts:l.parts,filename:Oa(u,c),attempt:i})),t()});return d(e)},l.status=qa,[4,d(function(){var e=y.config,t=y.file,t={apikey:e.apikey,filename:Oa(t,e),mimetype:e.mimetype||t.type||"application/octet-stream",size:t.size};e.policy&&e.signature&&(t.policy=e.policy,t.signature=e.signature),e.intelligent&&(t.multipart=!0);t=Ia(t,e);return pt("post",e.host+"/multipart/start").timeout(e.timeout).field(t)}())];case 1:return o=e.sent().body,y.params=o,s=ja(y,function(o){return b(m,void 0,void 0,function(){var t,r,a,n;return P(this,function(e){switch(e.label){case 0:return[4,Sa(o,y)];case 1:if(0===(t=e.sent()).size)return[2,Promise.reject(Error("Upload aborted due to empty chunk."))];r="upload part "+(t.number+1),l.parts[t.number]=t,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,Da(t,y)];case 3:return a=e.sent(),n=a.headers.etag,206===a.status?[2,i(r,function(){return s(t)},Error("Intelligent part failed to commit"),t)]:(t.loaded=t.size,Ra(t),c.intelligent||n?[2,n]:[2,Promise.reject(Error("Response from S3 is missing ETag header."))]);case 4:return n=e.sent(),[2,i(r,function(){return s(t)},n,t)];case 5:return[2]}})})}),o=function(e,t,r){void 0===r&&(r=1);for(var a=[];e<t;e+=r)a.push(e);return a}(0,Math.ceil(u.size/c.partSize)).map(function(e){return t=e,{buffer:null,chunks:[],chunkSize:(e=y).config.intelligentChunkSize||(e=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.substr(0,4))?1048576:8388608),intelligentOverride:!1,loaded:0,number:t,request:null,size:0};var t}),o=Promise.all(o.map(Pt(c.concurrency,s))),t(c.onProgress),[4,d(o)];case 2:return f=e.sent(),h=ja(y,function(){return b(m,void 0,void 0,function(){var t;return P(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,function(e){var t=y.config,r=y.file,a=y.params,n=Aa(a.location_url),o=a.location_region,a=g({apikey:t.apikey,size:r.size,filename:Oa(r,t),mimetype:t.mimetype||r.type||"application/octet-stream",parts:e.map(function(e,t){return t+1+":"+e}).join(";")},a);t.intelligent&&(a.multipart=!0,delete a.parts),t.policy&&t.signature&&(a.policy=t.policy,a.signature=t.signature);a=Ia(a,t),n=pt("post",n+"/multipart/complete");return o&&n.set("Filestack-Upload-Region",o),n.timeout(t.timeout),n.field(a)}(f)];case 1:return 202===(t=e.sent()).status?[2,new Promise(function(e){setTimeout(function(){return e(h())},1e3)})]:(l.status="done",r(c.onProgress),u.buffer&&(u.buffer=null),t.body&&t.body.error&&t.body.error.text?[2,Promise.reject(Error("File upload error: "+t.body.error.text))]:[2,t.body]);case 2:return t=e.sent(),[2,i("complete",h,t)];case 3:return[2]}})})}),[2,d(h())]}})})}function Ca(a,n){var o=Va[a];if(o||(Va[a]={},o=Va[a]),o.instance)return Promise.resolve(o.instance);if(o.promise)return o.promise;var e=new Promise(function(t,r){!function e(){"complete"===document.readyState?function(){o.resolvePromise=t;var e=document.createElement("script");e.src=a,e.onerror=r,n&&(e.id=n),document.body.appendChild(e)}():setTimeout(e,50)}()});return o.promise=e}
1var za=function(e){if((e=(e="".concat(e)).replace(/[ \t\n\f\r]/g,"")).length%4==0&&(e=e.replace(/==?$/,"")),e.length%4==1||/[^+/0-9A-Za-z]/.test(e))return null;for(var t,r="",a=0,n=0,o=0;e.length>o;o++)a<<=6,a|=(t=e[o],/[A-Z]/.test(t)?t.charCodeAt(0)-65:/[a-z]/.test(t)?t.charCodeAt(0)-97+26:/[0-9]/.test(t)?t.charCodeAt(0)-48+52:"+"===t?62:"/"===t?63:void 0),24===(n+=6)&&(r+=String.fromCharCode((16711680&a)>>16),r+=String.fromCharCode((65280&a)>>8),r+=String.fromCharCode(255&a),a=n=0);return 12===n?r+=String.fromCharCode(a>>=4):18===n&&(r+=String.fromCharCode((65280&(a>>=2))>>8),r+=String.fromCharCode(255&a)),r},Na=function(e){for(e="".concat(e),a=0;e.length>a;a++)if(255<e.charCodeAt(a))return null;for(var t,r="",a=0;e.length>a;a+=3){var n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(a)>>2,n[1]=(3&e.charCodeAt(a))<<4,e.length>a+1&&(n[1]|=e.charCodeAt(a+1)>>4,n[2]=(15&e.charCodeAt(a+1))<<2),e.length>a+2&&(n[2]|=e.charCodeAt(a+2)>>6,n[3]=63&e.charCodeAt(a+2));for(var o=0;n.length>o;o++)r+=void 0===n[o]?"=":(t=n[o])<26?String.fromCharCode(t+65):t<52?String.fromCharCode(t-26+97):t<62?String.fromCharCode(t-52+48):62===t?"+":63===t?"/":void 0}return r},Ua=tt(function(e,t){function u(e,t){var r=e[0],a=e[1],n=e[2],o=e[3],a=((a+=((n=((n+=((o=((o+=((r=((r+=(a&n|~a&o)+t[0]-680876936|0)<<7|r>>>25)+a|0)&a|~r&n)+t[1]-389564586|0)<<12|o>>>20)+r|0)&r|~o&a)+t[2]+606105819|0)<<17|n>>>15)+o|0)&o|~n&r)+t[3]-1044525330|0)<<22|a>>>10)+n|0;a=((a+=((n=((n+=((o=((o+=((r=((r+=(a&n|~a&o)+t[4]-176418897|0)<<7|r>>>25)+a|0)&a|~r&n)+t[5]+1200080426|0)<<12|o>>>20)+r|0)&r|~o&a)+t[6]-1473231341|0)<<17|n>>>15)+o|0)&o|~n&r)+t[7]-45705983|0)<<22|a>>>10)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a&n|~a&o)+t[8]+1770035416|0)<<7|r>>>25)+a|0)&a|~r&n)+t[9]-1958414417|0)<<12|o>>>20)+r|0)&r|~o&a)+t[10]-42063|0)<<17|n>>>15)+o|0)&o|~n&r)+t[11]-1990404162|0)<<22|a>>>10)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a&n|~a&o)+t[12]+1804603682|0)<<7|r>>>25)+a|0)&a|~r&n)+t[13]-40341101|0)<<12|o>>>20)+r|0)&r|~o&a)+t[14]-1502002290|0)<<17|n>>>15)+o|0)&o|~n&r)+t[15]+1236535329|0)<<22|a>>>10)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a&o|n&~o)+t[1]-165796510|0)<<5|r>>>27)+a|0)&n|a&~n)+t[6]-1069501632|0)<<9|o>>>23)+r|0)&a|r&~a)+t[11]+643717713|0)<<14|n>>>18)+o|0)&r|o&~r)+t[0]-373897302|0)<<20|a>>>12)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a&o|n&~o)+t[5]-701558691|0)<<5|r>>>27)+a|0)&n|a&~n)+t[10]+38016083|0)<<9|o>>>23)+r|0)&a|r&~a)+t[15]-660478335|0)<<14|n>>>18)+o|0)&r|o&~r)+t[4]-405537848|0)<<20|a>>>12)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a&o|n&~o)+t[9]+568446438|0)<<5|r>>>27)+a|0)&n|a&~n)+t[14]-1019803690|0)<<9|o>>>23)+r|0)&a|r&~a)+t[3]-187363961|0)<<14|n>>>18)+o|0)&r|o&~r)+t[8]+1163531501|0)<<20|a>>>12)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a&o|n&~o)+t[13]-1444681467|0)<<5|r>>>27)+a|0)&n|a&~n)+t[2]-51403784|0)<<9|o>>>23)+r|0)&a|r&~a)+t[7]+1735328473|0)<<14|n>>>18)+o|0)&r|o&~r)+t[12]-1926607734|0)<<20|a>>>12)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a^n^o)+t[5]-378558|0)<<4|r>>>28)+a|0)^a^n)+t[8]-2022574463|0)<<11|o>>>21)+r|0)^r^a)+t[11]+1839030562|0)<<16|n>>>16)+o|0)^o^r)+t[14]-35309556|0)<<23|a>>>9)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a^n^o)+t[1]-1530992060|0)<<4|r>>>28)+a|0)^a^n)+t[4]+1272893353|0)<<11|o>>>21)+r|0)^r^a)+t[7]-155497632|0)<<16|n>>>16)+o|0)^o^r)+t[10]-1094730640|0)<<23|a>>>9)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a^n^o)+t[13]+681279174|0)<<4|r>>>28)+a|0)^a^n)+t[0]-358537222|0)<<11|o>>>21)+r|0)^r^a)+t[3]-722521979|0)<<16|n>>>16)+o|0)^o^r)+t[6]+76029189|0)<<23|a>>>9)+n|0,a=((a+=((n=((n+=((o=((o+=((r=((r+=(a^n^o)+t[9]-640364487|0)<<4|r>>>28)+a|0)^a^n)+t[12]-421815835|0)<<11|o>>>21)+r|0)^r^a)+t[15]+530742520|0)<<16|n>>>16)+o|0)^o^r)+t[2]-995338651|0)<<23|a>>>9)+n|0,a=((a+=((o=((o+=(a^((r=((r+=(n^(a|~o))+t[0]-198630844|0)<<6|r>>>26)+a|0)|~n))+t[7]+1126891415|0)<<10|o>>>22)+r|0)^((n=((n+=(r^(o|~a))+t[14]-1416354905|0)<<15|n>>>17)+o|0)|~r))+t[5]-57434055|0)<<21|a>>>11)+n|0,a=((a+=((o=((o+=(a^((r=((r+=(n^(a|~o))+t[12]+1700485571|0)<<6|r>>>26)+a|0)|~n))+t[3]-1894986606|0)<<10|o>>>22)+r|0)^((n=((n+=(r^(o|~a))+t[10]-1051523|0)<<15|n>>>17)+o|0)|~r))+t[1]-2054922799|0)<<21|a>>>11)+n|0,a=((a+=((o=((o+=(a^((r=((r+=(n^(a|~o))+t[8]+1873313359|0)<<6|r>>>26)+a|0)|~n))+t[15]-30611744|0)<<10|o>>>22)+r|0)^((n=((n+=(r^(o|~a))+t[6]-1560198380|0)<<15|n>>>17)+o|0)|~r))+t[13]+1309151649|0)<<21|a>>>11)+n|0,a=((a+=((o=((o+=(a^((r=((r+=(n^(a|~o))+t[4]-145523070|0)<<6|r>>>26)+a|0)|~n))+t[11]-1120210379|0)<<10|o>>>22)+r|0)^((n=((n+=(r^(o|~a))+t[2]+718787259|0)<<15|n>>>17)+o|0)|~r))+t[9]-343485551|0)<<21|a>>>11)+n|0,e[0]=r+e[0]|0,e[1]=a+e[1]|0,e[2]=n+e[2]|0,e[3]=o+e[3]|0}function l(e){for(var t=[],r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}function c(e){for(var t=[],r=0;r<64;r+=4)t[r>>2]=e[r]+(e[r+1]<<8)+(e[r+2]<<16)+(e[r+3]<<24);return t}function r(e){for(var t,r,a,n,o=e.length,i=[1732584193,-271733879,-1732584194,271733878],s=64;s<=o;s+=64)u(i,l(e.substring(s-64,s)));for(t=(e=e.substring(s-64)).length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<t;s+=1)r[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(r[s>>2]|=128<<(s%4<<3),55<s)for(u(i,r),s=0;s<16;s+=1)r[s]=0;return n=(n=8*o).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(n[2],16),n=parseInt(n[1],16)||0,r[14]=a,r[15]=n,u(i,r),i}function i(e){for(var t=0;e.length>t;t+=1)e[t]=function(e){for(var t="",r=0;r<4;r+=1)t+=p[e>>8*r+4&15]+p[e>>8*r&15];return t}(e[t]);return e.join("")}function a(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function s(e){for(var t=[],r=e.length,a=0;a<r-1;a+=2)t.push(parseInt(e.substr(a,2),16));return String.fromCharCode.apply(String,t)}function n(){this.reset()}function o(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}var p;e.exports=(p=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],i(r("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(e,t){var r=this.byteLength,a=o(e,r),e=r;return void 0!==t&&(e=o(t,r)),e<a?new ArrayBuffer(0):(t=e-a,r=new ArrayBuffer(t),e=new Uint8Array(r),t=new Uint8Array(this,a,t),e.set(t),r)}),n.prototype.append=function(e){return this.appendBinary(a(e)),this},n.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;for(var t=this._buff.length,r=64;r<=t;r+=64)u(this._hash,l(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},n.prototype.end=function(e){for(var t,r=this._buff,a=r.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=0;o<a;o+=1)n[o>>2]|=r.charCodeAt(o)<<(o%4<<3);return this._finish(n,a),t=i(this._hash),e&&(t=s(t)),this.reset(),t},n.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},n.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},n.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},n.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},n.prototype._finish=function(e,t){var r,a=t;if(e[a>>2]|=128<<(a%4<<3),55<a)for(u(this._hash,e),a=0;a<16;a+=1)e[a]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),t=parseInt(r[2],16),r=parseInt(r[1],16)||0,e[14]=t,e[15]=r,u(this._hash,e)},n.hash=function(e,t){return n.hashBinary(a(e),t)},n.hashBinary=function(e,t){e=i(r(e));return t?s(e):e},(n.ArrayBuffer=function(){this.reset()}).prototype.append=function(e){var t,r,a,n,o=(r=this._buff.buffer,a=e,(n=new Uint8Array(r.byteLength+a.byteLength)).set(new Uint8Array(r)),n.set(new Uint8Array(a),r.byteLength),n),i=o.length;for(this._length+=e.byteLength,t=64;t<=i;t+=64)u(this._hash,c(o.subarray(t-64,t)));return this._buff=t-64<i?new Uint8Array(o.buffer.slice(t-64)):new Uint8Array(0),this},n.ArrayBuffer.prototype.end=function(e){for(var t,r=this._buff,a=r.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=0;o<a;o+=1)n[o>>2]|=r[o]<<(o%4<<3);return this._finish(n,a),t=i(this._hash),e&&(t=s(t)),this.reset(),t},n.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},n.ArrayBuffer.prototype.getState=function(){var e=n.prototype.getState.call(this);return e.buff=String.fromCharCode.apply(null,new Uint8Array(e.buff)),e},n.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e){for(var t=e.length,r=new ArrayBuffer(t),a=new Uint8Array(r),n=0;n<t;n+=1)a[n]=e.charCodeAt(n);return a}(e.buff),n.prototype.setState.call(this,e)},n.ArrayBuffer.prototype.destroy=n.prototype.destroy,n.ArrayBuffer.prototype._finish=n.prototype._finish,n.ArrayBuffer.hash=function(e,t){e=i(function(e){for(var t,r,a,n,o=e.length,i=[1732584193,-271733879,-1732584194,271733878],s=64;s<=o;s+=64)u(i,c(e.subarray(s-64,s)));for(t=(e=s-64<o?e.subarray(s-64):new Uint8Array(0)).length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<t;s+=1)r[s>>2]|=e[s]<<(s%4<<3);if(r[s>>2]|=128<<(s%4<<3),55<s)for(u(i,r),s=0;s<16;s+=1)r[s]=0;return n=(n=8*o).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(n[2],16),n=parseInt(n[1],16)||0,r[14]=a,r[15]=n,u(i,r),i}(new Uint8Array(e)));return t?s(e):e},n)}).ArrayBuffer,qa="running",La="paused",Ma=(Object.defineProperty(Ba.prototype,"token",{get:function(){if(this.cache){var e=localStorage.getItem("__fs_picker_token");if(e)return e}return this._token},set:function(e){this.cache&&localStorage.setItem("__fs_picker_token",e),this._token=e},enumerable:!0,configurable:!0}),Ba.prototype.prefetch=function(){var e={apikey:this.session.apikey};return pt("get",this.cloudApiUrl+"/prefetch").query(e).then(function(e){return e.body})},Ba.prototype.list=function(e,t){var n=this;void 0===t&&(t={});var o={apikey:this.session.apikey,clouds:e,flow:"web",token:this.token};return this.session.policy&&this.session.signature&&(o.policy=this.session.policy,o.signature=this.session.signature),new Promise(function(r,a){var e=pt("post",n.cloudApiUrl+"/folder/list").send(o).end(function(e,t){e?a(e):(t.body&&t.body.token&&(n.token=t.body.token),r(t.body))});t.cancel=function(){e.abort(),a(Error("Cancelled"))}})},Ba.prototype.store=function(n,e,t,r,o){var a,i=this;void 0===t&&(t={}),void 0===r&&(r={}),void 0===o&&(o={}),void 0===t.location&&(t.location="s3");var s={apikey:this.session.apikey,token:this.token,flow:"web",clouds:((a={})[n]={path:e,store:_t(t)},a)};return"customsource"===n&&r.customSourcePath&&(s.clouds.customsource.customSourcePath=r.customSourcePath),"customsource"===n&&r.customSourceContainer&&(s.clouds.customsource.customSourceContainer=r.customSourceContainer),this.session.policy&&this.session.signature&&(s.policy=this.session.policy,s.signature=this.session.signature),new Promise(function(r,a){var e=pt("post",i.cloudApiUrl+"/store/").send(s).end(function(e,t){e?a(e):(t.body&&t.body.token&&(i.token=t.body.token),r(t.body&&t.body[n]?t.body[n]:t.body))});o.cancel=function(){e.abort(),a(Error("Cancelled"))}})},Ba.prototype.link=function(n,e,t,o){var r,i=this;void 0===t&&(t={}),void 0===o&&(o={});var s={apikey:this.session.apikey,token:this.token,flow:"web",clouds:((r={})[n]={path:e},r)};return"customsource"===n&&t.customSourcePath&&(s.clouds.customsource.customSourcePath=t.customSourcePath),"customsource"===n&&t.customSourceContainer&&(s.clouds.customsource.customSourceContainer=t.customSourceContainer),this.session.policy&&this.session.signature&&(s.policy=this.session.policy,s.signature=this.session.signature),new Promise(function(r,a){var e=pt("post",i.cloudApiUrl+"/link/").send(s).end(function(e,t){e?a(e):(t.body&&t.body.token&&(i.token=t.body.token),r(t.body[n]||t.body))});o.cancel=function(){e.abort(),a(Error("Cancelled"))}})},Ba.prototype.logout=function(e){var t,n=this,o={apikey:this.session.apikey,flow:"web",token:this.token};return e?o.clouds=((t={})[e]={},t):this.cache&&localStorage.removeItem("__fs_picker_token"),new Promise(function(r,a){pt("post",n.cloudApiUrl+"/auth/logout/").send(o).end(function(e,t){e?a(e):(t.body&&t.body.token&&(n.token=t.body.token),r(t.body))})})},Ba.prototype.metadata=function(e){var t=this,n={apikey:this.session.apikey,url:e};return this.session.policy&&this.session.signature&&(n.policy=this.session.policy,n.signature=this.session.signature),new Promise(function(r,a){pt("post",t.cloudApiUrl+"/metadata").send(n).end(function(e,t){e?a(e):r(t.body)})})},Ba.prototype.tokInit=function(e){var t=this;if("video"!==e&&"audio"!==e)throw Error("Type must be one of video or audio.");return new Promise(function(r,a){return pt("post",t.cloudApiUrl+"/recording/"+e+"/init").end(function(e,t){e?a(e):r(t)})})},Ba.prototype.tokStart=function(e,t,r){var n=this;if("video"!==e&&"audio"!==e)throw Error("Type must be one of video or audio.");var o={apikey:t,session_id:r};return new Promise(function(r,a){return pt("post",n.cloudApiUrl+"/recording/"+e+"/start").send(o).end(function(e,t){e?a(e):r(t)})})},Ba.prototype.tokStop=function(e,t,r,a){var n=this;if("video"!==e&&"audio"!==e)throw Error("Type must be one of video or audio.");var o={apikey:t,session_id:r,archive_id:a};return new Promise(function(r,a){return pt("post",n.cloudApiUrl+"/recording/"+e+"/stop").send(o).end(function(e,t){e?a(e):r(t)})})},Ba),pe="function"==typeof Symbol&&"symbol"===re(Symbol.iterator)?function(e){return re(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":re(e)},Se=(Se=void 0,"object"===("undefined"==typeof window?"undefined":pe(window))&&((Se=window.filestackInternals)||(Se={},window.filestackInternals=Se),Se.loader||(Se.loader={modules:{}})),Se),Va=Se&&Se.loader.modules;function Ba(e,t){this.cache=!1,this.session=e,this.cloudApiUrl=e.urls.cloudApiUrl,t&&t.sessionCache&&(this.cache=t.sessionCache)}(Se={}).cw="CW",Se.ccw="CCW",(Se={}).inline="inline",Se.overlay="overlay",Se.dropPane="dropPane";var Ha=(Ka.prototype.open=function(){return b(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:return[4,this._initialized];case 1:return[4,e.sent().open()];case 2:return e.sent(),[2]}})})},Ka.prototype.crop=function(t){return b(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:return[4,this._initialized];case 1:return[4,e.sent().crop(t)];case 2:return e.sent(),[2]}})})},Ka.prototype.close=function(){return b(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:return[4,this._initialized];case 1:return[4,e.sent().close()];case 2:return e.sent(),[2]}})})},Ka.prototype.cancel=function(){return b(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:return[4,this._initialized];
1case 1:return[4,e.sent().cancel()];case 2:return e.sent(),[2]}})})},Ka.prototype.loadModule=function(t,r){return b(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:return[4,Ca(t.session.urls.pickerUrl,"__filestack-picker-module")];case 1:return[2,new(e.sent())(t,r)]}})})},Ka),Qa=(Ja.prototype.logout=function(e){return this.cloud.logout(e)},Ja.prototype.metadata=function(e,t,r){return function(e,n,t,r){if(!n||"string"!=typeof n)throw Error("A valid Filestack handle is required for metadata");Et("metadata",[{name:"size",type:Ve},{name:"mimetype",type:Ve},{name:"filename",type:Ve},{name:"width",type:Ve},{name:"height",type:Ve},{name:"uploaded",type:Ve},{name:"writeable",type:Ve},{name:"cloud",type:Ve},{name:"sourceUrl",type:Ve},{name:"md5",type:Ve},{name:"sha1",type:Ve},{name:"sha224",type:Ve},{name:"sha256",type:Ve},{name:"sha384",type:Ve},{name:"sha512",type:Ve},{name:"location",type:Ve},{name:"path",type:Ve},{name:"container",type:Ve},{name:"exif",type:Ve}],t);var o=g({},t);o.source_url=o.sourceUrl,o.policy=r&&r.policy||e.policy,o.signature=r&&r.signature||e.signature;var i=e.urls.fileApiUrl+"/"+n+"/metadata";return new Promise(function(r,a){ft(i).query(_t(o)).end(function(e,t){return e?a(e):void r(g({},t.body,{handle:n}))})})}(this.session,e,t,r)},Ja.prototype.picker=function(e){return new Ha(this,e)},Ja.prototype.preview=function(e,t){return function(e,t,r){if(!t||"string"!=typeof t)throw Error("A valid Filestack handle or storage alias is required for preview");Et("preview",[{name:"id",type:Je},{name:"css",type:Je}],r);var a,n,o,i,s=_t(r),i=(a=e,u=t,n=g({},s),o=a.policy,i=a.signature,r=i&&o,e=[a.urls.cdnUrl],n=(n=n.css&&encodeURIComponent('"'+n.css+'"'))?"preview=css:"+n:"preview",-1!==u.indexOf("src:")?e.push(a.apikey+"/"+n):e.push(n),r&&e.push("security=policy:"+o+",signature:"+i),e.push(u),e.join("/"));if(s.id){var u=s.id,e=document.createElement("iframe"),s=document.getElementById(u);if(e.src=i,e.width="100%",e.height="100%",!s)throw Error('DOM Element with id "'+u+'" not found.');return s.appendChild(e)}return window.open(i,t)}(this.session,e,t)},Ja.prototype.remove=function(e,t){return xt(this.session,e,!1,t)},Ja.prototype.removeMetadata=function(e,t){return xt(this.session,e,!0,t)},Ja.prototype.storeURL=function(e,t,r,a){return function(e,t,r,a,n){if(!t||"string"!=typeof t)throw Error("url is required for storeURL");e.policy=n&&n.policy||e.policy,e.signature=n&&n.signature||e.signature;var o=new Ea(t,e.apikey);return o.setCname(e.cname),(-1<e.urls.cdnUrl.indexOf("localhost")||-1<e.urls.cdnUrl.indexOf("badurl"))&&o.setCustomDomain(e.urls.cdnUrl),e.policy&&e.signature&&o.security({policy:e.policy,signature:e.signature}),o.store(r),new Promise(function(r,t){var e=ft(""+o);return a&&(a.cancel=function(){e.abort(),t(Error("Upload cancelled"))}),e.then(function(e){if(e.body&&e.body.url){var t=e.body.url.split("/").pop(),t=g({},e.body,{handle:t,mimetype:e.body.type});return r(t)}return r(e.body)}).catch(function(e){t(e)})})}(this.session,e,t,r,a)},Ja.prototype.retrieve=function(e,t,r){return function(e,t,r,a){if(void 0===r&&(r={}),!t||0===t.length||"string"!=typeof t)throw Error("File handle is required");Et("retrieveOptions",[{name:"metadata",type:Ve},{name:"head",type:Ve},{name:"dl",type:Ve},{name:"cache",type:Ve},{name:"extension",type:Je}],r);var n=g({},r);n.key=e.apikey,n.policy=a&&a.policy||e.policy,n.signature=a&&a.signature||e.signature;var o,i,s=St.get,u=Ot.blob;if(n.head&&(s=St.head,u=Ot.json,delete n.head),n.extension&&n.extension.length&&(o=n.extension,delete n.extension),n.metadata){if(s===St.head)throw Error("Head and metadata options cannot be used together");u=Ot.json,i=n.metadata,delete n.metadata}var l=e.urls.fileApiUrl+"/"+t+(o?"+"+o:"")+(i?"/metadata":"");return new Promise(function(r,a){yt[s](l).query(n).responseType(u).end(function(e,t){return e?a(e):s===St.head?r(t.headers):void r(t.body)})})}(this.session,e,t,r)},Ja.prototype.transform=function(e,t,r){return void 0===r&&(r=!1),ka(this.session,e,t,r)},Ja.prototype.upload=function(e,t,r,a,n){return i=this.session,c=n,void 0===(s=t)&&(s={}),void 0===(u=r)&&(u={}),void 0===(l=a)&&(l={}),"string"==typeof(e=e)&&(e=function(e,t){var r;void 0===t&&(t=512);var a="";e.split(",")[0].indexOf("base64")<0||(r=e.split(",")[1]),void 0!==r&&(a=e.split(",")[0].split(":")[1].split(";")[0],e=decodeURI(r));for(var n=za(e),o=[],i=0;n.length>i;i+=t){for(var s=n.slice(i,i+t),u=Array(s.length),l=0;s.length>l;l+=1)u[l]=s.charCodeAt(l);var c=new Uint8Array(u);o.push(c)}return new Blob(o,{type:a})}(e)),(!e||""+e!="[object File]"&&""+e!="[object Blob]"?Promise.reject(new TypeError("File argument is not a valid Blob")):Promise.resolve(e)).then(function(e){if(void 0!==e.size&&0===e.size||0===e.length)return Promise.reject(Error("file has a size of 0."));var t=[{name:"host",type:Je},{name:"path",type:Ve},{name:"mimetype",type:Je},{name:"partSize",type:Qe},{name:"concurrency",type:Ge(He,function(e){return 0<e})},{name:"onProgress",type:Be},{name:"progressInterval",type:He},{name:"onRetry",type:Be},{name:"retry",type:He},{name:"retryFactor",type:He},{name:"retryMaxTime",type:He},{name:"timeout",type:He},{name:"intelligent",type:Ze([Ve,Ke.of("fallback")])},{name:"intelligentChunkSize",type:Qe}],r=Je,a=We({id:Je}),n=Ze([r,a]);n.dispatch=function(e){return e.id?a:r};n=[{name:"location",type:Ke.of("s3 gcs rackspace azure dropbox")},{name:"region",type:Je},{name:"path",type:Je},{name:"container",type:Je},{name:"filename",type:Je},{name:"access",type:Ke.of("public private")},{name:"workflows",type:Ye(n)}];Et("upload (options)",t,s),Et("upload (storeOptions)",n,u);var o,t=g({},u),n=g({},s);t.filename?o=t.filename:void 0===e.name&&(o=e.type?"untitled."+e.type.split("/").pop():"untitled"),void 0===t.location&&(t.location="s3"),n.intelligent&&(n.partSize=8388608);n=g({host:i.urls.uploadApiUrl,apikey:i.apikey,policy:c&&c.policy||i.policy,signature:c&&c.signature||i.signature,partSize:6291456,concurrency:3,progressInterval:1e3,retry:10,retryFactor:2,retryM
1axTime:15e3,customName:o,mimetype:s.mimetype,store:{workflows:t.workflows,store_location:t.location,store_region:t.region,store_container:t.container,store_path:t.path,store_access:t.access},timeout:12e4},n);return $a({file:e,config:n,state:{parts:{},progressTick:null,previousPayload:null,retries:{},status:"init"}},l)});var i,s,u,l,c},Ja);function Ja(e,t){var r=this;if(!e||"string"!=typeof e||0===e.length)throw Error("An apikey is required to initialize the Filestack client");var a=i.urls;if(this.session={apikey:e,urls:a},t){var n,o=t.cname,e=t.security;if(e&&(!e.policy||!e.signature))throw Error("Both policy and signature are required for client security");e&&e.policy&&e.signature&&(this.session.policy=e.policy,this.session.signature=e.signature),o&&(this.session.urls=wt(this.session.urls,o),n=/filestackapi.com|filestackcontent.com/i,this.session.cname=o,Object.keys(a).forEach(function(e){r.session.urls[e]=a[e].replace(n,o)}))}this.cloud=new Ma(this.session,t)}function Ka(e,t){this._initialized=this.loadModule(e,t)}e.init=function(e,t){return new Qa(e,t)},e.setKey=function(){},e.responsive=function(e){e.src=e.getAttribute("data-fp-src")},e.pickAndStore=function(e,t,r){const a=filepicker.init("AvA8PZEw5SHeRvf3WJ-dyz");e={maxFiles:e.multiple?20:1,uploadInBackground:!1,fromSources:["local_file_system","url","imagesearch","webcam","googledrive","dropbox","box"],onUploadDone:function(e){r(e.filesUploaded)}};a.picker(e).open()},e.storeUrl=function(e,t,r){const a=filepicker.init("AvA8PZEw5SHeRvf3WJ-dyz");a.storeURL(e,t).then(function(e){r(e)})},e.version="1.14.6",e.TransformSchema=At,e.getSecurity=function(){console.warn("This method is only availale in Node runtimes")},e.transform=ka,e.Filelink=Ea,Object.defineProperty(e,"__esModule",{value:!0})});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.