@formio/core
Version:
The core Form.io renderering framework.
1 lines • 51.7 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FormioCore=t():e.FormioCore=t()}(self,(function(){return function(){var e={2937:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.intersection=t.map=t.head=t.last=t.filter=t.findEach=t.matches=t.findIndex=t.find=t.each=t.dropRight=t.drop=t.difference=t.concat=t.compact=t.chunk=void 0;var o=r(7739),i=r(1769);function s(e,t){var r=Array.isArray(e);for(var n in e)if(e.hasOwnProperty(n)&&!0===t(e[n],r?Number(n):n))break}function a(e,t,r){if(void 0===r&&(r=!1),e){if(Array.isArray(e)&&"function"==typeof t)return r?e.findIndex(t):e.find(t);var n=void 0,o=0;return u(e,t,(function(e,t){return n=e,o=t,!0})),r?o:n}}function c(e){var t=[],r={};return"string"==typeof e?(t=[e],r[e]=!0):(t=Object.keys(e),r=e),function(e){return(0,o.isEqual)((0,i.pick)(e,t),r)}}function u(e,t,r){s(e,(function(e,n){if(c(t)(e)&&!0===r(e,n))return!0}))}t.chunk=function(e,t){return e.reduce((function(e,r,o){return o%t==0?n(n([],e,!0),[[r]],!1):n(n([],e.slice(0,-1),!0),[n(n([],e.slice(-1)[0],!0),[r],!1)],!1)}),[])},t.compact=function(e){return e.filter(Boolean)},t.concat=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return e.concat.apply(e,t)},t.difference=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return e.filter((function(e){return!t.includes(e)}))}))},t.drop=function(e,t){return void 0===t&&(t=1),t>0?e.slice(t):e},t.dropRight=function(e,t){return void 0===t&&(t=1),t>0?e.slice(0,-t):e},t.each=s,t.find=a,t.findIndex=function(e,t){return a(e,t,!0)},t.matches=c,t.findEach=u,t.filter=function(e,t){if(!e)return[];if(t||(t=function(e){return!!e}),Array.isArray(e)&&"function"==typeof t)return e.filter(t);var r=[];return u(e,t,(function(t,n){r.push(t),Array.isArray(t)?e.splice(n,1):delete e[n]})),r},t.last=function(e){return e[e.length-1]},t.head=function(e){return e[0]},t.map=function(e,t){return e.map(t)},t.intersection=function(e,t){return e.filter((function(e){return t.includes(e)}))}},3254:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0,t.debounce=function(e,t){var r;return void 0===t&&(t=100),function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];r&&clearTimeout(r),r=setTimeout((function(){r=null,e.apply(void 0,n)}),t)}}},2373:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.chain=void 0;var c=i(r(2937)),u=function(){function e(e){this.chain=[],this.currentValue=[],this.currentValue=e}return e.prototype.value=function(){return this.chain.reduce((function(e,t){var r;return(r=c)[t.method].apply(r,a([e],t.args,!1))}),this.currentValue)},e}(),l=function(e){c.hasOwnProperty(e)&&(u.prototype[e]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this.chain.push({method:e,args:t}),this})};for(var f in c)l(f);function p(e){return new u(e)}t.chain=p,t.default=p,s(r(2937),t),s(r(3254),t),s(r(7739),t),s(r(7592),t),s(r(1769),t),s(r(7150),t)},7739:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRegExp=t.isBoolean=t.isNumber=t.isPlainObject=t.isObject=t.isObjectLike=t.isArray=t.isNull=t.isNil=t.isNaN=t.isInteger=t.isEmpty=t.isString=t.isEqual=t.noop=void 0;var n=r(2937);function o(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function i(e){return"object"==typeof e&&null!==e}function s(e){var t=typeof e;return null!=e&&("object"===t||"function"===t)}t.noop=function(){},t.isEqual=function e(t,r){var o=!1;return t===r||(t&&r&&(Array.isArray(t)||s(t))&&(o=!0,(0,n.each)(t,(function(t,n){return!Array.isArray(t)&&!s(t)||e(r[n],t)?r[n]!==t?(o=!1,!0):void 0:(o=!1,!0)}))),o)},t.isString=function(e){return"string"==typeof e},t.isEmpty=function(e){return[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length},t.isInteger=function(e){return Number.isInteger(e)},t.isNaN=function(e){return Number.isNaN(e)},t.isNil=function(e){return null==e},t.isNull=function(e){return null===e},t.isArray=function(e){return Array.isArray(e)},t.isObjectLike=i,t.isObject=s,t.isPlainObject=function(e){if(!i(e)||"[object Object]"!=o(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},t.isNumber=function(e){return"number"==typeof e||i(e)&&"[object Number]"==o(e)},t.isBoolean=function(e){return!0===e||!1===e||i(e)&&"[object Boolean]"==o(e)},t.isRegExp=function(e){return i(e)&&"[object RegExp]"==o(e)}},7592:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sumBy=t.sum=t.mod=t.subtract=t.round=t.multiply=t.minBy=t.min=t.meanBy=t.mean=t.maxBy=t.max=t.floor=t.divide=t.ceil=t.add=void 0;var n=r(7739),o=r(1769);function i(e,t,r){return void 0===r&&(r=0),r?t(e*(r=Math.pow(10,r)))/r:t(e)}function s(e,t,r){var i=e[0];if(e.length<=1)return i;var s=(0,n.isString)(t);return e.slice(1).reduce((function(e,n){var i=s?(0,o.get)(e,t):t(e),a=s?(0,o.get)(n,t):t(n);return r(i,a)===a?n:e}),i)}function a(e,t){return e+t}function c(e){return e.reduce(a,0)}function u(e,t){return function(e,t,r){var i=e[0];if(e.length<=1)return i;var s=(0,n.isString)(t);return e.slice(1).reduce((function(e,r){return n=e,i=s?(0,o.get)(r,t):t(r),n+i;var n,i}),s?(0,o.get)(i,t):t(i))}(e,t)}t.add=a,t.ceil=function(e,t){return void 0===t&&(t=0),i(e,Math.ceil,t)},t.divide=function(e,t){return e/t},t.floor=function(e,t){return void 0===t&&(t=0),i(e,Math.floor,t)},t.max=function(e){return Math.max.apply(Math,e)},t.maxBy=function(e,t){return s(e,t,Math.max)},t.mean=function(e){return c(e)/e.length},t.meanBy=function(e,t){return u(e,t)/e.length},t.min=function(e){return Math.min.apply(Math,e)},t.minBy=function(e,t){return s(e,t,Math.min)},t.multiply=function(e,t){return e*t},t.round=function(e,t){return void 0===t&&(t=0),i(e,Math.round,t)},t.subtract=function(e,t){return e-t},t.mod=function(e,t){return e%t},t.sum=c,t.sumBy=u},1769:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.pick=t.defaults=t.cloneDeep=t.clone=t.fastCloneDeep=t.merge=t.set=t.has=t.propertyOf=t.property=t.get=t.pathParts=t.values=t.keys=void 0;var i=r(7739),s=r(2937);function a(e){return e?("["===e[0]&&(e=e.replace(/^\[([^\]]+)\]/,"$1")),e.replace(/\[/g,".").replace(/\]/g,"").split(".")):[]}function c(e,t,r){var n=a(t).reduce((function(e,t){return(e||{})[t]}),e);return void 0!==r&&void 0===n?r:n}function u(e,t){try{return t in e}catch(e){return!1}}function l(e,t){return u(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function f(e,t){for(var r in t)if(t.hasOwnProperty(r)){if(l(e,r))return;u(e,r)?e[r]=h(e[r],t[r]):e[r]=d(t[r])}return e}function p(e,t){return t.forEach((function(t,r){e[r]=h(e[r],t)})),e}function h(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.shift();return e.reduce((function(t,r,n){return t&&t!==r?(0,i.isArray)(r)?((0,i.isArray)(t)||(e[n]=t=[]),p(t,r)):(0,i.isPlainObject)(r)?f(t,r):d(r):d(r)}),r)}function d(e){return Array.isArray(e)?e.map(d):null===e||"object"!=typeof e?e:Object.fromEntries(Object.entries(e).map((function(e){return[e[0],d(e[1])]})))}t.keys=function(e){return Object.keys(e)},t.values=function(e){return(0,i.isArray)(e)?e:Object.values(e)},t.pathParts=a,t.get=c,t.property=function(e){return function(t){return c(t,e)}},t.propertyOf=function(e){return function(t){return c(e,t)}},t.has=function(e,t){return void 0!==c(e,t,void 0)},t.set=function(e,t,r){var n=a(t);return n.reduce((function(e,t,o){return isNaN(Number(t))||(t=Number(t)),((Array.isArray(e)?t>=e.length:!e.hasOwnProperty(t))||o<n.length-1&&!Array.isArray(e[t])&&!(0,i.isObject)(e[t]))&&(e[t]=isNaN(Number(n[o+1]))?{}:[]),o===n.length-1&&(e[t]=r),e[t]}),e),e},t.merge=h,t.fastCloneDeep=function(e){try{return JSON.parse(JSON.stringify(e))}catch(e){return console.log("Clone Failed: ".concat(e.message)),null}},t.clone=function(e){return Array.isArray(e)?o([],e,!0):n({},e)},t.cloneDeep=d,t.defaults=function(e,t){return(0,s.each)(t,(function(t,r){e.hasOwnProperty(r)||(e[r]=t)})),e},t.pick=function(e,t){return t.reduce((function(t,r){return e&&e.hasOwnProperty(r)&&(t[r]=e[r]),t}),{})}},7150:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.endsWith=t.trim=void 0,t.trim=function(e,t){return void 0===t&&(t="\\s"),e.replace(new RegExp("^([".concat(t,"]*)(.*?)([").concat(t,"]*)$")),"$2")},String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return(void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),t.endsWith=function(e,t){return e.endsWith(t)}},6729:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,i||e,s),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,s=new Array(i);o<i;o++)s[o]=n[o].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,o,i,s){var a=r?r+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,o),!0;case 5:return l.fn.call(l.context,t,n,o,i),!0;case 6:return l.fn.call(l.context,t,n,o,i,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var p,h=l.length;for(u=0;u<h;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,o);break;default:if(!c)for(p=1,c=new Array(f-1);p<f;p++)c[p-1]=arguments[p];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||n&&a.context!==n||s(this,i);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||o&&!a[c].once||n&&a[c].context!==n)&&u.push(a[c]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},7559:function(e,t,r){var n;!function(o){"use strict";function i(e){var r=e&&e.Promise||o.Promise,n=e&&e.XMLHttpRequest||o.XMLHttpRequest;return function(){var e=Object.create(o,{fetch:{value:void 0,writable:!0}});return function(t){var o=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==o&&o,i="URLSearchParams"in o,s="Symbol"in o&&"iterator"in Symbol,a="FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch(e){return!1}}(),c="FormData"in o,u="ArrayBuffer"in o;if(u)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return s&&(t[Symbol.iterator]=function(){return t}),t}function y(e){this.map={},e instanceof y?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function v(e){if(e.bodyUsed)return r.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new r((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=m(t);return t.readAsArrayBuffer(e),r}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function j(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:c&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||f(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=v(this);if(e)return e;if(this._bodyBlob)return r.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return r.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return r.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?v(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?r.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):r.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var e,t,n,o=v(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=m(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return r.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return r.resolve(this._bodyText)},c&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}y.prototype.append=function(e,t){e=p(e),t=h(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},y.prototype.delete=function(e){delete this.map[p(e)]},y.prototype.get=function(e){return e=p(e),this.has(e)?this.map[e]:null},y.prototype.has=function(e){return this.map.hasOwnProperty(p(e))},y.prototype.set=function(e,t){this.map[p(e)]=h(t)},y.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},y.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},y.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},y.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},s&&(y.prototype[Symbol.iterator]=y.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function O(e,t){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,o=(t=t||{}).body;if(e instanceof O){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new y(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new y(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),w.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function U(e,t){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new y(t.headers),this.url=t.url||"",this._initBody(e)}O.prototype.clone=function(){return new O(this,{body:this._bodyInit})},j.call(O.prototype),j.call(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},U.error=function(){var e=new U(null,{status:0,statusText:""});return e.type="error",e};var A=[301,302,303,307,308];U.redirect=function(e,t){if(-1===A.indexOf(t))throw new RangeError("Invalid status code");return new U(null,{status:t,headers:{location:e}})},t.DOMException=o.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function x(e,i){return new r((function(r,s){var c=new O(e,i);if(c.signal&&c.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var l=new n;function f(){l.abort()}l.onload=function(){var e,t,n={status:l.status,statusText:l.statusText,headers:(e=l.getAllResponseHeaders()||"",t=new y,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};n.url="responseURL"in l?l.responseURL:n.headers.get("X-Request-URL");var o="response"in l?l.response:l.responseText;setTimeout((function(){r(new U(o,n))}),0)},l.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},l.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},l.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},l.open(c.method,function(e){try{return""===e&&o.location.href?o.location.href:e}catch(t){return e}}(c.url),!0),"include"===c.credentials?l.withCredentials=!0:"omit"===c.credentials&&(l.withCredentials=!1),"responseType"in l&&(a?l.responseType="blob":u&&c.headers.get("Content-Type")&&-1!==c.headers.get("Content-Type").indexOf("application/octet-stream")&&(l.responseType="arraybuffer")),!i||"object"!=typeof i.headers||i.headers instanceof y?c.headers.forEach((function(e,t){l.setRequestHeader(t,e)})):Object.getOwnPropertyNames(i.headers).forEach((function(e){l.setRequestHeader(e,h(i.headers[e]))})),c.signal&&(c.signal.addEventListener("abort",f),l.onreadystatechange=function(){4===l.readyState&&c.signal.removeEventListener("abort",f)}),l.send(void 0===c._bodyInit?null:c._bodyInit)}))}x.polyfill=!0,o.fetch||(o.fetch=x,o.Headers=y,o.Request=O,o.Response=U),t.Headers=y,t.Request=O,t.Response=U,t.fetch=x,Object.defineProperty(t,"__esModule",{value:!0})}(t),{fetch:e.fetch,Headers:e.Headers,Request:e.Request,Response:e.Response,DOMException:e.DOMException}}()}void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:void 0!==r.g?r.g:this)},6814:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Formio=t.FormioPathType=void 0;var o,i=n(r(7559)),s=r(2373),a=r(6176),c=n(r(6729)),u=(0,i.default)(),l=u.fetch,f=u.Headers,p=n(r(7689));(o=t.FormioPathType||(t.FormioPathType={})).Subdirectories="Subdirectories",o.Subdomains="Subdomains";var h=function(){function e(t,r){void 0===r&&(r={});var n=this;if(this.path=t,this.options=r,this.base="",this.projectsUrl="",this.projectUrl="",this.projectId="",this.roleUrl="",this.rolesUrl="",this.roleId="",this.formUrl="",this.formsUrl="",this.formId="",this.submissionsUrl="",this.submissionUrl="",this.submissionId="",this.actionsUrl="",this.actionId="",this.actionUrl="",this.vsUrl="",this.vId="",this.vUrl="",this.query="",this.noProject=!1,!(this instanceof e))return new e(t);if(r.hasOwnProperty("base")&&r.base?this.base=r.base:e.baseUrl?this.base=e.baseUrl:window&&window.location&&(this.base=window.location.href.match(/http[s]?:\/\/api./)[0]),!t)return this.projectUrl=e.projectUrl||"".concat(this.base,"/project"),this.projectsUrl="".concat(this.base,"/project"),this.projectId="",void(this.query="");r.hasOwnProperty("project")&&r.project&&(this.projectUrl=r.project);var o=this.projectUrl||e.projectUrl,i=/(^|\/)(project)($|\/[^/]+)/,s=-1!==t.search(i);o&&this.base===o&&!s&&(this.noProject=!0,this.projectUrl=this.base),0!==t.indexOf("http")&&0!==t.indexOf("//")&&(t=this.base+t);var a=this.getUrlParts(t),c="",u=[];if(a){c=a[1]+a[2];var l=(t=a.length>3?a[3]:"").split("?");l.length>1&&(t=l[0],this.query="?".concat(l[1]))}var f=function(e,r){n["".concat(e,"sUrl")]="".concat(r,"/").concat(e);var o=new RegExp("/".concat(e,"/([^/]+)"));return t&&-1!==t.search(o)&&(u=t.match(o),n["".concat(e,"Url")]=u?r+u[0]:"",n["".concat(e,"Id")]=u.length>1?u[1]:"",r+=u[0]),r},p=function(e,t,r){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];if(Array.isArray(o))p(o,t,!0);else{var i=f(o,t);t=r?t:i}}};if(!this.projectUrl||this.projectUrl===this.base)if(this.projectUrl||s||"Subdirectories"!==e.pathType)this.projectUrl=c;else{var h="^".concat(c.replace(/\//g,"\\/"),".[^/]+"),d=o.match(new RegExp(h));this.projectUrl=d?d[0]:c}var y=!1;if(e.pathType&&(y="Subdomains"!==e.pathType),!this.noProject){if(s)p(["project"],c),t=t.replace(i,"");else if(c===this.base){if(a&&a.length>3&&t.split("/").length>1){var v=t.split("/");v.shift();var m=v.shift();m&&(this.projectId=m,t="/".concat(v.join("/")),this.projectUrl="".concat(c,"/").concat(this.projectId))}}else a&&a.length>2&&(a[2].split(".").length>2||c.includes("localhost"))&&!y&&(this.projectUrl=c,this.projectId=a[2].split(".")[0]);this.projectsUrl=this.projectsUrl||"".concat(this.base,"/project")}if(p(["role"],this.projectUrl),/(^|\/)(form)($|\/)/.test(t))p(["form",["submission","action","v"]],this.projectUrl);else{var g=new RegExp("/(submission|action|v)($|/.*)"),b=t.match(g);b&&b.length>1&&(this.pathType=b[1]),t=(t=t.replace(g,"")).replace(/\/$/,""),this.formsUrl="".concat(this.projectUrl,"/form"),this.formUrl=t?this.projectUrl+t:"",this.formId=t.replace(/^\/+|\/+$/g,"");var j=["submission","action","v"];for(var w in j)if(j.hasOwnProperty(w)){var O=j[w];this["".concat(O,"sUrl")]="".concat(this.projectUrl+t,"/").concat(O),this.pathType===O&&b&&b.length>2&&b[2]&&(this["".concat(O,"Id")]=b[2].replace(/^\/+|\/+$/g,""),this["".concat(O,"Url")]=this.projectUrl+t+b[0])}}e.projectUrlSet||(e.projectUrl=this.projectUrl)}return e.prototype.delete=function(t,r){var n="".concat(t,"Id"),o="".concat(t,"Url");return this[n]?(e.cache={},this.makeRequest(t,this[o],"delete",null,r)):Promise.reject("Nothing to delete")},e.prototype.index=function(t,r,n){var o="".concat(t,"Url");return(r=r||"")&&(0,s.isObject)(r)&&(r="?".concat(e.serialize(r.params))),this.makeRequest(t,this[o]+r,"get",null,n)},e.prototype.save=function(t,r,n){var o="".concat(t,"Id"),i="".concat(t,"Url"),s=this[o]||r._id?"put":"post",a=this[o]?this[i]:this["".concat(t,"sUrl")];return this[o]||!r._id||"put"!==s||a.includes(r._id)||(a+="/".concat(r._id)),e.cache={},this.makeRequest(t,a+this.query,s,r,n)},e.prototype.load=function(t,r,n){var o="".concat(t,"Id"),i="".concat(t,"Url");return r&&(0,s.isObject)(r)&&(r=e.serialize(r.params)),r=r?this.query?"".concat(this.query,"&").concat(r):"?".concat(r):this.query,this[o]?this.makeRequest(t,this[i]+r,"get",null,n):Promise.reject("Missing ".concat(o))},e.prototype.makeRequest=function(t,r,n,o,i){return e.makeRequest(this,t,r,n,o,i)},e.prototype.loadProject=function(e,t){return this.load("project",e,t)},e.prototype.saveProject=function(e,t){return this.save("project",e,t)},e.prototype.deleteProject=function(e){return this.delete("project",e)},e.loadProjects=function(t,r){return t=t||"",(0,s.isObject)(t)&&(t="?".concat(e.serialize(t.params))),e.makeStaticRequest("".concat(e.baseUrl,"/project").concat(t),"GET",null,r)},e.prototype.loadRole=function(e){return this.load("role",null,e)},e.prototype.saveRole=function(e,t){return this.save("role",e,t)},e.prototype.deleteRole=function(e){return this.delete("role",e)},e.prototype.loadRoles=function(e){return this.index("roles",null,e)},e.prototype.loadForm=function(t,r){var n=this;return this.load("form",t,r).then((function(o){return!o.revisions||isNaN(parseInt(n.vId))||"current"===o.revisions&&n.submissionId?o:(t&&(0,s.isObject)(t)&&(t=e.serialize(t.params)),t=t?n.query?"".concat(n.query,"&").concat(t):"?".concat(t):n.query,n.makeRequest("form",n.vUrl+t,"get",null,r).then((function(e){return o._vid=e._vid,o.components=e.components,o.settings=e.settings,Object.assign({},o)})).catch((function(){return Object.assign({},o)})))}))},e.prototype.saveForm=function(e,t){return this.save("form",e,t)},e.prototype.deleteForm=function(e){return this.delete("form",e)},e.prototype.loadForms=function(e,t){return this.index("forms",e,t)},e.prototype.loadSubmission=function(e,t){var r=this;return this.load("submission",e,t).then((function(e){return r.vId=e._fvid,r.vUrl="".concat(r.formUrl,"/v/").concat(r.vId),e}))},e.prototype.saveSubmission=function(e,t){return isNaN(parseInt(this.vId))||(e._fvid=this.vId),this.save("submission",e,t)},e.prototype.deleteSubmission=function(e){return this.delete("submission",e)},e.prototype.loadSubmissions=function(e,t){return this.index("submissions",e,t)},e.prototype.loadAction=function(e,t){return this.load("action",e,t)},e.prototype.saveAction=function(e,t){return this.save("action",e,t)},e.prototype.deleteAction=function(e){return this.delete("action",e)},e.prototype.loadActions=function(e,t){return this.index("actions",e,t)},e.prototype.availableActions=function(){return this.makeRequest("availableActions","".concat(this.formUrl,"/actions"))},e.prototype.actionInfo=function(e){return this.makeRequest("actionInfo","".concat(this.formUrl,"/actions/").concat(e))},e.prototype.isObjectId=function(e){return new RegExp("^[0-9a-fA-F]{24}$").test(e)},e.prototype.getProjectId=function(){return this.projectId?this.isObjectId(this.projectId)?Promise.resolve(this.projectId):this.loadProject().then((function(e){return e._id})):Promise.resolve("")},e.prototype.getFormId=function(){return this.formId?this.isObjectId(this.formId)?Promise.resolve(this.formId):this.loadForm().then((function(e){return e._id})):Promise.resolve("")},e.prototype.currentUser=function(t){return e.currentUser(this,t)},e.prototype.accessInfo=function(){return e.accessInfo(this)},e.prototype.getToken=function(t){return e.getToken(Object.assign({formio:this},this.options,t))},e.prototype.setToken=function(t,r){return e.setToken(t,Object.assign({formio:this},this.options,r))},e.prototype.getTempToken=function(t,r,n){if(!e.getToken(n))return Promise.reject("You must be authenticated to generate a temporary auth token.");var o=e.authUrl||this.projectUrl;return this.makeRequest("tempToken","".concat(o,"/token"),"GET",null,{ignoreCache:!0,header:new f({"x-expire":t,"x-allow":r})})},e.prototype.getDownloadUrl=function(e){var t=this;if(!this.submissionId)return Promise.resolve("");if(!e)return this.loadForm().then((function(e){return e?t.getDownloadUrl(e):""}));var r="/project/".concat(e.project);r+="/form/".concat(e._id),r+="/submission/".concat(this.submissionId),r+="/download";var n=this.base+r;return new Promise((function(e,o){t.getTempToken(3600,"GET:".concat(r)).then((function(t){n+="?token=".concat(t.key),e(n)}),(function(){e(n)})).catch(o)}))},e.prototype.userPermissions=function(e,t,r){return Promise.all([void 0!==t?Promise.resolve(t):this.loadForm(),void 0!==e?Promise.resolve(e):this.currentUser(),void 0===r&&this.submissionId?this.loadSubmission():Promise.resolve(r),this.accessInfo()]).then((function(e){var t=e.shift(),r=e.shift()||{_id:!1,roles:[]},n=e.shift(),o=e.shift(),i={create:"create",read:"read",update:"edit",delete:"delete"},c={user:r,form:t,access:o,create:!1,read:!1,edit:!1,delete:!1};for(var u in o.roles)if(o.roles.hasOwnProperty(u)){var l=o.roles[u];if(l.default&&!1===r._id)r.roles.push(l._id);else if(l.admin&&-1!==r.roles.indexOf(l._id))return c.create=!0,c.read=!0,c.delete=!0,c.edit=!0,c}if(t&&t.submissionAccess)for(var f=0;f<t.submissionAccess.length;f++){var p=t.submissionAccess[f],h=p.type.split("_"),d=h[0],y=h[1];["create","read","update","delete"].includes(d)&&(0,s.intersection)(p.roles,r.roles).length&&(c[i[d]]="all"===y||!n||r._id===n.owner)}return n&&(0,a.eachComponent)(t.components,(function(e,t){if(e&&e.defaultPermission){var o=(0,s.get)(n.data,t);(Array.isArray(o)?o:[o]).forEach((function(t){t&&t._id&&r.roles.indexOf(t._id)>-1&&("read"===e.defaultPermission&&(c[i.read]=!0),"create"===e.defaultPermission&&(c[i.create]=!0,c[i.read]=!0),"write"===e.defaultPermission&&(c[i.create]=!0,c[i.read]=!0,c[i.update]=!0),"admin"===e.defaultPermission&&(c[i.create]=!0,c[i.read]=!0,c[i.update]=!0,c[i.delete]=!0))}))}})),c}))},e.prototype.canSubmit=function(){var t=this;return this.userPermissions().then((function(r){return!r.create&&e.getUser()?t.userPermissions(null).then((function(t){return!!t.create&&(e.setUser(null),!0)})):r.create}))},e.prototype.getUrlParts=function(t){return e.getUrlParts(t,this)},e.getUrlParts=function(t,r){var n=r&&r.base?r.base:e.baseUrl,o="^(http[s]?:\\/\\/)";return n&&0===t.indexOf(n)?o+="(".concat(n.replace(/^http[s]?:\/\//,""),")"):o+="([^/]+)",o+="($|\\/.*)",t.match(new RegExp(o))},e.serialize=function(e,t){var r,n=[];for(var o in e)e.hasOwnProperty(o)&&n.push("".concat(encodeURIComponent(o),"=").concat(encodeURIComponent((r=e[o],t?t(r):r))));return n.join("&")},e.getRequestArgs=function(e,t,r,n,o,i){n=(n||"GET").toUpperCase(),i&&(0,s.isObject)(i)||(i={});var a={url:r,method:n,data:o||null,opts:i};return t&&(a.type=t),e&&(a.formio=e),a},e.makeStaticRequest=function(t,r,n,o){var i=e.getRequestArgs(null,"",t,r,n,o),a=p.default.pluginWait("preRequest",i).then((function(){return p.default.pluginGet("staticRequest",i).then((function(t){return(0,s.isNil)(t)?e.request(i.url,i.method,i.data,i.opts.header,i.opts):t}))}));return p.default.pluginAlter("wrapStaticRequestPromise",a,i)},e.makeRequest=function(t,r,n,o,i,a){if(!t)return e.makeStaticRequest(n,o,i,a);var c=e.getRequestArgs(t,r,n,o,i,a);c.opts=c.opts||{},c.opts.formio=t,c.opts.headers||(c.opts.headers={}),c.opts.headers=(0,s.defaults)(c.opts.headers,{Accept:"application/json","Content-type":"application/json"});var u=p.default.pluginWait("preRequest",c).then((function(){return p.default.pluginGet("request",c).then((function(t){return(0,s.isNil)(t)?e.request(c.url,c.method,c.data,c.opts.header,c.opts):t}))}));return p.default.pluginAlter("wrapRequestPromise",u,c)},e.request=function(t,r,n,o,i){if(!t)return Promise.reject("No url provided");r=(r||"GET").toUpperCase(),(0,s.isBoolean)(i)&&(i={ignoreCache:i}),i&&(0,s.isObject)(i)||(i={});var a=btoa(encodeURI(t));if(!i.ignoreCache&&"GET"===r&&e.cache.hasOwnProperty(a))return Promise.resolve(e.cloneResponse(e.cache[a]));var c=o||new f(i.headers||{Accept:"application/json","Content-type":"application/json"}),u=e.getToken(i);u&&!i.noToken&&c.append("x-jwt-token",u);var l={};c.forEach((function(e,t){l[t]=e}));var h={method:r,headers:l,mode:"cors"};n&&(h.body=JSON.stringify(n)),((h=p.default.pluginAlter("requestOptions",h,t)).namespace||e.namespace)&&(i.namespace=h.namespace||e.namespace);var d=h.headers["x-jwt-token"],y=p.default.pluginAlter("wrapFetchRequestPromise",e.fetch(t,h),{url:t,method:r,data:n,opts:i}).then((function(o){if(!(o=p.default.pluginAlter("requestResponse",o,e,n)).ok)return 440===o.status?(e.setToken(null,i),e.events.emit("formio.sessionExpired",o.body)):401===o.status?e.events.emit("formio.unauthorized",o.body):416===o.status&&e.events.emit("formio.rangeIsNotSatisfiable",o.body),(o.headers.get("content-type").includes("application/json")?o.json():o.text()).then((function(e){return Promise.reject(e)}));var a=o.headers.get("x-jwt-token"),c=!1;return"GET"!==r||d||!a||i.external||t.includes("token=")||t.includes("x-jwt-token=")||(console.warn("Token was introduced in request."),c=!0),o.status>=200&&o.status<300&&a&&""!==a&&!c&&e.setToken(a,i),204===o.status?{}:(o.headers.get("content-type").includes("application/json")?o.json():o.text()).then((function(e){var t=o.headers.get("content-range");if(t&&(0,s.isObject)(e)){if("*"!==(t=t.split("/"))[0]){var r=t[0].split("-");e.skip=Number(r[0]),e.limit=r[1]-r[0]+1}e.serverCount="*"===t[1]?t[1]:Number(t[1])}if(!i.getHeaders)return e;var n={};return o.headers.forEach((function(e,t){n[t]=e})),{result:e,headers:n}}))})).then((function(t){return i.getHeaders?t:("GET"===r&&(e.cache[a]=t),e.cloneResponse(t))})).catch((function(t){return"Bad Token"===t&&(e.setToken(null,i),e.events.emit("formio.badToken",t)),t.message&&(t.message="Could not connect to API server (".concat(t.message,")"),t.networkError=!0),"GET"===r&&delete e.cache[a],Promise.reject(t)}));return y},Object.defineProperty(e,"token",{get:function(){return e.tokens.formioToken||""},set:function(t){e.tokens.formioToken=t||""},enumerable:!1,configurable:!0}),e.setToken=function(t,r){void 0===t&&(t=""),void 0===r&&(r={}),t=t||"";var n="".concat((r="string"==typeof r?{namespace:r}:r||{}).namespace||e.namespace||"formio","Token");if(e.tokens||(e.tokens={}),!t){r.fromUser||(r.fromToken=!0,e.setUser(null,r));try{localStorage.removeItem(n)}catch(e){console.log("Error removing token: ".concat(e.message))}return e.tokens[n]=t,Promise.resolve(null)}if(e.tokens[n]!==t){e.tokens[n]=t;try{localStorage.setItem(n,t)}catch(e){console.log("Error setting token: ".concat(e.message))}}return e.currentUser(r.formio,r)},e.getToken=function(t){var r="".concat((t="string"==typeof t?{namespace:t}:t||{}).namespace||e.namespace||"formio","Token"),n=t.decode?"".concat(r,"Decoded"):r;if(e.tokens||(e.tokens={}),e.tokens[n])return e.tokens[n];try{return e.tokens[r]=localStorage.getItem(r)||"",e.tokens[r]}catch(e){return console.log("Error retrieving token: ".concat(e.message)),""}},e.setUser=function(t,r){void 0===r&&(r={});var n="".concat(r.namespace||e.namespace||"formio","User");if(!t){r.fromToken||(r.fromUser=!0,e.setToken(null,r)),e.events.emit("formio.user",null);try{return localStorage.removeItem(n)}catch(e){return void console.log("Error removing token: ".concat(e.message))}}try{localStorage.setItem(n,JSON.stringify(t))}catch(e){console.log("Error setting token: ".concat(e.message))}e.events.emit("formio.user",t)},e.getUser=function(t){var r="".concat((t=t||{}).namespace||e.namespace||"formio","User");try{return JSON.parse(localStorage.getItem(r)||null)}catch(e){return console.log("Error getting user: ".concat(e.message)),{}}},e.setBaseUrl=function(t){e.baseUrl=t,e.projectUrlSet||(e.projectUrl=t)},e.getBaseUrl=function(){return e.baseUrl},e.setApiUrl=function(t){return e.setBaseUrl(t)},e.getApiUrl=function(){return e.getBaseUrl()},e.setAppUrl=function(t){console.warn("Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead."),e.projectUrl=t,e.projectUrlSet=!0},e.setProjectUrl=function(t){e.projectUrl=t,e.projectUrlSet=!0},e.setAuthUrl=function(t){e.authUrl=t},e.getAppUrl=function(){return console.warn("Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead."),e.projectUrl},e.getProjectUrl=function(){return e.projectUrl},e.clearCache=function(){e.cache={}},e.accessInfo=function(t){var r=t?t.projectUrl:e.projectUrl;return e.makeRequest(t,"accessInfo","".concat(r,"/access"))},e.projectRoles=function(t){var r=t?t.projectUrl:e.projectUrl;return e.makeRequest(t,"projectRoles","".concat(r,"/role"))},e.currentUser=function(t,r){void 0===r&&(r={});var n=e.authUrl;n||(n=t?t.projectUrl:e.projectUrl||e.baseUrl),n+="/current";var o=e.getUser(r);if(o)return p.default.pluginAlter("wrapStaticRequestPromise",Promise.resolve(o),{url:n,method:"GET",options:r});var i=e.getToken(r);return r&&r.external||i?e.makeRequest(t,"currentUser",n,"GET",null,r).then((function(t){return e.setUser(t,r),t})):p.default.pluginAlter("wrapStaticRequestPromise",Promise.resolve(null),{url:n,method:"GET",options:r})},e.logout=function(t,r){void 0===r&&(r={}),r.formio=t;var n=e.authUrl?e.authUrl:t?t.projectUrl:e.baseUrl;return e.makeRequest(t,"logout","".concat(n,"/logout")).then((function(t){return e.setToken(null,r),e.setUser(null,r),e.clearCache(),t})).catch((function(t){throw e.setToken(null,r),e.setUser(null,r),e.clearCache(),t}))},e.pageQuery=function(){var e={paths:[]},t=location.hash.substr(1).replace(/\?/g,"&").split("&"),r=[];return location.search.substr(1).split("&").forEach((function(t){(r=t.split("=")).length>1&&(e[r[0]]=r[1]&&decodeURIComponent(r[1]))})),t.forEach((function(t){(r=t.split("=")).length>1?e[r[0]]=r[1]&&decodeURIComponent(r[1]):0===t.indexOf("/")&&(e.paths=t.substr(1).split("/"))})),e},e.oAuthCurrentUser=function(t,r){return e.currentUser(t,{external:!0,headers:{Authorization:"Bearer ".concat(r)}})},e.samlInit=function(t){void 0===t&&(t={});var r=e.pageQuery();if(r.saml){e.setUser(null);var n=e.setToken(r.saml),o=window.location.toString();return o=o.substring(0,o.indexOf("?")),window.location.hash&&(o+=window.location.hash),window.history.replaceState({},document.title,o),n}t.relay||(t.relay=window.location.href);var i=e.authUrl||e.projectUrl;return window.location.href="".concat(i,"/saml/sso?relay=").concat(encodeURI(t.relay)),!1},e.oktaInit=function(t){if(void 0===t&&(t={}),void 0!==typeof OktaAuth&&(t.OktaAuth=OktaAuth),void 0===typeof t.OktaAuth){var r="Cannot find OktaAuth. Please include the Okta JavaScript SDK within your application. See https://developer.okta.com/code/javascript/okta_auth_sdk for an example.";return console.warn(r),Promise.reject(r)}return new Promise((function(r,n){var o=t.OktaAuth;delete t.OktaAuth;var i=new o(t);i.tokenManager.get("accessToken").then((function(o){o?r(e.oAuthCurrentUser(t.formio,o.accessToken)):location.hash?i.token.parseFromUrl().then((function(n){i.tokenManager.add("accessToken",n),r(e.oAuthCurrentUser(t.formio,n.accessToken))})).catch((function(e){console.warn(e),n(e)})):(i.token.getWithRedirect({responseType:"token",scopes:t.scopes}),r(!1))})).catch((function(e){n(e)}))}))},e.ssoInit=function(t,r){switch(void 0===r&&(r={}),t){case"saml":return e.samlInit(r);case"okta":return e.oktaInit(r);default:return console.warn("Unknown SSO type"),Promise.reject("Unknown SSO type")}},e.requireLibrary=function(t,r,n,o){if(void 0===o&&(o=!1),!e.libraries.hasOwnProperty(t)){e.libraries[t]={},e.libraries[t].ready=new Promise((function(r,n){e.libraries[t].resolve=r,e.libraries[t].reject=n}));var i="".concat(t,"Callback");o||window[i]||(window[i]=function(){return e.libraries[t].resolve()});var a=(0,s.get)(window,r);if(a)e.libraries[t].resolve(a);else if((n=Array.isArray(n)?n:[n]).forEach((function(e){var t={},r="";switch("string"==typeof e&&(e={type:"script",src:e}),e.type){case"script":r="script",t={src:e.src,type:"text/javascript",defer:!0,async:!0,referrerpolicy:"origin"};break;case"styles":r="link",t={href:e.src,rel:"stylesheet"}}var n=document.createElement(r);if(n.setAttribute)for(var o in t)n.setAttribute(o,t[o]);var i=document.head;i&&i.appendChild(n)})),o)var c=setInterval((function(){var n=(0,s.get)(window,r);n&&(clearInterval(c),e.libraries[t].resolve(n))}),200)}return e.libraries[t].ready},e.libraryReady=function(t){return e.libraries.hasOwnProperty(t)&&e.libraries[t].ready?e.libraries[t].ready:Promise.reject("".concat(t," library was not required."))},e.cloneResponse=function(e){var t=(0,s.fastCloneDeep)(e);return Array.isArray(e)&&(t.skip=e.skip,t.limit=e.limit,t.serverCount=e.serverCount),t},e.setPathType=function(t){"string"==typeof t&&(e.pathType=t)},e.getPathType=function(){return e.pathType},e.baseUrl="https://api.form.io",e.projectUrl="",e.authUrl="",e.projectUrlSet=!1,e.cache={},e.namespace="",e.events=new c.default,e.libraries={},e.fetch=l,e.Headers=f,e.tokens={},e.version="---VERSION---",e.plugins=p.default.plugins,e.deregisterPlugin=p.default.deregisterPlugin,e.registerPlugin=p.default.registerPlugin,e.getPlugin=p.default.getPlugin,e.pluginWait=p.default.pluginWait,e.pluginGet=p.default.pluginGet,e.pluginAlter=p.default.pluginAlter,e}();t.Formio=h,p.default.Formio=h},7689:function(e,t,r){"use strict";var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var o=r(2373),i=function(){function e(){}return e.identity=function(e){return e},e.deregisterPlugin=function(t){var r=e.plugins.length;return e.plugins=e.plugins.filter((function(r){return r!==t&&r.__name!==t||((r.deregister||o.noop).call(t,e.Formio),!1)})),r!==e.plugins.length},e.registerPlugin=function(t,r){e.plugins.push(t),e.plugins.sort((function(e,t){return(t.priority||0)-(e.priority||0)})),t.__name=r,(t.init||o.noop).call(t,e.Formio)},e.getPlugin=function(t){for(var r=0,n=e.plugins;r<n.length;r++){var o=n[r];if(o.__name===t)return o}return null},e.pluginWait=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return Promise.all(e.plugins.map((function(e){var i;return(i=e[t]||o.noop).call.apply(i,n([e],r,!1))})))},e.pluginGet=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=function(i){var a,c=e.plugins[i];return c?Promise.resolve((a=c[t]||o.noop).call.apply(a,n([c],r,!1))).then((function(e){return(0,o.isNil)(e)?s(i+1):e})):Promise.resolve(null)};return s(0)},e.pluginAlter=function(t,r){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return e.plugins.reduce((function(r,i){return(i[t]||e.identity).apply(void 0,n([r],o,!1))}),r)},e.plugins=[],e}();t.default=i},6550:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},c=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Evaluator=t.BaseEvaluator=void 0;var u=a(r(2373)),l=function(){function e(){}return e.evaluator=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return f.noeval?(console.warn("No evaluations allowed for this renderer."),u.noop):"function"==typeof e?e:("object"==typeof t[0]&&(t=u.keys(t[0])),new(Function.bind.apply(Function,c(c([void 0],t,!1),[e],!1))))},e.interpolateString=function(e,t,r){return void 0===r&&(r={}),e.replace(/({{\s*(.*?)\s*}})/g,(function(e,n,o){if(-1!==o.indexOf("("))return o.replace(/([^\(]+)\(([^\)]+)\s*\);?/,(function(e,n,o){n=u.trim(n);var i=u.get(t,n);return i?(o&&(o=o.split(",").map((function(e){return 0===(e=u.trim(e)).indexOf('"')||0===e.indexOf("'")?e.substring(1,e.length-1):u.get(t,e)}))),f.evaluate(i,o,"",!1,t,r)):""}));var i=o;-1!==o.indexOf("?")&&(i=o.replace(/\?\./g,"."));for(var s=i.split("||").map((function(e){return e.trim()})),a="",c="",l=0;l<s.length&&(c=s[l],!(a=u.get(t,c)));l++);return r.data&&u.set(r.data,c,a),a}))},e.interpolate=function(e,t,r){if(void 0===r&&(r={}),"function"==typeof e)try{return e(t)}catch(e){return console.warn("Error interpolating template",e,t),e.message}return f.interpolateString(String(e),t,r)},e.evaluate=function(t,r,n,o,i,s){void 0===r&&(r={}),void 0===n&&(n=""),void 0===o&&(o=!1),void 0===i&&(i={}),void 0===s&&(s={});var a=null;s=u.isObject(s)?s:{noeval:s};var c=r.component?r.component:{key:"unknown"};!r.form&&r.instance&&(r.form=u.get(r.instance,"root._form",{}));var l=c.key;if("string"==typeof t){n&&(t+=";return ".concat(n)),o&&(t=e.interpolate(t,r,s));try{t=f.noeval||s.noeval?u.noop:f.evaluator(t,r,i),r=u.values(r)}catch(e){console.warn("An error occured within the custom function for ".concat(l),e),a=null,t=!1}}if("function"==typeof t)try{a=f.execute(t,r,i,s)}catch(e){a=null,console.warn("An error occured within custom function for ".concat(l),e)}else t&&console.warn("Unknown function type for ".concat(l));return a},e.execute=function(e,t,r,n){if(void 0===r&&(r={}),void 0===n&&(n={}),n=u.isObject(n)?n:{noeval:n},!f.noeval&&!n.noeval)return Array.isArray(t)?e.apply(r,t):e.call(r,t);console.warn("No evaluations allowed for this renderer.")},e.templateSettings={interpolate:/{{([\s\S]+?)}}/g,evaluate:/\{%([\s\S]+?)%\}/g,escape:/\{\{\{([\s\S]+?)\}\}\}/g},e.noeval=!1,e}();t.BaseEvaluator=l;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.registerEvaluator=function(e){Object.keys(e).forEach((function(r){t[r]=e[r]}))},t}(l);t.Evaluator=f},6176:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.uniqueName=t.guid=t.flattenComponents=t.eachComponent=void 0;var o=r(6550),i=r(2373);function s(e,t,r,o,i){e&&(o=o||"",e.forEach((function(a){if(a){var c=a.columns&&Array.isArray(a.columns),u=a.rows&&Array.isArray(a.rows),l=a.components&&Array.isArray(a.components),f=!1,p=a.key?o?"".concat(o,".").concat(a.key):a.key:"";i&&(a.parent=n({},i),delete a.parent.components,delete a.parent.componentMap,delete a.parent.columns,delete a.parent.rows);